From 1677d950e1fae14a0e54ce5ef3ff91ce98525236 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Wed, 25 Dec 2024 14:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=8D=E6=95=B0=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../YNEduApp/learn/components/VideoStudy.vue | 97 -------------- pages/YNEduApp/learn/learn copy.vue | 81 ------------ pages/YNEduApp/learn/learn.vue | 120 +++++++++++++++++- pages/YNEduApp/learnProj/learnProjDetail.vue | 7 +- 4 files changed, 118 insertions(+), 187 deletions(-) delete mode 100644 pages/YNEduApp/learn/components/VideoStudy.vue delete mode 100644 pages/YNEduApp/learn/learn copy.vue diff --git a/pages/YNEduApp/learn/components/VideoStudy.vue b/pages/YNEduApp/learn/components/VideoStudy.vue deleted file mode 100644 index beef96a..0000000 --- a/pages/YNEduApp/learn/components/VideoStudy.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/pages/YNEduApp/learn/learn copy.vue b/pages/YNEduApp/learn/learn copy.vue deleted file mode 100644 index 85693b4..0000000 --- a/pages/YNEduApp/learn/learn copy.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/pages/YNEduApp/learn/learn.vue b/pages/YNEduApp/learn/learn.vue index 8fd1234..e46f6e6 100644 --- a/pages/YNEduApp/learn/learn.vue +++ b/pages/YNEduApp/learn/learn.vue @@ -9,9 +9,24 @@ :enable-progress-gesture="false" @error="videoErrorCallback" @timeupdate="videoTimeUpdate" - :controls="true" - :autoplay="true" - /> + controls + > + + x {{ currentRate }} + + + + {{ item }} + + + { + that.rateShow = true + }) + console.log('rateShow', that.rateShow) + }, + // 切换倍速 + switchRate(e) { + let that = this + let rate = Number(e.currentTarget.dataset.rate) + that.currentRate = rate + that.rateShow = false + this.video.playbackRate(rate) + }, videoErrorCallback(e) { console.log('视频错误信息:', e) }, // 视频播放时间更新 videoTimeUpdate(e) { let newTime = Math.ceil(e.detail.currentTime) + if (Math.abs(newTime - this.currentTime) > 1.5) { + console.log('手动拖动了进度条,重置时间到上传播放时间') + this.video.seek(this.currentTime) + return + } if (this.currentTime != newTime) { this.currentTime = newTime console.log('🚀 ~ 视频播放时间: ~ this.currentTime:', this.currentTime) @@ -356,9 +402,9 @@ export default { diff --git a/pages/YNEduApp/learnProj/learnProjDetail.vue b/pages/YNEduApp/learnProj/learnProjDetail.vue index 3e930f8..17c5de6 100644 --- a/pages/YNEduApp/learnProj/learnProjDetail.vue +++ b/pages/YNEduApp/learnProj/learnProjDetail.vue @@ -153,7 +153,8 @@ export default { eligibility: 0, learnIconObj: { color: '#1A63AC', size: '18', type: 'calendar' }, pracIconObj: { color: '#38B022', size: '18', type: 'compose' }, - listStage: [] + listStage: [], + isSpeed: '' } }, onLoad(params) { @@ -188,6 +189,7 @@ export default { this.listStageContentNum = res.data.listStageContentNum this.eligibility = res.data.eligibility this.listStage = res.data.listStage + this.isSpeed = res.data.isSpeed if (this.listStage.length > 0) { this.listStage.forEach((item, index) => { this.$set(item, 'isShow', true) @@ -210,7 +212,8 @@ export default { path: item.path, // 视频路径 studyDuration: item.studyDuration || 0, // 学习时长 allStudyDuration: item.allStudyDuration, // 总时长 - isEnd: item.studyPercentage >= 100 ? true : false + isEnd: item.studyPercentage >= 100 ? true : false, + isSpeed: this.isSpeed } console.log('🚀 ~ toggleTheoryLearn ~ params:', params) console.log('🚀 ~ toggleTheoryLearn ~ item:', item.path)