From be3c023d6cc3601a21b7dadd8c87b1576855ba86 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 1 Aug 2024 10:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E8=AE=B0?= =?UTF-8?q?=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);