陈剑华

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

@@ -9,6 +9,10 @@ export struct CardSourceInfo { @@ -9,6 +9,10 @@ export struct CardSourceInfo {
9 @State contentDTO: ContentDTO = new ContentDTO(); 9 @State contentDTO: ContentDTO = new ContentDTO();
10 @ObjectLink compDTO: CompDTO 10 @ObjectLink compDTO: CompDTO
11 11
  12 + aboutToAppear(): void {
  13 +
  14 + }
  15 +
12 handleTimeStr() { 16 handleTimeStr() {
13 return DateTimeUtils.getCommentTime( 17 return DateTimeUtils.getCommentTime(
14 this.contentDTO.publishTime.includes(' ') 18 this.contentDTO.publishTime.includes(' ')
@@ -36,6 +40,11 @@ export struct CardSourceInfo { @@ -36,6 +40,11 @@ export struct CardSourceInfo {
36 return flag; 40 return flag;
37 } 41 }
38 42
  43 + showCommentNum() {
  44 + const curRouter = router.getState().name;
  45 + return curRouter !== 'PeopleShipHomePage'
  46 + }
  47 +
39 /** 48 /**
40 * 全域数字显示规则 49 * 全域数字显示规则
41 * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 50 * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
@@ -132,7 +141,7 @@ export struct CardSourceInfo { @@ -132,7 +141,7 @@ export struct CardSourceInfo {
132 .flexShrink(0) 141 .flexShrink(0)
133 .margin({right: 4}) 142 .margin({right: 4})
134 } 143 }
135 - if (this.getContentDtoBean()?.interactData?.commentNum) { 144 + if (this.getContentDtoBean()?.interactData?.commentNum && this.showCommentNum()) {
136 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) 145 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
137 .fontSize($r("app.float.font_size_11")) 146 .fontSize($r("app.float.font_size_11"))
138 .fontColor($r("app.color.color_B0B0B0")) 147 .fontColor($r("app.color.color_B0B0B0"))