fix: rating

This commit is contained in:
zzc
2026-06-09 23:55:11 +08:00
parent 36dbf05c11
commit d4478cccd8
8 changed files with 101 additions and 58 deletions

View File

@@ -64,6 +64,18 @@ const handleLike = async () => {
try {
// 调用点赞接口 (点赞和取消点赞为同一个接口)
await topicItemCommentLike({ commentId: props.comment.id });
// 记录点赞事件
uni.$trackRecord({
eventName: 'like_comment',
eventType: 'like',
elementId: `comment_${props.comment.id}`,
elementContent: `评论项_${props.comment.name}`,
customParams: {
comment: props.comment.content,
page: 'rating_detail'
}
});
uni.showToast({ title: '操作成功', icon: 'success' });
} catch (error) {
// 接口调用失败,回滚 UI 状态
isLiked.value = !isLiked.value;