Jelajahi Sumber

feat:活动详情页面获取店长端二维码携带的活动id

zhanghui 1 tahun lalu
induk
melakukan
f3624eb6d7
1 mengubah file dengan 21 tambahan dan 2 penghapusan
  1. 21 2
      orderPages/activityDetail/activityDetail.vue

+ 21 - 2
orderPages/activityDetail/activityDetail.vue

@@ -196,9 +196,28 @@ export default {
     }
   },
   onLoad(e) {
+
+    if(e.id){
+      this.id = e.id
+      console.log('上一个页面传递过来的活动ID===>',this.id)
+    }
+
+    if (e.q) {
+      //用户扫技师端或者拓客端二维码传递过来的参数
+      const q = decodeURIComponent(e.q)
+      let a = q.split('?')
+      let b = a[1].split('&')
+      let param = {} //技师端分享过来的参数
+      for (let i = 0; i < b.length; i++) {
+        param[b[i].split('=')[0]] = b[i].split('=')[1]
+      }
+
+      this.id= param.activityId
+
+      console.log("扫店长端二维码进来的活动参数===》",param)
+    }
+
     this.userInfo = uni.getStorageSync('userInfo')
-    this.id = e.id
-    console.log('上一个页面传递过来的活动ID',this.id)
     this.activityDetail()
     this.activityCheck()
     this.listServiceObject()