陈剑华

fix: 20364 人民号>推荐,推荐动态内容,号主简介较长时缺少省略,与关注按钮重叠。

... ... @@ -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(()=>{
///个人主页 动态头像不能跳转
... ...