|
|
@@ -4,11 +4,22 @@
|
|
|
<view class="container">
|
|
|
<view class="text-bold" style="font-size: 40upx;padding: 30upx 0upx 10upx 40upx;">绑定银行卡</view>
|
|
|
<view class="padding-left-lg" style="font-size: 28upx;">请如实填写一下资料</view>
|
|
|
- <u-picker mode="selector" v-model="bankShow" :default-selector="[0]" :range="selector" @confirm="confirm"></u-picker>
|
|
|
+ <u-picker mode="selector" v-model="bankShow" :default-selector="[0]" :range="selector" range-key="dictValue" @confirm="bankConfirm"></u-picker>
|
|
|
+ <u-picker mode="selector" v-model="accountShow" :default-selector="[0]" :range="accountType" range-key="dictValue" @confirm="accountConfirm"></u-picker>
|
|
|
<view class="flex align-center" style="padding: 30upx 60upx 20upx 60upx;">
|
|
|
<view style="width: 160upx;font-family: PingFang SC;font-weight: bold;color: #000000;"><text class="text-red">*</text>选择银行</view>
|
|
|
- <view class="flex justify-between align-center" style="width: 200upx;height: 60upx;border: #565656 1upx solid;border-radius: 16upx;" @click="bankShow = true">
|
|
|
- <view class="padding-left-sm">{{bank}}</view>
|
|
|
+ <view class="flex justify-between align-center" style="width: 260upx;height: 60upx;border: #b0b0b0 1upx solid;border-radius: 16upx;" @click="bankShow = true">
|
|
|
+ <view class="padding-left-sm" :class="bank.startsWith('请') ? 'text-gray': ''">{{bank}}</view>
|
|
|
+ <view class="padding-right-xs cuIcon-unfold"></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="padding: 0 60upx;">
|
|
|
+ <u-line color="#d4d4d4"></u-line>
|
|
|
+ </view>
|
|
|
+ <view class="flex align-center" style="padding: 20upx 60upx;">
|
|
|
+ <view style="width: 160upx;font-family: PingFang SC;font-weight: bold;color: #000000;"><text class="text-red">*</text>账号类型</view>
|
|
|
+ <view class="flex justify-between align-center" style="width: 260upx;height: 60upx;border: #b0b0b0 1upx solid;border-radius: 16upx;" @click="accountShow = true">
|
|
|
+ <view class="padding-left-sm" :class="account.startsWith('请') ? 'text-gray': ''">{{account}}</view>
|
|
|
<view class="padding-right-xs cuIcon-unfold"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -54,8 +65,11 @@
|
|
|
data() {
|
|
|
return {
|
|
|
bankShow: false,
|
|
|
- bank: '招商银行',
|
|
|
+ bank: '请选择银行',
|
|
|
cardNum: '',
|
|
|
+ account: '请选择类型',
|
|
|
+ accountType: [],
|
|
|
+ accountShow: false,
|
|
|
name: '',
|
|
|
phone: '',
|
|
|
code: '',
|
|
|
@@ -63,12 +77,29 @@
|
|
|
totalTime: 120, //总时间,单位秒
|
|
|
recordingTime: 0, //记录时间变量
|
|
|
currentTime: 0, //显示时间变量
|
|
|
- selector: ['招商银行', '建设银行', '农业银行', '工商银行', '中信银行', '平安银行'],
|
|
|
+ selector: [],
|
|
|
}
|
|
|
},
|
|
|
+ onLoad() {
|
|
|
+ this.getBankType('bank_type');
|
|
|
+ this.getAccountType('bank_account_type');
|
|
|
+ },
|
|
|
methods: {
|
|
|
- confirm(index) {
|
|
|
- this.bank = this.selector[index];
|
|
|
+ getBankType(param) {
|
|
|
+ this.$u.api.dict.code({code: param}).then(res => {
|
|
|
+ this.selector = res;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAccountType(param) {
|
|
|
+ this.$u.api.dict.code({code: param}).then(res => {
|
|
|
+ this.accountType = res;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bankConfirm(index) {
|
|
|
+ this.bank = this.selector[index].dictValue;
|
|
|
+ },
|
|
|
+ accountConfirm(index) {
|
|
|
+ this.account = this.accountType[index].dictValue;
|
|
|
},
|
|
|
checking() {
|
|
|
if(!this.$u.test.mobile(this.phone)) {
|
|
|
@@ -77,13 +108,24 @@
|
|
|
title: "请输入正确的手机号码"
|
|
|
})
|
|
|
return;
|
|
|
+ } else {
|
|
|
+ let url = 'huawei/sms/sendSms?phone=' + this.phone
|
|
|
+ this.$u.post(url).then(res => {
|
|
|
+ if (res == 'success') {
|
|
|
+ //把显示时间设为总时间
|
|
|
+ this.currentTime = this.totalTime;
|
|
|
+ //开始倒计时
|
|
|
+ this.state = true;
|
|
|
+ //执行倒计时
|
|
|
+ this.checkingTime();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: res
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- //把显示时间设为总时间
|
|
|
- this.currentTime = this.totalTime;
|
|
|
- //开始倒计时
|
|
|
- this.state = true;
|
|
|
- //执行倒计时
|
|
|
- this.checkingTime();
|
|
|
},
|
|
|
checkingTime() {
|
|
|
let that = this;
|
|
|
@@ -113,6 +155,64 @@
|
|
|
this.currentTime = this.totalTime;
|
|
|
}
|
|
|
},
|
|
|
+ bind() {
|
|
|
+ if (this.$u.test.isEmpty(this.bank)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '请选择银行',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$u.test.isEmpty(this.account)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '请选择账号类型',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$u.test.isEmpty(this.cardNum)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '请输入银行卡号',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$u.test.isEmpty(this.name)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '请输入真实姓名',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$u.test.isEmpty(this.phone) || !this.$u.test.mobile(this.phone)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '请填写正确的手机号',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.$u.test.isEmpty(this.code)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '请输入验证码',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let url = 'huawei/sms/validCode?phone=' + this.phone + '&code=' + this.code;
|
|
|
+ this.$u.post(url).then(res => {
|
|
|
+ if (res == 'success') {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "绑定成功",
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: res,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|