陈剑华

fix: 标签问题优化

... ... @@ -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 评论等信息
... ...
... ... @@ -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
... ...
... ... @@ -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}`)
... ...
... ... @@ -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)
... ...