douaojie

fix: 添加标签

import { ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { Notes } from './notes';
const TAG: string = 'Card5Component';
... ... @@ -29,29 +30,31 @@ export struct Card5Component {
.autoResize(true)
.borderRadius($r('app.float.image_border_radius'))
if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle) {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
.linearGradient({
colors: [
['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
]
})
// Row()
// .width(CommonConstants.FULL_WIDTH)
// .height(59)
// .linearGradient({
// colors: [
// ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
// ]
// })
Row() {
if (this.titleShowPolicy === 1) {
Stack() {
if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
}
Text(this.contentDTO.newsTitle)
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.width(CommonConstants.FULL_WIDTH)// .height(CommonConstants.FULL_HEIGHT)
.fontColor(Color.White)
.fontSize($r('app.float.normal_text_size'))
.fontWeight(FontWeight.Bold)
.maxLines(2)
.align(Alignment.Bottom)
}
.align(Alignment.TopStart)
.textIndent(this.contentDTO.objectType == '5' ? 40 : 0)
}.alignContent(Alignment.TopStart)
}
.justifyContent(FlexAlign.Start)
.height(40)
// .height(40)
.margin({ left: 12, bottom: 10, right: 12 })
}
}
... ...
... ... @@ -39,8 +39,10 @@ export struct Card6Component {
.maxLines(3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textIndent(this.contentDTO.newTags.length < 5 && this.contentDTO.newTags.length > 2 ? 60 :
this.contentDTO.newTags.length != 0 && this.contentDTO.newTags.length < 3 ? 30 : 0)
.textIndent(
this.contentDTO.newTags.length < 5 && this.contentDTO.newTags.length > 2 ?
60 : this.contentDTO.newTags.length != 0 && this.contentDTO.newTags.length < 3 ?
30 : 0)
}.alignContent(Alignment.TopStart)
}.height("80%")
... ...