From 23e87d8d6e7f66c906b33f837d9f1e401bf8b755 Mon Sep 17 00:00:00 2001 From: liujiahui Date: Tue, 6 May 2025 16:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E6=8E=A5=E5=8F=A3=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index b2e99b7..11c37c8 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -34,11 +34,11 @@ struct Index { aboutToAppear(): void { this.classifyList = new ClassifyViewModel().getClassifyModelList(); - window.getLastWindow(getContext(this)).then((windowStage: window.Window) => { + window.getLastWindow(this.getUIContext().getHostContext()).then((windowStage: window.Window) => { let area = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); - this.topArea = px2vp(area.topRect.height); + this.topArea = this.getUIContext().px2vp(area.topRect.height); let bottom = windowStage.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR); - this.bottomArea = px2vp(bottom.bottomRect.height); + this.bottomArea = this.getUIContext().px2vp(bottom.bottomRect.height); if (this.topArea > 0) { windowStage.setWindowLayoutFullScreen(true); } @@ -69,7 +69,7 @@ struct Index { right: $r('app.float.image_margin_right') }) .onClick(() => { - router.back(); + this.getUIContext().getRouter().back(); }) Text($r('app.string.title')) @@ -132,7 +132,7 @@ struct Index { Text(item.classifyName) .fontSize($r('app.float.common_font_size')) .fontColor(index === this.currentClassify ? - $r('app.color.select_title_color') : $r('app.color.title_color')) + $r('app.color.select_title_color') : $r('app.color.title_color')) .fontWeight(index === this.currentClassify ? CommonConstants.FONT_WEIGHT_500 : FontWeight.Normal) .fontFamily($r('app.string.common_font_family')) .width($r('app.float.item_width')) -- Gitee