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-08 19:23:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5a9b92fa4f8e5e56437320b13473265ebdf17be8
5a9b92fa
1 parent
171266e0
ref |> 处理底部评论数量为0时,不显示
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
View file @
5a9b92f
...
...
@@ -87,45 +87,45 @@ export struct CommentIconComponent {
Stack({ alignContent: Alignment.TopEnd }) {
Image($r('app.media.comment_icon')).width(24).height(24)
// Stack({alignContent:Alignment.Start}) {
// if(Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0){
RelativeContainer() {
Image($r('app.media.comment_icon_number_bg'))
.objectFit(ImageFit.Fill)
.resizable({ slice: { top: 1, left: 20, right: 1, bottom: 1 } })
.alignRules({
top: { anchor: "Text", align: VerticalAlign.Top },
left: { anchor: "Text", align: HorizontalAlign.Start },
right: { anchor: "Text", align: HorizontalAlign.End },
bottom: { anchor: "Text", align: VerticalAlign.Bottom },
})// .offset({
// x:-6
// })
.id("Image")
Text(this.publishCommentModel.totalCommentNumer)// Text("44444444")
.fontSize(8)
.fontColor('#ffffff')// .backgroundColor('#ED2800')
.height(12)
.textAlign(TextAlign.Center)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})// .margin({left: 4,right:4
// })
/*动态计算文字宽度*/
.width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + 12)// .backgroundColor(Color.Green)
.id("Text")
// .offset({
// x: 3
// })
if(Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0){
RelativeContainer() {
Image($r('app.media.comment_icon_number_bg'))
.objectFit(ImageFit.Fill)
.resizable({ slice: { top: 1, left: 20, right: 1, bottom: 1 } })
.alignRules({
top: { anchor: "Text", align: VerticalAlign.Top },
left: { anchor: "Text", align: HorizontalAlign.Start },
right: { anchor: "Text", align: HorizontalAlign.End },
bottom: { anchor: "Text", align: VerticalAlign.Bottom },
})// .offset({
// x:-6
// })
.id("Image")
Text(this.publishCommentModel.totalCommentNumer)// Text("44444444")
.fontSize(8)
.fontColor('#ffffff')// .backgroundColor('#ED2800')
.height(12)
.textAlign(TextAlign.Center)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})// .margin({left: 4,right:4
// })
/*动态计算文字宽度*/
.width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + 12)// .backgroundColor(Color.Green)
.id("Text")
// .offset({
// x: 3
// })
}
// }
.offset({
x: 12
})
}
// }
.offset({
x: 12
})
// }
}
}.width(24).height(24)
...
...
Please
register
or
login
to post a comment