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-05-30 15:38:36 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
081c1b6f4b49333f6f72df8acd985e52eba7accb
081c1b6f
1 parent
860293cc
电子报直板、折叠屏、pad适配
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 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/ENewspaperItemComponent.ets
View file @
081c1b6
...
...
@@ -34,11 +34,10 @@ export struct ENewspaperItemComponent {
.visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
Image(this.newspaperListItemBean.pagePic)
.width('100%')
.aspectRatio(378 / 566)
.objectFit(ImageFit.Fill)
.onComplete(() => {
this.isShowSkeleton = false
})
.objectFit(ImageFit.Contain)
.visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible)
Canvas(this.context)
...
...
@@ -49,7 +48,7 @@ export struct ENewspaperItemComponent {
})
}
.padding({ top:
16, right: 16, bottom: 16, left: 16
})
.padding({ top:
14, right: 10, bottom: 14, left: 10
})
.margin({ left: 10, right: 10 })
.backgroundColor(Color.White)
.width('100%')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
081c1b6
...
...
@@ -28,6 +28,8 @@ export struct ENewspaperPageComponent {
@State swiperIndex: number = 0;
//当前选择的日期标记
@State selectDate: Date = new Date()
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
...
...
@@ -102,7 +104,10 @@ export struct ENewspaperPageComponent {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
this.picWidth = this.screenWidth - vp2px(52)
this.picHeight = this.picWidth * 566 / 378
let screenHeight = this.displayTool.height;
// bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
let height = screenHeight -this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60)
this.picHeight = height
// 默认日期
const date = new Date()
const month = date.getMonth() + 1
...
...
@@ -213,10 +218,11 @@ export struct ENewspaperPageComponent {
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
// newspaper_shadow 44 高度 e_newspaper_content 35 margin top
.height(px2vp(this.picHeight) - 44 - 35)
.vertical(true)
.autoPlay(false)
.cachedCount(
3
)
.cachedCount(
1
)
.indicator(false)
.loop(false)
.displayCount(1)
...
...
@@ -234,6 +240,7 @@ export struct ENewspaperPageComponent {
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.width('100%')
.margin({ left: 10, right: 10, top: -1 })
.objectFit(ImageFit.Contain)
.alignRules({
...
...
Please
register
or
login
to post a comment