Selaa lähdekoodia

双11数据埋点

HUANGYAQIAN-PC\huangyaqian 2 vuotta sitten
vanhempi
commit
d14c800ad5
2 muutettua tiedostoa jossa 15 lisäystä ja 14 poistoa
  1. 6 13
      pages/activity/doubleEleven/index.vue
  2. 9 1
      pages/activity/doubleEleven/pc.vue

+ 6 - 13
pages/activity/doubleEleven/index.vue

@@ -128,6 +128,7 @@ export default {
       this.client = 7;
     }
 
+    this.visit()
 
   },
   head: {
@@ -138,23 +139,15 @@ export default {
     setInterval(() => {
       _this.getCoupons()
     }, 600000);
-    this.makePoint('优惠券')
   },
   methods: {
-    makePoint(positionButton) {
-      const now = new Date();
-      this.$axios.$post('/public/v5/buriedPointRecord/reportRecords', [
+    visit() {
+      this.$axios.$post('/user/v5/userAccess/user/visit', 
         {
-          client: this.client,
-          eventCode: '优惠券',
-          userName: this.$auth.user.username,
-          positionButton,
-          operationTime: now
-            .toISOString()
-            .replace(/T/g, ' ')
-            .replace(/\.[\d]{3}Z/, ''),
+          loginType: this.token ? 1 : 2,
+          accessType: 13
         },
-      ]);
+      );
     },
     goOrder()
     {

+ 9 - 1
pages/activity/doubleEleven/pc.vue

@@ -127,7 +127,7 @@
       } else {
         this.client = 7;
       }
-  
+      this.visit()
   
     },
     head: {
@@ -140,6 +140,14 @@
       }, 600000);
     },
     methods: {
+    visit() {
+      this.$axios.$post('/user/v5/userAccess/user/visit', 
+        {
+          loginType: this.token ? 1 : 2,
+          accessType: 13
+        },
+      );
+    },
       goOrder()
       {
         const productId = !this.coupons.products || this.coupons.products.split(',').length > 1 ? -1 : parseInt(this.coupons.products)