Showing
1 changed file
with
20 additions
and
5 deletions
| @@ -22,7 +22,7 @@ interface ILikeStyleResp { | @@ -22,7 +22,7 @@ interface ILikeStyleResp { | ||
| 22 | export struct LikeComponent { | 22 | export struct LikeComponent { |
| 23 | @Consume contentDetailData: ContentDetailDTO | 23 | @Consume contentDetailData: ContentDetailDTO |
| 24 | @Prop pageComponentType: number | 24 | @Prop pageComponentType: number |
| 25 | - @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 25 | + @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 26 | @State likeStatus: boolean = false | 26 | @State likeStatus: boolean = false |
| 27 | viewModel: LikeViewModel = new LikeViewModel() | 27 | viewModel: LikeViewModel = new LikeViewModel() |
| 28 | @Prop @Watch('onDataUpdated') data: Record<string, string> | 28 | @Prop @Watch('onDataUpdated') data: Record<string, string> |
| @@ -41,6 +41,14 @@ export struct LikeComponent { | @@ -41,6 +41,14 @@ export struct LikeComponent { | ||
| 41 | // this.data['status'] = "1" | 41 | // this.data['status'] = "1" |
| 42 | 42 | ||
| 43 | aboutToAppear() { | 43 | aboutToAppear() { |
| 44 | + // 2:竖屏直播页 3:图集 4:横屏直播页 | ||
| 45 | + if(this.pageComponentType == 2 || this.pageComponentType == 4) { | ||
| 46 | + // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | ||
| 47 | + this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle | ||
| 48 | + } else { | ||
| 49 | + // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | ||
| 50 | + this.likesStyle = this.contentDetailData.likesStyle | ||
| 51 | + } | ||
| 44 | this.onDataUpdated() | 52 | this.onDataUpdated() |
| 45 | } | 53 | } |
| 46 | 54 | ||
| @@ -80,7 +88,7 @@ export struct LikeComponent { | @@ -80,7 +88,7 @@ export struct LikeComponent { | ||
| 80 | * 将点赞样式转换为icon | 88 | * 将点赞样式转换为icon |
| 81 | */ | 89 | */ |
| 82 | transLikeStyle(): ILikeStyleResp { | 90 | transLikeStyle(): ILikeStyleResp { |
| 83 | - if (this.likesStyle === 1) { | 91 | + if (this.likesStyle === 1 || this.likesStyle === 'love' || this.likesStyle === 'thumb') { |
| 84 | return { | 92 | return { |
| 85 | url: this.likeStatus ? $r(`app.media.ic_like_check`) : | 93 | url: this.likeStatus ? $r(`app.media.ic_like_check`) : |
| 86 | this.styleType == 1 ? | 94 | this.styleType == 1 ? |
| @@ -88,12 +96,12 @@ export struct LikeComponent { | @@ -88,12 +96,12 @@ export struct LikeComponent { | ||
| 88 | $r(`app.media.ic_like_uncheck`), | 96 | $r(`app.media.ic_like_uncheck`), |
| 89 | name: '赞' | 97 | name: '赞' |
| 90 | } | 98 | } |
| 91 | - } else if (this.likesStyle === 2) { | 99 | + } else if (this.likesStyle === 2 || this.likesStyle === 'pray') { |
| 92 | return { | 100 | return { |
| 93 | url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), | 101 | url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), |
| 94 | name: '祈祷' | 102 | name: '祈祷' |
| 95 | } | 103 | } |
| 96 | - } else if (this.likesStyle === 3) { | 104 | + } else if (this.likesStyle === 3 || this.likesStyle === 'mourning') { |
| 97 | return { | 105 | return { |
| 98 | url: this.likeStatus ? $r(`app.media.ic_candle_check`) : | 106 | url: this.likeStatus ? $r(`app.media.ic_candle_check`) : |
| 99 | $r(`app.media.ic_candle_uncheck`), | 107 | $r(`app.media.ic_candle_uncheck`), |
| @@ -143,6 +151,7 @@ export struct LikeComponent { | @@ -143,6 +151,7 @@ export struct LikeComponent { | ||
| 143 | } | 151 | } |
| 144 | .width(154) | 152 | .width(154) |
| 145 | .height(40) | 153 | .height(40) |
| 154 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 146 | } | 155 | } |
| 147 | 156 | ||
| 148 | @Builder | 157 | @Builder |
| @@ -160,6 +169,7 @@ export struct LikeComponent { | @@ -160,6 +169,7 @@ export struct LikeComponent { | ||
| 160 | .onClick(() => { | 169 | .onClick(() => { |
| 161 | this.clickButtonEvent() | 170 | this.clickButtonEvent() |
| 162 | }) | 171 | }) |
| 172 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 163 | } | 173 | } |
| 164 | 174 | ||
| 165 | @Builder | 175 | @Builder |
| @@ -173,7 +183,10 @@ export struct LikeComponent { | @@ -173,7 +183,10 @@ export struct LikeComponent { | ||
| 173 | .onClick(() => { | 183 | .onClick(() => { |
| 174 | this.clickButtonEvent() | 184 | this.clickButtonEvent() |
| 175 | }) | 185 | }) |
| 176 | - }.width(24).height(24) | 186 | + } |
| 187 | + .width(24) | ||
| 188 | + .height(24) | ||
| 189 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 177 | } | 190 | } |
| 178 | 191 | ||
| 179 | @Builder | 192 | @Builder |
| @@ -248,6 +261,7 @@ export struct LikeComponent { | @@ -248,6 +261,7 @@ export struct LikeComponent { | ||
| 248 | }.width(24).height(24).onClick(() => { | 261 | }.width(24).height(24).onClick(() => { |
| 249 | this.clickButtonEvent() | 262 | this.clickButtonEvent() |
| 250 | }) | 263 | }) |
| 264 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 251 | } | 265 | } |
| 252 | 266 | ||
| 253 | @Builder | 267 | @Builder |
| @@ -284,6 +298,7 @@ export struct LikeComponent { | @@ -284,6 +298,7 @@ export struct LikeComponent { | ||
| 284 | } | 298 | } |
| 285 | .width(36) | 299 | .width(36) |
| 286 | .height(42) | 300 | .height(42) |
| 301 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 287 | 302 | ||
| 288 | } | 303 | } |
| 289 | 304 |
-
Please register or login to post a comment