From 7be1b5b6966ae082dd9a39db787c191c82a4f5f1 Mon Sep 17 00:00:00 2001 From: nisen Date: Wed, 8 Nov 2023 10:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/article/Detail.vue | 5 +++-- src/views/portal/case/Detail.vue | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/portal/article/Detail.vue b/src/views/portal/article/Detail.vue index 2292d52e..cd298bc3 100644 --- a/src/views/portal/article/Detail.vue +++ b/src/views/portal/article/Detail.vue @@ -180,7 +180,7 @@ export default { }, beforeDestroy(){ window.removeEventListener("scroll",this.handleScroll); - clearInterval(this.setTime); + clearTimeout(this.setTime); this.cumulativeDuration = 0; }, methods: { @@ -296,11 +296,12 @@ export default { } this.setTime = setTimeout(()=>{ this.$store.dispatch("userTrigger", event); + this.cumulativeDuration += 60 if(this.cumulativeDuration<=this.defaultMaxTime){ this.sendEventData() }else{ this.cumulativeDuration = 0 - clearInterval(this.setTime); + clearTimeout(this.setTime); this.setTime = null } },61000);//1分钟后记录 diff --git a/src/views/portal/case/Detail.vue b/src/views/portal/case/Detail.vue index 6e6b37e2..8173d1b7 100644 --- a/src/views/portal/case/Detail.vue +++ b/src/views/portal/case/Detail.vue @@ -265,7 +265,7 @@ export default { this.endTimeRequst(this.resolveId, recordEndTime) sessionStorage.removeItem('startTime') window.removeEventListener("scroll", this.handleScroll); - clearInterval(this.setTimeCase); + clearTimeout(this.setTimeCase); this.cumulativeDuration = 0; }, methods: { @@ -560,7 +560,7 @@ export default { this.sendEventData() }else{ this.cumulativeDuration = 0 - clearInterval(this.setTimeCase); + clearTimeout(this.setTimeCase); this.setTimeCase = null } }, 61000);//1分钟之后发送阅读案例事件