修改删除评论之后的显示逻辑
parent
85f1af5f86
commit
eec8e82f31
|
|
@ -1390,16 +1390,25 @@
|
|||
// 更新子评论数组
|
||||
comment.sub_comments = filteredSubComments;
|
||||
filteredComments.push(comment);
|
||||
}
|
||||
}
|
||||
comment.comments_count = filteredSubComments.length;
|
||||
// 如果没有子评论且没有内容,则不添加这个父级评论
|
||||
} else {
|
||||
// 没有子评论的情况,直接保留父级评论
|
||||
filteredComments.push(comment);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除之后更新评论数据
|
||||
this.video_data_list.forEach(item => {
|
||||
if (item.id == this.current_video_id) {
|
||||
item.comments_count = filteredComments.length;
|
||||
}
|
||||
})
|
||||
// 更新active_comments
|
||||
this.active_comments = filteredComments;
|
||||
this.setData({
|
||||
active_comments: filteredComments,
|
||||
video_data_list: this.video_data_list
|
||||
})
|
||||
}
|
||||
},
|
||||
// 处理全局点击事件
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<view class="video-date">{{ item.add_time_date }}</view>
|
||||
<view class="video-likes flex-row align-c gap-4">
|
||||
<iconfont name="icon-givealike-o-fine" size="24rpx"></iconfont>
|
||||
<text>{{ item.access_count }}</text>
|
||||
<text>{{ item.give_thumbs_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<view class="video-date">{{ item.add_time_date }}</view>
|
||||
<view class="video-likes flex-row align-c gap-4">
|
||||
<iconfont name="icon-givealike-o-fine" size="24rpx"></iconfont>
|
||||
<text>{{ item.access_count }}</text>
|
||||
<text>{{ item.give_thumbs_count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
Loading…
Reference in New Issue