From a40c857575e28261acc0379bb39bb219e3ad1d66 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 Mar 2026 10:23:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=82=B9=E8=B5=9E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.nvue | 5 +++-- pages/plugins/video/detail/detail.vue | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/plugins/video/detail/detail.nvue b/pages/plugins/video/detail/detail.nvue index a0e549a4..4b4e84bd 100644 --- a/pages/plugins/video/detail/detail.nvue +++ b/pages/plugins/video/detail/detail.nvue @@ -1292,7 +1292,7 @@ const comment = this.active_comments[j]; if (comment.id == comments_id) { updateThumbsStatus(comment, new_data); - return; // 找到后直接返回 + break; // 处理完当前item后跳出循环 } else { // 安全检查sub_comments数组是否存在 if (comment.sub_comments && Array.isArray(comment.sub_comments)) { @@ -1301,13 +1301,14 @@ if (sub_comment.id == comments_id) { updateThumbsStatus(sub_comment, new_data); - return; // 找到后直接返回 + break; // 处理完当前item后跳出循环 } } } } } } + this.video_data_list[i].comments_list = this.active_comments; } else { updateThumbsStatus(item, new_data); } diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index e4374870..d27c7902 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -1343,6 +1343,7 @@ if (comment.id == comments_id) { updateThumbsStatus(comment, new_data); console.log(comment); + break; // 处理完当前item后跳出循环 } else { // 安全检查sub_comments数组是否存在 if (comment.sub_comments && Array.isArray(comment.sub_comments)) { @@ -1351,19 +1352,18 @@ if (sub_comment.id == comments_id) { updateThumbsStatus(sub_comment, new_data); + break; // 处理完当前item后跳出循环 } } } } } } - } else { - updateThumbsStatus(item, new_data); + this.video_data_list[i].comments_list = this.active_comments; } break; // 处理完当前item后跳出外层循环 } } - console.log(this.video_data_list[0]); this.setData({ video_data_list: this.video_data_list })