zhenghy

精选评论通顶通底

@@ -37,6 +37,7 @@ export struct QualityCommentsComponent { @@ -37,6 +37,7 @@ export struct QualityCommentsComponent {
37 aboutToDisappear(): void { 37 aboutToDisappear(): void {
38 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) 38 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
39 this.dialogController = null // 将dialogController置空 39 this.dialogController = null // 将dialogController置空
  40 + WindowModel.shared.setWindowLayoutFullScreen(false)
40 } 41 }
41 42
42 onPageShow(): void { 43 onPageShow(): void {
@@ -50,6 +51,7 @@ export struct QualityCommentsComponent { @@ -50,6 +51,7 @@ export struct QualityCommentsComponent {
50 aboutToAppear(): void { 51 aboutToAppear(): void {
51 this.getData(); 52 this.getData();
52 this.showAlert() 53 this.showAlert()
  54 + WindowModel.shared.setWindowLayoutFullScreen(true)
53 } 55 }
54 56
55 showAlert() { 57 showAlert() {
@@ -111,8 +113,10 @@ export struct QualityCommentsComponent { @@ -111,8 +113,10 @@ export struct QualityCommentsComponent {
111 return 113 return
112 } 114 }
113 Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y) 115 Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
114 - Logger.debug(TAG, "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)  
115 - let persent = Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY ) / 150 //- this.topSafeHeight) / 283 116 + Logger.debug(TAG,
  117 + "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
  118 + let persent =
  119 + Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY) / 150 //- this.topSafeHeight) / 283
116 if (persent > 1) { 120 if (persent > 1) {
117 persent = 1 121 persent = 1
118 } 122 }
@@ -134,10 +138,9 @@ export struct QualityCommentsComponent { @@ -134,10 +138,9 @@ export struct QualityCommentsComponent {
134 .alignRules({ 138 .alignRules({
135 center: { anchor: "__container__", align: VerticalAlign.Center }, 139 center: { anchor: "__container__", align: VerticalAlign.Center },
136 left: { anchor: "__container__", align: HorizontalAlign.Start } 140 left: { anchor: "__container__", align: HorizontalAlign.Start }
137 - })  
138 - // .offset({  
139 - // y: (this.topSafeHeight / 2) + 'px'  
140 - // }) 141 + })// .offset({
  142 + // y: (this.topSafeHeight / 2) + 'px'
  143 + // })
141 .margin({ left: 16 }) 144 .margin({ left: 16 })
142 .onClick(() => { 145 .onClick(() => {
143 router.back() 146 router.back()
@@ -148,53 +151,48 @@ export struct QualityCommentsComponent { @@ -148,53 +151,48 @@ export struct QualityCommentsComponent {
148 .height(44) 151 .height(44)
149 .width('100%') 152 .width('100%')
150 .backgroundColor($r('app.color.color_transparent')) 153 .backgroundColor($r('app.color.color_transparent'))
151 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
152 } 154 }
153 155
154 /*导航栏*/ 156 /*导航栏*/
155 @Builder 157 @Builder
156 TabbarNormal() { 158 TabbarNormal() {
157 - RelativeContainer() {  
158 - //标题栏目  
159 - Image($r('app.media.icon_arrow_left'))  
160 - .width(24)  
161 - .height(24)  
162 - .objectFit(ImageFit.Auto)  
163 - .id("back_icon")  
164 - .alignRules({  
165 - center: { anchor: "__container__", align: VerticalAlign.Center },  
166 - left: { anchor: "__container__", align: HorizontalAlign.Start }  
167 - })  
168 - // .offset({  
169 - // y: (this.topSafeHeight / 2) + 'px'  
170 - // })  
171 - .margin({ left: 16 })  
172 - .onClick(() => {  
173 - router.back()  
174 - }) 159 + Column() {
  160 + Row() {
  161 + }
  162 + .width('100%')
  163 + .height(px2vp(this.topSafeHeight))
  164 + .backgroundColor($r('app.color.white'))
  165 + .opacity(this.tileOpacity)
175 166
176 - Text('精选评论')// .height('42lpx')  
177 - .maxLines(1)  
178 - .id("title")  
179 - .fontSize('35lpx')  
180 - .fontWeight(400)  
181 - .fontColor($r('app.color.color_222222'))  
182 - .lineHeight('42lpx')  
183 - .alignRules({  
184 - center: { anchor: "__container__", align: VerticalAlign.Center },  
185 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
186 - })  
187 - // .offset({  
188 - // y: (this.topSafeHeight / 2) + 'px'  
189 - // }) 167 + Stack({ alignContent: Alignment.Start }) {
  168 + Row() {
  169 + Text('精选评论')// .height('42lpx')
  170 + .maxLines(1)
  171 + .id("title")
  172 + .fontSize('35lpx')
  173 + .fontWeight(400)
  174 + .fontColor($r('app.color.color_222222'))
  175 + .lineHeight('42lpx')
  176 + }
  177 + .height(44)
  178 + .width('100%')
  179 + .justifyContent(FlexAlign.Center)
  180 + .alignItems(VerticalAlign.Center)
  181 + .opacity(this.tileOpacity)
  182 + .backgroundColor($r('app.color.white'))
  183 +
  184 + Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))
  185 + .width(24)
  186 + .height(24)
  187 + .objectFit(ImageFit.Auto)
  188 + .margin({ left: 16 })
  189 + .onClick(() => {
  190 + router.back()
  191 + })
  192 +
  193 + }
190 } 194 }
191 - .visibility(this.tileOpacity > 0 ? 0 : 1)  
192 - .opacity(this.tileOpacity)  
193 - // .height(this.topSafeHeight + vp2px(44) + 'px')  
194 - .height(44)  
195 - .width('100%')  
196 - .backgroundColor($r('app.color.white'))  
197 - // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 195 +
198 } 196 }
199 197
200 build() { 198 build() {
@@ -219,12 +217,10 @@ export struct QualityCommentsComponent { @@ -219,12 +217,10 @@ export struct QualityCommentsComponent {
219 .friction(0.6) 217 .friction(0.6)
220 .scrollBar(BarState.Off) 218 .scrollBar(BarState.Off)
221 .edgeEffect(EdgeEffect.None) 219 .edgeEffect(EdgeEffect.None)
222 - // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
223 220
224 - this.TabbarTransparent() 221 + // this.TabbarTransparent()
225 this.TabbarNormal() 222 this.TabbarNormal()
226 } 223 }
227 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
228 224
229 } 225 }
230 226