王士厅

fix:功能缺陷-【uat】进入视频直播-肌少症--小心跌倒,点击评论按钮,进入全部评论,底部点赞图标显示和android不一致,看图

@@ -58,6 +58,7 @@ export struct LikeComponent { @@ -58,6 +58,7 @@ export struct LikeComponent {
58 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false 58 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
59 } 59 }
60 console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData)) 60 console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
  61 + console.log(TAG, 'this.componentType', this.componentType)
61 console.log(TAG, 'this.likesStyle', this.likesStyle) 62 console.log(TAG, 'this.likesStyle', this.likesStyle)
62 console.log(TAG, 'this.openLikes', this.openLikes) 63 console.log(TAG, 'this.openLikes', this.openLikes)
63 this.onDataUpdated() 64 this.onDataUpdated()
@@ -93,7 +94,7 @@ export struct LikeComponent { @@ -93,7 +94,7 @@ export struct LikeComponent {
93 //卡片底部互动样式 94 //卡片底部互动样式
94 this.likeCompStyle3() 95 this.likeCompStyle3()
95 } else if (this.componentType == 4) { 96 } else if (this.componentType == 4) {
96 - // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 97 + // 使用包括频道视频底部点赞
97 this.likeCompStyle4() 98 this.likeCompStyle4()
98 } else if (this.componentType == 5) { 99 } else if (this.componentType == 5) {
99 // 图集点赞,展示标识 100 // 图集点赞,展示标识
@@ -286,38 +287,57 @@ export struct LikeComponent { @@ -286,38 +287,57 @@ export struct LikeComponent {
286 287
287 @Builder 288 @Builder
288 likeCompStyle4() { 289 likeCompStyle4() {
289 - Stack({ alignContent: Alignment.Bottom }) {  
290 - Column() {  
291 - Image(this.transLikeStyle().url)  
292 - .width(24)  
293 - .height(24)  
294 - .onClick(() => {  
295 - this.clickButtonEvent()  
296 - })  
297 - }  
298 - .justifyContent(FlexAlign.Center)  
299 - .width(36)  
300 - .height(36)  
301 - .borderRadius(18) 290 + Stack({ alignContent: Alignment.TopEnd }) {
  291 + Image(this.transLikeStyle().url)
  292 + .width(24)
  293 + .height(24)
302 .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') 294 .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
303 - Row() {  
304 - Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))  
305 - .fontSize(8)  
306 - .fontColor(Color.White)  
307 - .padding({ left: 8, right: 2 }) 295 + if (this.likeCount != 0) {
  296 + RelativeContainer() {
  297 + Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
  298 + .objectFit(ImageFit.Fill)
  299 + .resizable({
  300 + slice: {
  301 + top: 1,
  302 + left: 20,
  303 + right: 1,
  304 + bottom: 1
  305 + }
  306 + })
  307 + .alignRules({
  308 + top: { anchor: "Text", align: VerticalAlign.Top },
  309 + left: { anchor: "Text", align: HorizontalAlign.Start },
  310 + right: { anchor: "Text", align: HorizontalAlign.End },
  311 + bottom: { anchor: "Text", align: VerticalAlign.Bottom },
  312 + })
  313 + .id("Image")
  314 +
  315 + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444")
  316 + .fontSize(8)
  317 + .fontColor(Color.White)
  318 + .height(12)
  319 + .textAlign(TextAlign.Center)
  320 + .alignRules({
  321 + top: { anchor: "__container__", align: VerticalAlign.Top },
  322 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  323 + })
  324 + /*动态计算文字宽度*/
  325 + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +
  326 + 8)
  327 + .padding({left:2})
  328 + .id("Text")
  329 + .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
  330 + }
  331 + .offset({
  332 + x: 12
  333 + })
308 } 334 }
309 - .height(12)  
310 - .alignItems(VerticalAlign.Center)  
311 - .position({ x: '100%', y: 10 })  
312 - .markAnchor({ x: '100%' })  
313 - .backgroundImage($r('app.media.ic_like_back'))  
314 - .backgroundImageSize({height: 13})  
315 - .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +  
316 - 12)  
317 - .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)  
318 } 335 }
319 - .width(36)  
320 - .height(42) 336 + .width(24)
  337 + .height(24)
  338 + .onClick(() => {
  339 + this.clickButtonEvent()
  340 + })
321 .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) 341 .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
322 342
323 } 343 }