Showing
4 changed files
with
13 additions
and
2 deletions
| @@ -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,6 +12,7 @@ export struct HeadPictureCardComponent { | @@ -11,6 +12,7 @@ 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) |
| 15 | + if (this.compDTO.extraData.length > 0) { | ||
| 14 | Row() | 16 | Row() |
| 15 | .width(CommonConstants.FULL_WIDTH) | 17 | .width(CommonConstants.FULL_WIDTH) |
| 16 | .height(59) | 18 | .height(59) |
| @@ -26,10 +28,14 @@ export struct HeadPictureCardComponent { | @@ -26,10 +28,14 @@ export struct HeadPictureCardComponent { | ||
| 26 | .fontColor(Color.White) | 28 | .fontColor(Color.White) |
| 27 | .fontSize($r('app.float.normal_text_size')) | 29 | .fontSize($r('app.float.normal_text_size')) |
| 28 | .fontWeight(FontWeight.Bold) | 30 | .fontWeight(FontWeight.Bold) |
| 31 | + .maxLines(2) | ||
| 29 | } | 32 | } |
| 30 | .height(25) | 33 | .height(25) |
| 31 | .margin({left: 12, bottom: 10, right: 12}) | 34 | .margin({left: 12, bottom: 10, right: 12}) |
| 32 | } | 35 | } |
| 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 | } |
-
Please register or login to post a comment