diff --git a/entry/src/main/ets/pages/AuthorizedDialog.ets b/entry/src/main/ets/pages/AuthorizedDialog.ets index 07ce6de2771661aa217c55dc6e68b32fed03171c..d706e340800feec20e6768fe43dfbfb2934a545e 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 7c12320f31350a8bc87dbaea04c3dbf85cfa4449..f507891c74a698263dcd8f9b4fe35ef651eaa13c 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(); },