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 })