diff --git a/entry/src/main/ets/pages/GoCompany.ets b/entry/src/main/ets/pages/GoCompany.ets index 0513ab3f11a63ee66ede1e389e55debf77f30fee..2fc23219e6051ad4274490f3fafb583b05a7a128 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 cab0a10512778c85ea7a35657badbaf164df9e96..248c7d80e2f96d1d03748ebee15815c449f745f6 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 a303cb90182a4714357649971d24abaf3f6d6420..e698780a7613f3c77335a901632bd70b3d06c1fb 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 })