wallet.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <service-widget @btnClick="btn_click"></service-widget>
  6. <view style="z-index: 99;">
  7. <view class="search dis a-c j-s">
  8. <u-icon name="arrow-left" size="40" @tap="back"></u-icon>
  9. <text class="center">钱包</text>
  10. <text class="bank" @click="changeBank">卡包</text>
  11. </view>
  12. </view>
  13. <view class="" style="padding:0 16px 16px;">
  14. <view class="assets dis f-c j-s">
  15. <view class="dis f-c j-s a-c">
  16. <text>我的资产(元)</text>
  17. <text> <text style="font-size: 16px;">¥</text> {{totalAssetAmount}}</text>
  18. <u-button size="medium" type="primary"
  19. style="background: linear-gradient( 270deg, #0052FF 0%, #6899FF 100%);"
  20. @click="toWithdraw">提现</u-button>
  21. </view>
  22. <view class="yushou dis f-c">
  23. <view class="dis j-s a-start" @click="details('/pages/wallet/preReceivedDetails')">
  24. <image src="/static/image/wallet/yushou.png" mode=""></image>
  25. <view class="dis f-c " style="width: 90%;">
  26. <view class="dis a-c j-s">
  27. <text style="font-size: 15px;color: #333;font-weight: bold;">预收明细</text>
  28. <u-icon name="arrow-right" size="30" color="#C7C6CA"></u-icon>
  29. </view>
  30. <text style="font-size: 12px;color: rgba(51,51,51,0.8);">车牌订单明细内容</text>
  31. </view>
  32. </view>
  33. <view class="dis j-s a-start" style="margin-top: 16px;"
  34. @click="details('/pages/wallet/transactionDetails')">
  35. <image src="/static/image/wallet/yushou.png" mode=""></image>
  36. <view class="dis f-c " style="width: 90%;">
  37. <view class="dis a-c j-s">
  38. <text style="font-size: 15px;color: #333;font-weight: bold;">收支明细</text>
  39. <u-icon name="arrow-right" size="30" color="#C7C6CA"></u-icon>
  40. </view>
  41. <text style="font-size: 12px;color: rgba(51,51,51,0.8);">收入/提现中/已提现明细内容</text>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. mapState
  52. } from "vuex"
  53. export default {
  54. data() {
  55. return {
  56. totalAssetAmount: null,
  57. }
  58. },
  59. computed: {
  60. ...mapState(['userInfo'])
  61. },
  62. onShow() {
  63. this.getAdvanceMoney(); //金额
  64. },
  65. onLoad() {
  66. this.getAdvanceMoney(); //手续费金额
  67. this.$http.get('/sysMenuRecord/add?type=1&menuType=3')
  68. },
  69. methods: {
  70. btn_click() {
  71. uni.navigateTo({
  72. url: '/pages/chat/chat'
  73. })
  74. },
  75. // 预收账户金额查询
  76. async getAdvanceMoney() {
  77. let res = await this.$http.get('/sysUserAccount/getUserSumAmountByUserId?userId=' + this.userInfo
  78. .sysUser.id);
  79. this.totalAssetAmount = res.data;
  80. },
  81. // 绑定银行卡界面
  82. async changeBank() {
  83. let res = await this.$http.post('/userBank/getUserBankList', {
  84. auditStatus: "",
  85. });
  86. if (res.data.length) {
  87. this.navigate({
  88. url: "/pages/wallet/bankCard"
  89. }, "navigateTo", true);
  90. } else {
  91. this.navigate({
  92. url: '/pages/wallet/bindBank',
  93. complete: () => {
  94. setTimeout(() => {
  95. uni.showToast({
  96. title: '请先绑定银行卡',
  97. duration: 3000,
  98. icon: "none"
  99. });
  100. }, 500);
  101. }
  102. }, "navigateTo", true)
  103. }
  104. },
  105. back() {
  106. uni.navigateBack({
  107. delta: 1, // 返回的页面数,如果是1表示返回上一页
  108. success: function() {}
  109. });
  110. },
  111. details(url) {
  112. this.navigate({
  113. url: url
  114. }, "navigateTo", true);
  115. },
  116. // 去提现
  117. async toWithdraw() {
  118. let res = await this.$http.post('/userBank/getUserBankList', {
  119. auditStatus: '1',
  120. delFlag: '0'
  121. });
  122. if (res.data.length) {
  123. this.navigate({
  124. url: `/pages/wallet/withdraw?amount=${this.totalAssetAmount}`,
  125. }, "navigateTo", true)
  126. } else {
  127. uni.showToast({
  128. title: '暂无审核通过的银行卡,不可提现',
  129. duration: 3000,
  130. icon: "none"
  131. });
  132. }
  133. },
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. @import '@/style/mixin.scss';
  139. page {
  140. background: #F8FAFE;
  141. }
  142. .assets {
  143. width: 100%;
  144. height: auto;
  145. background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFE 100%);
  146. box-shadow: 0px 4px 10px 0px #DAE3F4;
  147. border-radius: 10px;
  148. border: 1px solid #FFFFFF;
  149. padding: 0 10px;
  150. >view:nth-child(1) {
  151. border-bottom: 1px solid #CFCFCF;
  152. padding: 24px 0;
  153. color: #333;
  154. text:nth-child(1) {
  155. font-size: 14px;
  156. }
  157. text:nth-child(2) {
  158. font-size: 30px;
  159. font-weight: bold;
  160. margin: 6px 0;
  161. }
  162. }
  163. .yushou {
  164. padding: 16px 0;
  165. image {
  166. width: 20px;
  167. height: 20px;
  168. margin-top: 5px;
  169. }
  170. }
  171. }
  172. /* 银行卡信息Start */
  173. .search {
  174. height: auto;
  175. width: 100%;
  176. z-index: 999999;
  177. padding: 50px 16px 30px;
  178. height: auto;
  179. background: #F8FAFE;
  180. background-image: url("/static/image/wallet/qianbao.png");
  181. background-size: 100% 100%;
  182. position: relative;
  183. text {
  184. font-size: 18px;
  185. font-weight: bold;
  186. color: #000;
  187. }
  188. .bank {
  189. font-weight: 600;
  190. font-size: 28rpx;
  191. color: #000000;
  192. }
  193. .center {
  194. position: absolute;
  195. left: 50%;
  196. transform: translateX(-50%);
  197. }
  198. image {
  199. width: 22px;
  200. height: 22px;
  201. margin-left: 20px;
  202. }
  203. }
  204. </style>