Przeglądaj źródła

Merge branch 'develop/3.1.5' into test

DESKTOP-SVI9JE1\muzen 1 rok temu
rodzic
commit
411cf67df9
1 zmienionych plików z 15 dodań i 5 usunięć
  1. 15 5
      src/pages/map/index.vue

+ 15 - 5
src/pages/map/index.vue

@@ -75,6 +75,8 @@ import { options, list, storeList } from '@/api/map'
 export default {
   data() {
     return {
+      // 是否为APP内部H5
+      inside: getApp().globalData.inside,
       // 定位
       location: '定位中...',
       // 省市区列表
@@ -252,7 +254,7 @@ export default {
     openMap(e) {
       this.$refs.popup.close()
       let url = ''
-      if (getApp().globalData.inside) {
+      if (this.inside) {
         openOtherApp.postMessage(`?page=${e.value}&longitude=${this.toLng}&latitude=${this.toLat}&name=${this.toName}`)
       } else {
         // 腾讯地图
@@ -355,14 +357,22 @@ export default {
 
     // 跳转第三方店铺
     getStore(url) {
-      openOtherApp.postMessage(`?page=openOtherWeb&url=${url}`)
+      if (this.inside) {
+        openOtherApp.postMessage(`?page=openOtherWeb&url=${url}`)
+      } else {
+        window.location.href = url
+      }
     },
 
     // 拨打电话
     getPhone(e) {
-      uni.makePhoneCall({
-        phoneNumber: e
-      })
+      if (this.inside) {
+        openOtherApp.postMessage(`?page=callPhone&name=${e}`)
+      } else {
+        uni.makePhoneCall({
+          phoneNumber: e
+        })
+      }
     },
 
     // 打开地图