linwenxin пре 7 месеци
родитељ
комит
579ac06300
1 измењених фајлова са 10 додато и 8 уклоњено
  1. 10 8
      src/common/utils/common.js

+ 10 - 8
src/common/utils/common.js

@@ -224,14 +224,16 @@ export const copy = val => {
 export const openLocation = (options = {}) => {
   if (!options) return
   const { lat, lng, name, address } = options
-  wx.openLocation({
-    latitude: Number(lat),
-    longitude: Number(lng),
-    name,
-    address,
-    success: () => {
-      console.log('success')
-    }
+  wxConfig(undefined, undefined, () => {
+    wx.openLocation({
+      latitude: Number(lat),
+      longitude: Number(lng),
+      name,
+      address,
+      success: () => {
+        console.log('success')
+      }
+    })
   })
 }