陈剑华

feat: 18041 号主>文章、动态列表,不需要展示评论数元素

... ... @@ -9,6 +9,10 @@ export struct CardSourceInfo {
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
aboutToAppear(): void {
}
handleTimeStr() {
return DateTimeUtils.getCommentTime(
this.contentDTO.publishTime.includes(' ')
... ... @@ -36,6 +40,11 @@ export struct CardSourceInfo {
return flag;
}
showCommentNum() {
const curRouter = router.getState().name;
return curRouter !== 'PeopleShipHomePage'
}
/**
* 全域数字显示规则
* 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
... ... @@ -132,7 +141,7 @@ export struct CardSourceInfo {
.flexShrink(0)
.margin({right: 4})
}
if (this.getContentDtoBean()?.interactData?.commentNum) {
if (this.getContentDtoBean()?.interactData?.commentNum && this.showCommentNum()) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
... ...