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 + }) + } + } } }, }