From be3c023d6cc3601a21b7dadd8c87b1576855ba86 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 1 Aug 2024 10:59:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E9=97=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/study/courseStudy.vue | 42 ++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 7fa6c24..00c7857 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -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); From 2ccb81e70794749f3c335db603d8ec4af21f4be0 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 1 Aug 2024 11:14:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/study/courseStudy.vue | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 00c7857..3f7383c 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -1558,14 +1558,7 @@ status: 2, contentTotal:this.totalContent } - 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); - } - }) + apiCourseStudy.studyContent(params) this.trueFalse = false } //console.log("当前播放11",itme); @@ -1598,7 +1591,7 @@ } //以下是每隔10秒存储一下进度 let saveTime=Math.floor(intTime%10); - //console.log(intTime,saveTime,'aa',this.curContent.studyItemId) + // console.log(intTime,saveTime,'aa',this.curContent.studyItemId) if(this.preTime!=intTime && saveTime==0 && this.curContent.studyItemId!=''){ this.preTime=intTime; this.curContent.lastStudyTime=intTime; From 317453ac0d86d0e49ea55ff5b69a986c5380fe96 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 1 Aug 2024 11:42:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=91=E7=8E=B0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=B0=8Fbug=EF=BC=8C=E9=A1=BA=E6=89=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/study/courseStudy.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 3f7383c..8b068d4 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -881,6 +881,7 @@ }, //更换播放内容 changePlayRes(con){ + this.videoPlayingTime = 0 this.scormUrl='';//清空地址 this.articleMore=true; this.clearTimeHandle();