Browse Source

行为轨迹统计

zhengjinyi 2 years ago
parent
commit
3bfa599dc1

+ 3 - 0
src/main/resources/static/js/activity/activityTopic.js

@@ -1,5 +1,6 @@
 var activity = new Vue({
     el: '#activity',
+    mixins: [cmSysVitaMixins],
     data: {
         listLoading: true, //加载动画
         hotlist: [],       //热搜词
@@ -29,6 +30,7 @@ var activity = new Vue({
     },
     computed: {},
     created: function () {
+        this.cmSysParams.pageType = 13;
         // this.init();
     },
     methods: {
@@ -91,6 +93,7 @@ var activity = new Vue({
                 if (res.code === 0) {
                     _self.floorList = res.data.floorList;
                     _self.pageInfo = res.data.page;
+                    _self.cmSysParams.pageLabel = _self.pageInfo.contentLabel;
                     if( _self.pageInfo.backgroundImageWay == 1){
                         _self.bgClass = 'bg-repeat';
                     }else{

+ 1 - 1
src/main/resources/static/js/article/detail.js

@@ -46,7 +46,7 @@ var articleRelated = new Vue({
             pageLabelArray.push($(this).find('a').text());
         })
         this.cmSysParams.pageType = 11;
-        this.cmSysParams.pageLabel =  pageLabelArray.join(',');
+        this.cmSysParams.pageLabel =  pageLabelArray.join('/');
         this.infoId = $("#articleId").val() ? $("#articleId").val()*1 : 0;
         this.articleLabels = $("#articleLabels").val()?$("#articleLabels").val():"";
         // 获取相关阅读

+ 2 - 1
src/main/resources/static/js/mixins/cmSysMixins.js

@@ -21,7 +21,8 @@ var cmSysVitaMixins = function () {
             setTime() {
                 //设置定时器
                 let _self = this;
-                if(GLOBAL_TOKEN){ this.cmSysParams.userId = GLOBAL_USER_ID; }
+                const globalUserData = JSON.parse(localStorage.getItem('userInfo'));
+                if(globalUserData){ this.cmSysParams.userId = globalUserData.userId * 1; }
                 this.cmSysParams.pagePath = window.location.href;
                 this.clearTimeSet = setInterval(() => {
                     _self.browseTime++;

+ 9 - 1
src/main/resources/static/js/product/detail.js

@@ -176,6 +176,7 @@ var productDetail = new Vue({
             ProductApi.GetProductDdtails({userId: GLOBAL_USER_ID, productId: _self.productId,typeId:_self.typeId}, function (response) {
                 if (response.code == 0) {
                     var product = response.data;
+                    var $pageLabel = '';
                     _self.product = response.data;
                     _self.pcActType = product.pcActType;
                     _self.beautyActFlag = product.beautyActFlag;
@@ -183,7 +184,14 @@ var productDetail = new Vue({
                     _self.recommendType = product.recommendType ? product.recommendType : 0;
                     _self.archiveId = product.archiveId; // 保存资料列表id
                     _self.productDetailChose = product.productDetailChose; // 同资质机构显示商品详情
-                    _self.cmSysParams.pageLabel = `${product.smallTypeName ? product.smallTypeName : ''}-${product.brandName?product.brandName:''}`;//设置统计数据标签
+                    if(product.tinyTypeName){
+                        $pageLabel = product.tinyTypeName
+                    }else if(!product.tinyTypeName && product.smallTypeName){
+                        $pageLabel = product.smallTypeName
+                    }else{
+                        $pageLabel = product.bigTypeName
+                    }
+                    _self.cmSysParams.pageLabel = `${$pageLabel}-${product.brandName?product.brandName:''}`;//设置统计数据标签
                     if(product.shopType == 2){
                         _self.isShowCaimeiShop = true
                     }

+ 1 - 0
src/main/resources/templates/activity/activityTopic.html

@@ -1768,6 +1768,7 @@
   <template th:replace="components/foot-link"></template>
   <script charset="utf-8" type="text/javascript"
     th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
+  <script charset="utf-8" type="text/javascript" th:src="@{/js/mixins/cmSysMixins.js(v=${version})}"></script>
   <script charset="utf-8" type="text/javascript" th:src="@{/js/activity/activityTopic.js(v=${version})}"></script>
 </body>