mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 12:26:44 +08:00
修改
This commit is contained in:
@@ -180,7 +180,7 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy(){
|
beforeDestroy(){
|
||||||
window.removeEventListener("scroll",this.handleScroll);
|
window.removeEventListener("scroll",this.handleScroll);
|
||||||
clearInterval(this.setTime);
|
clearTimeout(this.setTime);
|
||||||
this.cumulativeDuration = 0;
|
this.cumulativeDuration = 0;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -296,11 +296,12 @@ export default {
|
|||||||
}
|
}
|
||||||
this.setTime = setTimeout(()=>{
|
this.setTime = setTimeout(()=>{
|
||||||
this.$store.dispatch("userTrigger", event);
|
this.$store.dispatch("userTrigger", event);
|
||||||
|
this.cumulativeDuration += 60
|
||||||
if(this.cumulativeDuration<=this.defaultMaxTime){
|
if(this.cumulativeDuration<=this.defaultMaxTime){
|
||||||
this.sendEventData()
|
this.sendEventData()
|
||||||
}else{
|
}else{
|
||||||
this.cumulativeDuration = 0
|
this.cumulativeDuration = 0
|
||||||
clearInterval(this.setTime);
|
clearTimeout(this.setTime);
|
||||||
this.setTime = null
|
this.setTime = null
|
||||||
}
|
}
|
||||||
},61000);//1分钟后记录
|
},61000);//1分钟后记录
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ export default {
|
|||||||
this.endTimeRequst(this.resolveId, recordEndTime)
|
this.endTimeRequst(this.resolveId, recordEndTime)
|
||||||
sessionStorage.removeItem('startTime')
|
sessionStorage.removeItem('startTime')
|
||||||
window.removeEventListener("scroll", this.handleScroll);
|
window.removeEventListener("scroll", this.handleScroll);
|
||||||
clearInterval(this.setTimeCase);
|
clearTimeout(this.setTimeCase);
|
||||||
this.cumulativeDuration = 0;
|
this.cumulativeDuration = 0;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -560,7 +560,7 @@ export default {
|
|||||||
this.sendEventData()
|
this.sendEventData()
|
||||||
}else{
|
}else{
|
||||||
this.cumulativeDuration = 0
|
this.cumulativeDuration = 0
|
||||||
clearInterval(this.setTimeCase);
|
clearTimeout(this.setTimeCase);
|
||||||
this.setTimeCase = null
|
this.setTimeCase = null
|
||||||
}
|
}
|
||||||
}, 61000);//1分钟之后发送阅读案例事件
|
}, 61000);//1分钟之后发送阅读案例事件
|
||||||
|
|||||||
Reference in New Issue
Block a user