Showing
3 changed files
with
43 additions
and
20 deletions
| @@ -132,6 +132,10 @@ export class WindowModel { | @@ -132,6 +132,10 @@ export class WindowModel { | ||
| 132 | }) | 132 | }) |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | + setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) { | ||
| 136 | + this.windowClass?.setWindowSystemBarEnable(names) | ||
| 137 | + } | ||
| 138 | + | ||
| 135 | setWindowLayoutFullScreen(isFullScreen: boolean) { | 139 | setWindowLayoutFullScreen(isFullScreen: boolean) { |
| 136 | this.isFullScreen = isFullScreen | 140 | this.isFullScreen = isFullScreen |
| 137 | this.windowClass?.setWindowLayoutFullScreen(isFullScreen) | 141 | this.windowClass?.setWindowLayoutFullScreen(isFullScreen) |
| @@ -157,20 +157,20 @@ export struct TopNavigationComponent { | @@ -157,20 +157,20 @@ export struct TopNavigationComponent { | ||
| 157 | if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) { | 157 | if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) { |
| 158 | this.barBackgroundColor = Color.Black | 158 | this.barBackgroundColor = Color.Black |
| 159 | this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor) | 159 | this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor) |
| 160 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 161 | - WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 162 | - this.isLayoutFullScreen = true | ||
| 163 | - this.bottomRectHeight = this.bottomSafeHeight | ||
| 164 | - this.topRectHeight = this.topSafeHeight | 160 | + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 161 | + // WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 162 | + // this.isLayoutFullScreen = true | ||
| 163 | + // this.bottomRectHeight = this.bottomSafeHeight | ||
| 164 | + // this.topRectHeight = this.topSafeHeight | ||
| 165 | 165 | ||
| 166 | } else { | 166 | } else { |
| 167 | this.barBackgroundColor = Color.Transparent | 167 | this.barBackgroundColor = Color.Transparent |
| 168 | this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor) | 168 | this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor) |
| 169 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 170 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 171 | - this.isLayoutFullScreen = false | ||
| 172 | - this.bottomRectHeight = 0 | ||
| 173 | - this.topRectHeight = 0 | 169 | + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 170 | + // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 171 | + // this.isLayoutFullScreen = false | ||
| 172 | + // this.bottomRectHeight = 0 | ||
| 173 | + // this.topRectHeight = 0 | ||
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | 176 |
| @@ -2,7 +2,7 @@ import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index'; | @@ -2,7 +2,7 @@ import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index'; | ||
| 2 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | 2 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' |
| 3 | import { ResponseDTO } from 'wdNetwork/Index'; | 3 | import { ResponseDTO } from 'wdNetwork/Index'; |
| 4 | import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' | 4 | import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' |
| 5 | -import { Test } from './Test' | 5 | +// import { Test } from './Test' |
| 6 | import router from '@ohos.router'; | 6 | import router from '@ohos.router'; |
| 7 | import window from '@ohos.window'; | 7 | import window from '@ohos.window'; |
| 8 | import { | 8 | import { |
| @@ -12,7 +12,7 @@ import { | @@ -12,7 +12,7 @@ import { | ||
| 12 | contentsItem, | 12 | contentsItem, |
| 13 | getRecCompInfoParams | 13 | getRecCompInfoParams |
| 14 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 14 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 15 | -import { WindowModel } from 'wdKit/Index'; | 15 | +import { Logger, WindowModel } from 'wdKit/Index'; |
| 16 | import { BusinessError } from '@kit.BasicServicesKit'; | 16 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 17 | 17 | ||
| 18 | interface loadMoreData { | 18 | interface loadMoreData { |
| @@ -21,6 +21,9 @@ interface loadMoreData { | @@ -21,6 +21,9 @@ interface loadMoreData { | ||
| 21 | loadStrategy: string; | 21 | loadStrategy: string; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | +const TAG = 'VideoChannelDetail' | ||
| 25 | +let timer: number = -1 | ||
| 26 | + | ||
| 24 | @Entry | 27 | @Entry |
| 25 | @Component | 28 | @Component |
| 26 | export struct VideoChannelDetail { | 29 | export struct VideoChannelDetail { |
| @@ -48,33 +51,49 @@ export struct VideoChannelDetail { | @@ -48,33 +51,49 @@ export struct VideoChannelDetail { | ||
| 48 | * 监听视频频道激活或失活 | 51 | * 监听视频频道激活或失活 |
| 49 | */ | 52 | */ |
| 50 | navIndexChange() { | 53 | navIndexChange() { |
| 54 | + if (timer) clearTimeout(timer) | ||
| 55 | + | ||
| 56 | + timer = setTimeout(() => { | ||
| 51 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { | 57 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { |
| 52 | // 如果视频在暂停则播放视频 | 58 | // 如果视频在暂停则播放视频 |
| 53 | this.switchVideoStatus = true | 59 | this.switchVideoStatus = true |
| 60 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' }) | ||
| 54 | } else { | 61 | } else { |
| 55 | // 如果视频在播放则暂停视频 | 62 | // 如果视频在播放则暂停视频 |
| 56 | this.switchVideoStatus = false | 63 | this.switchVideoStatus = false |
| 64 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' }) | ||
| 65 | + // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 57 | } | 66 | } |
| 67 | + timer = -1 | ||
| 68 | + }, 100) | ||
| 69 | + | ||
| 58 | 70 | ||
| 59 | } | 71 | } |
| 60 | 72 | ||
| 61 | - async aboutToAppear(): Promise<void> { | ||
| 62 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 73 | + aboutToAppear() { |
| 74 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' }) | ||
| 75 | + // WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 63 | // 根据视频频道传参查询视频楼层信息 | 76 | // 根据视频频道传参查询视频楼层信息 |
| 64 | this.getRecCompInfo() | 77 | this.getRecCompInfo() |
| 78 | + Logger.info(TAG, 'aboutToAppear'); | ||
| 65 | } | 79 | } |
| 66 | 80 | ||
| 67 | aboutToDisappear(): void { | 81 | aboutToDisappear(): void { |
| 68 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 69 | - console.error('aboutToDisappear videoChanel') | 82 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' }) |
| 83 | + // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 84 | + Logger.info(TAG, 'aboutToDisappear'); | ||
| 70 | } | 85 | } |
| 71 | 86 | ||
| 72 | - onPageHide(): void { | ||
| 73 | - console.error('onPageHide videoChanel') | 87 | + onPageShow(): void { |
| 88 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' }) | ||
| 89 | + // WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 90 | + Logger.info(TAG, 'onPageShow'); | ||
| 74 | } | 91 | } |
| 75 | 92 | ||
| 76 | - onPageShow(): void { | ||
| 77 | - console.error('onPageShow videoChanel') | 93 | + onPageHide(): void { |
| 94 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' }) | ||
| 95 | + // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 96 | + Logger.info(TAG, 'onPageHide'); | ||
| 78 | } | 97 | } |
| 79 | 98 | ||
| 80 | /** | 99 | /** |
-
Please register or login to post a comment