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-04 17:39:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a4b313ed89ee81c4a7f7c6edfd8de5931462f75d
a4b313ed
1 parent
94f83a29
新增图卡集
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
2 deletions
sight_harmony/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/wdComponent/src/main/ets/components/view/AlbumCardComponent.ets
sight_harmony/wdComponent/src/main/resources/base/media/album_card_shape.png
sight_harmony/wdConstant/src/main/ets/enum/CompStyle.ts
sight_harmony/wdComponent/src/main/ets/components/CompParser.ets
View file @
a4b313e
...
...
@@ -16,6 +16,7 @@ import {
import {
HorizontalStrokeCardThreeTwoRadioForOneComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
import { AlbumCardComponent } from './view/AlbumCardComponent';
/**
* comp适配器.
...
...
@@ -57,7 +58,10 @@ export struct CompParser {
HeadPictureCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.ZhGrid_Layout_03) {
ZhGridLayoutComponent({ compDTO: compDTO })
} else {
} else if (compDTO.compStyle === CompStyle.Album_Card_01) {
AlbumCardComponent({ compDTO: compDTO })
}
else {
// todo:组件未实现 / Component Not Implemented
Text(compDTO.compStyle)
.width(CommonConstants.FULL_PARENT)
...
...
@@ -65,4 +69,5 @@ export struct CompParser {
// .backgroundColor(Color.Brown) // 展示本页未实现的compStyle
}
}
}
\ No newline at end of file
}
...
...
sight_harmony/wdComponent/src/main/ets/components/view/AlbumCardComponent.ets
0 → 100644
View file @
a4b313e
import { CompDTO } from 'wdBean'
import { DateTimeUtils, Logger } from 'wdKit';
const TAG = 'AlbumCardComponent';
@Preview
@Component
export struct AlbumCardComponent {
@State compDTO: CompDTO = {} as CompDTO
aboutToAppear() {
Logger.debug(TAG + "" + JSON.stringify(this.compDTO.operDataList));
}
build() {
Column({ space: 8 }) {
Text(this.compDTO.operDataList[0].newsTitle)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize(17)
.fontColor(0x222222)
.lineHeight(25)
.maxLines(3)
.margin({ top: 6,
left: 16,
right: 16 })
.width(343)
RelativeContainer() {
Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url)
.width(229)
.height(154)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.id('mainImage')
Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url)
.width(112)
.height(76)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.id('subTopImage')
Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url)
.width(112)
.height(76)
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('subBottomImage')
Shape() {
Rect().width(33).height(18)
}
// .viewPort({ x: -2, y: -2, width: 304, height: 130 })
.fill(0x000000)
.fillOpacity(0.3)
// .strokeDashArray([20])
// .strokeDashOffset(10)
.strokeLineCap(LineCapStyle.Round)
.strokeLineJoin(LineJoinStyle.Round)
.antiAlias(true)
.id('shape')
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.margin({ right: 4,
bottom: 4 })
Image($r('app.media.album_card_shape'))
.width(22)
.height(18)
.alignRules({
left: { anchor: "shape", align: HorizontalAlign.Start },
top: { anchor: "shape", align: VerticalAlign.Top }
})
.id('shapeSubImage')
Text(this.compDTO.operDataList[0].fullColumnImgUrls.length + '')
.fontSize(13)
.fontColor(0xFFFFFF)
.id('pageIndex')
.alignRules({
right: { anchor: "shape", align: HorizontalAlign.End },
top: { anchor: "shape", align: VerticalAlign.Top }
})
.margin({ right: 2 })
.textAlign(TextAlign.Center)
.width(17)
.height(17)
}
.width(343)
.height(154)
Row() {
Text(this.compDTO.operDataList[0].source)
.fontSize(13)
.fontColor(0xB0B0B0)
.margin({
left: 16
})
Image($r('app.media.point'))
.width(16)
.height(16)
Text('45分钟')
.fontSize(13)
.fontColor(0xB0B0B0)
Text('328评')
.fontSize(13)
.fontColor(0xB0B0B0)
.margin({
left: 6
})
}
.width(375)
.height(16)
.id('label')
}
.width(375)
// .backgroundColor(0x000000)
}
}
\ No newline at end of file
...
...
sight_harmony/wdComponent/src/main/resources/base/media/album_card_shape.png
0 → 100644
View file @
a4b313e
1.03 KB
sight_harmony/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
a4b313e
...
...
@@ -25,4 +25,5 @@ export const enum CompStyle {
Title_All_01
=
'3'
,
// 全标题
Single_Imagecard_03
=
'13'
,
//单图卡:3行标题
ZhGrid_Layout_03
=
'Zh_Grid_Layout-03'
,
//金刚位卡
Album_Card_01
=
'17'
//图卡集
}
...
...
Please
register
or
login
to post a comment