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 | 286 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 185 insertions(+), 101 deletions(-)
diff --git a/pages/quanyi/add.vue b/pages/quanyi/add.vue
index 273c1d8..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()
- }
+ // }
- })
- }
- })
+ // })
+ // }
+ // })
},
@@ -993,7 +1075,7 @@
<text>身份证号</text>
</view>
<view class="inp_box">
- <input maxlength="18" v-model="idCardNo" class="inp" placeholder="请输入身份证号" />
+ <input maxlength="18" v-model="idCardNo" class="inp" placeholder="请输入身份证号码" />
</view>
</view>
@@ -1001,6 +1083,16 @@
<!-- <view style="background: #F7F7F7;height: 20rpx;"></view>-->
<view class="form-item-title" style="margin: 40rpx;font-size: 32rpx;color: #333333;font-weight: 600;">请输入您的银行卡信息</view>
<view class="form-item-ct">
+ <view class="clo">
+ <view class="label">
+ <text>银行卡号</text>
+ </view>
+ <view class="inp_box">
+ <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>
+
+ </view>
<view class="clo">
<view class="label">
<text>银行卡名称</text>
@@ -1013,20 +1105,10 @@
</view>
<view class="clo">
<view class="label">
- <text>银行卡号</text>
- </view>
- <view class="inp_box">
- <input 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>
-
- </view>
- <view class="clo">
- <view class="label">
<view>预留手机号</view>
</view>
<view class="inp_box" style="position: relative;">
- <input maxlength="11" v-model="cardPhone" class="inp" placeholder="请输入预留手机号" />
+ <input maxlength="11" v-model="cardPhone" class="inp" placeholder="请输入银行预留手机号" />
<!-- <view class="code" style="position: absolute;top: 30rpx;right: 0;" @click="getSmsCode">-->
<!-- <text :class="isCounting?'code_k':'code_a'">{{ isCounting ? countText : '获取验证码' }}</text>-->
<!-- </view>-->
@@ -1038,7 +1120,7 @@
<text>短信验证码</text>
</view>
<view class="inp_box" style="position: relative;">
- <input maxlength="6" v-model="verificationCode" class="inp" type="number" placeholder="请输入短信验证码" />
+ <input maxlength="6" v-model="verificationCode" class="inp" type="number" placeholder="请输入手机短信验证码" />
<view class="code" style="position: absolute;top: 30rpx;right: 0;" @click="getSmsCode">
<text :class="isCounting?'code_k':'code_a'">{{ isCounting ? countText : '获取验证码' }}</text>
@@ -1067,7 +1149,7 @@
<text>收件人姓名</text>
</view>
<view class="inp_box">
- <input maxlength="8" v-model="addressDetail.consignee" class="inp" placeholder="请输入收件人姓名" />
+ <input maxlength="20" v-model="addressDetail.consignee" class="inp" placeholder="请输入收件人姓名" />
</view>
</view>
<view class="clo">
@@ -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>
@@ -1396,7 +1480,7 @@
<provincesCity ref="provincesCity" @confirm="provincesCityChange" />
- <!-- <text-box v-if="showTextBox" ref="textBox" :getPlatformProtocolNewList="getPlatformProtocolNewList"></text-box> -->
+ <text-box v-if="showTextBox" ref="textBox" :getPlatformProtocolNewList="getPlatformProtocolNewList"></text-box>
</view>
</template>
--
Gitblit v1.9.3