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:30:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3d70f919c19f181872c1a1fca0eecffc31d06397
3d70f919
1 parent
be7b05e1
fix:somebug
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
24 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
3d70f91
...
...
@@ -50,17 +50,27 @@ export struct Card2Component {
Column() {
Column() {
Stack() {
// if(this.contentDTO.objectType == '5'){
// Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
// }else if(this.contentDTO.objectType == '2'){
// if(this.contentDTO.seoTags){
// Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
// }else if(this.contentDTO.newTags){
// Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
//
// }
// }else {
// if(this.contentDTO.newTags){
// Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
// }
// }
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
}else if(this.contentDTO.objectType == '2'){
if(this.contentDTO.seoTags){
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}else if(this.contentDTO.newTags){
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}else {
if(this.contentDTO.newTags){
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
...
...
@@ -89,8 +99,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 :
(this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 :
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
3d70f91
...
...
@@ -32,19 +32,6 @@ export struct Card6Component {
this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
}
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;
...
...
@@ -74,7 +61,8 @@ export struct Card6Component {
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
} else if (this.contentDTO.newTags) {
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
...
...
@@ -97,7 +85,10 @@ export struct Card6Component {
.maxLines(3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(this.calculateTextIndent())
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
}
...
...
Please
register
or
login
to post a comment