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 18:48:40 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ba716502e3cf05999140f87d1ce47406067e3683
ba716502
1 parent
d5bcdd69
电子报优化骨架屏逻辑,折叠屏bug修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
22 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 @
ba71650
...
...
@@ -64,13 +64,12 @@ export struct ENewspaperItemComponent {
.zIndex(15)
}
}
// this.itemPicWidth this.itemPicHeight 外层计算已减去,注掉解决骨架屏压缩变形
/*.padding({
.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 @
ba71650
...
...
@@ -145,7 +145,6 @@ export struct ENewspaperPageComponent {
let ratio = this.ratio == '100%' ? 1 : 0.5
this.picWidth = this.picWidth * ratio
this.picHeight = this.picHeight
// 默认日期
const date = new Date()
const month = date.getMonth() + 1
...
...
@@ -174,14 +173,17 @@ export struct ENewspaperPageComponent {
resizeWindow() {
this.windowClass?.on('windowSizeChange', () => {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.ratio = this.screenWidth > 2000 ? '50%' : '100%'
let ratio = this.ratio == '100%' ? 1 : 0.5
this.picWidth = this.screenWidth - vp2px(20)
this.picWidth = this.picWidth * ratio
this.resize()
});
}
resize() {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.ratio = this.screenWidth > 2000 ? '50%' : '100%'
let ratio = this.ratio == '100%' ? 1 : 0.5
this.picWidth = this.screenWidth - vp2px(20)
this.picWidth = this.picWidth * ratio
}
build() {
Stack() {
...
...
@@ -257,10 +259,10 @@ export struct ENewspaperPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('news_skeleton_id')
.width('100%')
.height(px2vp(this.picHeight) + 32)
.width(px2vp(this.picWidth))
.height(px2vp(this.picHeight))
.margin({ top: 59, left: 10, right: 10 })
.padding({ right: 10, left: 10 })
//
.padding({ right: 10, left: 10 })
}
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
...
...
@@ -448,8 +450,7 @@ export struct ENewspaperPageComponent {
private async getNewspaperList() {
// ENewspaperItemComponent .padding({ top:14, right: 10, bottom: 14, left: 10 })
// 计算图片的内容宽高
let ratio = this.ratio == '100%' ? 1 : 0.5
this.itemPicWidth = this.picWidth * ratio - vp2px(20)
this.itemPicWidth = this.picWidth - vp2px(20)
this.itemPicHeight = this.picHeight - vp2px(28)
try {
if (NetworkUtil.isNetConnected()) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/skeleton/newsSkeleton.ets
View file @
ba71650
...
...
@@ -15,35 +15,39 @@ export struct newsSkeleton {
Row() {
Column() {
Image($r('app.media.peopleSeleton'))
.width(120.89)
.height(46.98)// 后缀名不能省略
.width('100%')
.height(47)// 后缀名不能省略
.interpolation(ImageInterpolation.High)
.margin({
bottom: 6
})
textArea('100%', 8)
}
.margin({
right:
5
right:
'2%'
})
.width(
120.89
)
.width(
`76%`
)
.alignItems(HorizontalAlign.Start)
Column() {
Row()
.width(`1
6.5
%`)
.width(`1
00
%`)
.height(25)
.backgroundColor('#FFF5F5F5')
Row()
.width(`1
6.5
%`)
.width(`1
00
%`)
.height(4)
.backgroundColor('#FFF5F5F5')
.margin({ top: 3, bottom: 3 })
Row()
.width(`1
6.5
%`)
.width(`1
00
%`)
.height(20)
.backgroundColor('#FFF5F5F5')
// textArea(27, 25)
// textArea(27, 4)
// textArea(27, 20)
}
.width(`22%`)
.border({ width: 1 })
.borderColor('#FFF5F5F5')
.padding({
...
...
@@ -119,6 +123,7 @@ export struct newsSkeleton {
.width('100%')
}
.height('100%')
.width('100%')
}
}
...
...
Please
register
or
login
to post a comment