xugenyuan

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

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -546,6 +546,7 @@ struct commentFooterView { @@ -546,6 +546,7 @@ struct commentFooterView {
546 }) 546 })
547 } 547 }
548 548
  549 + if (this.item.id) { // 审核通过的才显示点赞
549 Row({ space: 6 }) { 550 Row({ space: 6 }) {
550 Text(this.item.likeNum) 551 Text(this.item.likeNum)
551 .fontColor($r('app.color.color_666666')) 552 .fontColor($r('app.color.color_666666'))
@@ -556,9 +557,18 @@ struct commentFooterView { @@ -556,9 +557,18 @@ struct commentFooterView {
556 width: 16, 557 width: 16,
557 height: 16 558 height: 16
558 }) 559 })
559 -  
560 } 560 }
561 .onClick(() => { 561 .onClick(() => {
  562 + this.clickLike()
  563 + })
  564 + }
  565 + }
  566 + .justifyContent(FlexAlign.SpaceBetween)
  567 + .width('100%')
  568 + .height(30)
  569 + }
  570 +
  571 + clickLike() {
562 // 未登录,跳转登录 572 // 未登录,跳转登录
563 const user_id = HttpUtils.getUserId() 573 const user_id = HttpUtils.getUserId()
564 if (!user_id) { 574 if (!user_id) {
@@ -570,12 +580,6 @@ struct commentFooterView { @@ -570,12 +580,6 @@ struct commentFooterView {
570 }).catch(() => { 580 }).catch(() => {
571 commentLikeChange(this.item) 581 commentLikeChange(this.item)
572 }) 582 })
573 - })  
574 -  
575 - }  
576 - .justifyContent(FlexAlign.SpaceBetween)  
577 - .width('100%')  
578 - .height(30)  
579 } 583 }
580 } 584 }
581 585