xiebaomin 1 năm trước cách đây
mục cha
commit
e9313fdea6

+ 14 - 1
src/main/resources/static/js/mixins/cmsMixins.js

@@ -16,7 +16,9 @@ var cmsMixins = function () {
                 window.open($eventHref)
             },
             handleRightStatistics:function($event,type){// 右侧模块
-                const $eventHref  = $event[0].attributes[3].value;
+                const $eventHref  = $event[0].attributes[4].value;
+                const $eventId = $event[0].attributes[0].value;
+                this.cmsActiveStatistics($eventId, type)
                 this.cmsSysStatistics(type)
                 window.open($eventHref)
             },
@@ -48,6 +50,17 @@ var cmsMixins = function () {
                     }
                 })
             },
+            cmsActiveStatistics ($eventId, type) {
+                if (type === 3) {
+                    BeautyArchiveApi.GetStatisticsAddPv({type, authorId: $eventId}, (response) => {
+                        if(response.code === 0){
+                            console.log(`<-------活动专区首页点击量统计数据成功------>`)
+                        } else {
+                            console.log('<-------统计数据异常------>')
+                        }
+                    })
+                }
+            },
             // 活动专区首页点击量统计
             cmsSetActivityStatistics($eventHref) {
                 BeautyArchiveApi.GetStatisticsAddPv({type: 3, authorId: $eventHref.id}, (response) => {

+ 6 - 6
src/main/resources/templates/index.html

@@ -126,7 +126,7 @@
                             </a>
                         </div>
                         <div class="right_item_main" th:each="live,stat : ${sideJson.get('liveList')}" th:object="${live}">
-                            <a th:if="${stat.index}==0" th:attr="data-href=*{link}" href="javascript:void(0)" onclick="handleRightStatistics($(this),2)" th:title="*{liveTitle}" class="item_banner">
+                            <a th:if="${stat.index}==0" th:attr="data-href=*{link}" th:data-id="*{id}" href="javascript:void(0)" onclick="handleRightStatistics($(this),2)" th:title="*{liveTitle}" class="item_banner">
                                 <img src="/img/base/placeholder.png" th:attr="data-original=*{homePageImage}" th:alt="*{liveTitle}">
                                 <div class="name" th:text="*{liveTitle}"></div>
                                 <div class="statu">
@@ -135,7 +135,7 @@
                                     <template th:if="*{liveStatus}==3"><i class="mIcon icon-end"></i><p>看回放</p></template>
                                 </div>
                             </a>
-                            <a th:if="${stat.index}>0" th:attr="data-href=*{link}" href="javascript:void(0)" onclick="handleRightStatistics($(this),2)" th:title="*{liveTitle}" class="item_text">
+                            <a th:if="${stat.index}>0" th:attr="data-href=*{link}" th:data-id="*{id}" href="javascript:void(0)" onclick="handleRightStatistics($(this),2)" th:title="*{liveTitle}" class="item_text">
                                 <p class="item_text_name" th:text="*{liveTitle}"></p>
                             </a>
                         </div>
@@ -148,11 +148,11 @@
                             </a>
                         </div>
                         <div class="right_item_main" th:each="image,stat : ${sideJson.get('cmImageList')}" th:object="${image}">
-                            <a th:if="${stat.index}==0" th:attr="data-href=*{link}" onclick="handleRightStatistics($(this),3)" href="javascript:void(0)" th:title="*{title}" class="item_banner">
+                            <a th:if="${stat.index}==0" th:attr="data-href=*{link}" th:data-id="*{id}" onclick="handleRightStatistics($(this),3)" href="javascript:void(0)" th:title="*{title}" class="item_banner">
                                 <img src="/img/base/placeholder.png" th:attr="data-original=*{homePageImage}" th:alt="*{title}">
                                 <div class="name" th:text="*{title}"></div>
                             </a>
-                            <a th:if="${stat.index}>0" th:attr="data-href=*{link}" onclick="handleRightStatistics($(this),3)" href="javascript:void(0)"  th:title="*{title}" class="item_text">
+                            <a th:if="${stat.index}>0" th:attr="data-href=*{link}" th:data-id="*{id}" onclick="handleRightStatistics($(this),3)" href="javascript:void(0)"  th:title="*{title}" class="item_text">
                                 <p class="item_text_name" th:text="*{title}"></p>
                             </a>
                         </div>
@@ -165,11 +165,11 @@
                             </a>
                         </div>
                         <div class="right_item_main" th:each="info,stat : ${sideJson.get('infoList')}" th:object="${info}">
-                            <a th:if="${stat.index}==0" th:attr="data-href=*{link}" onclick="handleRightStatistics($(this),4)" href="javascript:void(0)"  th:title="*{title}" class="item_banner">
+                            <a th:if="${stat.index}==0" th:attr="data-href=*{link}" th:data-id="*{id}" onclick="handleRightStatistics($(this),4)" href="javascript:void(0)"  th:title="*{title}" class="item_banner">
                                 <img src="/img/base/placeholder.png" th:attr="data-original=*{homePageImage}" th:alt="*{title}">
                                 <div class="name" th:text="*{title}"></div>
                             </a>
-                            <a th:if="${stat.index}>0" th:attr="data-href=*{link}" onclick="handleRightStatistics($(this),4)" href="javascript:void(0)"  th:title="*{title}" class="item_text">
+                            <a th:if="${stat.index}>0" th:attr="data-href=*{link}" th:data-id="*{id}" onclick="handleRightStatistics($(this),4)" href="javascript:void(0)"  th:title="*{title}" class="item_text">
                                 <p class="item_text_name info" th:text="*{title}"></p>
                                 <p class="item_text_time" v-if="isPC" th:text="*{createDate}"></p>
                             </a>