From 7b1e4d3539ad229b5766bd93093e5a32f4d65d8c Mon Sep 17 00:00:00 2001
From: lin <1005713861@163.com>
Date: Tue, 26 May 2026 16:11:10 +0800
Subject: [PATCH] feat:星享购 绑卡+权收
---
pages/quanyi/add.vue | 258 ++++++++++++++++++++++++++++++++++-----------------
1 files changed, 171 insertions(+), 87 deletions(-)
diff --git a/pages/quanyi/add.vue b/pages/quanyi/add.vue
index 6969cf4..0d95dcf 100644
--- a/pages/quanyi/add.vue
+++ b/pages/quanyi/add.vue
@@ -194,43 +194,15 @@
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({
@@ -324,6 +296,15 @@
},
});*/
},
+ 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;}
@@ -340,6 +321,14 @@
icon: "none",
});
return;
+ } else {
+ if (!_this.isValidIDCard(_this.idCardNo)) {
+ uni.showToast({
+ title: "请输入正确的身份证号",
+ icon: "none",
+ });
+ return;
+ }
}
if(!_this.cardNumber){
uni.showToast({
@@ -347,6 +336,14 @@
icon: "none",
});
return;
+ } else {
+ if (!_this.isValidChineseBankCard(_this.cardNumber)) {
+ uni.showToast({
+ title: "请输入正确的银行卡号",
+ icon: "none",
+ });
+ return;
+ }
}
if(!_this.cardPhone){
uni.showToast({
@@ -386,6 +383,10 @@
});
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: "请输入收件人所在地",
@@ -432,72 +433,153 @@
_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()
- }
+ // }
- })
- }
- })
+ // })
+ // }
+ // })
},
@@ -1006,7 +1088,7 @@
<text>银行卡号</text>
</view>
<view class="inp_box">
- <input maxlength="30" @blur="validateAndCacheCardInfo" v-model="cardNumber" class="inp" placeholder="请输入银行卡号" />
+ <input type="number" maxlength="30" @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>
@@ -1254,6 +1336,7 @@
v-model="verificationCodeT"
border="none"
placeholder="请输入验证码"
+ type="number"
style="height: 100rpx;border: 1px solid #EEEEEE;border-radius: 30rpx;padding: 0 50rpx;"
>
<template #suffix>
@@ -1361,6 +1444,7 @@
v-model="verificationCodeS"
border="none"
placeholder="请输入验证码"
+ type="number"
style="height: 100rpx;border: 1px solid #EEEEEE;border-radius: 30rpx;padding: 0 50rpx;"
>
<template #suffix>
--
Gitblit v1.9.3