修改点赞数据记录

master
于肖磊 2026-03-13 10:23:31 +08:00
parent 5bd3f222f0
commit a40c857575
2 changed files with 6 additions and 5 deletions

View File

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

View File

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