From 6d71b9213de7166da8da954241f9ee073fc5b0e3 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 10:42:51 +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/Index.ets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index c014f71..d422dc6 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -37,7 +37,7 @@ struct WebCustomPressMenu { aboutToAppear() { webview.WebviewController.initializeWebEngine(); - let context = getContext(this) as common.UIAbilityContext; + let context = this.getUIContext().getHostContext() as common.UIAbilityContext; this.context = context; } @@ -163,8 +163,8 @@ struct WebCustomPressMenu { if (event) { this.result = event.result; this.param = event.param; - this.pressPosX = px2vp(event.param.x()); - this.pressPosY = px2vp(event.param.y()); + this.pressPosX = this.getUIContext().px2vp(event.param.x()); + this.pressPosY = this.getUIContext().px2vp(event.param.y()); logger.debug(CommonConstants.TAG, `x coord = ${this.pressPosX}, y coord = ${this.pressPosY}`); logger.info(CommonConstants.TAG, 'link url = ' + event.param.getLinkUrl()); this.linkUrl = event.param.getLinkUrl(); -- Gitee