mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
设置最大时长30分钟
This commit is contained in:
@@ -159,7 +159,7 @@ export default {
|
|||||||
isPraise:false,
|
isPraise:false,
|
||||||
isFavorite: false,
|
isFavorite: false,
|
||||||
setTime: null,
|
setTime: null,
|
||||||
defaultMaxTime: 180,//最大时长
|
defaultMaxTime: 1800,//最大时长
|
||||||
cumulativeDuration:0,//累计时长
|
cumulativeDuration:0,//累计时长
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -255,7 +255,21 @@ export default {
|
|||||||
this.articleDetailData=res.result;
|
this.articleDetailData=res.result;
|
||||||
//if(this.articleDetailData.toString()!='{}'){
|
//if(this.articleDetailData.toString()!='{}'){
|
||||||
this.getAuthorInfo(this.articleDetailData)
|
this.getAuthorInfo(this.articleDetailData)
|
||||||
//记录时长
|
//记录查看文章
|
||||||
|
this.$store.dispatch("userTrigger", {
|
||||||
|
key: "ViewArticle",//后台的事件key 发布文章且审核通过
|
||||||
|
title: "查看文章",//事件的标题
|
||||||
|
parameters:"",//用户自定义参数 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
|
||||||
|
});
|
||||||
|
//记录阅读时长
|
||||||
this.sendEventData()
|
this.sendEventData()
|
||||||
//}
|
//}
|
||||||
}else{
|
}else{
|
||||||
@@ -268,10 +282,10 @@ export default {
|
|||||||
},
|
},
|
||||||
sendEventData(){
|
sendEventData(){
|
||||||
let event = {
|
let event = {
|
||||||
key: "ViewArticle",//后台的事件key 发布文章且审核通过
|
key: "ReadArticle",//后台的事件key 发布文章且审核通过
|
||||||
title: "查看文章",//事件的标题
|
title: "阅读文章",//事件的标题
|
||||||
parameters:"",//用户自定义参数 name:value,name:value
|
parameters:"second:60",//用户自定义参数 name:value,name:value
|
||||||
content: "查看了文章",//事件的内容
|
content: "阅读了文章",//事件的内容
|
||||||
source:'page',
|
source:'page',
|
||||||
objId: this.articleId,//关联的id
|
objId: this.articleId,//关联的id
|
||||||
objType: "2",//关联的类型
|
objType: "2",//关联的类型
|
||||||
@@ -280,12 +294,7 @@ export default {
|
|||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 //状态,直接写1
|
status: 1 //状态,直接写1
|
||||||
}
|
}
|
||||||
this.$store.dispatch("userTrigger", event);
|
|
||||||
this.setTime = setTimeout(()=>{
|
this.setTime = setTimeout(()=>{
|
||||||
event.key = 'ReadArticle';
|
|
||||||
event.title = "阅读文章";
|
|
||||||
event.parameters='second:60';//增加60秒的学习时长
|
|
||||||
event.content = "阅读了文章"
|
|
||||||
$this.$store.dispatch("userTrigger", event);
|
$this.$store.dispatch("userTrigger", event);
|
||||||
if(this.cumulativeDuration<=this.defaultMaxTime){
|
if(this.cumulativeDuration<=this.defaultMaxTime){
|
||||||
this.sendEventData()
|
this.sendEventData()
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ export default {
|
|||||||
orgData: [],
|
orgData: [],
|
||||||
setTimeCase: null,
|
setTimeCase: null,
|
||||||
dataTime: sessionStorage.getItem('startTime') || 0,
|
dataTime: sessionStorage.getItem('startTime') || 0,
|
||||||
defaultMaxTime: 180,//最大时长
|
defaultMaxTime: 1800,//最大时长
|
||||||
cumulativeDuration:0,//累计时长
|
cumulativeDuration:0,//累计时长
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -333,6 +333,18 @@ export default {
|
|||||||
if (xmlhttp.status == 200) {
|
if (xmlhttp.status == 200) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
$this.Internet = 1;
|
$this.Internet = 1;
|
||||||
|
this.$store.dispatch("userTrigger", {
|
||||||
|
key: "ViewCase",//后台的事件key 发布文章且审核通过
|
||||||
|
title: '查看案例',//事件的标题
|
||||||
|
parameters: "",//用户自定义参数 name:value,name:value
|
||||||
|
content: '查看了案例',//事件的内容
|
||||||
|
objId: this.resolveId,//关联的id
|
||||||
|
objType: "3",//关联的类型
|
||||||
|
objInfo: this.caseDetail.title,
|
||||||
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
|
status: 1 //状态,直接写1
|
||||||
|
});
|
||||||
$this.sendEventData();
|
$this.sendEventData();
|
||||||
} else {
|
} else {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
@@ -529,10 +541,10 @@ export default {
|
|||||||
},
|
},
|
||||||
sendEventData() {
|
sendEventData() {
|
||||||
let event = {
|
let event = {
|
||||||
key: "ViewCase",//后台的事件key 发布文章且审核通过
|
key: "ReadCase",//后台的事件key 发布文章且审核通过
|
||||||
title: '查看案例',//事件的标题
|
title: '阅读案例',//事件的标题
|
||||||
parameters: "",//用户自定义参数 name:value,name:value
|
parameters: "second:60",//用户自定义参数 name:value,name:value
|
||||||
content: '查看了案例',//事件的内容
|
content: '阅读了案例',//事件的内容
|
||||||
objId: this.resolveId,//关联的id
|
objId: this.resolveId,//关联的id
|
||||||
objType: "3",//关联的类型
|
objType: "3",//关联的类型
|
||||||
objInfo: this.caseDetail.title,
|
objInfo: this.caseDetail.title,
|
||||||
@@ -540,13 +552,8 @@ export default {
|
|||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 //状态,直接写1
|
status: 1 //状态,直接写1
|
||||||
}
|
}
|
||||||
this.$store.dispatch("userTrigger", event);
|
|
||||||
let $this = this;
|
let $this = this;
|
||||||
this.setTimeCase = setTimeout(() => {
|
this.setTimeCase = setTimeout(() => {
|
||||||
event.key = 'ReadCase';
|
|
||||||
event.title = '阅读案例';
|
|
||||||
event.parameters = "second:60";
|
|
||||||
event.content = '阅读了案例';
|
|
||||||
$this.$store.dispatch("userTrigger", event);
|
$this.$store.dispatch("userTrigger", event);
|
||||||
this.cumulativeDuration += 60
|
this.cumulativeDuration += 60
|
||||||
if(this.cumulativeDuration<=this.defaultMaxTime){
|
if(this.cumulativeDuration<=this.defaultMaxTime){
|
||||||
|
|||||||
Reference in New Issue
Block a user