Bläddra i källkod

朋友圈广告注册埋点

bayi 1 år sedan
förälder
incheckning
5ce385764e
4 ändrade filer med 21 tillägg och 17 borttagningar
  1. 8 4
      app.js
  2. 4 4
      pages/commodity/index.less
  3. 4 4
      pages/commodity/index.wxss
  4. 5 5
      utils/request.js

+ 8 - 4
app.js

@@ -41,10 +41,15 @@ App({
             }
         } else {
             let shareUid = options.query.uid || ''
-            this.login(shareUid)
+            let userChannelCode='3001'
+            if ([1045, 1046, 1084].includes(scene)) {
+                console.log("朋友圈广告进入");
+                userChannelCode='4001'
+            }
+            this.login(shareUid,userChannelCode)
         }
     },
-    async login(shareUid) {
+    async login(shareUid,userChannelCode='3001') {
         let uid = wx.getStorageSync('uid')
         if (uid) {
             let userInfo = await getMyInfo()
@@ -62,6 +67,7 @@ App({
                         // 获取openid
                         let data = {
                             code: res.code,
+                            userChannelCode
                         }
                         if (shareUid != 'undefined' && shareUid) {
                             data.shareUid = shareUid
@@ -136,8 +142,6 @@ App({
                     console.log(res);
                 })
             }
-        } else if ([1045,1046].includes(scene)) {
-            console.log("朋友圈广告进入");
         }
     },
     getNavbarInfo() {

+ 4 - 4
pages/commodity/index.less

@@ -62,11 +62,11 @@
         left: 0;
         bottom: 0;
         width: 100%;
-        padding: 34rpx 38rpx;
+        padding: 32rpx 36rpx;
         background: white;
 
         .left {
-            font-size: 38rpx;
+            font-size: 36rpx;
         }
 
         .price {
@@ -76,7 +76,7 @@
         }
 
         .pay {
-            padding: 14rpx 50rpx;
+            padding: 14rpx 46rpx;
             background: #ff9108;
             color: white;
             font-weight: 500;
@@ -103,7 +103,7 @@
             align-items: center;
             width: 483rpx;
             height: 521rpx;
-            padding: 38rpx;
+            padding: 68rpx 38rpx 38rpx;
             box-sizing: border-box;
             border-radius: 11px;
             background: white;

+ 4 - 4
pages/commodity/index.wxss

@@ -55,11 +55,11 @@
   left: 0;
   bottom: 0;
   width: 100%;
-  padding: 34rpx 38rpx;
+  padding: 32rpx 36rpx;
   background: white;
 }
 #container .payBox .left {
-  font-size: 38rpx;
+  font-size: 36rpx;
 }
 #container .payBox .price {
   color: #ff9108;
@@ -67,7 +67,7 @@
   font-weight: bold;
 }
 #container .payBox .pay {
-  padding: 14rpx 50rpx;
+  padding: 14rpx 46rpx;
   background: #ff9108;
   color: white;
   font-weight: 500;
@@ -92,7 +92,7 @@
   align-items: center;
   width: 483rpx;
   height: 521rpx;
-  padding: 38rpx;
+  padding: 68rpx 38rpx 38rpx;
   box-sizing: border-box;
   border-radius: 11px;
   background: white;

+ 5 - 5
utils/request.js

@@ -6,13 +6,13 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-// if (envVersion == 'develop') {
+if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-// } else {
-//     baseUrl = 'https://reader-api.ai160.com/wx'
-//     oldUrl = 'https://reader-api.ai160.com'
-// }
+} else {
+    baseUrl = 'https://reader-api.ai160.com/wx'
+    oldUrl = 'https://reader-api.ai160.com'
+}
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
     let header = {