yangchenggong1_wd

desc:全屏 我的 主页 状态栏 颜色适配

@@ -47,7 +47,7 @@ struct PeopleShipHomePage { @@ -47,7 +47,7 @@ struct PeopleShipHomePage {
47 } 47 }
48 48
49 onPageHide(): void { 49 onPageHide(): void {
50 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 50 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
51 } 51 }
52 52
53 topOpacityChange(){ 53 topOpacityChange(){
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; 2 +import { DateTimeUtils, NetworkUtil, StringUtils, WindowModel } from 'wdKit';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
4 import { editModelParams } from '../model/EditInfoModel'; 4 import { editModelParams } from '../model/EditInfoModel';
5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; 5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
@@ -14,7 +14,7 @@ const TAG = "MineHomePage" @@ -14,7 +14,7 @@ const TAG = "MineHomePage"
14 @Entry 14 @Entry
15 @Component 15 @Component
16 struct MineHomePage { 16 struct MineHomePage {
17 - @State tileOpacity: number = 0; 17 + @Watch('topOpacityChange') @State tileOpacity: number = 0;
18 firstPositionY:number = 0; 18 firstPositionY:number = 0;
19 fontColor: string = '#999999' 19 fontColor: string = '#999999'
20 selectedFontColor: string = '#000000' 20 selectedFontColor: string = '#000000'
@@ -43,6 +43,7 @@ struct MineHomePage { @@ -43,6 +43,7 @@ struct MineHomePage {
43 pageHideTime:number = 0; 43 pageHideTime:number = 0;
44 44
45 onPageShow(): void { 45 onPageShow(): void {
  46 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
46 this.pageShowTime = DateTimeUtils.getTimeStamp() 47 this.pageShowTime = DateTimeUtils.getTimeStamp()
47 this.getUserInfo() 48 this.getUserInfo()
48 49
@@ -55,7 +56,16 @@ struct MineHomePage { @@ -55,7 +56,16 @@ struct MineHomePage {
55 }, 200); 56 }, 200);
56 } 57 }
57 58
  59 + topOpacityChange(){
  60 + if(this.tileOpacity > 0.8){
  61 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
  62 + }else{
  63 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  64 + }
  65 + }
  66 +
58 onPageHide(): void { 67 onPageHide(): void {
  68 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
59 this.pageHideTime = DateTimeUtils.getTimeStamp() 69 this.pageHideTime = DateTimeUtils.getTimeStamp()
60 let duration = 0 70 let duration = 0
61 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) 71 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
@@ -16,6 +16,7 @@ import { CommentListItem } from '../viewmodel/CommentListItem'; @@ -16,6 +16,7 @@ import { CommentListItem } from '../viewmodel/CommentListItem';
16 struct VisitorCommentPage { 16 struct VisitorCommentPage {
17 @State data: LazyDataSource<CommentListItem> = new LazyDataSource(); 17 @State data: LazyDataSource<CommentListItem> = new LazyDataSource();
18 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 18 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  19 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
19 @State count: number = 0; 20 @State count: number = 0;
20 @State isLoading: boolean = false 21 @State isLoading: boolean = false
21 @State hasMore: boolean = true 22 @State hasMore: boolean = true
@@ -35,13 +36,14 @@ struct VisitorCommentPage { @@ -35,13 +36,14 @@ struct VisitorCommentPage {
35 } 36 }
36 37
37 build() { 38 build() {
  39 + Column(){
38 Column() { 40 Column() {
39 //标题栏目 41 //标题栏目
40 CustomTitleUI({ titleName: "评论列表" }) 42 CustomTitleUI({ titleName: "评论列表" })
41 if (this.count == 0) { 43 if (this.count == 0) {
42 if (this.isGetRequest == true) { 44 if (this.isGetRequest == true) {
43 if(this.isConnectNetwork){ 45 if(this.isConnectNetwork){
44 - EmptyComponent({ emptyType: 10 }) 46 + EmptyComponent({ emptyType: 11 })
45 .height('100%') 47 .height('100%')
46 .width('100%') 48 .width('100%')
47 }else{ 49 }else{
@@ -98,6 +100,10 @@ struct VisitorCommentPage { @@ -98,6 +100,10 @@ struct VisitorCommentPage {
98 .backgroundColor($r('app.color.color_transparent')) 100 .backgroundColor($r('app.color.color_transparent'))
99 .height('100%') 101 .height('100%')
100 .width('100%') 102 .width('100%')
  103 + }.width("100%")
  104 + .height("100%")
  105 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  106 +
101 } 107 }
102 108
103 @Builder ListLayout(){ 109 @Builder ListLayout(){