Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
caohuahui
2024-02-01 15:02:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
57ed2f8a2a40b35a1ff0d233dc6d841a3495bd1d
57ed2f8a
1 parent
dbc7a748
头图卡类型
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
2 deletions
PeopleDaily_Harmony/wdComponent/src/main/ets/Index.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/CompParser.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/HeadPictureCardComponent.ets → PeopleDaily_Harmony/wdComponent/src/main/ets/components/view/HeadPictureCardComponent.ets
PeopleDaily_Harmony/wdConstant/src/main/ets/enum/CompStyle.ts
PeopleDaily_Harmony/wdComponent/src/main/ets/Index.ets
View file @
57ed2f8
...
...
@@ -26,3 +26,4 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent"
export { BigPicCardComponent } from "./components/view/BigPicCardComponent"
export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent"
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/CompParser.ets
View file @
57ed2f8
...
...
@@ -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)
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/HeadPictureCardComponent.ets → PeopleDaily_Harmony/wdComponent/src/main/ets/components/
view/
HeadPictureCardComponent.ets
View file @
57ed2f8
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)
}
}
...
...
PeopleDaily_Harmony/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
57ed2f8
...
...
@@ -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'
,
// 头图卡
}
...
...
Please
register
or
login
to post a comment