1
This commit is contained in:
@@ -71,14 +71,12 @@ const CommentReply = () => {
|
||||
|
||||
setCommentList(mappedList);
|
||||
|
||||
// 获取未读评论ID并标记已读
|
||||
const unreadIds = res.data.rows
|
||||
.filter((item: any) => item.is_read === 0)
|
||||
.map((item: any) => item.id);
|
||||
// 获取所有评论ID列表并标记已读(传入所有ID,包括已读和未读)
|
||||
const allCommentIds = res.data.rows.map((item: any) => item.id);
|
||||
|
||||
if (unreadIds.length > 0) {
|
||||
// 使用统一接口标记已读
|
||||
messageService.markAsRead('comment', unreadIds).catch(e => {
|
||||
if (allCommentIds.length > 0) {
|
||||
// 使用统一接口标记已读,传入所有评论ID
|
||||
messageService.markAsRead('comment', allCommentIds).catch(e => {
|
||||
console.error("标记评论已读失败:", e);
|
||||
});
|
||||
}
|
||||
@@ -217,6 +215,15 @@ const CommentReply = () => {
|
||||
}));
|
||||
|
||||
setCommentList(mappedList);
|
||||
|
||||
// 获取所有评论ID列表并标记已读(传入所有ID)
|
||||
const allCommentIds = res.data.rows.map((item: any) => item.id);
|
||||
|
||||
if (allCommentIds.length > 0) {
|
||||
messageService.markAsRead('comment', allCommentIds).catch(e => {
|
||||
console.error("标记评论已读失败:", e);
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
|
||||
Reference in New Issue
Block a user