This commit is contained in:
nisen
2023-11-08 10:51:00 +08:00
parent eb88dcbe74
commit 7be1b5b696
2 changed files with 5 additions and 4 deletions

View File

@@ -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分钟后记录

View File

@@ -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分钟之后发送阅读案例事件