mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
提交事件发送修改
This commit is contained in:
@@ -236,25 +236,7 @@ export default {
|
|||||||
"scroll",
|
"scroll",
|
||||||
this.handleScroll
|
this.handleScroll
|
||||||
);
|
);
|
||||||
let event = {
|
|
||||||
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.$store.dispatch("userTrigger", event);
|
|
||||||
this.setTimeCase = setTimeout(()=>{
|
|
||||||
event.key = 'ReadCase';
|
|
||||||
event.title = '阅读案例';
|
|
||||||
event.content = '阅读了案例';
|
|
||||||
this.$store.dispatch("userTrigger", event);
|
|
||||||
},1000 * 60 *3)
|
|
||||||
},
|
},
|
||||||
beforeDestroy(){
|
beforeDestroy(){
|
||||||
window.removeEventListener("scroll",this.handleScroll);
|
window.removeEventListener("scroll",this.handleScroll);
|
||||||
@@ -291,6 +273,7 @@ export default {
|
|||||||
if (xmlhttp.status==200){
|
if (xmlhttp.status==200){
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
$this.Internet = 1;
|
$this.Internet = 1;
|
||||||
|
$this.sendEventData();
|
||||||
}else{
|
}else{
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
$this.Internet = 2;
|
$this.Internet = 2;
|
||||||
@@ -475,7 +458,31 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
sendEventData(){
|
||||||
|
let event = {
|
||||||
|
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.$store.dispatch("userTrigger", event);
|
||||||
|
let $this=this;
|
||||||
|
this.setTimeCase = setTimeout(()=>{
|
||||||
|
event.key = 'ReadCase';
|
||||||
|
event.title = '阅读案例';
|
||||||
|
event.parameters="second:60";
|
||||||
|
event.content = '阅读了案例';
|
||||||
|
$this.$store.dispatch("userTrigger", event);
|
||||||
|
},61000);//1分钟之后发送阅读案例事件
|
||||||
|
},
|
||||||
getCaseData() {
|
getCaseData() {
|
||||||
|
let $this=this;
|
||||||
apiCase.details(this.resolveId,true).then(res => {
|
apiCase.details(this.resolveId,true).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if (JSON.stringify(res.result) != '{}') {
|
if (JSON.stringify(res.result) != '{}') {
|
||||||
@@ -485,6 +492,7 @@ export default {
|
|||||||
if(this.caseDetail.filePath){
|
if(this.caseDetail.filePath){
|
||||||
//this.pdfPath=this.basePath+this.caseDetail.filePath;
|
//this.pdfPath=this.basePath+this.caseDetail.filePath;
|
||||||
this.createPlayUrl(this.caseDetail.filePath);
|
this.createPlayUrl(this.caseDetail.filePath);
|
||||||
|
this.sendEventData();
|
||||||
}else{
|
}else{
|
||||||
this.$message.error('内容文件不存在或已被删除,请与管理员联系');
|
this.$message.error('内容文件不存在或已被删除,请与管理员联系');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -502,6 +502,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.appendStudyOtherHandle!=null){
|
||||||
|
windows.clearTimeout(this.appendStudyOtherHandle);
|
||||||
|
}
|
||||||
this.playerBoxShow = false;
|
this.playerBoxShow = false;
|
||||||
//显示内容部分
|
//显示内容部分
|
||||||
this.$refs.mynote.showVideoTimeBtn(false);
|
this.$refs.mynote.showVideoTimeBtn(false);
|
||||||
@@ -568,11 +571,6 @@
|
|||||||
//用户的学习时长,非音视频课程学习,单独的处理
|
//用户的学习时长,非音视频课程学习,单独的处理
|
||||||
this.isAppendTime = false;
|
this.isAppendTime = false;
|
||||||
|
|
||||||
if(this.appendStudyOtherHandle!=null){
|
|
||||||
windows.clearTimeout(this.appendStudyOtherHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this.appendStudyOtherHandle = setTimeout(function() {
|
this.appendStudyOtherHandle = setTimeout(function() {
|
||||||
$this.appendStudyOtherTime();
|
$this.appendStudyOtherTime();
|
||||||
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
||||||
|
|||||||
Reference in New Issue
Block a user