|
@@ -1,7 +1,22 @@
|
|
|
import { InAppBrowser, DefaultWebViewOptions } from "@capacitor/inappbrowser";
|
|
|
-import dayjs from "dayjs";
|
|
|
+import { openGaoDe } from "./appLauncher";
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// dappView
|
|
|
+await InAppBrowser.addListener(
|
|
|
+ "browserPageNavigationCompleted",
|
|
|
+ async (data) => {
|
|
|
+ if (data.url.indexOf("amap.com/navigation") > -1) {
|
|
|
+ const params = new URLSearchParams(data.url);
|
|
|
+ const to = params.get("to");
|
|
|
+ await openGaoDe(to[0], to[1], to[2]);
|
|
|
+ // await InAppBrowser.close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+
|
|
|
export const openDapp = async (url, params) => {
|
|
|
// 将对象参数转换为 URL 查询字符串
|
|
|
const queryString = new URLSearchParams(params).toString();
|
|
@@ -13,7 +28,9 @@ export const openDapp = async (url, params) => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const browser = await InAppBrowser.openInWebView({
|
|
|
+
|
|
|
+
|
|
|
+ await InAppBrowser.openInWebView({
|
|
|
// url: "http://192.168.0.11:5173",
|
|
|
url: fullUrl,
|
|
|
options: {
|