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
yumaochao
2024-05-24 16:18:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
be7b05e1236d9080d2db488e5ebbe4ec9c733b5e
be7b05e1
1 parent
a8f41da4
fix:somebug
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
be7b05e
...
...
@@ -36,18 +36,7 @@ export struct Card2Component {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
}
calculateTextIndent() {
if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) {
return 58;
} else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) {
// 当newTags或seoTags存在时,应用相同的缩进
return 35;
} else if (this.contentDTO.objectType == '5') {
return 35;
} else {
return 0;
}
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
...
...
@@ -75,6 +64,15 @@ export struct Card2Component {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
//新闻标题
// if (this.contentDTO.newTags) {
//
// //Notes({ newTags: this.contentDTO.newTags })
// } else if (this.contentDTO.objectType == '5') {
//
// //Notes({ objectType: this.contentDTO.objectType })
// }
Text() {
if (this.titleMarked) {
Span(this.str01)
...
...
@@ -91,11 +89,9 @@ export struct Card2Component {
.lineHeight(27)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent(
(this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5) ? 58 :
.textIndent( (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5) ? 58 :
(this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 :
0
)
0 )
}.alignContent(Alignment.TopStart)
//.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
...
...
Please
register
or
login
to post a comment