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-09 10:54:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fd93f4b269c94ff92c4075ae88be69a14a307c0c
fd93f4b2
1 parent
1bba8e8e
单图卡,小视频卡 来源需要控制16个字
大图卡,三图卡,来源可以展示一行的就不需要控制16个字
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 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 @
fd93f4b
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 {
...
...
Please
register
or
login
to post a comment