From 85f1af5f86a7c6b5215dbad25a45062f2bfc7e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 13 Feb 2026 10:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 47 ++++++- pages/plugins/video/index/index.vue | 13 +- pages/plugins/video/search/search-record.vue | 126 +++++++++++-------- pages/plugins/video/search/search.vue | 15 ++- 4 files changed, 135 insertions(+), 66 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index f930fbeb..cf1d387b 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -88,7 +88,7 @@ - + 评论 @@ -168,7 +168,7 @@ - + 举报原因* @@ -181,7 +181,7 @@ - + 请选择具体的类型* @@ -297,7 +297,11 @@ }, // 如果是第一个或者最后一个的情况下,取消无限轮播 close_circular() { - return this.video_data_list[0].id == this.current_video_id || this.video_data_list[this.video_data_list.length - 1].id == this.current_video_id; + if (this.video_data_list.length > 0) { + return this.video_data_list[0].id == this.current_video_id || this.video_data_list[this.video_data_list.length - 1].id == this.current_video_id; + } else { + return true + } } }, onLoad(params) { @@ -475,13 +479,22 @@ this.display_video_list.forEach((item, index) => { this.create_video_contexts[index] = uni.createVideoContext(`video_${index}`, this); + //#ifdef H5 this.video_contexts[index] = document.getElementById(`video_${index}`).querySelector('video'); + //#endif }); setTimeout(() => { + //#ifdef H5 if (this.video_contexts[0]) { // 当前播放的视频索引为0 this.video_play_event(this.video_contexts[0], true); } + //#endif + //#ifndef H5 + if (this.create_video_contexts[0]) { // 当前播放的视频索引为0 + this.video_play_event(this.create_video_contexts[0], true); + } + //#endif }, 200); }, 0); } @@ -656,9 +669,14 @@ try { if (is_first_play) { + //#ifdef H5 videoContext.play().catch((error) => { this.setData({ paused: true }); }); + //#endif + //#ifndef H5 + videoContext.play(); + //#endif } else { videoContext.play(); } @@ -993,6 +1011,11 @@ page: 0, sub_comments: [], }) + this.video_data_list.forEach(item => { + if (item.id == this.current_video_id) { + item.comments_count++; + } + }) } else { this.active_comments.forEach(item => { if (item.id == new_video_comments_id) { @@ -1003,6 +1026,8 @@ } // 清空输入框, 更新数据内容 this.setData({ + active_comments: this.active_comments, + video_data_list: this.video_data_list, form_images_list: [], comment_input_value: '', comments_data: {}, @@ -1094,6 +1119,9 @@ item = new_item; } }); + this.setData({ + video_data_list: this.video_data_list + }) } } }); @@ -1152,6 +1180,9 @@ break; // 处理完当前item后跳出外层循环 } } + this.setData({ + video_data_list: this.video_data_list + }) } else { if (app.globalData.is_login_check(res.data)) { app.globalData.showToast(res.data.msg); @@ -1233,6 +1264,9 @@ item.show_goods = false; } }); + this.setData({ + video_data_list: this.video_data_list + }) }, handle_product_card_item(e) { const id = e?.currentTarget?.dataset?.id || ''; @@ -1252,6 +1286,9 @@ } } }); + this.setData({ + video_data_list: this.video_data_list + }) }, // 清理所有视频资源 cleanup_all_videos() { @@ -1430,7 +1467,7 @@ } }, - // 新增方法:直接选择子类型(用于一行显示的点击) + // 直接选择子类型(用于一行显示的点击) select_sub_reason(e) { const index = e?.currentTarget?.dataset?.index || 0; const sub_index = parseInt(index); diff --git a/pages/plugins/video/index/index.vue b/pages/plugins/video/index/index.vue index e00e58a2..5d241464 100644 --- a/pages/plugins/video/index/index.vue +++ b/pages/plugins/video/index/index.vue @@ -1,5 +1,5 @@