wallet.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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. bankNumber: "",
  130. }
  131. }
  132. },
  133. computed: {
  134. ...mapState(['userInfo'])
  135. },
  136. onShow() {
  137. this.getAdvanceMoney(); //金额
  138. this.getbankCard();
  139. },
  140. onLoad() {
  141. this.getAdvanceMoney(); //手续费金额
  142. this.$http.get('/sysMenuRecord/add?type=1&menuType=3')
  143. },
  144. methods: {
  145. btn_click() {
  146. uni.navigateTo({
  147. url: '/pages/chat/chat'
  148. })
  149. },
  150. // 获取银行卡信息
  151. async getbankCard() {
  152. let res = await this.$http.post('/userBank/getUserBankList', {
  153. auditStatus: "1",
  154. delFlag: '0'
  155. });
  156. if (res.data.length) {
  157. this.bankList.map(val => {
  158. res.data.map(ele => {
  159. if (val.bankName == ele.bankAccount) {
  160. ele.logo = val.logo;
  161. return ele;
  162. }
  163. })
  164. })
  165. let bankinfo = res.data.find(val => val.isDefault == 1)
  166. if (bankinfo) {
  167. this.bankCardInfo = bankinfo;
  168. } else {
  169. this.bankCardInfo = res.data[0]
  170. }
  171. }
  172. },
  173. // 预收账户金额查询
  174. async getAdvanceMoney() {
  175. let res = await this.$http.get('/sysUserAccount/getUserSumAmountByUserId?userId=' + this.userInfo
  176. .sysUser.id);
  177. this.totalAssetAmount = res.data;
  178. },
  179. // 绑定银行卡界面
  180. async changeBank() {
  181. let res = await this.$http.post('/userBank/getUserBankList', {
  182. auditStatus: "",
  183. });
  184. if (res.data.length) {
  185. this.navigate({
  186. url: "/pages/wallet/bankCard"
  187. }, "navigateTo", true);
  188. } else {
  189. this.navigate({
  190. url: '/pages/wallet/bindBank',
  191. complete: () => {
  192. setTimeout(() => {
  193. uni.showToast({
  194. title: '请先绑定银行卡',
  195. duration: 3000,
  196. icon: "none"
  197. });
  198. }, 500);
  199. }
  200. }, "navigateTo", true)
  201. }
  202. },
  203. back() {
  204. uni.navigateBack({
  205. delta: 1, // 返回的页面数,如果是1表示返回上一页
  206. success: function() {}
  207. });
  208. },
  209. details(url) {
  210. this.navigate({
  211. url: url
  212. }, "navigateTo", true);
  213. },
  214. // 去提现
  215. async toWithdraw() {
  216. let that = this;
  217. let signResult = await this.$http.post('/ttqf/queryPressing', {
  218. userId: uni.getStorageSync('username'),
  219. bankNumber: this.bankCardInfo.bankNumber,
  220. })
  221. if (signResult.code == '200') {
  222. if (signResult.data.bizCode === '1') { // 未签约
  223. uni.showModal({
  224. title: '温馨提示',
  225. content: '尚未签约,需先去签约!',
  226. showCancel: true,
  227. confirmText: '去签约',
  228. cancelText: '稍后签约',
  229. async success(res) {
  230. if (res.confirm) {
  231. let srcResult = await that.$http.post('/ttqf/signingAddress', {
  232. userId: uni.getStorageSync('username')
  233. })
  234. if (srcResult.data) {
  235. plus.runtime.openURL(srcResult.data.url)
  236. } else {
  237. uni.showToast({
  238. title: srcResult.msg,
  239. duration: 3000,
  240. icon: "none"
  241. });
  242. }
  243. }
  244. }
  245. })
  246. } else if (signResult.data.bizCode === '2') { // 签约未完成
  247. uni.showModal({
  248. title: '温馨提示',
  249. content: '签约进行中,是否去查看?',
  250. showCancel: true,
  251. confirmText: '去查看',
  252. cancelText: '取消',
  253. success(res) {
  254. if (res.confirm) {
  255. if (signResult.data) {
  256. plus.runtime.openURL(signResult.data.url)
  257. }
  258. }
  259. }
  260. })
  261. } else if (signResult.data.bizCode === '3' || signResult.data.bizCode === '0') { // 签约完成
  262. let res = await this.$http.post('/userBank/getUserBankList', {
  263. auditStatus: '1',
  264. delFlag: '0'
  265. });
  266. if (res.data.length) {
  267. this.navigate({
  268. url: `/pages/wallet/withdraw?amount=${this.totalAssetAmount}`,
  269. }, "navigateTo", true)
  270. } else {
  271. uni.showToast({
  272. title: '暂无审核通过的银行卡,不可提现',
  273. duration: 3000,
  274. icon: "none"
  275. });
  276. }
  277. }
  278. } else {
  279. uni.showToast({
  280. title: signResult.msg,
  281. duration: 3000,
  282. icon: "none"
  283. });
  284. }
  285. },
  286. }
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. @import '@/style/mixin.scss';
  291. page {
  292. background: #F8FAFE;
  293. }
  294. .assets {
  295. width: 100%;
  296. height: auto;
  297. background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFE 100%);
  298. box-shadow: 0px 4px 10px 0px #DAE3F4;
  299. border-radius: 10px;
  300. border: 1px solid #FFFFFF;
  301. padding: 0 10px;
  302. >view:nth-child(1) {
  303. border-bottom: 1px solid #CFCFCF;
  304. padding: 24px 0;
  305. color: #333;
  306. text:nth-child(1) {
  307. font-size: 14px;
  308. }
  309. text:nth-child(2) {
  310. font-size: 30px;
  311. font-weight: bold;
  312. margin: 6px 0;
  313. }
  314. }
  315. .yushou {
  316. padding: 16px 0;
  317. image {
  318. width: 20px;
  319. height: 20px;
  320. margin-top: 5px;
  321. }
  322. }
  323. }
  324. /* 银行卡信息Start */
  325. .search {
  326. height: auto;
  327. width: 100%;
  328. z-index: 999999;
  329. padding: 50px 16px 30px;
  330. height: auto;
  331. background: #F8FAFE;
  332. background-image: url("/static/image/wallet/qianbao.png");
  333. background-size: 100% 100%;
  334. position: relative;
  335. text {
  336. font-size: 18px;
  337. font-weight: bold;
  338. color: #000;
  339. }
  340. .bank {
  341. font-weight: 600;
  342. font-size: 28rpx;
  343. color: #000000;
  344. }
  345. .center {
  346. position: absolute;
  347. left: 50%;
  348. transform: translateX(-50%);
  349. }
  350. image {
  351. width: 22px;
  352. height: 22px;
  353. margin-left: 20px;
  354. }
  355. }
  356. </style>