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
shishuangxi
2024-01-23 22:12:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a36e1453bcd1a5614a4a857d5c2e4bae93c0407e
a36e1453
1 parent
f5d00f51
新增标题缩略comp样式
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
113 additions
and
0 deletions
PeopleDaily_Harmony/entry/src/main/resources/rawfile/comp_list0.json
PeopleDaily_Harmony/wdComponent/src/main/ets/components/PageComponent.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/TitleAbbrComponent.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/TitleAllComponent.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/repository/bean/ContentDTO.ets
PeopleDaily_Harmony/wdComponent/src/main/resources/base/element/color.json
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/point.png
PeopleDaily_Harmony/wdConstant/src/main/ets/enum/CompStyle.ts
PeopleDaily_Harmony/entry/src/main/resources/rawfile/comp_list0.json
View file @
a36e145
This diff could not be displayed because it is too large.
PeopleDaily_Harmony/wdComponent/src/main/ets/components/PageComponent.ets
View file @
a36e145
...
...
@@ -6,6 +6,8 @@ import { EmptyComponent } from './EmptyComponent';
import { ErrorComponent } from './ErrorComponent';
import { LabelComponent } from './LabelComponent';
import { LoadingComponent } from './LoadingComponent';
import { TitleAbbrComponent } from './TitleAbbrComponent';
import { TitleAllComponent } from './TitleAllComponent';
const TAG = 'PageComponent';
...
...
@@ -42,6 +44,10 @@ export struct PageComponent {
componentBuilder(compDTO: CompDTO, compIndex: number) {
if (compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Title_Abbr_01) {
TitleAbbrComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Title_All_01) {
TitleAllComponent({ compDTO: compDTO })
} else {
// todo:组件未实现 / Component Not Implemented
Text(compDTO.compStyle)
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/TitleAbbrComponent.ets
0 → 100644
View file @
a36e145
//缩略标题
import { CommonConstants } from 'wdConstant'
import { CompDTO } from '../repository/bean/CompDTO'
@Component
export struct TitleAbbrComponent {
@State compDTO: CompDTO = {} as CompDTO
build() {
Column() {
Text(this.compDTO.operDataList[0].title)
.fontSize($r("app.float.font_size_16"))
.fontColor($r("app.color.color_222222"))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.width(CommonConstants.FULL_WIDTH)
Row() {
Text("锐评")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_ED2800"))
Text(this.compDTO.operDataList[0].source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
Image($r("app.media.point"))
.width(16)
.height(16)
Text("46分钟前")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
.margin({ top: 8 })
}.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/TitleAllComponent.ets
0 → 100644
View file @
a36e145
//全标题 "compStyle":"3",
import { CommonConstants } from 'wdConstant'
import { CompDTO } from '../repository/bean/CompDTO'
@Component
export struct TitleAllComponent {
@State compDTO: CompDTO = {} as CompDTO
build() {
Column() {
Text(this.compDTO.operDataList[0].title)
.fontSize($r("app.float.font_size_16"))
.fontColor($r("app.color.color_222222"))
.width(CommonConstants.FULL_WIDTH)
Row() {
Text("锐评")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_ED2800"))
Text(this.compDTO.operDataList[0].source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
Image($r("app.media.point"))
.width(16)
.height(16)
Text("46分钟前")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
.margin({ top: 8 })
}.width("100%")
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/repository/bean/ContentDTO.ets
View file @
a36e145
...
...
@@ -33,4 +33,5 @@ export interface ContentDTO {
title: string;
vImageUrl: string;
screenType: string;
source:string;
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/resources/base/element/color.json
View file @
a36e145
...
...
@@ -19,6 +19,18 @@
{
"name"
:
"color_FE4B05"
,
"value"
:
"#FE4B05"
},
{
"name"
:
"color_222222"
,
"value"
:
"#222222"
},
{
"name"
:
"color_ED2800"
,
"value"
:
"#ED2800"
},
{
"name"
:
"color_B0B0B0"
,
"value"
:
"#B0B0B0"
}
]
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/point.png
0 → 100644
View file @
a36e145
495 Bytes
PeopleDaily_Harmony/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
a36e145
...
...
@@ -19,4 +19,6 @@ export const enum CompStyle {
Grid_Layout_01
=
'Grid_Layout-01'
,
// 横屏宫格卡:视频、直播
Grid_Layout_02
=
'Grid_Layout-02'
,
// 竖屏宫格卡:视频、直播、榜单
Masonry_Layout_01
=
'Masonry_Layout-01'
,
// 双列瀑布流/瀑布流卡:视频、直播、专题、活动
Title_Abbr_01
=
'Title_Abbr_01'
,
// 标题缩略
Title_All_01
=
'Title_All_01'
,
// 全标题
}
...
...
Please
register
or
login
to post a comment