xugenyuan

ref |> 处理自己发的评论预显不可以点赞

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -546,37 +546,41 @@ struct commentFooterView {
})
}
Row({ space: 6 }) {
Text(this.item.likeNum)
.fontColor($r('app.color.color_666666'))
.fontSize(14)
Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal'))
.size({
width: 16,
height: 16
})
}
.onClick(() => {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
if (this.item.id) { // 审核通过的才显示点赞
Row({ space: 6 }) {
Text(this.item.likeNum)
.fontColor($r('app.color.color_666666'))
.fontSize(14)
Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal'))
.size({
width: 16,
height: 16
})
}
commentLikeChange(this.item)
commentViewModel.commentLike(this.item).then(() => {
}).catch(() => {
commentLikeChange(this.item)
.onClick(() => {
this.clickLike()
})
})
}
}
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
.height(30)
}
clickLike() {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
commentLikeChange(this.item)
commentViewModel.commentLike(this.item).then(() => {
}).catch(() => {
commentLikeChange(this.item)
})
}
}
function commentLikeChange(item: commentItemModel) {
... ...