From 36c9f216a4f265ffe02530ef7243ab5202c39236 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 12 Oct 2022 15:01:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5=20openLocation):=20=E8=85=BE=E8=AE=AF?= =?UTF-8?q?=E3=80=81=E9=AB=98=E5=BE=B7=E5=AF=BC=E8=88=AA=E6=9C=AA=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(question/155066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system-routes/open-location/index.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/platforms/h5/components/system-routes/open-location/index.vue b/src/platforms/h5/components/system-routes/open-location/index.vue index 139c5cca8..564a709e3 100644 --- a/src/platforms/h5/components/system-routes/open-location/index.vue +++ b/src/platforms/h5/components/system-routes/open-location/index.vue @@ -141,17 +141,15 @@ export default { url = `https://www.google.com/maps/dir/?api=1${origin}&destination=${this.latitude}%2C${this.longitude}` } else if (mapInfo.type === MapType.QQ) { const fromcoord = this.location.latitude - ? `&fromcoord=${this.location.latitude}%2C${this.location.longitude}` + ? `&fromcoord=${this.location.latitude}%2C${this.location.longitude}&from=${encodeURIComponent( + '我的位置' + )}` : '' url = `https://apis.map.qq.com/uri/v1/routeplan?type=drive${fromcoord}&tocoord=${this.latitude - }%2C${this.longitude}&from=${encodeURIComponent( - '我的位置' - )}&to=${encodeURIComponent(this.name || '目的地')}&ref=${mapInfo.key}` + }%2C${this.longitude}&to=${encodeURIComponent(this.name || '目的地')}&ref=${mapInfo.key}` } else if (mapInfo.type === MapType.AMAP) { - url = `https://m.amap.com/navi/?dest=${this.longitude},${this.latitude}&key=${mapInfo.key}` - if (this.name) { - url += `&destName=${this.name}` - } + const from = this.location.latitude ? `from=${this.location.longitude},${this.location.latitude},${encodeURIComponent('我的位置')}&` : '' + url = `https://uri.amap.com/navigation?${from}to=${this.longitude},${this.latitude},${encodeURIComponent(this.name || '目的地')}}` } window.open(url) } -- GitLab