wallet.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <view style="z-index: 99;">
  6. <view class="search dis a-c j-s">
  7. <u-icon name="arrow-left" size="40" @tap="back"></u-icon>
  8. <text class="center">钱包</text>
  9. <text class="bank" @click="changeBank">卡包</text>
  10. </view>
  11. </view>
  12. <view class="" style="padding:0 16px 16px;">
  13. <view class="assets dis f-c j-s">
  14. <view class="dis f-c j-s a-c">
  15. <text>我的资产(元)</text>
  16. <text> <text style="font-size: 16px;">¥</text> {{totalAssetAmount}}</text>
  17. <u-button size="medium" type="primary"
  18. style="background: linear-gradient( 270deg, #0052FF 0%, #6899FF 100%);"
  19. @click="toWithdraw">提现</u-button>
  20. </view>
  21. <view class="yushou dis f-c">
  22. <view class="dis j-s a-start" @click="details('/pages/wallet/preReceivedDetails')">
  23. <image src="/static/image/wallet/yushou.png" mode=""></image>
  24. <view class="dis f-c " style="width: 90%;">
  25. <view class="dis a-c j-s">
  26. <text style="font-size: 15px;color: #333;font-weight: bold;">预收明细</text>
  27. <u-icon name="arrow-right" size="30" color="#C7C6CA"></u-icon>
  28. </view>
  29. <text style="font-size: 12px;color: rgba(51,51,51,0.8);">车牌订单明细内容</text>
  30. </view>
  31. </view>
  32. <view class="dis j-s a-start" style="margin-top: 16px;"
  33. @click="details('/pages/wallet/transactionDetails')">
  34. <image src="/static/image/wallet/yushou.png" mode=""></image>
  35. <view class="dis f-c " style="width: 90%;">
  36. <view class="dis a-c j-s">
  37. <text style="font-size: 15px;color: #333;font-weight: bold;">收支明细</text>
  38. <u-icon name="arrow-right" size="30" color="#C7C6CA"></u-icon>
  39. </view>
  40. <text style="font-size: 12px;color: rgba(51,51,51,0.8);">收入/提现中/已提现明细内容</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. mapState
  51. } from "vuex"
  52. export default {
  53. data() {
  54. return {
  55. totalAssetAmount: null,
  56. bankList: [{
  57. bankName: "中国邮政储蓄银行",
  58. logo: "/static/image/bankLogo/youzheng.png",
  59. background: "linear-gradient(90deg, rgba(79, 136, 69, 0.7) 0%, #4f8845 100%)"
  60. },
  61. {
  62. bankName: "中国工商银行",
  63. logo: "/static/image/bankLogo/gongshang.png",
  64. background: "linear-gradient(90deg, rgba(177, 0, 13, 0.7) 0%, #b1000d 100%)"
  65. },
  66. {
  67. bankName: "中国农业银行",
  68. logo: "/static/image/bankLogo/nongye.png",
  69. background: "linear-gradient(90deg, rgba(86,152, 130, 0.7) 0%, #569882 100%)"
  70. },
  71. {
  72. bankName: "中国银行",
  73. logo: "/static/image/bankLogo/zhongguo.png",
  74. background: "linear-gradient(90deg, rgba(157, 32, 40, 0.7) 0%, #9d2028 100%)"
  75. },
  76. {
  77. bankName: "中国建设银行",
  78. logo: "/static/image/bankLogo/jianshe.png",
  79. background: "linear-gradient(90deg, rgba(6, 89, 159, 0.7) 0%, #06569F 100%)"
  80. },
  81. {
  82. bankName: "招商银行",
  83. logo: "/static/image/bankLogo/zhaoshang.png",
  84. background: "linear-gradient(90deg, rgba(197, 0, 25, 0.7) 0%, #c50019 100%)"
  85. },
  86. {
  87. bankName: "中国民生银行",
  88. logo: "/static/image/bankLogo/minsheng.png",
  89. background: "linear-gradient(90deg, rgba(84,149, 92, 0.7) 0%, #54955c 100%)"
  90. },
  91. {
  92. bankName: "中国光大银行",
  93. logo: "/static/image/bankLogo/guangda.png",
  94. background: "linear-gradient(90deg, rgba(93, 30, 131, 0.7) 0%, #5d1e83 100%)"
  95. },
  96. {
  97. bankName: "中信银行",
  98. logo: "/static/image/bankLogo/zhongxin.png",
  99. background: "linear-gradient(90deg, rgba(184, 0,22, 0.7) 0%, #b80016 100%)"
  100. },
  101. {
  102. bankName: "华夏银行",
  103. logo: "/static/image/bankLogo/huaxia.png",
  104. background: "linear-gradient(90deg, rgba(216, 12, 24, 0.7) 0%, #d80c18 100%)"
  105. },
  106. {
  107. bankName: "中国交通银行",
  108. logo: "/static/image/bankLogo/jiaotong.png",
  109. background: "linear-gradient(90deg, rgba(33, 58, 120, 0.7) 0%, #213a78 100%)"
  110. },
  111. {
  112. bankName: "晋商银行",
  113. logo: "/static/image/bankLogo/jinshang.png",
  114. background: "linear-gradient(90deg, rgba(224, 150, 165, 0.7) 0%, #e096a5 100%)"
  115. },
  116. {
  117. bankName: "山西银行",
  118. logo: "/static/image/bankLogo/shanxi.png",
  119. background: "linear-gradient(90deg, rgba(192, 19, 73, 0.7) 0%, #c01349 100%)"
  120. },
  121. {
  122. bankName: "农村商业银行",
  123. logo: "/static/image/bankLogo/nongcun.png",
  124. background: "linear-gradient(90deg, rgba(0, 155, 77, 0.7) 0%, #009b4d 100%)"
  125. },
  126. ],
  127. bankCardInfo: {}
  128. }
  129. },
  130. computed: {
  131. ...mapState(['userInfo'])
  132. },
  133. onShow() {
  134. this.getAdvanceMoney(); //金额
  135. this.getbankCard();
  136. },
  137. onLoad() {
  138. this.getAdvanceMoney(); //手续费金额
  139. },
  140. methods: {
  141. // 获取银行卡信息
  142. async getbankCard() {
  143. let res = await this.$http.post('/userBank/getUserBankList', {
  144. auditStatus: "1",
  145. delFlag: '0'
  146. });
  147. this.bankList.map(val => {
  148. res.data.map(ele => {
  149. if (val.bankName == ele.bankAccount) {
  150. ele.logo = val.logo;
  151. return ele;
  152. }
  153. })
  154. })
  155. let bankinfo = res.data.find(val => val.isDefault == 1)
  156. if (bankinfo) {
  157. this.bankCardInfo = bankinfo;
  158. } else {
  159. this.bankCardInfo = res.data[0]
  160. }
  161. },
  162. // 预收账户金额查询
  163. async getAdvanceMoney() {
  164. let res = await this.$http.get('/sysUserAccount/getUserSumAmountByUserId?userId=' + this.userInfo
  165. .sysUser.id);
  166. this.totalAssetAmount = res.data;
  167. },
  168. // 绑定银行卡界面
  169. async changeBank() {
  170. let res = await this.$http.post('/userBank/getUserBankList', {
  171. auditStatus: "",
  172. });
  173. if (res.data.length) {
  174. this.navigate({
  175. url: "/pages/wallet/bankCard"
  176. }, "navigateTo", true);
  177. } else {
  178. this.navigate({
  179. url: '/pages/wallet/bindBank',
  180. complete: () => {
  181. setTimeout(() => {
  182. uni.showToast({
  183. title: '请先绑定银行卡',
  184. duration: 3000,
  185. icon: "none"
  186. });
  187. }, 500);
  188. }
  189. }, "navigateTo", true)
  190. }
  191. },
  192. back() {
  193. uni.navigateBack({
  194. delta: 1, // 返回的页面数,如果是1表示返回上一页
  195. success: function() {}
  196. });
  197. },
  198. details(url) {
  199. this.navigate({
  200. url: url
  201. }, "navigateTo", true);
  202. },
  203. // 去提现
  204. async toWithdraw() {
  205. let that = this
  206. let signResult = await this.$http.post('/ttqf/queryPressing', {
  207. userId: uni.getStorageSync('username'),
  208. bankNumber: this.bankCardInfo.bankNumber
  209. })
  210. if(signResult.data.bizCode === '1') { // 未签约
  211. uni.showModal({
  212. title: '温馨提示',
  213. content: '尚未签约,需先去签约!',
  214. showCancel: true,
  215. confirmText: '去签约',
  216. cancelText: '稍后签约',
  217. async success(res) {
  218. if(res.confirm) {
  219. let srcResult = await that.$http.post('/ttqf/signingAddress', {
  220. userId: uni.getStorageSync('username')
  221. })
  222. if(srcResult.data) {
  223. plus.runtime.openURL(srcResult.data.url)
  224. }
  225. }
  226. }
  227. })
  228. } else if(signResult.data.bizCode === '2') { // 签约未完成
  229. uni.showModal({
  230. title: '温馨提示',
  231. content: '签约进行中,是否去查看?',
  232. showCancel: true,
  233. confirmText: '去查看',
  234. cancelText: '取消',
  235. success(res) {
  236. if(res.confirm) {
  237. if(signResult.data) {
  238. plus.runtime.openURL(signResult.data.url)
  239. }
  240. }
  241. }
  242. })
  243. } else if(signResult.data.bizCode === '3' || signResult.data.bizCode === '0') { // 签约完成
  244. let res = await this.$http.post('/userBank/getUserBankList', {
  245. auditStatus: '1',
  246. delFlag: '0'
  247. });
  248. if (res.data.length) {
  249. this.navigate({
  250. url: `/pages/wallet/withdraw?amount=${this.totalAssetAmount}`,
  251. }, "navigateTo", true)
  252. } else {
  253. uni.showToast({
  254. title: '暂无审核通过的银行卡,不可提现',
  255. duration: 3000,
  256. icon: "none"
  257. });
  258. }
  259. }
  260. },
  261. }
  262. }
  263. </script>
  264. <style lang="scss" scoped>
  265. @import '@/style/mixin.scss';
  266. page {
  267. background: #F8FAFE;
  268. }
  269. .assets {
  270. width: 100%;
  271. height: auto;
  272. background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFE 100%);
  273. box-shadow: 0px 4px 10px 0px #DAE3F4;
  274. border-radius: 10px;
  275. border: 1px solid #FFFFFF;
  276. padding: 0 10px;
  277. >view:nth-child(1) {
  278. border-bottom: 1px solid #CFCFCF;
  279. padding: 24px 0;
  280. color: #333;
  281. text:nth-child(1) {
  282. font-size: 14px;
  283. }
  284. text:nth-child(2) {
  285. font-size: 30px;
  286. font-weight: bold;
  287. margin: 6px 0;
  288. }
  289. }
  290. .yushou {
  291. padding: 16px 0;
  292. image {
  293. width: 20px;
  294. height: 20px;
  295. margin-top: 5px;
  296. }
  297. }
  298. }
  299. /* 银行卡信息Start */
  300. .search {
  301. height: auto;
  302. width: 100%;
  303. z-index: 999999;
  304. padding: 50px 16px 30px;
  305. height: auto;
  306. background: #F8FAFE;
  307. background-image: url("/static/image/wallet/qianbao.png");
  308. background-size: 100% 100%;
  309. position: relative;
  310. text {
  311. font-size: 18px;
  312. font-weight: bold;
  313. color: #000;
  314. }
  315. .bank {
  316. font-weight: 600;
  317. font-size: 28rpx;
  318. color: #000000;
  319. }
  320. .center {
  321. position: absolute;
  322. left: 50%;
  323. transform: translateX(-50%);
  324. }
  325. image {
  326. width: 22px;
  327. height: 22px;
  328. margin-left: 20px;
  329. }
  330. }
  331. </style>