Explorar o código

feat:充值,权益卡,参加活动时获取门店优化

zhanghui hai 1 ano
pai
achega
8c38bfbec5

+ 8 - 2
myPages/recharge/index.vue

@@ -223,8 +223,14 @@
 //提交充值订单
       handleCommon(){
         const that = this;
-        let promotionParam = uni.getStorageSync('promotionParam')
-        Object.assign(this.reqOrderParm,promotionParam)
+
+        let param = uni.getStorageSync('promotionParam')
+        console.log('获取到技师的二维码数据',param)
+        if (!param){
+          console.log('获取到门店的二维码数据',param)
+          param = uni.getStorageSync('storeParam')
+        }
+        Object.assign(this.reqOrderParm,param)
         // 提交订单
         this.$api.commonGeneralOrder(this.reqOrderParm).then((res)=>{
           console.log('+++++++++++commonGeneralOrder++++++++++',res)

+ 8 - 0
orderPages/activityDetail/activityDetail.vue

@@ -207,9 +207,15 @@ export default {
     // 扫技师端携带的参数,已存在缓存中
     let promotionParam = uni.getStorageSync('promotionParam')
     if (promotionParam){
+      console.log('获取到技师的二维码数据',promotionParam)
       this.storeId = promotionParam.storeId
       this.techNo = promotionParam.techNo
+    }else {
+      let storeParam = uni.getStorageSync('storeParam')
+      console.log('获取到门店的二维码数据',param)
+      this.storeId = storeParam.storeId
     }
+
     if (e.q) {
       //扫店长端二维码进来的活动参数
       const q = decodeURIComponent(e.q)
@@ -223,6 +229,8 @@ export default {
       this.storeId= param.storeId
       this.techNo= ''
       console.log("扫店长端二维码进来的活动参数===》",param)
+      uni.setStorageSync('storeParam', param)
+      uni.removeStorageSync('promotionParam');
     }
 
     this.userInfo = uni.getStorageSync('userInfo')

+ 10 - 3
pages/index/index.vue

@@ -311,14 +311,21 @@
 					param[b[i].split('=')[0]] = b[i].split('=')[1]
 				}
 				if (param.expandUserId) { //从拓客端进来的用户
+          console.log('扫拓客端二维码进入小程序')
 					uni.setStorageSync('expandParam', param)
 				}else if (param.scene){
-					//用户扫用户的会员吗进入小程序
+          console.log('扫用户的会员码进入小程序')
 					uni.setStorageSync('shareUserId', param.scene)
 
-				}else { //从技师端进来的用户
+				}else if (param.techNo) { //从技师端进来的用户
+          console.log('扫技师二维码进入小程序')
 					uni.setStorageSync('promotionParam', param)
-				}
+          uni.removeStorageSync('storeParam');
+				}else {
+          //用户扫门店的二维码进入小程序
+          uni.setStorageSync('storeParam', param)
+          uni.removeStorageSync('promotionParam');
+        }
 
 				console.log("用户扫技师端或者拓客端二维码传递过来的参数",param)
 			}

+ 7 - 2
storePages/rights/index.vue

@@ -154,10 +154,15 @@ export default {
 		},
 
 		commonGeneralOrder() {
-			let promotionParam = uni.getStorageSync('promotionParam')
+      let param = uni.getStorageSync('promotionParam')
+      console.log('获取到技师的二维码数据',param)
+      if (!param){
+        console.log('获取到门店的二维码数据',param)
+        param = uni.getStorageSync('storeParam')
+      }
 			this.$refs.popup.close()
 			this.$api.commonGeneralOrder({
-				...promotionParam,
+				...param,
 				orderType: 5,
 				serviceObjectId: this.serviceObject.id,
 				equityCardId: this.orderRights.id