chenjun

19996 卡片来源显示规则,评论数未展示

@@ -64,11 +64,13 @@ export struct CardSourceInfo { @@ -64,11 +64,13 @@ export struct CardSourceInfo {
64 } 64 }
65 65
66 handleTimeStr() { 66 handleTimeStr() {
67 - return DateTimeUtils.getCommentTime( 67 + let str = DateTimeUtils.getCommentTime(
68 this.contentDTO.publishTime.includes(' ') 68 this.contentDTO.publishTime.includes(' ')
69 ? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString()) 69 ? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())
70 : Number.parseFloat(this.contentDTO.publishTime) 70 : Number.parseFloat(this.contentDTO.publishTime)
71 ) 71 )
  72 + console.log('cj2024 str', str)
  73 + return str
72 } 74 }
73 75
74 showTime() { 76 showTime() {
@@ -80,6 +82,7 @@ export struct CardSourceInfo { @@ -80,6 +82,7 @@ export struct CardSourceInfo {
80 let flag: boolean = false; 82 let flag: boolean = false;
81 if (curRouter === 'MainPage') { 83 if (curRouter === 'MainPage') {
82 if (this.isTwoDaysAgo(publishTime)) { 84 if (this.isTwoDaysAgo(publishTime)) {
  85 + console.log('cj2024 isTwoDaysAgo', this.isTwoDaysAgo(publishTime))
83 flag = false 86 flag = false
84 } else { 87 } else {
85 flag = true; 88 flag = true;
@@ -87,6 +90,7 @@ export struct CardSourceInfo { @@ -87,6 +90,7 @@ export struct CardSourceInfo {
87 } else { 90 } else {
88 flag = true; 91 flag = true;
89 } 92 }
  93 + console.log('cj2024 flag', flag)
90 return flag; 94 return flag;
91 } 95 }
92 96
@@ -156,26 +160,24 @@ export struct CardSourceInfo { @@ -156,26 +160,24 @@ export struct CardSourceInfo {
156 } 160 }
157 161
158 // 点 162 // 点
159 - if (this.showTime()) {  
160 - if (((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&  
161 - this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&  
162 - (this.getContentDtoBean()?.interactData?.commentNum  
163 - // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''  
164 - || (this.contentDTO.isSearch || this.contentDTO.isCollection ||  
165 - !this.contentDTO.isSearch && DateTimeUtils.getCommentTime  
166 - (Number  
167 - .parseFloat(this  
168 - .contentDTO.publishTime))  
169 - .indexOf  
170 - ('-') === -1)  
171 - )) {  
172 -  
173 - Image($r("app.media.point"))  
174 - .width(11)  
175 - .height(11)  
176 - .visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden) 163 + if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
  164 + this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
  165 + (this.getContentDtoBean()?.interactData?.commentNum
  166 + // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
  167 + || (this.contentDTO.isSearch || this.contentDTO.isCollection ||
  168 + !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
  169 + (Number
  170 + .parseFloat(this
  171 + .contentDTO.publishTime))
  172 + .indexOf
  173 + ('-') === -1)
  174 + )) {
  175 +
  176 + Image($r("app.media.point"))
  177 + .width(11)
  178 + .height(11)
  179 + .visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden)
177 180
178 - }  
179 } 181 }
180 182
181 // 发布日期 183 // 发布日期
@@ -189,7 +191,8 @@ export struct CardSourceInfo { @@ -189,7 +191,8 @@ export struct CardSourceInfo {
189 } 191 }
190 192
191 // 评论数 193 // 评论数
192 - if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) { 194 + // if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
  195 + if (!this.isEllipsisActive) {
193 if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && 196 if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
194 this.showCommentNum()) { 197 this.showCommentNum()) {
195 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) 198 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)