From 3200aeb58e0ff777564c763e403892f537e3fe78 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 27 May 2024 17:11:28 +0800 Subject: [PATCH 1/2] =?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/2] =?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 } - } + // } }, }, }