Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-05-09 09:03:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b3e6e0cee2a5b983a0b217c8d2d8a3409c79bea7
b3e6e0ce
1 parent
6357e926
ref |> 处理自己发的评论预显不可以点赞
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
b3e6e0c
...
...
@@ -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) {
...
...
Please
register
or
login
to post a comment