chenjun

单图卡,小视频卡 来源需要控制16个字

大图卡,三图卡,来源可以展示一行的就不需要控制16个字
import { CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
import { DateTimeUtils, Logger } from 'wdKit/Index';
import router from '@ohos.router'
... ... @@ -20,9 +20,16 @@ export struct CardSourceInfo {
this.processText();
}
private isLimited(): boolean {
return this.compDTO.compStyle === CompStyle.Card_13
|| this.compDTO.compStyle === CompStyle.Card_14
|| this.compDTO.compStyle === CompStyle.Card_06
|| this.compDTO.compStyle === CompStyle.Card_21;
}
processText() {
const sourceText = this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source;
if (sourceText.length > this.maxLength) {
if (this.isLimited() && sourceText.length > this.maxLength) {
this.displayText = sourceText.substring(0, this.maxLength) + '...';
this.isEllipsisActive = true;
} else {
... ...