caohuahui

头图卡添加数据

1 import { CommonConstants } from 'wdConstant'; 1 import { CommonConstants } from 'wdConstant';
2 import thermal from '@ohos.thermal'; 2 import thermal from '@ohos.thermal';
3 import { CompDTO } from '../../repository/bean/CompDTO'; 3 import { CompDTO } from '../../repository/bean/CompDTO';
  4 +import { ContentDTO } from '../../repository/bean/ContentDTO';
4 import { CompUtils } from '../../utils/CompUtils'; 5 import { CompUtils } from '../../utils/CompUtils';
5 6
6 @Component 7 @Component
@@ -9,28 +10,31 @@ export struct HeadPictureCardComponent { @@ -9,28 +10,31 @@ export struct HeadPictureCardComponent {
9 10
10 build() { 11 build() {
11 Stack() { 12 Stack() {
12 - Image(this.compDTO.backgroundImgUrl) 13 + Image(this.compDTO.operDataList[0].coverUrl)
13 .width(CommonConstants.FULL_WIDTH) 14 .width(CommonConstants.FULL_WIDTH)
14 .height(CommonConstants.FULL_HEIGHT) 15 .height(CommonConstants.FULL_HEIGHT)
15 - if (this.compDTO.extraData.length > 0) { 16 +
  17 + if (this.compDTO.operDataList[0].description != null) {
16 Row() 18 Row()
17 .width(CommonConstants.FULL_WIDTH) 19 .width(CommonConstants.FULL_WIDTH)
18 .height(59) 20 .height(59)
  21 + .backgroundColor(Color.Red)
19 .linearGradient({ 22 .linearGradient({
20 colors:[ 23 colors:[
21 ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] 24 ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
22 ] 25 ]
23 }) 26 })
24 Row() { 27 Row() {
25 - Text(CompUtils.getLabelTitle(this.compDTO.extraData)) 28 + Text(this.compDTO.operDataList[0].description)
26 .width(CommonConstants.FULL_WIDTH) 29 .width(CommonConstants.FULL_WIDTH)
27 .height(CommonConstants.FULL_HEIGHT) 30 .height(CommonConstants.FULL_HEIGHT)
28 .fontColor(Color.White) 31 .fontColor(Color.White)
29 .fontSize($r('app.float.normal_text_size')) 32 .fontSize($r('app.float.normal_text_size'))
30 .fontWeight(FontWeight.Bold) 33 .fontWeight(FontWeight.Bold)
31 .maxLines(2) 34 .maxLines(2)
  35 + .align(Alignment.Bottom)
32 } 36 }
33 - .height(25) 37 + .height(40)
34 .margin({left: 12, bottom: 10, right: 12}) 38 .margin({left: 12, bottom: 10, right: 12})
35 } 39 }
36 } 40 }