mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-10 03:16:45 +08:00
提交修改
This commit is contained in:
@@ -533,6 +533,12 @@
|
||||
onReady() {
|
||||
this.videoPlayer=uni.createVideoContext("myVideo", this);
|
||||
},
|
||||
onHide(){
|
||||
//清除定时任务
|
||||
if(this.appendStudyOtherHandle!=null){
|
||||
window.clearTimeout(this.appendStudyOtherHandle);
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
...mapActions({
|
||||
// getResOwnerTree:'resOwner/getResOwnerTree',
|
||||
@@ -685,66 +691,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(con,'con');
|
||||
if(this.videoPlayer){
|
||||
//console.log('切换视频');
|
||||
this.videoPlayer.stop();
|
||||
}
|
||||
this.playerBoxShow=false;
|
||||
if(con.contentType==40){
|
||||
//如果是文档,需要再次加载pdf
|
||||
if(con.content!='' && con.content.indexOf('.pdf')==-1){
|
||||
// 先置空,否则会有延迟
|
||||
con.content = '';
|
||||
apiCourseFile.detail(con.contentRefId).then(cfrs=>{
|
||||
if(cfrs.status==200){
|
||||
con.content=cfrs.result.previewFilePath;
|
||||
//console.log(r.content);
|
||||
}else{
|
||||
$this.$refs.messager.show({message:'加载pdf课件文件失败',type:'error'});
|
||||
}
|
||||
});
|
||||
}
|
||||
}else if(con.contentType==52){
|
||||
if(con.content.startsWith('\{')){
|
||||
this.conLink=JSON.parse(con.content);
|
||||
}else{
|
||||
this.conLink.url=con.content;
|
||||
this.conLink.openType=1;
|
||||
}
|
||||
} else if(con.contentType==10 || con.contentType==20) {
|
||||
|
||||
if(con.content.startsWith('\{')){
|
||||
this.curriculumData=JSON.parse(con.content);
|
||||
}else{
|
||||
this.curriculumData.url=con.content;
|
||||
}
|
||||
this.blobUrl=this.fileBaseUrl+this.curriculumData.url;
|
||||
console.log(this.blobUrl,'this.blobUrl');
|
||||
}
|
||||
this.curContent=con;
|
||||
this.catalogShow=false;
|
||||
this.scoreInfo.itemId=con.id;
|
||||
if(this.curContent.status<2){
|
||||
this.curContent.status=2; //设置状态 进行中
|
||||
}
|
||||
//横向滚动条定位
|
||||
let len=0;
|
||||
this.scrollList.some((sitem,idx)=>{
|
||||
if(sitem.id==con.id){
|
||||
len=idx;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
this.scrollInfo.scrollLeft=len*this.scrollItemWidth+len*6;
|
||||
if(con.contentType>20){
|
||||
let $this=this;
|
||||
//非视频,音频的5秒后学习完成
|
||||
this.handleTimeout = setTimeout(function(){$this.saveStudyInfo();},5000);
|
||||
}
|
||||
|
||||
//切换播放内容
|
||||
this.changePlayRes(con);
|
||||
},
|
||||
loadReCourses(){
|
||||
let dto={
|
||||
@@ -821,6 +769,73 @@
|
||||
});
|
||||
|
||||
},
|
||||
//更换播放内容
|
||||
changePlayRes(con){
|
||||
// console.log(con,'con');
|
||||
if(this.videoPlayer){
|
||||
//console.log('切换视频');
|
||||
this.videoPlayer.stop();
|
||||
}
|
||||
this.playerBoxShow=false;
|
||||
if(con.contentType==40){
|
||||
//如果是文档,需要再次加载pdf
|
||||
if(con.content!='' && con.content.indexOf('.pdf')==-1){
|
||||
// 先置空,否则会有延迟
|
||||
con.content = '';
|
||||
apiCourseFile.detail(con.contentRefId).then(cfrs=>{
|
||||
if(cfrs.status==200){
|
||||
con.content=cfrs.result.previewFilePath;
|
||||
//console.log(r.content);
|
||||
}else{
|
||||
$this.$refs.messager.show({message:'加载pdf课件文件失败',type:'error'});
|
||||
}
|
||||
});
|
||||
}
|
||||
}else if(con.contentType==52){
|
||||
if(con.content.startsWith('\{')){
|
||||
this.conLink=JSON.parse(con.content);
|
||||
}else{
|
||||
this.conLink.url=con.content;
|
||||
this.conLink.openType=1;
|
||||
}
|
||||
} else if(con.contentType==10 || con.contentType==20) {
|
||||
|
||||
if(con.content.startsWith('\{')){
|
||||
this.curriculumData=JSON.parse(con.content);
|
||||
}else{
|
||||
this.curriculumData.url=con.content;
|
||||
}
|
||||
this.blobUrl=this.fileBaseUrl+this.curriculumData.url;
|
||||
console.log(this.blobUrl,'this.blobUrl');
|
||||
}
|
||||
this.curContent=con;
|
||||
this.catalogShow=false;
|
||||
this.scoreInfo.itemId=con.id;
|
||||
if(this.curContent.status<2){
|
||||
this.curContent.status=2; //设置状态 进行中
|
||||
}
|
||||
//横向滚动条定位
|
||||
let len=0;
|
||||
this.scrollList.some((sitem,idx)=>{
|
||||
if(sitem.id==con.id){
|
||||
len=idx;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
this.scrollInfo.scrollLeft=len*this.scrollItemWidth+len*6;
|
||||
if(con.contentType>20){
|
||||
let $this=this;
|
||||
//用户的学习时长,音视频课程学习,单独的处理,不再追加学习时长
|
||||
this.isAppendTime = false;
|
||||
this.appendStudyOtherHandle = setTimeout(function() {
|
||||
$this.appendStudyOtherTime();
|
||||
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
||||
//this.appendStudyTime();
|
||||
//非视频,音频的5秒后学习完成
|
||||
this.handleTimeout = setTimeout(function(){$this.saveStudyInfo();},5000);//5秒后记录学习完成
|
||||
}
|
||||
},
|
||||
followUser(tea){
|
||||
//实现关注处理
|
||||
if(tea.followed){
|
||||
@@ -1371,7 +1386,8 @@
|
||||
9:'finish',
|
||||
}
|
||||
return statusObj[status]
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user