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-27 13:59:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d0ff90e7493aac8a14f1c9aebbf852a7f17b5a73
d0ff90e7
1 parent
ab4ea936
feat: 18020 大图卡组件样式,搜索结果中标题展示不全、标签元素缺失
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
34 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
d0ff90e
...
...
@@ -32,6 +32,12 @@ export struct CardParser {
pageShowTime:number = 0;
pageHideTime:number = 0;
aboutToAppear(): void {
console.log('CardParser-contentDTO', JSON.stringify(this.contentDTO))
console.log('CardParser-compDTO', JSON.stringify(this.compDTO))
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
View file @
d0ff90e
...
...
@@ -77,8 +77,15 @@ export struct Card10Component {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center).margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
}.alignContent(Alignment.BottomStart)
...
...
@@ -128,8 +135,15 @@ export struct Card10Component {
Row() {
Column() {
Stack() {
if (item.objectType == '5') {
Notes({ objectType: 5 })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
...
...
@@ -137,7 +151,10 @@ export struct Card10Component {
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(item.objectType == '5' ? 38 : 0)
.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)
//bottom 评论等信息
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
View file @
d0ff90e
...
...
@@ -38,10 +38,15 @@ export struct Card11Component {
build() {
Column() {
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
...
...
@@ -63,9 +68,10 @@ export struct Card11Component {
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.width(CommonConstants.FULL_WIDTH)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.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/Card3Component.ets
View file @
d0ff90e
...
...
@@ -36,10 +36,20 @@ export struct Card3Component {
build() {
Column() {
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
// if (this.contentDTO.newTags) {
// Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
// } else if (this.contentDTO.objectType == '5') {
// Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
// }
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
...
...
@@ -59,9 +69,10 @@ export struct Card3Component {
.fontSize($r("app.float.font_size_18"))
.fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
.width(CommonConstants.FULL_WIDTH)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.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/Card4Component.ets
View file @
d0ff90e
...
...
@@ -46,10 +46,15 @@ export struct Card4Component {
//body
Column() {
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(19).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
...
...
@@ -69,9 +74,10 @@ export struct Card4Component {
.fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 30 : 0)
.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/Card5Component.ets
View file @
d0ff90e
...
...
@@ -57,10 +57,15 @@ export struct Card5Component {
})
Row() {
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags })
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
}
}
Text() {
...
...
@@ -83,9 +88,10 @@ export struct Card5Component {
.maxLines(2)
.align(Alignment.TopStart)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.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)
}
.justifyContent(FlexAlign.Start)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
View file @
d0ff90e
...
...
@@ -88,10 +88,16 @@ export struct Card9Component {
topLeft: $r('app.float.image_border_radius'),
topRight: $r('app.float.image_border_radius')
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
.margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
}
}
}.alignContent(Alignment.BottomStart)
...
...
Please
register
or
login
to post a comment