mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
案例时长
This commit is contained in:
@@ -548,6 +548,18 @@ export default {
|
|||||||
let totalTime = Math.round((endTime - startTime) / 1000);
|
let totalTime = Math.round((endTime - startTime) / 1000);
|
||||||
this.cumulativeDuration += totalTime
|
this.cumulativeDuration += totalTime
|
||||||
if(this.cumulativeDuration <= this.defaultMaxTime){
|
if(this.cumulativeDuration <= this.defaultMaxTime){
|
||||||
|
console.log(totalTime,'时长');
|
||||||
|
this.sendStudyTime(totalTime)
|
||||||
|
this.secondTime = 60
|
||||||
|
this.sendEventData()
|
||||||
|
}else{
|
||||||
|
this.cumulativeDuration = 0
|
||||||
|
clearTimeout(this.setTimeCase);
|
||||||
|
this.setTimeCase = null
|
||||||
|
}
|
||||||
|
}, this.secondTime * 1000);//15秒记录一次之后1分钟之后发送阅读案例事件
|
||||||
|
},
|
||||||
|
sendStudyTime(totalTime){
|
||||||
this.$store.dispatch("userTrigger", {
|
this.$store.dispatch("userTrigger", {
|
||||||
key: "ReadCase",//后台的事件key 发布文章且审核通过
|
key: "ReadCase",//后台的事件key 发布文章且审核通过
|
||||||
title: '阅读案例',//事件的标题
|
title: '阅读案例',//事件的标题
|
||||||
@@ -560,14 +572,6 @@ export default {
|
|||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 //状态,直接写1
|
status: 1 //状态,直接写1
|
||||||
});
|
});
|
||||||
this.secondTime = 60
|
|
||||||
this.sendEventData()
|
|
||||||
}else{
|
|
||||||
this.cumulativeDuration = 0
|
|
||||||
clearTimeout(this.setTimeCase);
|
|
||||||
this.setTimeCase = null
|
|
||||||
}
|
|
||||||
}, this.secondTime * 1000);//15秒记录一次之后1分钟之后发送阅读案例事件
|
|
||||||
},
|
},
|
||||||
getCaseData() {
|
getCaseData() {
|
||||||
let $this = this;
|
let $this = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user