From bca1841fa1697411d1665f351fd7496eb2bc1237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Tue, 10 Feb 2026 16:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=98=BE=E7=A4=BA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 52 ++++++++++++++------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index a6ce0cec..4fd10b4c 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -20,8 +20,8 @@ - - + + @@ -63,10 +63,10 @@ - + @@ -332,8 +332,7 @@ }); if (is_last == 1 && is_next == 1) { this.update_display_data(); - console.log(this.display_video_list); - + setTimeout(() => { // // 更新分享信息 this.update_share_info(this.display_video_list[0]); @@ -344,18 +343,7 @@ setTimeout(() => { if (this.video_contexts[0]) { // 当前播放的视频索引为0 - console.log(this.video_contexts[0]); - // try { - this.video_contexts[0].play().catch(error => { - this.setData({ - paused: true, - }); - }); - // } catch (error) { - // this.setData({ - // paused: true, - // }); - // } + this.video_play_event(this.video_contexts[0]); } }, 200); }, 0); @@ -375,6 +363,18 @@ } }); }, + video_play_event(video_contexts) { + try { + video_contexts.play().then((err) => { + console.log(err); + + }); + } catch (error) { + this.setData({ + paused: true, + }); + } + }, update_share_info(data) { const info = { title: data.title || '', @@ -582,19 +582,23 @@ setTimeout(() => { // 播放当前视频 if (this.video_contexts[current]) { - this.video_contexts[current].play(); + this.video_play_event(this.video_contexts[current]); } }, 100); }, // 切换播放暂停 toggle_play_pause() { - if (!this.video_contexts[this.current_index]) return; // 当前播放的视频索引为1 + if (this.video_contexts[this.current_index] == null) return; // 当前播放的视频索引为1 - this.paused = !this.paused; + this.setData({ + paused: !this.paused + }); + // this.paused = !this.paused; + console.log(this.paused); if (this.paused) { this.video_contexts[this.current_index].pause(); // 暂停中间的视频 } else { - this.video_contexts[this.current_index].play(); // 播放中间的视频 + this.video_play_event(this.video_contexts[this.current_index]); // 播放中间的视频 } }, // 收藏 @@ -885,8 +889,8 @@ left: 50%; transform: translate(-50%, -50%); background: #fff; - width: 80rpx; - height: 80rpx; + width: 60rpx; + height: 60rpx; z-index: 0; } .play-icon-iconfont {