修改视频记录时间问题

This commit is contained in:
zhangsir
2024-08-01 10:59:09 +08:00
parent 345bda9e15
commit be3c023d6c

View File

@@ -1558,7 +1558,14 @@
status: 2,
contentTotal:this.totalContent
}
apiCourseStudy.studyContent(params)
apiCourseStudy.studyContent(params).then(res=>{
if(res.status == 200) {
this.curContent.status=2;//完成
this.curContent.studyItemId=res.result;//学习记录id
}else{
console.log('记录学习失败:'+res.message+''+res.error);
}
})
this.trueFalse = false
}
//console.log("当前播放11",itme);
@@ -1570,23 +1577,24 @@
//判断是否完成
let completeType=this.curriculumData.completeSetup;
let completeSecond=this.curriculumData.second;
if(!completeSecond){
completeSecond=5;//如果没有就采用默认的时间了
}
if(completeType>0 && this.curContent.status<9){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
let videDuration=this.curContent.duration;
let percent =intTime*100/videDuration;
if(percent>=finishPercent){
this.finishStudyItem();
}
}else{
if(intTime>=completeSecond){
this.finishStudyItem();
}
if (!completeSecond || completeType == 0) {
completeSecond = 5; //如果没有就采用默认的时间了
}
if (this.curContent.status < 9) { //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if (completeType == 1) {
let finishPercent=this.curriculumData.setupTage;
let videDuration=this.curContent.duration;
let percent =intTime*100/videDuration;
if (percent >= finishPercent) {
this.finishStudyItem();
}
} else {
if (intTime >= completeSecond) {
this.finishStudyItem();
}
}
}
}
}
//以下是每隔10秒存储一下进度
let saveTime=Math.floor(intTime%10);