xugenyuan

ref |> 精选评论页适配全屏

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -112,13 +112,12 @@ export struct QualityCommentsComponent {
Image($r('app.media.comment_img_banner')).width('100%')
.height(283)
// .aspectRatio(375 / 283);
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
.onAreaChange((oldValue: Area, newValue: Area) => {
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
// 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)
... ... @@ -128,9 +127,16 @@ export struct QualityCommentsComponent {
persent = 1
}
this.tileOpacity = persent
this.topOpacityChange()
})
}
topOpacityChange(){
if(this.tileOpacity > 0.8){
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}else{
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
}
/*透明导航栏*/
@Builder
... ... @@ -164,16 +170,20 @@ export struct QualityCommentsComponent {
@Builder
TabbarNormal() {
Stack({ alignContent: Alignment.Top }) {
//// 默认显示的白色返回按钮
Row() {
}
.width('100%')
.height(px2vp(this.topSafeHeight))
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
.visibility(this.tileOpacity > 0 ? 0 : 1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Image($r('app.media.icon_arrow_left_white'))
.width(24).height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16, top: px2vp(this.topSafeHeight) + (44 - 24)/2})
.onClick(() => {
router.back()
})
}.width('100%').height(px2vp(this.topSafeHeight) + 44)
.opacity(1- this.tileOpacity)
Stack({ alignContent: Alignment.Start }) {
//// 上滑显示的黑色按钮和标题
Stack({ alignContent: Alignment.Top }) {
Row() {
Text('精选评论')// .height('42lpx')
.maxLines(1)
... ... @@ -182,25 +192,25 @@ export struct QualityCommentsComponent {
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.visibility(this.tileOpacity < 0.8 ? 1 : 0)
}
.height(44)
.width('100%')
.height(44).width('100%')
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.opacity(this.tileOpacity)
.backgroundColor($r('app.color.white'))
Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))
.width(24)
.height(24)
Row() {
Image($r('app.media.icon_arrow_left'))
.width(24).height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16 })
.margin({ left: 16, top: (44-24)/2})
.onClick(() => {
router.back()
})
}.height(44).width('100%')
}
.width('100%').height(px2vp(this.topSafeHeight) + 44)
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
.padding({top:px2vp(this.topSafeHeight)})
}
}
... ...