diff --git a/common/js/request.js b/common/js/request.js index 1cd09c6..152556e 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -7,8 +7,8 @@ export default { uni.addInterceptor('request', { invoke(args) { // request 触发前拼接 url - args.url = 'https://www.opsoul.com' + args.url; - // args.url = 'http://127.0.0.1:80' + args.url; + // args.url = 'https://www.opsoul.com' + args.url; + args.url = 'http://127.0.0.1:80' + args.url; // args.url = 'http://10.45.137.214:80' + args.url; if (args.data) { args.data.deptId = globalData.deptId; @@ -248,7 +248,15 @@ export default { }, async bindBankCard(params) { let res = await uni.request({ - url: '/customer/bankcard/bind', + url: '/worker/bank/bind', + method: 'POST', + data: params + }) + return res[1].data; + }, + async getBindBankCardByWorkerId(params) { + let res = await uni.request({ + url: '/worker/bank/getByWorkerId', method: 'POST', data: params }) diff --git a/pages/my/bank-account-bind.vue b/pages/my/bank-account-bind.vue index ac9c584..b4bf01c 100644 --- a/pages/my/bank-account-bind.vue +++ b/pages/my/bank-account-bind.vue @@ -77,7 +77,7 @@ curUserInfo: {} } }, - onLoad() { + onLoad(options) { this.loadData(); }, methods: { @@ -100,7 +100,7 @@ if (this.curAccountType === '1') { let params = { ...this.formData, - customerId: this.curUserInfo.workerId + workerId: this.curUserInfo.workerId } let res = await this.$request.bindBankCard(params); if (res.code === 0) { diff --git a/pages/my/withdraw.vue b/pages/my/withdraw.vue index 55d68b7..22f8349 100644 --- a/pages/my/withdraw.vue +++ b/pages/my/withdraw.vue @@ -6,9 +6,18 @@ 提现 - - 提现帐号绑定 - + + + + 已绑定 + {{bindBankCard.encodeBankNum}} + + 帐号另绑 + + + 提现帐号绑定 + + @@ -49,10 +58,32 @@ data() { return { balance: '0.00', - imgList: [] + imgList: [], + curUserInfo: {}, + bindBankCard: null } }, + onLoad() { + this.loadData(); + }, + onShow() { + this.reloadData(); + }, methods: { + async loadData() { + this.curUserInfo = this.$request.getCurUserInfo(); + this.loadBindBankCard(); + }, + async reloadData() { + this.loadBindBankCard(); + }, + async loadBindBankCard() { + let res = await this.$request.getBindBankCardByWorkerId({ + workerId: this.curUserInfo.workerId + }); + this.bindBankCard = res.data; + this.bindBankCard.encodeBankNum = '****' + this.bindBankCard.bankNum.substring(this.bindBankCard.bankNum.length - 4); + }, bindAccount() { uni.navigateTo({ url: '/pages/my/bank-account-bind'