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
陈剑华
2024-10-09 14:03:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7cdb74b1e0f2e2c3e2c08ccabf132e80f077c30d
7cdb74b1
1 parent
8d6438ec
fix: 19531 【UI走查-卡片】折叠屏展开-人民号单图卡
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
View file @
7cdb74b
...
...
@@ -134,6 +134,10 @@ export struct RmhTitle {
return this.rmhInfo?.cnIsAttention && this.rmhInfo?.userType != "5"
}
getFollowText() {
return Number(this.followStatus) === 0 ? '关注' : '已关注'
}
build() {
Flex() {
if (this.rmhInfo.userType != '5') {
...
...
@@ -201,8 +205,17 @@ export struct RmhTitle {
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
.width('calc(100% - 65vp)')
// .constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))})
// .width('calc(100% - 65vp)')
.constraintSize({
maxWidth:(
DisplayUtils.getDeviceWidth()
- 32
- 8 - 12
- 36
- (this.hasRightFollow() ? (19 + 6 + this.getTextWidth(this.getFollowText(), $r('app.float.font_size_13'))) : 0)
- this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)), $r("app.float.font_size_12"))
)
})
}
}
...
...
@@ -226,7 +239,7 @@ export struct RmhTitle {
.margin({right: 3})
}
Text(
Number(this.followStatus) === 0 ? '关注' : '已关注'
)
Text(
this.getFollowText()
)
.fontSize($r('app.float.font_size_13'))
.fontWeight(600)
.fontColor(Number(this.followStatus) === 0 ? $r('app.color.color_ED2800') : 0xc6c6c6)
...
...
@@ -266,10 +279,10 @@ export struct RmhTitle {
}
// 获取文本宽度
private getTextWidth(text: string) {
private getTextWidth(text: string
, fontSize: Resource
) {
let size = measure.measureTextSize({
textContent: text,
fontSize:
$r("app.float.font_size_12")
fontSize:
fontSize
})
return px2vp(Number(size.width))
}
...
...
Please
register
or
login
to post a comment