陈剑华

fix: 19347 卡片来源显示规则-来源过长时,不符合省略优先级

... ... @@ -100,12 +100,6 @@ export struct CardSourceInfo {
return flag;
}
showCommentNum() {
const curRouter = router.getState().name;
// return curRouter !== 'PeopleShipHomePage'
return true
}
/**
* 全域数字显示规则
* 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
... ... @@ -150,25 +144,12 @@ export struct CardSourceInfo {
}
showDot() {
// return (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)
// )
let flag = false;
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
if (this.showTime() && !this.isEllipsisActive) {
flag = true
} else if (!this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) {
flag = true;
} else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
flag = true;
... ... @@ -271,10 +252,8 @@ export struct CardSourceInfo {
}
// 评论数
// 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()) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
.fontSize(12)
.fontColor($r("app.color.color_B0B0B0"))
... ... @@ -328,17 +307,11 @@ export struct CardSourceInfo {
* @returns
*/
private getContentDtoBean(): ContentDTO {
let content = new ContentDTO
if (this.compDTO == undefined) {
content = this.contentDTO
}
if (this.compDTO.operDataList.length == 0) {
content = this.contentDTO
}
if (!content) {
content = this.compDTO.operDataList[0]
if (this.compDTO.operDataList.length > 0) {
return this.compDTO.operDataList[0]
} else {
return this.contentDTO
}
return content;
}
/**
... ... @@ -366,8 +339,7 @@ export struct CardSourceInfo {
}
// 评论数
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0) {
have = true
} else {
if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
... ...