From 1899482bb287069142b0a206be51e03d0bc0b653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 14:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index bf937383..9b3e7622 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -39,7 +39,7 @@ {{ video_item.give_thumbs_count }} - + {{ video_item.comments_count }} @@ -873,7 +873,8 @@ }, // 打开评论区 handle_comment(e) { - const old_data = e?.currentTarget?.dataset?.value || ''; + const id = e?.currentTarget?.dataset?.id || ''; + const old_data = this.video_data_list.find(item => item.id == id); // 初始化评论数据 const new_data = old_data.comments_list.map(item1 => ({ ...item1, @@ -1126,18 +1127,27 @@ const data = res.data; if (data.code == 0) { const new_data = data.data; + // 合并评论列表 + let video_data = JSON.parse(JSON.stringify(this.video_data_list)); // 更新视频数据 - this.video_data_list.forEach(item => { + const new_video_data = video_data.map(item => { if (item.id == id) { + console.log(new_data.data.comments_list, '1'); const new_item = { ...item, - ...new_data, + ...new_data.data, + comments_list: new_data.data.comments_list, }; + console.log(new_item, '2'); + item = new_item; } }); + console.log(new_video_data, '3'); + + // 更新数据 this.setData({ - video_data_list: this.video_data_list + video_data_list: new_video_data }) } }