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
chenjun
2024-08-14 13:40:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9a461ab5f45d73aaf5d732fb2f5e02892a37eb94
9a461ab5
1 parent
96cdd65a
19996 卡片来源显示规则,评论数未展示
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
View file @
9a461ab
...
...
@@ -64,11 +64,13 @@ export struct CardSourceInfo {
}
handleTimeStr() {
return
DateTimeUtils.getCommentTime(
let str =
DateTimeUtils.getCommentTime(
this.contentDTO.publishTime.includes(' ')
? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())
: Number.parseFloat(this.contentDTO.publishTime)
)
console.log('cj2024 str', str)
return str
}
showTime() {
...
...
@@ -80,6 +82,7 @@ export struct CardSourceInfo {
let flag: boolean = false;
if (curRouter === 'MainPage') {
if (this.isTwoDaysAgo(publishTime)) {
console.log('cj2024 isTwoDaysAgo', this.isTwoDaysAgo(publishTime))
flag = false
} else {
flag = true;
...
...
@@ -87,6 +90,7 @@ export struct CardSourceInfo {
} else {
flag = true;
}
console.log('cj2024 flag', flag)
return flag;
}
...
...
@@ -156,26 +160,24 @@ export struct CardSourceInfo {
}
// 点
if (this.showTime()) {
if (((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
(this.getContentDtoBean()?.interactData?.commentNum
// || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
|| (this.contentDTO.isSearch || this.contentDTO.isCollection ||
!this.contentDTO.isSearch && DateTimeUtils.getCommentTime
(Number
.parseFloat(this
.contentDTO.publishTime))
.indexOf
('-') === -1)
)) {
Image($r("app.media.point"))
.width(11)
.height(11)
.visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden)
if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
(this.getContentDtoBean()?.interactData?.commentNum
// || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
|| (this.contentDTO.isSearch || this.contentDTO.isCollection ||
!this.contentDTO.isSearch && DateTimeUtils.getCommentTime
(Number
.parseFloat(this
.contentDTO.publishTime))
.indexOf
('-') === -1)
)) {
Image($r("app.media.point"))
.width(11)
.height(11)
.visibility(!this.isEllipsisActive ? Visibility.Visible : Visibility.Hidden)
}
}
// 发布日期
...
...
@@ -189,7 +191,8 @@ export struct CardSourceInfo {
}
// 评论数
if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
// if (!this.contentDTO.cornerMark && !this.contentDTO.corner && !this.isEllipsisActive) {
if (!this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
...
...
Please
register
or
login
to post a comment