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 ++++++++++++++++++++++++++++--------------
 pages/quanshou/index.vue |    8 
 pages/quanyi/index.vue   |   83 +++++++++++++
 pages.json               |    7 +
 4 files changed, 262 insertions(+), 94 deletions(-)

diff --git a/pages.json b/pages.json
index 8c01344..500b0f4 100644
--- a/pages.json
+++ b/pages.json
@@ -244,6 +244,13 @@
 			}
 		},
 		{
+			"path": "pages/web/toUrl",
+			"style": {
+				"navigationStyle":"custom",
+				"navigationBarTitleText": ""
+			}
+		},
+		{
 			"path": "pages/vip/index",
 			"style": {
 				"navigationBarTitleText": "会员"
diff --git a/pages/quanshou/index.vue b/pages/quanshou/index.vue
index 199d763..33aebf9 100644
--- a/pages/quanshou/index.vue
+++ b/pages/quanshou/index.vue
@@ -109,7 +109,7 @@
             uni.request( {
               url: _this.$webHost+'/api/v2/memberEquity/clickUrlByShop/'+_this.$util.getUserInfo().phone,
             })
-            uni.navigateTo( {
+            uni.navigateTo({
               url: '/pages/web/toUrl?webUel=' + encodeURIComponent(res.data.data.url)
             })
           } else {
@@ -199,8 +199,8 @@
       <!--   尊享会员年卡   -->
       <view style="background: url('/static/img/qyBg2.png') no-repeat top center; background-size: 100%;width: 100%;height: 390rpx;padding: 80rpx;margin-top: 30rpx;">
         <view style="font-size: 48rpx;font-weight: bold;background: -webkit-linear-gradient(#2A261A, #141316);-webkit-background-clip: text;-webkit-text-fill-color: transparent;">黑卡VIP卡</view>
-        <view style="font-size: 28rpx;font-weight: 400;color: #2A261A;">扣款日期:2026-05-01</view>
-        <view style="display: flex;margin-top: 50rpx;align-items: self-end;">
+        <view v-if="lst.length" style="font-size: 28rpx;font-weight: 400;color: #2A261A;">扣款日期:{{lst[0].buyDate}}</view>
+        <view v-if="lst.length" style="display: flex;margin-top: 50rpx;align-items: self-end;">
           <view v-if="lst.length" style="font-size: 28rpx;width: 70%;">
             <p style="background: -webkit-linear-gradient(#2A261A, #141316);-webkit-background-clip: text;-webkit-text-fill-color: transparent;font-size: 48rpx;font-weight: 500;">¥{{lst[0].amount.toFixed(2)}} <span style="font-size: 24rpx;">{{lst[0].isBuy?'已扣款' : ''}}</span></p>
           </view>
@@ -238,7 +238,7 @@
 			  <image style="width: 100%;height: 538rpx;" mode="aspectFit" src="/static/img/quanshou/xn1.png"></image>
 			  <image style="width: 100%;height: 538rpx;" mode="aspectFit" src="/static/img/quanshou/xn2.png"></image>
 			  <image style="width: 100%;height: 342rpx;" mode="aspectFit" src="/static/img/quanshou/xn3.png"></image>
-			  <image style="width: 100%;height: 712rpx;" mode="aspectFit" src="/static/img/quanshou/xn4.png"></image>
+			  <image style="width: 100%;height: 712rpx;margin-top: 20rpx;" mode="aspectFit" src="/static/img/quanshou/xn4.png"></image>
 			  <button class="exchange-btn" @click="toHuiyuan">我要领取</button>
 			  <view class="note" style="padding-bottom: 50rpx;text-align: center;">* 虚拟权益以实际兑换为准</view>
 		  </view>
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>
diff --git a/pages/quanyi/index.vue b/pages/quanyi/index.vue
index ee5ec56..3163965 100644
--- a/pages/quanyi/index.vue
+++ b/pages/quanyi/index.vue
@@ -63,6 +63,7 @@
 
   data() {
     return  {
+      active: 0,
       ygxLogin:{},
       protocolChecked: [0],
       showTextBox: false,
@@ -219,9 +220,9 @@
 		  </view>
         <button
             style="height: 88rpx;color: #ffffff;border-radius: 40rpx;font-size: 34rpx;flex: 1;margin-top: 10rpx;margin-right: 10rpx;line-height: 88rpx;"
-      
+
             @click="submit"
-      
+
             :class="tm &&protocolChecked.length?'activityBut':'disabledBut'"
         >立即开通<text v-if="!tm">({{text}}秒)</text></button>
       </view>
@@ -236,8 +237,36 @@
         <text style="display: inline;font-size: 24rpx;color: #4766FE" @click="link(`/pages/web/xieyi?code=${memberPeriodConfigInfo.protocolCode}&title=${memberPeriodConfigInfo.protocolName}`)">{{memberPeriodConfigInfo.protocolName}}</text>
       </view>
 
+
+	  <view style="background-color: #ffffff;border-radius: 50rpx 50rpx 0 0;margin-top: 40rpx;">
+	  		  <view class="tab-wrap" style="padding-top: 60rpx;">
+	  		    <text @click="active=0" :class="active==0?'active':''">实物权益</text>
+	  		    <text @click="active=1" :class="active==1?'active':''">虚拟权益</text>
+	  		  </view>
+	  		  <view v-if="active === 0" class="sw-container">
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw1.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw2.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw3.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw4.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw5.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw6.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw7.png"></image>
+	  			  <image style="width: 100%;height: 220rpx;" mode="aspectFit" src="/static/img/quanshou/sw8.png"></image>
+	  			  <!-- <button class="exchange-btn" v-if="active==0" @click="getTips">我要查询</button> -->
+	  			  <view class="note" style="padding-bottom: 50rpx;text-align: center;">页面展示为实物样例,实际以用户收到的商品为准</view>
+	  		  </view>
+	  		  <view v-if="active === 1">
+	  			  <image style="width: 100%;height: 538rpx;" mode="aspectFit" src="/static/img/quanshou/xn1.png"></image>
+	  			  <image style="width: 100%;height: 538rpx;" mode="aspectFit" src="/static/img/quanshou/xn2.png"></image>
+	  			  <image style="width: 100%;height: 342rpx;" mode="aspectFit" src="/static/img/quanshou/xn3.png"></image>
+	  			  <image style="width: 100%;height: 712rpx;" mode="aspectFit" src="/static/img/quanshou/xn4.png"></image>
+	  			  <!-- <button class="exchange-btn" @click="toHuiyuan">我要领取</button> -->
+	  			  <view class="note" style="padding-bottom: 50rpx;text-align: center;">* 虚拟权益以实际兑换为准</view>
+	  		  </view>
+	  </view>
+
 <!--      <view  class="tips" style="color: #666666;margin-top: 24rpx;margin-bottom: 20rpx;font-size: 26rpx">*会员服务一经开通不支持取消、退款,会员服务到期前,用户可以选择续订或取消续费。</view>-->
-      
+
 
       <!--   专享会员生活权益   -->
       <!-- <view>
@@ -329,4 +358,52 @@
   flex-direction: row;
 }
 
+/* tab */
+.tab-wrap {
+  display: flex;
+  justify-content: space-evenly;
+  margin-bottom: 50rpx;
+}
+.tab-wrap text {
+  font-weight: 600;
+  font-size: 36rpx;
+  color: #666;
+}
+.active {
+  color: #333 !important;
+  position: relative;
+  &::after {
+    content: "";
+    display: block;
+    width: 50rpx;
+    height: 8rpx;
+    background: linear-gradient(271deg, #FFE4A1 0%, #FFC57A 51%, #FFE1B9 100%);
+    border-radius: 32rpx;
+    position: absolute;
+    bottom: -20rpx;
+    left: calc(50% - 25rpx);
+  }
+}
+
+/* 按钮 */
+.exchange-btn {
+  font-weight: 600;
+  font-size: 36rpx;
+  color: #FFD39A;
+  padding: 26rpx;
+  background: linear-gradient(271deg, #2A1601 0%, #3B2106 51%);
+  border-radius: 200rpx;
+  margin-top: 60rpx;
+}
+.note {
+  font-size: 24rpx;
+  color: #999;
+  margin-top: 20rpx;
+}
+
+.sw-container {
+  image {
+    margin-top: 20rpx;
+  }
+}
 </style>

--
Gitblit v1.9.3