zhenghy

精选评论通顶通底

... ... @@ -37,6 +37,7 @@ export struct QualityCommentsComponent {
aboutToDisappear(): void {
// windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
this.dialogController = null // 将dialogController置空
WindowModel.shared.setWindowLayoutFullScreen(false)
}
onPageShow(): void {
... ... @@ -50,6 +51,7 @@ export struct QualityCommentsComponent {
aboutToAppear(): void {
this.getData();
this.showAlert()
WindowModel.shared.setWindowLayoutFullScreen(true)
}
showAlert() {
... ... @@ -111,8 +113,10 @@ export struct QualityCommentsComponent {
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
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
}
... ... @@ -134,8 +138,7 @@ export struct QualityCommentsComponent {
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
// .offset({
})// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
... ... @@ -148,31 +151,21 @@ export struct QualityCommentsComponent {
.height(44)
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
/*导航栏*/
@Builder
TabbarNormal() {
RelativeContainer() {
//标题栏目
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.id("back_icon")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
})
Column() {
Row() {
}
.width('100%')
.height(px2vp(this.topSafeHeight))
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
Stack({ alignContent: Alignment.Start }) {
Row() {
Text('精选评论')// .height('42lpx')
.maxLines(1)
.id("title")
... ... @@ -180,21 +173,26 @@ export struct QualityCommentsComponent {
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity)
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.opacity(this.tileOpacity)
.backgroundColor($r('app.color.white'))
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16 })
.onClick(() => {
router.back()
})
}
}
}
build() {
... ... @@ -219,12 +217,10 @@ export struct QualityCommentsComponent {
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
this.TabbarTransparent()
// this.TabbarTransparent()
this.TabbarNormal()
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
... ...