From 9bd913b15b11d00fc324d72ec127cd18ef10d565 Mon Sep 17 00:00:00 2001 From: WX1379483 Date: Thu, 8 May 2025 10:30:29 +0800 Subject: [PATCH] fixed --- entry/src/main/ets/pages/AuthorizedDialog.ets | 16 ++++++++-------- entry/src/main/ets/pages/Logout.ets | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/entry/src/main/ets/pages/AuthorizedDialog.ets b/entry/src/main/ets/pages/AuthorizedDialog.ets index 07ce6de..d706e34 100644 --- a/entry/src/main/ets/pages/AuthorizedDialog.ets +++ b/entry/src/main/ets/pages/AuthorizedDialog.ets @@ -40,24 +40,24 @@ export struct AuthorizedDialog { loginVerification() { if (!this.inputContent || !this.password) { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.input_phone_number_or_password'), duration: 2000 }); } else if (this.inputContent && this.password && !this.allowClick) { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.incorrect_mobile_number_format'), duration: 2000 }); } else { if (!this.isHasNetwork) { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.network_error'), duration: 2000 }); } else { if (!this.isChecked) { - promptAction.openCustomDialog({ + this.getUIContext().getPromptAction().openCustomDialog({ builder: () => { this.customDialogComponent(); }, @@ -79,7 +79,7 @@ export struct AuthorizedDialog { }) } else { AppStorage.setOrCreate('isLogin', true); - router.pushUrl({ + this.getUIContext().getRouter().pushUrl({ url: 'pages/Index' }); } @@ -127,7 +127,7 @@ export struct AuthorizedDialog { .height($r('app.float.customDialog_bottom_row_height')) .lineHeight($r('app.float.line_height')) .onClick(() => { - promptAction.closeCustomDialog(this.customDialogComponentId) + this.getUIContext().getPromptAction().closeCustomDialog(this.customDialogComponentId) }) Text($r('app.string.confirm_login')) @@ -140,10 +140,10 @@ export struct AuthorizedDialog { .lineHeight($r('app.float.line_height')) .onClick(() => { AppStorage.setOrCreate('isLogin', true); - router.pushUrl({ + this.getUIContext().getRouter().pushUrl({ url: 'pages/Index' }); - promptAction.closeCustomDialog(this.customDialogComponentId); + this.getUIContext().getPromptAction().closeCustomDialog(this.customDialogComponentId); }) } .height($r('app.float.customDialog_bottom_row_height')) diff --git a/entry/src/main/ets/pages/Logout.ets b/entry/src/main/ets/pages/Logout.ets index 7c12320..f507891 100644 --- a/entry/src/main/ets/pages/Logout.ets +++ b/entry/src/main/ets/pages/Logout.ets @@ -39,7 +39,7 @@ export struct Logout { .height($r('app.float.customDialog_bottom_row_height')) .lineHeight($r('app.float.line_height')) .onClick(() => { - promptAction.closeCustomDialog(this.customDialogComponentId); + this.getUIContext().getPromptAction().closeCustomDialog(this.customDialogComponentId); }) Text($r('app.string.confirmed')) @@ -53,10 +53,10 @@ export struct Logout { .onClick(() => { this.isShowSheet = false; AppStorage.setOrCreate('isLogin', false); - router.pushUrl({ + this.getUIContext().getRouter().pushUrl({ url: 'pages/Index' }); - promptAction.closeCustomDialog(this.customDialogComponentId); + this.getUIContext().getPromptAction().closeCustomDialog(this.customDialogComponentId); }) } .height($r('app.float.customDialog_bottom_row_height')) @@ -80,7 +80,7 @@ export struct Logout { .textAlign(TextAlign.Center) .width(CommonConstants.FULL_SCREEN) .onClick(() => { - promptAction.openCustomDialog({ + this.getUIContext().getPromptAction().openCustomDialog({ builder: () => { this.customDialogComponent(); }, -- Gitee