dingdong-master/pages/my/b-account-bind.vue

104 lines
3.0 KiB
Vue
Raw Normal View History

2022-05-19 22:12:16 +08:00
<template>
2022-07-22 21:24:18 +08:00
<view v-if="curUserInfo && curUserInfo.status != -1">
2022-05-19 22:12:16 +08:00
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
2022-07-22 21:24:18 +08:00
<!-- <block slot="content"></block> -->
2022-05-19 22:12:16 +08:00
</cu-custom>
<view class="margin-lr-sm margin-tb-lg shadow-warp">
<view class="bg-gray flex justify-start align-center text-xl padding-lr padding-top-xs">
2022-07-22 21:24:18 +08:00
<view class="padding-lr padding-tb-sm" :class="curAccountType === '1' ? 'curTab' : ''" data-type="1" @click="changAccountType">银行</view>
2022-05-19 22:12:16 +08:00
</view>
2022-07-22 21:24:18 +08:00
<view v-if="curAccountType === '1'" class="bg-white padding text-lg">
2022-05-19 22:12:16 +08:00
<view>
2022-07-22 21:24:18 +08:00
<view class="margin-bottom-sm">姓名</view>
2022-05-26 20:25:04 +08:00
<input type="text" placeholder="请输入开户人姓名" placeholder-style="color:#989898" v-model="formData.name">
2022-05-19 22:12:16 +08:00
</view>
<view class="margin-top">
2022-07-22 21:24:18 +08:00
<view class="margin-bottom-sm">证件号码</view>
<input type="text" placeholder="请输入证件号码" placeholder-style="color:#989898" v-model="formData.certId">
2022-05-19 22:12:16 +08:00
</view>
<view class="margin-top">
2022-05-26 20:25:04 +08:00
<view class="margin-bottom-sm">手机号</view>
<input type="text" placeholder="请输入手机号" placeholder-style="color:#989898" v-model="formData.phone">
2022-05-19 22:12:16 +08:00
</view>
<view class="margin-top">
2022-07-22 21:24:18 +08:00
<view class="margin-bottom-sm">号码</view>
<input type="text" placeholder="请输入号码" placeholder-style="color:#989898" v-model="formData.bankNum">
2022-05-26 20:25:04 +08:00
</view>
2022-05-19 22:12:16 +08:00
</view>
</view>
<!-- 操作按钮 -->
2022-05-21 23:49:53 +08:00
<view class="margin-lr">
<button class="cu-btn lg bg-main-color long-btn shadow-blur" @click="submit">提交</button>
2022-05-19 22:12:16 +08:00
</view>
2022-07-22 21:24:18 +08:00
<view class="text-red padding">
工盟互联小程序承诺此账户只用于接收家政服务收益
</view>
2022-05-19 22:12:16 +08:00
</view>
</template>
<script>
import myUniCombox from '@/components/uni-combox/my-uni-combox.vue';
export default {
components: {
myUniCombox
},
data() {
return {
2022-07-22 21:24:18 +08:00
curAccountType: '1',
2022-05-19 22:12:16 +08:00
provinceList: [],
cityList: [],
formData: {
provinceObj: {},
cityObj: {}
2022-05-26 20:25:04 +08:00
},
curUserInfo: {}
2022-05-19 22:12:16 +08:00
}
},
2022-05-28 00:32:09 +08:00
onLoad(options) {
2022-05-19 22:12:16 +08:00
this.loadData();
},
methods: {
async loadData() {
2022-05-26 20:25:04 +08:00
// let res = await this.$request.areaListByStep();
// this.provinceList = res.data;
this.curUserInfo = this.$request.getCurUserInfo();
2022-05-19 22:12:16 +08:00
},
async chooseRegion(e) {
let res = await this.$request.areaListByStep({
parentCode: e.areaCode
});
this.cityList = res.data;
this.formData.cityObj = {}
},
changAccountType(e) {
this.curAccountType = e.currentTarget.dataset.type;
},
2022-05-26 20:25:04 +08:00
async submit() {
if (this.curAccountType === '1') {
let params = {
...this.formData,
2022-05-28 00:32:09 +08:00
workerId: this.curUserInfo.workerId
2022-05-26 20:25:04 +08:00
}
let res = await this.$request.bindBankCard(params);
if (res.code === 0) {
uni.navigateBack({
delta: -1
})
}
}
2022-05-19 22:12:16 +08:00
}
},
}
</script>
<style scoped>
.curTab {
background-color: #ffffff;
color: #0081ff;
border-radius: 15rpx 15rpx 0 0;
}
</style>