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
王士厅
2024-06-19 16:19:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4329d1710cd366a186b51f19b27c82fc73b8b59d
4329d171
1 parent
c6ff187f
电子报优化骨架屏逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/skeleton/newsSkeleton.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
View file @
4329d17
...
...
@@ -51,6 +51,7 @@ export struct ENewspaperItemComponent {
.zIndex(10)
newsSkeleton()
.visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
.width('100%')
.zIndex(1)
if (this.contentWidth !== 0) {
Canvas(this.context)
...
...
@@ -63,12 +64,13 @@ export struct ENewspaperItemComponent {
.zIndex(15)
}
}
.padding({
// this.itemPicWidth this.itemPicHeight 外层计算已减去,注掉解决骨架屏压缩变形
/*.padding({
top: 14,
right: 10,
bottom: 14,
left: 10
})
})
*/
.backgroundColor(Color.White)
.width('100%')
.onTouch((event: TouchEvent) => {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
4329d17
...
...
@@ -260,6 +260,7 @@ export struct ENewspaperPageComponent {
.width('100%')
.height(px2vp(this.picHeight) + 32)
.margin({ top: 59, left: 10, right: 10 })
.padding({ right: 10, left: 10 })
}
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
...
...
@@ -447,7 +448,7 @@ export struct ENewspaperPageComponent {
private async getNewspaperList() {
// ENewspaperItemComponent .padding({ top:14, right: 10, bottom: 14, left: 10 })
// 计算图片的内容宽高
let ratio = this.ratio == '100%' ? 1 : 0.
6
let ratio = this.ratio == '100%' ? 1 : 0.
5
this.itemPicWidth = this.picWidth * ratio - vp2px(20)
this.itemPicHeight = this.picHeight - vp2px(28)
try {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/skeleton/newsSkeleton.ets
View file @
4329d17
...
...
@@ -14,26 +14,30 @@ export struct newsSkeleton {
Column() {
Row() {
Column() {
Image($r('app.media.peopleSeleton')).width('100%').height(47)// 后缀名不能省略
Image($r('app.media.peopleSeleton'))
.width(120.89)
.height(46.98)// 后缀名不能省略
.interpolation(ImageInterpolation.High)
textArea('100%', 8)
}
.width(124)
.margin({
right: 5
})
.width(120.89)
.alignItems(HorizontalAlign.Start)
.margin({ right: 5 })
Column() {
Row()
.width(
27
)
.width(
`16.5%`
)
.height(25)
.backgroundColor('#FFF5F5F5')
Row()
.width(
27
)
.width(
`16.5%`
)
.height(4)
.backgroundColor('#FFF5F5F5')
.margin({ top: 3, bottom: 3 })
Row()
.width(
27
)
.width(
`16.5%`
)
.height(20)
.backgroundColor('#FFF5F5F5')
// textArea(27, 25)
...
...
@@ -113,7 +117,6 @@ export struct newsSkeleton {
Column().backgroundColor('#909090').height(5).width(326)
}
.width('100%')
.padding({ right: 10, left: 10 })
}
.height('100%')
...
...
Please
register
or
login
to post a comment