Merge branch 'zcwyMaster' into dev0731

This commit is contained in:
nisen
2023-11-16 18:03:07 +08:00
6 changed files with 62 additions and 12 deletions

View File

@@ -19,7 +19,8 @@ if(process.env.NODE_ENV === 'development'){
oldApiBaseUrl = '/uboeApi';
statApiBaseUrl='/statApi';
socialApiBaseUrl='/socialApi';
fileUrl = 'https://u-pre.boe.com/cdn/upload';
fileUrl = 'https://u-pre.boe.com/upload';
//fileUrl = 'https://u-pre.boe.com/cdn/upload';
loginPath='/mobile/pages/login/login';
scormPlayer='https://u-pre.boe.com/scorm-player';
}else if(process.env.ENV_TYPE === 'preview'){

View File

@@ -49,7 +49,11 @@
// 字符串的形式
p: 'word-break:break-all;font-size: 28upx;letter-spacing:1rpx; line-height: 1.6;margin-bottom:25px',
span: 'word-break:break-all;font-size: 28upx;letter-spacing:1rpx; line-height: 1.6'
}
},
secondTime: 15,//默认时长
cumulativeDuration: 0,
setTime: null,
defaultMaxTime: 1800,//最大时长
}
},
@@ -74,15 +78,22 @@
source:"h5",
}
apiStat.sendEvent(event);
this.sendEventData()
// this.$store.dispatch("userTrigger", event);
this.setTime = setTimeout(()=>{
event.key = 'ReadArticle';
event.title = "阅读文章";
event.parameters='second:60';//增加60秒的学习时长
event.content = "阅读了文章"
apiStat.sendEvent(event);
// $this.$store.dispatch("userTrigger", event);
},61000);//1分钟后记录
// this.setTime = setTimeout(()=>{
// event.key = 'ReadArticle';
// event.title = "阅读文章";
// event.parameters='second:60';//增加60秒的学习时长
// event.content = "阅读了文章"
// apiStat.sendEvent(event);
// // $this.$store.dispatch("userTrigger", event);
// },61000);//1分钟后记录
},
destroyed() {
if(this.setTime){
clearTimeout(this.setTime);
}
},
onReachBottom(){
this.getDetail()
@@ -91,6 +102,35 @@
...mapGetters(['userInfo'])
},
methods: {
// 发送计时
sendEventData(){
let event = {
key: "ReadArticle",//后台的事件key 发布文章且审核通过
title: "阅读文章",//事件的标题
parameters:"second:" + this.secondTime,//用户自定义参数 name:value,name:value
content: "阅读了文章",//事件的内容
source:'page',
objId: this.id,//关联的id
objType: "2",//关联的类型
objInfo: this.detail.title,
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 ,//状态直接写1
source:"h5",
}
this.setTime = setTimeout(()=>{
this.cumulativeDuration += this.secondTime
if(this.cumulativeDuration <= this.defaultMaxTime){
apiStat.sendEvent(event);
this.secondTime = 60
this.sendEventData()
}else{
this.cumulativeDuration = 0
clearTimeout(this.setTime);
this.setTime = null
}
},this.secondTime * 1000);//15秒记录一次之后1分钟后记录
},
getDetail(){
uni.showLoading({title:'加载中...'});
let $this=this;

View File

@@ -568,6 +568,12 @@
getSysTypeTree:'sysType/getSysTypeTree',
loadSysTypes:'sysType/loadSysTypes'
}),
// 没有写播放时间
onPlayerPlay() {
this.playerBoxShow = false;
this.isAppendTime=true;
this.appendStudyTime();//启动追加学习时长
},
convertTypeName(code){
if(!code){return '';}
return this.sysTypeMap.get(code);
@@ -945,7 +951,8 @@
return false;
})
this.scrollInfo.scrollLeft=len*this.scrollItemWidth+len*6;
if(con.contentType>20){
//50事scorm项目单独计时
if(con.contentType>20 && con.contentType !== 50){
let $this=this;
//用户的学习时长,音视频课程学习,单独的处理,不再追加学习时长
this.isAppendTime = false;

View File

@@ -19,4 +19,4 @@
hm.src = "https://hm.baidu.com/hm.js?ea89f02dca369037a73c5e3907e2c14a";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();</script></head><body><div id=app></div><script src=/mobile/static/js/chunk-vendors.f9a98a7b.js></script><script src=/mobile/static/js/index.2b186d12.js></script></body></html>
})();</script></head><body><div id=app></div><script src=/mobile/static/js/chunk-vendors.f9a98a7b.js></script><script src=/mobile/static/js/index.9db50935.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long