From 36b846e41c1e5614de17dfc980b691e00da5838d Mon Sep 17 00:00:00 2001 From: WX1377357 Date: Thu, 8 May 2025 10:40:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=BA=9F=E5=BC=83api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fund/src/main/ets/view/FundComponent.ets | 2 +- .../main/ets/view/FundNavigationComponent.ets | 2 +- features/fund/src/main/ets/view/Funding.ets | 4 ++-- features/fund/src/main/ets/view/TrendsPage.ets | 12 ++++++------ features/home/src/main/ets/view/AccountPage.ets | 6 +++--- .../home/src/main/ets/view/HomeComponent.ets | 2 +- .../src/main/ets/view/TransactionComponent.ets | 4 ++-- product/phone/src/main/ets/pages/Index.ets | 16 ++++++++-------- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/features/fund/src/main/ets/view/FundComponent.ets b/features/fund/src/main/ets/view/FundComponent.ets index 7b815c8..3fd6651 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 7eee6a4..b159654 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 6157f96..453f852 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 4033a35..6bcf249 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 6c10a7c..2e63072 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 61d21ab..c0437db 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 9047f07..9dddd8b 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 7889791..baf8992 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); }) }) -- Gitee