陈剑华

fix: 16813 精选评论卡,点击点赞按钮没有反应;爱心和android 展示不一致

@@ -30,6 +30,7 @@ const TAG = 'Zh_Single_Row-06' @@ -30,6 +30,7 @@ const TAG = 'Zh_Single_Row-06'
30 @Component 30 @Component
31 export struct ZhSingleRow06 { 31 export struct ZhSingleRow06 {
32 @State compDTO: CompDTO = {} as CompDTO 32 @State compDTO: CompDTO = {} as CompDTO
  33 + @State likeBl: boolean = false;
33 34
34 build() { 35 build() {
35 Column() { 36 Column() {
@@ -81,7 +82,7 @@ export struct ZhSingleRow06 { @@ -81,7 +82,7 @@ export struct ZhSingleRow06 {
81 .fontColor(0x999999) 82 .fontColor(0x999999)
82 83
83 Row(){ 84 Row(){
84 - Image($r('app.media.icon_like_no')) 85 + Image(this.likeBl ? $r('app.media.icon_like_select') : $r('app.media.icon_like'))
85 .width(16) 86 .width(16)
86 .height(16) 87 .height(16)
87 .margin({right: 3}) 88 .margin({right: 3})
@@ -90,6 +91,13 @@ export struct ZhSingleRow06 { @@ -90,6 +91,13 @@ export struct ZhSingleRow06 {
90 .fontSize(14) 91 .fontSize(14)
91 .fontColor(0x999999) 92 .fontColor(0x999999)
92 } 93 }
  94 + .onClick(() => {
  95 + if (this.likeBl) {
  96 + this.likeBl = false;
  97 + } else {
  98 + this.likeBl = true;
  99 + }
  100 + })
93 } 101 }
94 .justifyContent(FlexAlign.SpaceBetween) 102 .justifyContent(FlexAlign.SpaceBetween)
95 .width('100%') 103 .width('100%')