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
wangyong_wd
2024-04-09 21:02:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dd126eb553f336ec59a959c6b7dc8e7afb9898b6
dd126eb5
1 parent
c9902c8e
人民号主题卡样式新增
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
3 deletions
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn04.ets
sight_harmony/features/wdComponent/src/main/resources/base/element/float.json
sight_harmony/features/wdComponent/src/main/resources/base/media/rmh_theme_bg.png
sight_harmony/features/wdComponent/src/main/resources/base/media/rmh_theme_book_icon.png
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
dd126eb
...
...
@@ -64,5 +64,6 @@ export interface ContentDTO {
hasMore: number,
slideShows: slideShows[],
voiceInfo: VoiceInfoDTO
voiceInfo: VoiceInfoDTO,
tagWord: number,
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
dd126eb
...
...
@@ -3,7 +3,6 @@ import { CommonConstants, CompStyle } from 'wdConstant';
import { BannerComponent } from './view/BannerComponent';
import { LabelComponent } from './view/LabelComponent';
import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
import { ZhGridLayoutComponent } from './view/ZhGridLayoutComponent';
import {
HorizontalStrokeCardThreeTwoRadioForMoreComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
...
...
@@ -11,6 +10,7 @@ import {
HorizontalStrokeCardThreeTwoRadioForOneComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
import { ZhSingleRow04 } from './compview/ZhSingleRow04'
import { ZhSingleColumn04 } from './compview/ZhSingleColumn04'
import { ZhGridLayout03 } from './compview/ZhGridLayout03'
import { CardParser } from './CardParser';
/**
...
...
@@ -45,7 +45,9 @@ export struct CompParser {
ZhGridLayout03({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: compDTO})
} else if (!isNaN(Number(compDTO.compStyle))) {
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: compDTO})
} else if (!Number.isNaN(Number(compDTO.compStyle))) {
CardParser({ contentDTO: compDTO.operDataList[0]});
}
else {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn04.ets
0 → 100644
View file @
dd126eb
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'Zh_Single_Column-04';
/**
* 人民号主题卡
* 枚举值 Zh_Single_Column-04
*/
@Entry
@Component
export struct ZhSingleColumn04 {
@State compDTO: CompDTO = {} as CompDTO
operDataList: ContentDTO[] = [
// {newsTitle: "民检普法课堂:正当防卫是什么正当防卫是什么正当防卫是什么正当防卫是什么?", tagWord: 1} as ContentDTO,
// {newsTitle: "审批站”进菜市场 学才艺有云课堂", tagWord: 2} as ContentDTO,
]
aboutToAppear() {
this.operDataList = this.compDTO.operDataList;
}
build() {
Column() {
Row() {
Image($r("app.media.redLine"))
.width(3)
.height(16)
.margin({ right: 4 })
Text(this.compDTO.objectTitle)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
.width(CommonConstants.FULL_WIDTH)
.margin({ bottom: 10 })
Column() {
ForEach(this.operDataList, (item: ContentDTO) => {
this.rmhThemeItem(item)
})
}
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
}
@Builder
rmhThemeItem(item: ContentDTO) {
Row() {
Image($r('app.media.rmh_theme_book_icon'))
.width(12)
.margin({ left: 12, right: 8 })
Text(item.newsTitle)
.fontSizeColorWeight($r('app.float.font_size_12'), $r('app.color.color_222222'), 400)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.layoutWeight(1)
if (item.tagWord === 1) {
Text('热')
.padding(3)
.borderRadius(4)
.fontSizeColorWeight($r('app.float.vp_12'), '#F07E46', 500)
.backgroundColor('rgba(240, 126, 70, 0.2)')
.margin({ right: 18 })
} else if (item.tagWord === 2) {
Text('新')
.padding(3)
.borderRadius(4)
.fontSizeColorWeight($r('app.float.vp_12'), '#468DF0', 500)
.backgroundColor('rgba(70, 141, 240, 0.2)')
.margin({ right: 18 })
}
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
.margin({ bottom: 4 })
.backgroundImage($r('app.media.rmh_theme_bg'))
.backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH })
.onClick(() => {
ProcessUtils.processPage(item)
})
}
}
@Extend(Text)
function fontSizeColorWeight(fontSize: Resource, fontColor: Resource | string,
fontWeight:
number) {
.fontSize(fontSize)
.fontColor(fontColor)
.fontWeight(fontWeight)
}
...
...
sight_harmony/features/wdComponent/src/main/resources/base/element/float.json
View file @
dd126eb
...
...
@@ -159,6 +159,14 @@
{
"name"
:
"vp_16"
,
"value"
:
"16vp"
},
{
"name"
:
"card_comp_pagePadding_lf"
,
"value"
:
"16fp"
},
{
"name"
:
"card_comp_pagePadding_tb"
,
"value"
:
"14fp"
}
]
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/rmh_theme_bg.png
0 → 100644
View file @
dd126eb
3.81 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/rmh_theme_book_icon.png
0 → 100644
View file @
dd126eb
1.03 KB
Please
register
or
login
to post a comment