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
guochunsong
2024-02-02 10:42:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1da824523a9a7e8841739b4488f587873d646df8
1da82452
1 parent
0b9052b5
提交金刚卡位
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
9 deletions
sight_harmony/wdComponent/Index.ets
sight_harmony/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
sight_harmony/wdComponent/src/main/ets/components/view/ZhGridLayoutComponent.ets
sight_harmony/wdConstant/src/main/ets/enum/CompStyle.ts
sight_harmony/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/wdComponent/Index.ets
View file @
1da8245
...
...
@@ -47,3 +47,5 @@ export { TriPicCardComponent } from "./src/main/ets/components/view/TriPicCardCo
export { BigPicCardComponent } from "./src/main/ets/components/view/BigPicCardComponent"
export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPictureCardComponent"
export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent"
...
...
sight_harmony/wdComponent/src/main/ets/components/CompParser.ets
View file @
1da8245
...
...
@@ -9,6 +9,7 @@ import { BigPicCardComponent } from './view/BigPicCardComponent';
import { TriPicCardComponent } from './view/TriPicCardComponent';
import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
import { HeadPictureCardComponent } from './view/HeadPictureCardComponent';
import { ZhGridLayoutComponent } from './view/ZhGridLayoutComponent';
/**
* comp适配器.
...
...
@@ -42,6 +43,8 @@ export struct CompParser {
LiveHorizontalCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
HeadPictureCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.ZhGrid_Layout_03) {
ZhGridLayoutComponent({ compDTO: compDTO })
} else {
// todo:组件未实现 / Component Not Implemented
Text(compDTO.compStyle)
...
...
sight_harmony/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
View file @
1da8245
import { Action, CompDTO, ContentDTO, Params } from 'wdBean';
import { CompStyle } from 'wdConstant';
import { Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
...
...
@@ -18,12 +19,11 @@ export struct SingleImageCardComponent {
@State titleNumber: number = 3 //标题行数
aboutToAppear() {
if
(this.compDTO.compStyle === 'Single_Imagecard_03')
{
if
(this.compDTO.operDataList[0].newsTitle.length > 25)
{
this.titleNumber = 3;
} else {
this.titleNumber = 2;
}
}
build() {
...
...
@@ -63,6 +63,7 @@ export struct SingleImageCardComponent {
Blank(16)
Image(this.compDTO.operDataList[0].coverUrl)
.width('38%')
.borderRadius(5)
.aspectRatio(3 / 2)
}
.padding(
...
...
sight_harmony/wdComponent/src/main/ets/components/view/ZhGridLayoutComponent.ets
0 → 100644
View file @
1da8245
import { Action, CompDTO, ContentDTO, Params } from 'wdBean';
import { CompStyle } from 'wdConstant';
import { Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
const TAG = 'Zh_Grid_Layout-03';
const FULL_PARENT: string = '100%';
/**
* 金刚卡位
* 枚举值Zh_Grid_Layout-03
* Zh_Grid_Layout-03
*
*/
@Entry
@Component
export struct ZhGridLayoutComponent {
@State compDTO: CompDTO = {} as CompDTO
aboutToAppear() {
Logger.info(TAG + ' comp:'+ JSON.stringify(this.compDTO))
}
build() {
Column() {
Flex({ wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.SpaceEvenly,
alignItems :ItemAlign.End}) {
ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
Column() {
Image(item.coverUrl)
.width(50)
.aspectRatio(1 / 1)
.autoResize(true)
Text(item.newsTitle)
.fontSize(16)
.margin({ top: 10 })
}.margin({
top:5,
bottom:5,
left:5,
right :5
})
}, (item: ContentDTO) => JSON.stringify(item))
}
.backgroundColor(Color.White)
.borderRadius(12)
.padding({
top: 10,
bottom: 10
})
.width(FULL_PARENT)
.margin(10)
}
}
}
...
...
sight_harmony/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
1da8245
...
...
@@ -25,5 +25,5 @@ export const enum CompStyle {
Title_All_01
=
'3'
,
// 全标题
Single_Imagecard_02
=
'13'
,
//单图卡:2行标题
Single_Imagecard_03
=
'13'
,
//单图卡:3行标题
Grid_Layout_03
=
'Zh_Grid_Layout-03'
,
//金刚位卡
Zh
Grid_Layout_03
=
'Zh_Grid_Layout-03'
,
//金刚位卡
}
...
...
sight_harmony/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
1da8245
...
...
@@ -74,24 +74,24 @@ export class HttpUrlUtils {
}
static addSpecialHeaders(headers: HashMap<string, string>) {
switch (this.hostUrl) {
case this.HOST_UAT:
switch (HttpUrlUtils.hostUrl) {
case HttpUrlUtils.HOST_UAT:
// TODO 待优化到常量类里
headers.set('X-Ca-Stage', 'PRE');
headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a');
headers.set('appCode', '83092caa603a421aa0222308b3f6b27a');
break
case
thi
s.HOST_SIT:
case
HttpUrlUtil
s.HOST_SIT:
headers.set('X-Ca-Stage', 'TEST');
headers.set('Authorization', 'APPCODE 0af1f9085e484c97b2a44704bae72c07');
headers.set('appCode', '0af1f9085e484c97b2a44704bae72c07');
break
case
thi
s.HOST_PRODUCT:
case
HttpUrlUtil
s.HOST_PRODUCT:
headers.set('X-Ca-Stage', 'RELEASE');
headers.set('Authorization', 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6');
headers.set('appCode', '3d4181bceeb94d9780e10dbb6c67bbf6');
break
case
thi
s.HOST_DEV:
case
HttpUrlUtil
s.HOST_DEV:
headers.set('X-Ca-Stage', 'TEST');
headers.set('Authorization', 'APPCODE ff33172859e14f9a8299e3bd769e79f9');
headers.set('appCode', 'ff33172859e14f9a8299e3bd769e79f9');
...
...
@@ -102,7 +102,7 @@ export class HttpUrlUtils {
}
static getHost() {
return
thi
s.hostUrl;
return
HttpUrlUtil
s.hostUrl;
}
private static getCity() {
...
...
Please
register
or
login
to post a comment