fix: rating
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user