index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="center">
  3. <view v-if="accountType == 1">
  4. <view class="account">
  5. <image src="../../../static/images/myAccount/qian.png" mode="" class="account_img"></image>
  6. </view>
  7. <view class="money">可用余额</view>
  8. <view class="money_number">{{dataInfo.accountBalance?dataInfo.accountBalance:0}}<span class="yuan">元</span>
  9. </view>
  10. <view class="money_no">(已冻结:<span class="number">{{dataInfo.frozenAmount?dataInfo.frozenAmount:0}}</span>元)
  11. </view>
  12. <view class="next_btn" @click="withdrawal">提现</view>
  13. </view>
  14. <view v-else>
  15. <view class="company_account">
  16. <view class="company_money">可用余额(元)</view>
  17. <view class="flex company_center">
  18. <view class="company_money_number">{{dataInfo.accountBalance?dataInfo.accountBalance:0}}</view>
  19. <view class="company_next" @click="withdrawal">
  20. <view class="btn">
  21. 提现
  22. </view>
  23. </view>
  24. </view>
  25. <view class="company_money_no">(已冻结:{{dataInfo.frozenAmount?dataInfo.frozenAmount:0}} 元)</view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. dataInfo: {},
  35. accountType: '', //accountType 1个人 2企业
  36. id: "", //如果是企业 公司id
  37. }
  38. },
  39. onLoad(options) {
  40. if (options.id) { //我的企业进来的
  41. this.accountType = '2'
  42. this.id = options.id
  43. } else { //个人账户
  44. this.accountType = '1'
  45. }
  46. },
  47. onShow() {
  48. this.getList()
  49. },
  50. onNavigationBarButtonTap(e) {
  51. uni.$u.route('/pages/mine/myAccount/bill?type=' + this.accountType + '&id=' + this.id)
  52. },
  53. methods: {
  54. getList() {
  55. if (this.accountType == '1') {
  56. this.$request.baseRequest('get', '/cargoOwnerInfo/selectAccount', {
  57. commonId: uni.getStorageSync("userInfo").id
  58. }).then(res => {
  59. this.dataInfo = res.data
  60. })
  61. } else if (this.accountType == '2') {
  62. this.$request.baseRequest('get', '/cargoOwnerInfo/selectAccountBalance', {
  63. id: this.id,
  64. flag: this.accountType
  65. }).then(res => {
  66. this.dataInfo = res.data
  67. })
  68. }
  69. },
  70. withdrawal() {
  71. if (this.accountType == '1') {
  72. uni.$u.route("/pages/mine/myAccount/withdrawal?id=" + this.dataInfo.id + "&flag=" + this.accountType)
  73. } else if (this.accountType == '2') {
  74. uni.$u.route("/pages/mine/myAccount/withdrawal?id=" + this.id + "&flag=" + this.accountType)
  75. }
  76. },
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .center {
  82. padding: 20rpx;
  83. text-align: center;
  84. .account {
  85. width: 100%;
  86. height: 250rpx;
  87. margin-top: 30rpx;
  88. margin: 0 auto;
  89. text-align: center;
  90. .account_img {
  91. width: 100rpx;
  92. height: 100rpx;
  93. margin-top: 200rpx;
  94. }
  95. }
  96. .money {
  97. margin-top: 90rpx;
  98. font-size: 32rpx;
  99. // margin: 40rpx;
  100. }
  101. .money_number {
  102. font-size: 68rpx;
  103. font-weight: 500;
  104. margin-top: 20rpx;
  105. .yuan {
  106. font-size: 36rpx;
  107. margin-left: 6rpx;
  108. }
  109. }
  110. .money_no {
  111. margin-top: 20rpx;
  112. color: #999999;
  113. font-size: 28rpx;
  114. .number {
  115. color: #2a74fb;
  116. margin: 0 10rpx;
  117. }
  118. }
  119. .next_btn {
  120. background: #F5BA3C;
  121. color: #FFFFFF;
  122. padding: 25rpx 0;
  123. border-radius: 60rpx;
  124. margin-top: 100rpx;
  125. }
  126. // 公司账户
  127. .company_account {
  128. padding-top: 60rpx;
  129. text-align: left;
  130. color: #FFFFFF;
  131. height: 280rpx;
  132. border-radius: 10rpx;
  133. background: linear-gradient(45deg, #2873fb, #4385fd, #5f98ff);
  134. .company_money {
  135. margin-left: 40rpx;
  136. font-size: 30rpx;
  137. }
  138. .company_center {
  139. margin: 20rpx;
  140. .company_money_number {
  141. width: 50%;
  142. font-size: 70rpx;
  143. margin-left: 20rpx;
  144. }
  145. .company_next {
  146. width: 50%;
  147. text-align: center;
  148. line-height: 60rpx;
  149. color: #F5BA3C;
  150. }
  151. .btn {
  152. padding: 12rpx 0;
  153. width: 180rpx;
  154. background: #ffffff;
  155. margin: 0 auto;
  156. border-radius: 30px;
  157. }
  158. }
  159. .company_money_no {
  160. margin-left: 40rpx;
  161. }
  162. }
  163. }
  164. </style>