mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
修改课程案例和文章时长
This commit is contained in:
@@ -282,23 +282,13 @@ export default {
|
||||
})
|
||||
},
|
||||
sendEventData(){
|
||||
let event = {
|
||||
key: "ReadArticle",//后台的事件key 发布文章且审核通过
|
||||
title: "阅读文章",//事件的标题
|
||||
parameters:"second:" + this.secondTime,//用户自定义参数 name:value,name:value
|
||||
content: "阅读了文章",//事件的内容
|
||||
source:'page',
|
||||
objId: this.articleId,//关联的id
|
||||
objType: "2",//关联的类型
|
||||
objInfo: this.articleDetailData.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
let startTime = new Date().getTime();
|
||||
this.setTime = setTimeout(()=>{
|
||||
this.cumulativeDuration += this.secondTime
|
||||
let endTime = new Date().getTime();
|
||||
let totalTime = parseInt((endTime - startTime) / 1000);
|
||||
this.cumulativeDuration += totalTime;
|
||||
if(this.cumulativeDuration <= this.defaultMaxTime){
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
this.sendStudyTime(totalTime);
|
||||
this.secondTime = 60
|
||||
this.sendEventData()
|
||||
}else{
|
||||
@@ -308,6 +298,22 @@ export default {
|
||||
}
|
||||
},this.secondTime * 1000);//15秒记录一次之后1分钟后记录
|
||||
},
|
||||
// 发送学习时间
|
||||
sendStudyTime(totalTime){
|
||||
this.$store.dispatch("userTrigger", {
|
||||
key: "ReadArticle",//后台的事件key 发布文章且审核通过
|
||||
title: "阅读文章",//事件的标题
|
||||
parameters:"second:" + totalTime,//用户自定义参数 name:value,name:value
|
||||
content: "阅读了文章",//事件的内容
|
||||
source:'page',
|
||||
objId: this.articleId,//关联的id
|
||||
objType: "2",//关联的类型
|
||||
objInfo: this.articleDetailData.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
});
|
||||
},
|
||||
//获取文章发布人的人物信息
|
||||
getAuthorInfo(data){
|
||||
let ids=[data.sysCreateAid]
|
||||
|
||||
Reference in New Issue
Block a user