From 6f931f715751a3439e4f36f565d48aee62f0be2b Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Mon, 9 Dec 2024 16:39:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- me/detail/detail.nvue | 31 ++++++++++++++-- me/detail/detail.vue | 2 +- me/detail/detailIOS.nvue | 4 +-- pages/task/index.vue | 76 ++++++++++++++++++++++++++++------------ 4 files changed, 85 insertions(+), 28 deletions(-) diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index fdbc392..63f787c 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -3,7 +3,7 @@ - + + {{getRedEnvelopeTips}} + - {{countPrice*scale}}金币解锁整部视频 + {{countPrice*scale}}金币解锁单集视频 @@ -535,6 +538,7 @@ videoPlay(videoId,courseDetailsId) { this.courseDetailsId = courseDetailsId if ( !this.playFlag ) { + console.log(this.courseDetailsId) this.playFlag = true httpsRequest.getT('app/course/viewCourse', { courseId: this.courseId, @@ -576,6 +580,27 @@ this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId); this.$forceUpdate() }, + disappear(e, index) { + + if (this.videoContext) { //判断之前是否有视频的上下文 + this.videoContext.stop(); + this.videoContext = null; + } + let numIdCurr = this.videoList[index-1].courseDetailsId; + if (this.videoList[index-1].videoUrl) { //已经购买可直接播放 + // 播放时记录当前播放的id + this.appear(numIdCurr,index-1) + this.videoContextId = 'myVideo' + numIdCurr; + this.videoContext = uni.createVideoContext(this.videoContextId, this); + console.log('走更新了') + + this.$nextTick(() => { + //播放当前的 + this.videoContext.play(); + }) + } + // this.$forceUpdate(); + }, //选集弹窗的回调 changeXj(e) { if (e.show == false) { @@ -972,7 +997,7 @@ if (res.code == 0) { uni.hideLoading() uni.showToast({ - title: '已解锁', + title: '已成功解锁', icon: 'none' }) this.closePopusPay() diff --git a/me/detail/detail.vue b/me/detail/detail.vue index d03da63..e3e21d0 100644 --- a/me/detail/detail.vue +++ b/me/detail/detail.vue @@ -1249,7 +1249,7 @@ if (res.code == 0) { uni.hideLoading() uni.showToast({ - title: '已解锁', + title: '已成功解锁', icon: 'none' }) that.showPay = false diff --git a/me/detail/detailIOS.nvue b/me/detail/detailIOS.nvue index 6e993ae..48fdfe3 100644 --- a/me/detail/detailIOS.nvue +++ b/me/detail/detailIOS.nvue @@ -144,7 +144,7 @@ - {{getRedEnvelopeTips}} + {{this.courseDetailsId}} @@ -961,7 +961,7 @@ if (res.code == 0) { uni.hideLoading() uni.showToast({ - title: '已解锁', + title: '已成功解锁', icon: 'none' }) this.closePopusPay() diff --git a/pages/task/index.vue b/pages/task/index.vue index 357b81c..9fc8655 100644 --- a/pages/task/index.vue +++ b/pages/task/index.vue @@ -22,7 +22,7 @@ {{ item.detail }} - {{ item.buttonTitle }} + {{ item.buttonTitle }} {{ item.buttonTitle }} @@ -36,8 +36,7 @@