From e5f040e22c142524d28a0155456ec5a51d6340f5 Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 17 Nov 2022 12:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AD=A6=E4=B9=A0=E8=80=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/course-exam/course-exam.vue | 9 ++++++--- pages/study/courseStudy.vue | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/components/course-exam/course-exam.vue b/components/course-exam/course-exam.vue index 9b1ca3e..5dc6c66 100644 --- a/components/course-exam/course-exam.vue +++ b/components/course-exam/course-exam.vue @@ -5,7 +5,7 @@ - + @@ -74,6 +74,7 @@ show:0, toLetter:numberToLetter, testType:getQuestionType, + allowTimes:'无限制', has:true, startTime:null, testStart: false, @@ -98,8 +99,10 @@ loadExamInfo(){ apiCourse.getExam(this.content.id).then(res=>{ if(res.status==200){ - this.info=res.result; - + if(res.result.times>0){ + this.allowTimes=res.result.times; + } + this.info=res.result; }else if(res.status==404){ //没有找到考试信息 }else{ diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 47df931..ed65283 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -436,10 +436,7 @@ treePopupWidth:'400px', fileBaseUrl:this.$config.fileUrl, curSection:{},//当前所在的章 - curContent:{ - studyItemId:'', - status:1 - },//当前的内容 + curContent:{id:'',studyItemId:'',status:1},//当前的内容 conLink:{openType:1,url:''},//外连接内容 curriculumData:{url:'',isDrag:true,completeSetup:1,setupTage:0,second:0},// 课件内容 @@ -603,6 +600,7 @@ } let showConId=this.initContentId; + //console.log(showConId,'showConId'); if(rs.result.course.type >10){ rs.result.sections.forEach(sec=>{ sec.status=1;//加入状态表未开始 @@ -610,6 +608,7 @@ c.status=1;//初始化状态 ,未开始 c.studyItemId='';//初始化字段,学习条目id c.lastStudyTime=0; + if(showConId!='' && c.id==showConId){ $this.curContent=c; $this.curSection=sec; @@ -642,6 +641,13 @@ rs.result.contents.splice(delIdx,1); }) } + //定位初始化数据 + rs.result.contents.forEach((c,cidx) => { + if(showConId!='' && c.id==showConId){ + $this.curContent=c; + } + }) + } this.contentList=rs.result.contents;//内容列表 this.totalContent=rs.result.contents.length;//一共有向个可以播放的内容 @@ -668,7 +674,7 @@ }) }); //设置正在学习的章节 - if(this.curContent.studyItemId){ + if(this.curContent.id){ this.playContent(this.curContent,0); //this.curSection=this.sectionList[0]; }else{ @@ -816,7 +822,7 @@ this.curriculumData.url=con.content; } this.blobUrl=this.fileBaseUrl+this.curriculumData.url; - console.log(this.blobUrl,'this.blobUrl'); + //console.log(this.blobUrl,'this.blobUrl'); } this.curContent=con; this.catalogShow=false;