xugenyuan

ref |> 调整精选评论详情页顶部间距问题

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
import { ViewType } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, ToastUtils, WindowModel } from 'wdKit/Index'
import { DateTimeUtils, LazyDataSource, Logger, ToastUtils, WindowModel } from 'wdKit/Index'
import { commentItemModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { router, window } from '@kit.ArkUI'
... ... @@ -106,8 +106,13 @@ export struct QualityCommentsComponent {
// .aspectRatio(375 / 283);
}
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
Logger.debug(TAG, "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
let persent = Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY ) / 150 //- this.topSafeHeight) / 283
if (persent > 1) {
persent = 1
}
... ... @@ -130,16 +135,17 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
})
}
.visibility(this.tileOpacity > 0 ? 1 : 0)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
... ... @@ -159,9 +165,9 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
... ... @@ -178,16 +184,17 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
build() {
... ... @@ -212,7 +219,7 @@ export struct QualityCommentsComponent {
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
this.TabbarTransparent()
this.TabbarNormal()
... ...