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
陈剑华
2024-05-15 15:59:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fffd601fb04abb7fcfc9e1061d9bfad1a6c8cb9f
fffd601f
1 parent
804578e8
fix: 17150 debug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
fffd601
...
...
@@ -17,12 +17,26 @@ export struct Card6Component {
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
async aboutToAppear(): Promise<void> {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
// this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
if (this.contentDTO.title.includes('<em>') && this.contentDTO.title.includes('</em>')) {
this.titleMarked = true;
this.str01 = this.contentDTO.newsTitle?.split('<em>')[0] || '';
this.str02 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[0] || '';
this.str03 = this.contentDTO.newsTitle?.split('<em>')[1].split('</em>')[1] || '';
}
}
build() {
Row() {
Column() {
...
...
@@ -44,7 +58,16 @@ export struct Card6Component {
Notes({ objectType: this.contentDTO.objectType })
}
Text(`${this.contentDTO.newsTitle}`)
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(this.contentDTO.newsTitle)
}
}
.fontColor(this.clicked ? 0x848484 : 0x222222)
.fontSize(16)
.lineHeight(24)
...
...
Please
register
or
login
to post a comment