From 8e12de58b1fa7a3ab4afb58674f87d682f2c48fd Mon Sep 17 00:00:00 2001 From: donqi Date: Thu, 26 May 2022 20:25:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 8 +++++++ pages/my/bank-account-bind.vue | 39 ++++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index 1021376..1cd09c6 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -245,5 +245,13 @@ export default { data: params }) return res[1].data; + }, + async bindBankCard(params) { + let res = await uni.request({ + url: '/customer/bankcard/bind', + method: 'POST', + data: params + }) + return res[1].data; } } diff --git a/pages/my/bank-account-bind.vue b/pages/my/bank-account-bind.vue index dfc1a3d..ac9c584 100644 --- a/pages/my/bank-account-bind.vue +++ b/pages/my/bank-account-bind.vue @@ -25,17 +25,21 @@ 开户人姓名 - + - 银行名称 - + 身份证号 + + + + 手机号 + 银行卡号 - + - + @@ -69,7 +73,8 @@ formData: { provinceObj: {}, cityObj: {} - } + }, + curUserInfo: {} } }, onLoad() { @@ -77,8 +82,9 @@ }, methods: { async loadData() { - let res = await this.$request.areaListByStep(); - this.provinceList = res.data; + // let res = await this.$request.areaListByStep(); + // this.provinceList = res.data; + this.curUserInfo = this.$request.getCurUserInfo(); }, async chooseRegion(e) { let res = await this.$request.areaListByStep({ @@ -90,8 +96,19 @@ changAccountType(e) { this.curAccountType = e.currentTarget.dataset.type; }, - submit() { - console.log(this.formData) + async submit() { + if (this.curAccountType === '1') { + let params = { + ...this.formData, + customerId: this.curUserInfo.workerId + } + let res = await this.$request.bindBankCard(params); + if (res.code === 0) { + uni.navigateBack({ + delta: -1 + }) + } + } } }, }