From 9dfc9fd22017919c00b59c9debb1e4d036058b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E4=B8=9C=E6=B5=B7?= Date: Tue, 6 May 2025 16:28:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E7=9A=84API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/GoCompany.ets | 2 +- entry/src/main/ets/pages/GoHouse.ets | 2 +- entry/src/main/ets/pages/Index.ets | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entry/src/main/ets/pages/GoCompany.ets b/entry/src/main/ets/pages/GoCompany.ets index 0513ab3..2fc2321 100644 --- a/entry/src/main/ets/pages/GoCompany.ets +++ b/entry/src/main/ets/pages/GoCompany.ets @@ -47,7 +47,7 @@ export struct GoCompany { } showTips() { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.ui_displayed'), duration: 2000 }) diff --git a/entry/src/main/ets/pages/GoHouse.ets b/entry/src/main/ets/pages/GoHouse.ets index cab0a10..248c7d8 100644 --- a/entry/src/main/ets/pages/GoHouse.ets +++ b/entry/src/main/ets/pages/GoHouse.ets @@ -49,7 +49,7 @@ export struct GoHouse { } showTips() { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.ui_displayed'), duration: 2000 }) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index a303cb9..e698780 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -49,7 +49,7 @@ struct Index { } display.on('change', callback); } else { - let deviceWidth = px2vp(display.getDefaultDisplaySync().width); + let deviceWidth = this.getUIContext().px2vp(display.getDefaultDisplaySync().width); if (deviceWidth < 380) { this.voiceIcon = 312; } @@ -62,7 +62,7 @@ struct Index { } showTips() { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.ui_displayed'), duration: 2000 }) -- Gitee