yangchenggong1_wd

fix:bug[17967] 号主页-页面展示_顶部展示异常

@@ -28,7 +28,7 @@ struct PeopleShipHomePage { @@ -28,7 +28,7 @@ struct PeopleShipHomePage {
28 // 总滑动空间 28 // 总滑动空间
29 scroller: Scroller = new Scroller() 29 scroller: Scroller = new Scroller()
30 // 顶部透明度 30 // 顶部透明度
31 - @State topOpacity: number = 0 31 + @Watch('topOpacityChange') @State topOpacity: number = 0
32 //发布数量 32 //发布数量
33 @State publishCount: number = 0 33 @State publishCount: number = 0
34 // 是否关注 34 // 是否关注
@@ -42,6 +42,22 @@ struct PeopleShipHomePage { @@ -42,6 +42,22 @@ struct PeopleShipHomePage {
42 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 42 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
43 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() 43 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
44 44
  45 + onPageShow(): void {
  46 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  47 + }
  48 +
  49 + onPageHide(): void {
  50 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  51 + }
  52 +
  53 + topOpacityChange(){
  54 + if(this.topOpacity > 0.8){
  55 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  56 + }else{
  57 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  58 + }
  59 + }
  60 +
45 build() { 61 build() {
46 if(this.isConnectNetwork){ 62 if(this.isConnectNetwork){
47 Stack({ alignContent: Alignment.TopStart }) { 63 Stack({ alignContent: Alignment.TopStart }) {
@@ -50,7 +66,8 @@ struct PeopleShipHomePage { @@ -50,7 +66,8 @@ struct PeopleShipHomePage {
50 Image($r('app.media.home_page_bg')) 66 Image($r('app.media.home_page_bg'))
51 .width('100%') 67 .width('100%')
52 .height('120vp') 68 .height('120vp')
53 - .objectFit(ImageFit.Fill) 69 + .objectFit(ImageFit.Auto)
  70 + .objectRepeat(ImageRepeat.NoRepeat)
54 .backgroundColor(Color.White) 71 .backgroundColor(Color.White)
55 .visibility(this.isLoading ? Visibility.None : Visibility.Visible) 72 .visibility(this.isLoading ? Visibility.None : Visibility.Visible)
56 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 73 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
@@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent { @@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent {
40 Image($r('app.media.home_page_bg')) 40 Image($r('app.media.home_page_bg'))
41 .width('100%') 41 .width('100%')
42 .height('48vp') 42 .height('48vp')
43 - .objectFit(ImageFit.Fill) 43 + .objectFit(ImageFit.Auto)
  44 + .objectRepeat(ImageRepeat.NoRepeat)
  45 + .objectFit(ImageFit.Auto)
44 .backgroundColor(Color.White) 46 .backgroundColor(Color.White)
45 // 头像和名称 47 // 头像和名称
46 Row() { 48 Row() {