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-09-20 13:44:40 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bbbbdc9d378b4ba58bd984cd4d8579b0606b1b2a
bbbbdc9d
1 parent
d04c9451
fix: 20364 人民号>推荐,推荐动态内容,号主简介较长时缺少省略,与关注按钮重叠。
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 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 @
bbbbdc9
...
...
@@ -121,7 +121,11 @@ export struct RmhTitle {
const time1 = new Date().getTime(); // 今天日期的时间戳
const time2 = new Date(date).getTime(); // 要比较日期的时间戳
const diffDays = Math.round(Math.abs((time1 - time2) / oneDay)); // 两个日期时间戳差值除以一天的毫秒数得到天数,取绝对值并四舍五入
return Math.ceil(diffDays);
return diffDays;
}
showTime() {
return !(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)
}
build() {
...
...
@@ -158,7 +162,7 @@ export struct RmhTitle {
// Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) {
Row() {
if (
!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2
)) {
if (
this.showTime(
)) {
if (this.publishTime) {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
.fontSize($r("app.float.font_size_12"))
...
...
@@ -182,16 +186,19 @@ export struct RmhTitle {
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
.constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))})
.width('calc(100% - 54vp)')
// .constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))})
}
}
.height(14)
.align(Alignment.Start)
.width('100%')
// }
// .width('calc(100% - 36vp - 8vp)')
}
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
Blank()
if (this.rmhInfo?.cnIsAttention) {
...
...
@@ -207,14 +214,17 @@ export struct RmhTitle {
.fontSize($r('app.float.font_size_13'))
.fontColor(Number(this.followStatus) === 0 ? $r('app.color.color_ED2800') : 0xc6c6c6)
}.margin({top:4})
.height(36)
}
.flexShrink(0)
.onClick(() => {
this.handleAccention();
})
.height(36)
}
}
.width(CommonConstants.FULL_WIDTH)
.height(36)
.margin({ bottom: 10 })
.onClick(()=>{
///个人主页 动态头像不能跳转
...
...
Please
register
or
login
to post a comment