diff --git a/features/fund/src/main/ets/view/FundComponent.ets b/features/fund/src/main/ets/view/FundComponent.ets index 7b815c87c541a8e634da19a7aee23ed677a8be99..3fd6651f96ac63a27fabc24f9a4067807543e07f 100644 --- a/features/fund/src/main/ets/view/FundComponent.ets +++ b/features/fund/src/main/ets/view/FundComponent.ets @@ -487,7 +487,7 @@ export struct FundComponent { this.backgroundX = width - FundConstants.CALCULATE_POSITION; } } - this.backgroundX = vp2px(this.backgroundX) + this.backgroundX = this.getUIContext().vp2px(this.backgroundX) }) } } \ No newline at end of file diff --git a/features/fund/src/main/ets/view/FundNavigationComponent.ets b/features/fund/src/main/ets/view/FundNavigationComponent.ets index 7eee6a4bd841835e6b58f6a99e659a2802b19c3a..b159654cc0acffc457cccc515b92a1d913cf0526 100644 --- a/features/fund/src/main/ets/view/FundNavigationComponent.ets +++ b/features/fund/src/main/ets/view/FundNavigationComponent.ets @@ -469,7 +469,7 @@ export struct FundNavigationComponent { this.backgroundX = width - FundConstants.CALCULATE_POSITION; } } - this.backgroundX = vp2px(this.backgroundX) + this.backgroundX = this.getUIContext().vp2px(this.backgroundX) }) } } \ No newline at end of file diff --git a/features/fund/src/main/ets/view/Funding.ets b/features/fund/src/main/ets/view/Funding.ets index 6157f9603ad95689dde79e0ad96f3a5907523cd8..453f852e57ac79b38f4e5c76ec6f7d3900182e72 100644 --- a/features/fund/src/main/ets/view/Funding.ets +++ b/features/fund/src/main/ets/view/Funding.ets @@ -118,7 +118,7 @@ export struct Funding { .hideTitleBar(true) .onWillShow(() => { AppStorage.setOrCreate('allFund', FundingViewModel.getAllFundInfo()); - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let sysBarProps: window.SystemBarProperties = { statusBarColor: '#FFFFFF' }; @@ -126,7 +126,7 @@ export struct Funding { }) }) .onWillDisappear(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let sysBarProps: window.SystemBarProperties = { statusBarColor: '#00ffffff' }; diff --git a/features/fund/src/main/ets/view/TrendsPage.ets b/features/fund/src/main/ets/view/TrendsPage.ets index 4033a3585863553294560dd252e963995938171d..6bcf2490253c1bfd1c526f850191e126b2a0c3cc 100644 --- a/features/fund/src/main/ets/view/TrendsPage.ets +++ b/features/fund/src/main/ets/view/TrendsPage.ets @@ -36,12 +36,12 @@ export struct TrendsPage { private controller: TabsController = new TabsController(); private callback: Callback = (data: display.FoldDisplayMode) => { if (this.isLandScape && data === display.FoldDisplayMode.FOLD_DISPLAY_MODE_FULL) { - window.getLastWindow(getContext(this)).then((stage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((stage: window.Window) => { stage.setPreferredOrientation(window.Orientation.PORTRAIT); }); } if (data === display.FoldDisplayMode.FOLD_DISPLAY_MODE_MAIN) { - window.getLastWindow(getContext(this)).then((stage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((stage: window.Window) => { stage.setPreferredOrientation(window.Orientation.LANDSCAPE) }); this.isLandScape = true; @@ -255,11 +255,11 @@ export struct TrendsPage { } .hideTitleBar(true) .onAppear(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowLayoutFullScreen(false); }) if (!this.isLandScape && this.breakPoint === CommonConstants.BREAK_POINT_SM) { - window.getLastWindow(getContext(this)).then((stage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((stage: window.Window) => { stage.setPreferredOrientation(window.Orientation.LANDSCAPE); this.isLandScape = true; }); @@ -271,11 +271,11 @@ export struct TrendsPage { } }) .onWillDisappear(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowLayoutFullScreen(true); }) if (this.isLandScape) { - window.getLastWindow(getContext(this)).then((stage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((stage: window.Window) => { stage.setPreferredOrientation(window.Orientation.PORTRAIT); }); this.isLandScape = false; diff --git a/features/home/src/main/ets/view/AccountPage.ets b/features/home/src/main/ets/view/AccountPage.ets index 6c10a7cf39398e3e403b5ea07e53107367797295..2e63072eb15f61100c299fca212c0adbbdc6c0a8 100644 --- a/features/home/src/main/ets/view/AccountPage.ets +++ b/features/home/src/main/ets/view/AccountPage.ets @@ -22,9 +22,9 @@ export struct AccountPage { @StorageProp('avoidArea') topHeight: number = 0; onPageShow() { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let area = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); - let topHeight = px2vp(area.topRect.height); + let topHeight = this.getUIContext().px2vp(area.topRect.height); if (topHeight > 0) { windowStage.setWindowLayoutFullScreen(true); } @@ -32,7 +32,7 @@ export struct AccountPage { } onPageHide() { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { if (this.topHeight > 0) { windowStage.setWindowLayoutFullScreen(false); } diff --git a/features/home/src/main/ets/view/HomeComponent.ets b/features/home/src/main/ets/view/HomeComponent.ets index 61d21abd07b93c2e207d39268c5fca0cd263ed5f..c0437db2c28fbbf8d37348b99a6b4ab53b17f0ba 100644 --- a/features/home/src/main/ets/view/HomeComponent.ets +++ b/features/home/src/main/ets/view/HomeComponent.ets @@ -196,7 +196,7 @@ export struct HomeComponent { if (this.offsetValue > 0) { this.offsetValue = 0; } - this.scrollY = vp2px(this.offsetValue); + this.scrollY = this.getUIContext().vp2px(this.offsetValue); }) } .height(CommonConstants.FULL_HEIGHT_PERCENT) diff --git a/features/transaction/src/main/ets/view/TransactionComponent.ets b/features/transaction/src/main/ets/view/TransactionComponent.ets index 9047f079d4df03896137b9cc7e40ef82edc943dc..9dddd8b88443cda6feba75a638cca180265d5720 100644 --- a/features/transaction/src/main/ets/view/TransactionComponent.ets +++ b/features/transaction/src/main/ets/view/TransactionComponent.ets @@ -282,7 +282,7 @@ export struct TransactionComponent { } .hideTitleBar(true) .onShown(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let sysBarProps: window.SystemBarProperties = { statusBarColor: '#F7F7F7' }; @@ -290,7 +290,7 @@ export struct TransactionComponent { }) }) .onHidden(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let sysBarProps: window.SystemBarProperties = { statusBarColor: '#00ffffff' }; diff --git a/product/phone/src/main/ets/pages/Index.ets b/product/phone/src/main/ets/pages/Index.ets index 7889791fcf5811bca92a3521d15c02d80e46e747..baf89924f42441ea14f6a1bada12e57dc26f21a3 100644 --- a/product/phone/src/main/ets/pages/Index.ets +++ b/product/phone/src/main/ets/pages/Index.ets @@ -41,11 +41,11 @@ struct Index { } onPageShow() { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let area = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); - let topHeight = px2vp(area.topRect.height); + let topHeight = this.getUIContext().px2vp(area.topRect.height); let bottomArea = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR); - let bottom = px2vp(bottomArea.bottomRect.height); + let bottom = this.getUIContext().px2vp(bottomArea.bottomRect.height); if (topHeight > 0) { windowStage.setWindowLayoutFullScreen(true); AppStorage.setOrCreate('avoidArea', topHeight); @@ -55,7 +55,7 @@ struct Index { } onPageHide() { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { if (this.topHeight > 0) { windowStage.setWindowLayoutFullScreen(false); } @@ -110,12 +110,12 @@ struct Index { } .hideTitleBar(true) .onWillShow(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowLayoutFullScreen(false); }) }) .onWillDisappear(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowLayoutFullScreen(true); }) }) @@ -129,12 +129,12 @@ struct Index { } .hideTitleBar(true) .onWillShow(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowLayoutFullScreen(false); }) }) .onWillDisappear(() => { - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { windowStage.setWindowLayoutFullScreen(true); }) })