caohuahui

头图卡类型

@@ -26,3 +26,4 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent" @@ -26,3 +26,4 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent"
26 26
27 export { BigPicCardComponent } from "./components/view/BigPicCardComponent" 27 export { BigPicCardComponent } from "./components/view/BigPicCardComponent"
28 28
  29 +export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent"
@@ -9,6 +9,7 @@ import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/Horizon @@ -9,6 +9,7 @@ import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/Horizon
9 import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent'; 9 import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
10 import { BigPicCardComponent } from './view/BigPicCardComponent'; 10 import { BigPicCardComponent } from './view/BigPicCardComponent';
11 import { TriPicCardComponent } from './view/TriPicCardComponent'; 11 import { TriPicCardComponent } from './view/TriPicCardComponent';
  12 +import { HeadPictureCardComponent } from './view/HeadPictureCardComponent';
12 13
13 import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'; 14 import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
14 15
@@ -40,6 +41,8 @@ export struct CompParser { @@ -40,6 +41,8 @@ export struct CompParser {
40 TriPicCardComponent({ compDTO: compDTO }) 41 TriPicCardComponent({ compDTO: compDTO })
41 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2 ) { 42 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2 ) {
42 LiveHorizontalCardComponent({ compDTO: compDTO }) 43 LiveHorizontalCardComponent({ compDTO: compDTO })
  44 + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
  45 + HeadPictureCardComponent({ compDTO: compDTO })
43 } else { 46 } else {
44 // todo:组件未实现 / Component Not Implemented 47 // todo:组件未实现 / Component Not Implemented
45 Text(compDTO.compStyle) 48 Text(compDTO.compStyle)
1 import { CommonConstants } from 'wdConstant'; 1 import { CommonConstants } from 'wdConstant';
2 -import { CompDTO } from '../repository/bean/CompDTO';  
3 -import { CompUtils } from '../utils/CompUtils'; 2 +import thermal from '@ohos.thermal';
  3 +import { CompDTO } from '../../repository/bean/CompDTO';
  4 +import { CompUtils } from '../../utils/CompUtils';
4 5
5 @Component 6 @Component
6 export struct HeadPictureCardComponent { 7 export struct HeadPictureCardComponent {
@@ -11,25 +12,30 @@ export struct HeadPictureCardComponent { @@ -11,25 +12,30 @@ export struct HeadPictureCardComponent {
11 Image(this.compDTO.backgroundImgUrl) 12 Image(this.compDTO.backgroundImgUrl)
12 .width(CommonConstants.FULL_WIDTH) 13 .width(CommonConstants.FULL_WIDTH)
13 .height(CommonConstants.FULL_HEIGHT) 14 .height(CommonConstants.FULL_HEIGHT)
14 - Row()  
15 - .width(CommonConstants.FULL_WIDTH)  
16 - .height(59)  
17 - .linearGradient({  
18 - colors:[  
19 - ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]  
20 - ]  
21 - })  
22 - Row() {  
23 - Text(CompUtils.getLabelTitle(this.compDTO.extraData)) 15 + if (this.compDTO.extraData.length > 0) {
  16 + Row()
24 .width(CommonConstants.FULL_WIDTH) 17 .width(CommonConstants.FULL_WIDTH)
25 - .height(CommonConstants.FULL_HEIGHT)  
26 - .fontColor(Color.White)  
27 - .fontSize($r('app.float.normal_text_size'))  
28 - .fontWeight(FontWeight.Bold) 18 + .height(59)
  19 + .linearGradient({
  20 + colors:[
  21 + ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
  22 + ]
  23 + })
  24 + Row() {
  25 + Text(CompUtils.getLabelTitle(this.compDTO.extraData))
  26 + .width(CommonConstants.FULL_WIDTH)
  27 + .height(CommonConstants.FULL_HEIGHT)
  28 + .fontColor(Color.White)
  29 + .fontSize($r('app.float.normal_text_size'))
  30 + .fontWeight(FontWeight.Bold)
  31 + .maxLines(2)
  32 + }
  33 + .height(25)
  34 + .margin({left: 12, bottom: 10, right: 12})
29 } 35 }
30 - .height(25)  
31 - .margin({left: 12, bottom: 10, right: 12})  
32 } 36 }
33 .alignContent(Alignment.Bottom) 37 .alignContent(Alignment.Bottom)
  38 + .width(CommonConstants.FULL_WIDTH)
  39 + .height(200)
34 } 40 }
35 } 41 }
@@ -22,4 +22,5 @@ export const enum CompStyle { @@ -22,4 +22,5 @@ export const enum CompStyle {
22 Title_Abbr_01 = 'Title_Abbr_01', // 标题缩略 22 Title_Abbr_01 = 'Title_Abbr_01', // 标题缩略
23 Title_All_01 = 'Title_All_01', // 全标题 23 Title_All_01 = 'Title_All_01', // 全标题
24 Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡 24 Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡
  25 + Zh_Single_Column_02 = 'Zh_Single_Column-02', // 头图卡
25 } 26 }