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-08-22 16:54:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4c0159a4c52a4a249ec962b119a280aba739d019
4c0159a4
1 parent
93c83999
fix: 标签问题优化
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
41 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/notes.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
sight_harmony/features/wdComponent/src/main/ets/utils/FuncUtils.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
View file @
4c0159a
...
...
@@ -222,13 +222,7 @@ export struct Card10ComponentTimelineItem {
.fontColor(this.isRead ? 0x848484 : '#222222')
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
)
)
.textIndent(this.slideItem.objectType == '5' ? 38 : 0)
}.alignContent(Alignment.TopStart)
Blank()
...
...
@@ -271,13 +265,7 @@ export struct Card10ComponentTimelineItem {
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
)
)
.textIndent(this.slideItem.objectType == '5' ? 38 : 0)
}.alignContent(Alignment.TopStart)
//bottom 评论等信息
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/notes.ets
View file @
4c0159a
...
...
@@ -13,10 +13,10 @@ export struct Notes {
@State objectLevel: number | string = -1
@State newTags: string = ''
@State seoTags: string = ''
@State marginTop: number =
0
;
@State marginTop: number =
-1
;
build() {
if (
this.returnTypeTitleFn(
)) {
if (
returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel
)) {
Text(returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel))
.fontSize($r('app.float.font_size_11'))
.padding({
...
...
@@ -31,23 +31,4 @@ export struct Notes {
.margin({ top: this.marginTop})
}
}
returnTypeTitleFn(): string {
if (this.newTags) {
return this.newTags
}
if (this.objectType == 5) {
if (this.objectLevel == 24) {
return '调查'
}
return '专题'
}
if (this.objectType == 10) {
return 'H5'
}
if (this.objectType == 8) {
return '文章'
}
return ''
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
View file @
4c0159a
...
...
@@ -223,13 +223,13 @@ struct CarouselLayout01CardView {
// 文本信息
Stack() {
if(this.item.objectType == '5'){
Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel })
Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel
, marginTop: 4
})
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
Notes({ newTags: this.item.seoTags
, marginTop: 4
})
}
if (this.item.newTags) {
Notes({ newTags: this.item.newTags })
Notes({ newTags: this.item.newTags
, marginTop: 4
})
}
}
Text(`${this.item.newsTitle}`)
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/FuncUtils.ets
View file @
4c0159a
...
...
@@ -17,9 +17,9 @@ export function runWithAnimation(
}
export function getNotesContentWidth(
newTags: string,
objectType: number | string,
objectLevel: number | string,
newTags?: string,
objectType?: number | string,
objectLevel?: number | string,
fontSize?: string | number | Resource
) {
let textContent: string = returnTypeTitleFn(newTags, objectType, objectLevel)
...
...
Please
register
or
login
to post a comment