Sfoglia il codice sorgente

小程序码进入活动页面参数调整

kk.shi 3 anni fa
parent
commit
a88bd99927
2 ha cambiato i file con 15 aggiunte e 8 eliminazioni
  1. 7 2
      pages/luckDraw/detail.js
  2. 8 6
      pages/signIn/activity/activity.js

+ 7 - 2
pages/luckDraw/detail.js

@@ -38,6 +38,7 @@ Page({
         popBgPic: '',
         boxBgPic: '',
         bgColor: '',
+        channelId: '',
     },
 
     /**
@@ -54,6 +55,7 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+      console.log(options)
         Object.assign(this, Common)
         if (!options.id) {
             this.popMessage ('入参错误');
@@ -63,7 +65,8 @@ Page({
             return
         }
         this.setData({
-            isLogin: getMobileCache() != ''
+            isLogin: getMobileCache() != '',
+            channelId: options.channelId,
         })
         this.data.activityId = options.id
         this.loadActivity()
@@ -75,6 +78,7 @@ Page({
             module: 'luckdraw',
             action: 'visit',
             businessId: this.data.activityId,
+            department: this.data.channelId,
         })
     },
     loadActivity: function() {
@@ -235,7 +239,8 @@ Page({
         Statistics.done({
             module: 'luckdraw',
             action: 'click',
-            businessId: this.data.activityId
+            businessId: this.data.activityId,
+            department: this.data.channelId,
         })
     },
     

+ 8 - 6
pages/signIn/activity/activity.js

@@ -24,20 +24,20 @@ Page({
         todayIsSigned: false,
         notUseNum: 0,
         signInId: '',
+        channelId: '',
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-      if(options && options.scene) {
-        const scene = decodeURIComponent(options.scene)
-        let index = scene.indexOf("/")
-        const signInId =scene.substring(0,index);
+      console.log(options)
+      if(options && options.signId) {
         this.setData({
-          signInId: signInId,
+          signInId: options.signId,
+          channelId: options.channelId,
         })
-        console.log(signInId) //abcd
+        console.log(options.signId) //abcd
       }
     },
 
@@ -68,6 +68,7 @@ Page({
                     module: 'signin',
                     action: 'visit',
                     businessId: res.data.id,
+                    department: this.data.channelId,
                 })
 
             }
@@ -211,6 +212,7 @@ Page({
             module: 'signin',
             action: 'click',
             businessId: this.data.activity.id,
+            department: this.data.channelId,
         })
     },