wallet.vue 9.7 KB

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