From 3200aeb58e0ff777564c763e403892f537e3fe78 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 27 May 2024 17:11:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=B6=E9=97=B43=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/VideoPlayer/index.vue | 5 +++++ src/views/study/coursenew.vue | 25 +++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/components/VideoPlayer/index.vue b/src/components/VideoPlayer/index.vue index f9dc221a..a8c94147 100644 --- a/src/components/VideoPlayer/index.vue +++ b/src/components/VideoPlayer/index.vue @@ -24,6 +24,7 @@ height="100%" @waiting="onWaiting" @playing="onPlaying" + @timeupdate="onAudioTimeUpdate" > @@ -561,6 +562,10 @@ export default { this.isPlaying = true; this.videoDom.play(); }, + onAudioTimeUpdate() { + const currentTime = this.$refs.video.currentTime; + this.$emit('onTimeUpdate', currentTime); + }, }, watch: { currentVolume: function () { diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 1e039fe7..838c596d 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -30,7 +30,7 @@ + @onPlayerEnded="onPlayerEnded" :isCrowd="isCrowd" @onTimeUpdate="handleAudioTimeUpdate">
@@ -320,6 +320,7 @@ }, data() { return { + trueFalse: true, audiences:'', isCrowd:false, cutOrgNamePath, @@ -444,6 +445,7 @@ } treeList.push(treeNode); }); + console.log(treeList,'treeList') return treeList; } }, @@ -1188,6 +1190,7 @@ audiences:this.audiences }).then(rs => { if (rs.status == 200) { + this.contentStudysLength = rs.result.contentStudys if(rs.result.contents.length==0){ $this.$message.error('课程内容已删除或课程已不再使用'); return; @@ -1582,7 +1585,25 @@ }, heartabtwo() { this.tab = 2 - } + }, + handleAudioTimeUpdate(currentTime) { + if(this.contentStudysLength.length == 0){ + let params = { + studyId: this.studyId, //学习id, + courseId: this.courseId, //课程id, + contentId: this.contentData.id, //内容id, + contentType: this.contentData.contentType, + contentName: this.contentData.contentName, //内容名称 + progress: 100, + status: 9, + contentTotal: this.totalContent + }; + if(currentTime > 3&&this.trueFalse){ + apiStudy.studyContent(params) + this.trueFalse = false + } + } + }, }, } From 2e099b4f7368b211d195455101bd44fff2e30c0b Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 27 May 2024 17:15:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/study/coursenew.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 838c596d..fa0012fc 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -1587,22 +1587,22 @@ this.tab = 2 }, handleAudioTimeUpdate(currentTime) { - if(this.contentStudysLength.length == 0){ + // if(this.contentStudysLength.length == 0){ let params = { studyId: this.studyId, //学习id, courseId: this.courseId, //课程id, contentId: this.contentData.id, //内容id, contentType: this.contentData.contentType, contentName: this.contentData.contentName, //内容名称 - progress: 100, - status: 9, + progress: 1, + status: 2, contentTotal: this.totalContent }; - if(currentTime > 3&&this.trueFalse){ + if(currentTime > 2 && this.trueFalse){ apiStudy.studyContent(params) this.trueFalse = false } - } + // } }, }, } From 17d461cdc4fc138a6151d8e163d718fd9f7e2020 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 27 May 2024 20:29:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=AF=BE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/assess.vue | 17 +++++++++++++++++ src/components/Course/exam.vue | 31 +++++++++++++++++++++++++++++++ src/views/study/coursenew.vue | 6 ++++-- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/components/Course/assess.vue b/src/components/Course/assess.vue index a6535d91..01ff1710 100644 --- a/src/components/Course/assess.vue +++ b/src/components/Course/assess.vue @@ -60,6 +60,10 @@ content:{ type: Object, default: ()=>{} + }, + courseType:{ + type: String, + default: 0 } }, data(){ @@ -159,6 +163,19 @@ this.$message.error(res.message); } }) + if(this.courseType == 20){ + let params = { + studyId: this.studyId, //学习id, + courseId: this.content.courseId, //课程id, + contentId: this.content.id, //内容id, + contentType: '', + contentName: '', //内容名称 + progress: 100, + status: 9, + contentTotal: '' + }; + apiCourseStudy.studyContent(params) + } } } } diff --git a/src/components/Course/exam.vue b/src/components/Course/exam.vue index 2b743b04..c3c74896 100644 --- a/src/components/Course/exam.vue +++ b/src/components/Course/exam.vue @@ -152,6 +152,10 @@ export default { showTest:{ type:Boolean, default:false + }, + courseType:{ + type: String, + default:0 } }, data() { @@ -512,6 +516,33 @@ export default { }, submitTest(testScore){ //提交处理 //清空提示 + if(this.courseType == 20){ + if(testScore<80){ + const params = { + studyId: this.studyId, //学习id, + courseId: this.content.courseId, //课程id, + contentId: this.content.id, //内容id, + contentType: '', + contentName: '', //内容名称 + progress: 1, + status: 2, + contentTotal: '' + }; + apiStudy.studyContent(params) + }else{ + const params = { + studyId: this.studyId, //学习id, + courseId: this.content.courseId, //课程id, + contentId: this.content.id, //内容id, + contentType: '', + contentName: '', //内容名称 + progress: 100, + status: 9, + contentTotal: '' + }; + apiStudy.studyContent(params) + } + } if(this.timer){ window.clearInterval(this.timer); } diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index fa0012fc..c489d57f 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -102,10 +102,10 @@
- +
- +
@@ -320,6 +320,7 @@ }, data() { return { + courseType: 0, trueFalse: true, audiences:'', isCrowd:false, @@ -1190,6 +1191,7 @@ audiences:this.audiences }).then(rs => { if (rs.status == 200) { + this.courseType = rs.result.course.type this.contentStudysLength = rs.result.contentStudys if(rs.result.contents.length==0){ $this.$message.error('课程内容已删除或课程已不再使用');