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-05 17:23:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2cb0962e6eb40d0a40ce4481800b05d614952132
2cb0962e
1 parent
828bcf2c
代码优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
PeopleDaily_Harmony/wdComponent/src/main/ets/components/view/HeadPictureCardComponent.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/view/HeadPictureCardComponent.ets
View file @
2cb0962
...
...
@@ -7,14 +7,21 @@ import { CompUtils } from '../../utils/CompUtils';
@Component
export struct HeadPictureCardComponent {
@State compDTO: CompDTO = {} as CompDTO
private item: ContentDTO
aboutToAppear() {
// Data Initialization.
this.item = this.compDTO.operDataList[0];
}
build() {
Stack() {
Image(this.
compDTO.operDataList[0]
.coverUrl)
Image(this.
item
.coverUrl)
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
if (this.
compDTO.operDataList[0]
.newsTitle != null) {
if (this.
item
.newsTitle != null) {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
...
...
@@ -24,7 +31,7 @@ export struct HeadPictureCardComponent {
]
})
Row() {
Text(this.
compDTO.operDataList[0]
.newsTitle)
Text(this.
item
.newsTitle)
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.fontColor(Color.White)
...
...
@@ -39,7 +46,7 @@ export struct HeadPictureCardComponent {
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(imageSizeRatio(this.
compDTO.operDataList[0]
.coverSize))
.aspectRatio(imageSizeRatio(this.
item
.coverSize))
.height(200)
}
}
...
...
Please
register
or
login
to post a comment