caohuahui

头图卡类型

... ... @@ -26,3 +26,4 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent"
export { BigPicCardComponent } from "./components/view/BigPicCardComponent"
export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent"
... ...
... ... @@ -9,6 +9,7 @@ import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/Horizon
import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
import { BigPicCardComponent } from './view/BigPicCardComponent';
import { TriPicCardComponent } from './view/TriPicCardComponent';
import { HeadPictureCardComponent } from './view/HeadPictureCardComponent';
import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
... ... @@ -40,6 +41,8 @@ export struct CompParser {
TriPicCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2 ) {
LiveHorizontalCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
HeadPictureCardComponent({ compDTO: compDTO })
} else {
// todo:组件未实现 / Component Not Implemented
Text(compDTO.compStyle)
... ...
import { CommonConstants } from 'wdConstant';
import { CompDTO } from '../repository/bean/CompDTO';
import { CompUtils } from '../utils/CompUtils';
import thermal from '@ohos.thermal';
import { CompDTO } from '../../repository/bean/CompDTO';
import { CompUtils } from '../../utils/CompUtils';
@Component
export struct HeadPictureCardComponent {
... ... @@ -11,6 +12,7 @@ export struct HeadPictureCardComponent {
Image(this.compDTO.backgroundImgUrl)
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
if (this.compDTO.extraData.length > 0) {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
... ... @@ -26,10 +28,14 @@ export struct HeadPictureCardComponent {
.fontColor(Color.White)
.fontSize($r('app.float.normal_text_size'))
.fontWeight(FontWeight.Bold)
.maxLines(2)
}
.height(25)
.margin({left: 12, bottom: 10, right: 12})
}
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
.height(200)
}
}
... ...
... ... @@ -22,4 +22,5 @@ export const enum CompStyle {
Title_Abbr_01 = 'Title_Abbr_01', // 标题缩略
Title_All_01 = 'Title_All_01', // 全标题
Zh_Single_Row_01 = 'Zh_Single_Row-01', // 横划卡
Zh_Single_Column_02 = 'Zh_Single_Column-02', // 头图卡
}
... ...