caohuahui

头图卡添加数据

import { CommonConstants } from 'wdConstant';
import thermal from '@ohos.thermal';
import { CompDTO } from '../../repository/bean/CompDTO';
import { ContentDTO } from '../../repository/bean/ContentDTO';
import { CompUtils } from '../../utils/CompUtils';
@Component
... ... @@ -9,28 +10,31 @@ export struct HeadPictureCardComponent {
build() {
Stack() {
Image(this.compDTO.backgroundImgUrl)
Image(this.compDTO.operDataList[0].coverUrl)
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
if (this.compDTO.extraData.length > 0) {
if (this.compDTO.operDataList[0].description != null) {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
.backgroundColor(Color.Red)
.linearGradient({
colors:[
['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
]
})
Row() {
Text(CompUtils.getLabelTitle(this.compDTO.extraData))
Text(this.compDTO.operDataList[0].description)
.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)
}
.height(25)
.height(40)
.margin({left: 12, bottom: 10, right: 12})
}
}
... ...