From 4a17f2242c6cfcf0ca3f3056f0b53ff15235bdf9 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 27 Apr 2026 17:01:35 +0800
Subject: [PATCH] feat: 微信地图定位

---
 src/components/WebViewPlus.vue |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/components/WebViewPlus.vue b/src/components/WebViewPlus.vue
index 437b7a8..d5e9d9d 100644
--- a/src/components/WebViewPlus.vue
+++ b/src/components/WebViewPlus.vue
@@ -24,15 +24,30 @@
 // WEB_INVOKE_APPSERVICE
 function messageFun(e) {
   if (e.data.type === "WEB_INVOKE_APPSERVICE") {
-    if (e.data.data.arg.type === "tokenExpired") {
-      return uni.reLaunch({
-        url: "/pages/login/index",
-      });
+    const {type,data} = e.data.data.arg
+    if (type === "tokenExpired") {
+      return uni.reLaunch({url: "/pages/login/index"});
+    }else if(type === "wxOpenLocation"){
+      return wx.openLocation({
+        latitude: data.latitude,
+        longitude: data.longitude,
+        name: data.name,
+        address: data.name,
+        scale: 18
+      })
+    }else{
+      emit("webMessage", e.data.data.arg);
     }
-    emit("webMessage", e.data.data.arg);
   }
 }
 
+
+onLoad((obj) => {
+  // const h5Params = obj?.cs && JSON.parse(obj?.cs)
+  // console.log('h5Params', h5Params)
+  // h5Params && viewMessage({detail: {data: [h5Params.data]}})
+})
+
 onShow(() => {
   if (window && window.addEventListener)
     window.addEventListener("message", messageFun);

--
Gitblit v1.9.3