From 203af2a19b20945a1adcf5032cb286929575ebd9 Mon Sep 17 00:00:00 2001 From: "@feng-yu4279" Date: Tue, 13 May 2025 16:13:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BA=9F=E5=BC=83api=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/ets/pages/PaymentSuccess.ets | 2 +- entry/src/main/ets/view/MessageItem.ets | 2 +- entry/src/main/ets/view/WarningBox.ets | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets b/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets index 31b31c6..cc5d8a6 100644 --- a/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets +++ b/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets @@ -19,7 +19,7 @@ import { promptAction } from '@kit.ArkUI'; @Preview @Component export struct PaymentSuccess { - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; + private context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; backToApp() { const want: Want = {}; diff --git a/entry/src/main/ets/view/MessageItem.ets b/entry/src/main/ets/view/MessageItem.ets index 521d830..17c64b8 100644 --- a/entry/src/main/ets/view/MessageItem.ets +++ b/entry/src/main/ets/view/MessageItem.ets @@ -23,7 +23,7 @@ function EmptyBuilder() {} export struct MessageItem { @Prop message: Message; @BuilderParam contentBuilder: () => void = EmptyBuilder; - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; + private context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; build() { Row() { diff --git a/entry/src/main/ets/view/WarningBox.ets b/entry/src/main/ets/view/WarningBox.ets index dc3dd68..c2a187d 100644 --- a/entry/src/main/ets/view/WarningBox.ets +++ b/entry/src/main/ets/view/WarningBox.ets @@ -18,7 +18,7 @@ import { pullUpSystemSetting } from '../viewmodel/MessageViewModel'; @Component export struct WarningBox { - private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; + private context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; build() { Row() { -- Gitee From f2f405ea61a95a031e05199f1946315af6d8f4d4 Mon Sep 17 00:00:00 2001 From: "@feng-yu4279" Date: Tue, 13 May 2025 17:30:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BA=9F=E5=BC=83api=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/ets/pages/PaymentSuccess.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets b/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets index cc5d8a6..e3173e2 100644 --- a/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets +++ b/dependence/AppLinkingTestDemo/entry/src/main/ets/pages/PaymentSuccess.ets @@ -32,7 +32,7 @@ export struct PaymentSuccess { } aboutToAppear(): void { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.page_redirect_notice'), duration: 3000 }) -- Gitee