| | |
| | | fontSize: "30rpx", |
| | | fontWeight: "bold", |
| | | }, |
| | | bindStatus:false |
| | | |
| | | bindStatus:false, |
| | | getSmsCodeTimer: null, |
| | | |
| | | }; |
| | | }, |
| | |
| | | kk(){ |
| | | |
| | | const _this = this; |
| | | _this.getUserInfo() |
| | | // if(this.addressStr.length < 8){ |
| | | |
| | | if(this.addressStr.length < 8){ |
| | | |
| | | uni.showToast({ |
| | | title: '请输入详细地址', |
| | | icon: 'none' |
| | | }); |
| | | return |
| | | } |
| | | |
| | | uni.request({ |
| | | url: _this.$webHost + "/api/v2/customer/appAddCstAddress", |
| | | method: "POST", |
| | | data: { |
| | | ..._this.addressDetail, |
| | | customerId: uni.getStorageSync('ygxLogin').customerId, |
| | | sourceId: uni.getStorageSync('ygxLogin').appId |
| | | }, |
| | | success(){ |
| | | uni.request({ |
| | | url: _this.$webHost+'/api/v2/sign/signed/'+uni.getStorageSync('ygxLogin').customerId, |
| | | method:'POST', |
| | | }) |
| | | |
| | | uni.request({ |
| | | url: _this.$webHost+'/api/v2/pay/memberPurchaseBenefitsPays', |
| | | method:'POST', |
| | | data:{ |
| | | customerId: uni.getStorageSync('ygxLogin').customerId, |
| | | memberPeriodConfigId: uni.getStorageSync('memberPeriodConfigInfo').id |
| | | }, |
| | | success(){ |
| | | _this.getUserInfo() |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | // uni.showToast({ |
| | | // title: '请输入详细地址', |
| | | // icon: 'none' |
| | | // }); |
| | | // return |
| | | // } |
| | | |
| | | // 移到上面了,先保存地址再走下面的接口 |
| | | // uni.request({ |
| | |
| | | }, |
| | | });*/ |
| | | }, |
| | | isValidIDCard(IDCard) { |
| | | // 正则:15位纯数字 或 18位(前17位数字 + 最后一位数字/X) |
| | | const idCardReg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/; |
| | | return idCardReg.test(IDCard) |
| | | }, |
| | | isValidChineseBankCard(cardNumber) { |
| | | const length = cardNumber.length; |
| | | return length === 16 || length === 19; |
| | | }, |
| | | submit() { |
| | | const _this = this; |
| | | if(!this.protocolChecked[0]){uni.showToast({title: '请阅读并同意相关协议', icon: 'none'});return;} |
| | |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } else { |
| | | if (!_this.isValidIDCard(_this.idCardNo)) { |
| | | uni.showToast({ |
| | | title: "请输入正确的身份证号", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | if(!_this.cardNumber){ |
| | | uni.showToast({ |
| | |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } else { |
| | | if (!_this.isValidChineseBankCard(_this.cardNumber)) { |
| | | uni.showToast({ |
| | | title: "请输入正确的银行卡号", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | if(!_this.cardPhone){ |
| | | uni.showToast({ |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(_this.addressDetail.contactPhone)) return uni.showToast({ |
| | | title: '请输入正确的收件人联系电话', |
| | | icon: 'none' |
| | | }); |
| | | if (!_this.addressDetail.provinceCode) { |
| | | uni.showToast({ |
| | | title: "请输入收件人所在地", |
| | |
| | | _this.getPayBindCardInfo = res.data.data; |
| | | } |
| | | }) |
| | | |
| | | // 保存地址:地址保存成功后再走提交接口 |
| | | uni.request({ |
| | | url: _this.$webHost + "/api/v2/customer/appAddCstAddress", |
| | | method: "POST", |
| | | data: { |
| | | ..._this.addressDetail, |
| | | customerId: uni.getStorageSync('ygxLogin').customerId, |
| | | sourceId: uni.getStorageSync('ygxLogin').appId |
| | | }, |
| | | success: function (res) { |
| | | if(res.data.code==200){ |
| | | uni.request({ |
| | | url: _this.$webHost+'/api/v2/pay/verifySMSCodes', |
| | | method:'POST', |
| | | data:{ |
| | | ..._this.bindCardId, |
| | | |
| | | "customerId": uni.getStorageSync('ygxLogin').customerId, |
| | | "cardPhone" : _this.cardPhone, //手机号 |
| | | |
| | | "cardNumber": _this.cardNumber, //卡号 |
| | | |
| | | "cardName" : _this.cardName, // 名字 |
| | | "cardIdNo" : _this.cardIdNo, |
| | | "bankName" : _this.bankName, |
| | | "cardNo" : _this.cardNumber, |
| | | |
| | | "verificationCode": _this.verificationCode, |
| | | }, |
| | | success(e){ |
| | | if(e.data.code!==200){ |
| | | uni.showToast({ |
| | | title: e.data.data, |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | uni.request({ |
| | | url:_this.$webHost+`/api/v2/pay/getPayBindCardInfo/${uni.getStorageSync('ygxLogin').customerId}`, |
| | | method:'get', |
| | | success:function(res){ |
| | | const ls = res.data.data; |
| | | _this.getPayBindCardInfo = res.data.data; |
| | | if(!ls || !ls.some(item => item.bindStatus == 0)) {_this.kk();return;} |
| | | |
| | | |
| | | |
| | | if(ls.length && !ls[1].bindStatus){ |
| | | _this.$refs.codeUi.open() |
| | | _this.isCounting = false; |
| | | _this.countText = ''; |
| | | return; |
| | | } |
| | | if(ls.length && !ls[2].bindStatus){ |
| | | _this.$refs.setUi.open(); |
| | | _this.isCounting = false; |
| | | _this.countText = ''; |
| | | return; |
| | | } |
| | | if(!ls || !ls.some(item => item.bindStatus == 0)) {_this.kk();return;} |
| | | |
| | | |
| | | |
| | | _this.kk() |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.data.msg, |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | uni.request({ |
| | | url: _this.$webHost+'/api/v2/pay/verifySMSCodes', |
| | | method:'POST', |
| | | data:{ |
| | | ..._this.bindCardId, |
| | | // uni.request({ |
| | | // url: _this.$webHost+'/api/v2/pay/verifySMSCodes', |
| | | // method:'POST', |
| | | // data:{ |
| | | // ..._this.bindCardId, |
| | | |
| | | "customerId": uni.getStorageSync('ygxLogin').customerId, |
| | | "cardPhone" : _this.cardPhone, //手机号 |
| | | // "customerId": uni.getStorageSync('ygxLogin').customerId, |
| | | // "cardPhone" : _this.cardPhone, //手机号 |
| | | |
| | | "cardNumber": _this.cardNumber, //卡号 |
| | | // "cardNumber": _this.cardNumber, //卡号 |
| | | |
| | | "cardName" : _this.cardName, // 名字 |
| | | "cardIdNo" : _this.cardIdNo, |
| | | "bankName" : _this.bankName, |
| | | "cardNo" : _this.cardNumber, |
| | | // "cardName" : _this.cardName, // 名字 |
| | | // "cardIdNo" : _this.cardIdNo, |
| | | // "bankName" : _this.bankName, |
| | | // "cardNo" : _this.cardNumber, |
| | | |
| | | "verificationCode": _this.verificationCode, |
| | | }, |
| | | success(e){ |
| | | if(e.data.code!==200){ |
| | | // _this.$util.Tips({ |
| | | // title: e.data.data |
| | | // }); |
| | | uni.showToast({ |
| | | title: e.data.data, |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | uni.request({ |
| | | url:_this.$webHost+`/api/v2/pay/getPayBindCardInfo/${uni.getStorageSync('ygxLogin').customerId}`, |
| | | method:'get', |
| | | success:function(res){ |
| | | const ls = res.data.data; |
| | | _this.getPayBindCardInfo = res.data.data; |
| | | if(!ls || !ls.some(item => item.bindStatus == 0)) {_this.kk();return;} |
| | | // "verificationCode": _this.verificationCode, |
| | | // }, |
| | | // success(e){ |
| | | // if(e.data.code!==200){ |
| | | // // _this.$util.Tips({ |
| | | // // title: e.data.data |
| | | // // }); |
| | | // uni.showToast({ |
| | | // title: e.data.data, |
| | | // icon: 'none' |
| | | // }); |
| | | // return; |
| | | // } |
| | | // uni.request({ |
| | | // url:_this.$webHost+`/api/v2/pay/getPayBindCardInfo/${uni.getStorageSync('ygxLogin').customerId}`, |
| | | // method:'get', |
| | | // success:function(res){ |
| | | // const ls = res.data.data; |
| | | // _this.getPayBindCardInfo = res.data.data; |
| | | // if(!ls || !ls.some(item => item.bindStatus == 0)) {_this.kk();return;} |
| | | |
| | | |
| | | |
| | | if(ls.length && !ls[1].bindStatus){ |
| | | _this.$refs.codeUi.open() |
| | | _this.isCounting = false; |
| | | _this.countText = ''; |
| | | return; |
| | | } |
| | | if(ls.length && !ls[2].bindStatus){ |
| | | _this.$refs.setUi.open(); |
| | | _this.isCounting = false; |
| | | _this.countText = ''; |
| | | return; |
| | | } |
| | | if(!ls || !ls.some(item => item.bindStatus == 0)) {_this.kk();return;} |
| | | // if(ls.length && !ls[1].bindStatus){ |
| | | // _this.$refs.codeUi.open() |
| | | // _this.isCounting = false; |
| | | // _this.countText = ''; |
| | | // return; |
| | | // } |
| | | // if(ls.length && !ls[2].bindStatus){ |
| | | // _this.$refs.setUi.open(); |
| | | // _this.isCounting = false; |
| | | // _this.countText = ''; |
| | | // return; |
| | | // } |
| | | // if(!ls || !ls.some(item => item.bindStatus == 0)) {_this.kk();return;} |
| | | |
| | | |
| | | |
| | | _this.kk() |
| | | // _this.kk() |
| | | |
| | | |
| | | |
| | | } |
| | | // } |
| | | |
| | | }) |
| | | } |
| | | }) |
| | | // }) |
| | | // } |
| | | // }) |
| | | |
| | | |
| | | }, |
| | | getSmsCode(){ |
| | | const that = this; |
| | | clearInterval(that.getSmsCodeTimer); |
| | | console.log(that.getPayBindCardInfo[0].paymentMethod); |
| | | if(this.isCounting){ |
| | | return |
| | |
| | | that.countText = `${count}s秒后重新获取`; |
| | | |
| | | |
| | | const timer = setInterval(() => { |
| | | that.getSmsCodeTimer = setInterval(() => { |
| | | count--; |
| | | that.countText = `${count}s秒后重新获取`; |
| | | if (count <= 0) { |
| | | clearInterval(timer); |
| | | clearInterval(that.getSmsCodeTimer); |
| | | that.isCounting = false; |
| | | that.countText = ''; |
| | | } |
| | |
| | | url: '/pages/index/index' |
| | | }); |
| | | }, |
| | | |
| | | // 收件人所在地:弹窗选择城市 |
| | | openProvincesCity() { |
| | | let defaultData = [] |
| | | if(this.addressDetail.provinceCode && this.addressDetail.cityCode) { |
| | |
| | | |
| | | this.$refs.provincesCity.open(defaultData) |
| | | }, |
| | | // 弹窗选择城市回调 |
| | | provincesCityChange(e) { |
| | | if(e.value.length > 0) { |
| | | this.addressDetail.provinceCode = e.value[0].code |
| | |
| | | <text>银行卡号</text> |
| | | </view> |
| | | <view class="inp_box"> |
| | | <input maxlength="30" @blur="validateAndCacheCardInfo" v-model="cardNumber" class="inp" placeholder="请输入银行卡号" /> |
| | | <input type="number" maxlength="19" @blur="validateAndCacheCardInfo" v-model="cardNumber" class="inp" placeholder="请输入银行卡号" /> |
| | | <image @click="cardNumber=''" v-show="!bindStatus && cardNumber" :src="offIcon" style="width: 40rpx;height: 40rpx;position: absolute;right: 0rpx;top: 30rpx;"></image> |
| | | </view> |
| | | |
| | |
| | | v-model="verificationCodeT" |
| | | border="none" |
| | | placeholder="请输入验证码" |
| | | type="number" |
| | | style="height: 100rpx;border: 1px solid #EEEEEE;border-radius: 30rpx;padding: 0 50rpx;" |
| | | > |
| | | <template #suffix> |
| | |
| | | v-model="verificationCodeS" |
| | | border="none" |
| | | placeholder="请输入验证码" |
| | | type="number" |
| | | style="height: 100rpx;border: 1px solid #EEEEEE;border-radius: 30rpx;padding: 0 50rpx;" |
| | | > |
| | | <template #suffix> |