From 4c0c0bb546f0084e85c89b256660a3da4e550fc0 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 14 Jul 2023 09:21:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=8E=B7=E5=8F=96=E7=B2=BE?= =?UTF-8?q?=E7=A1=AE=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index 30b8767a..5765e353 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -157,16 +157,19 @@ const Index = () => { Taro.showLoading({ title: '加载中' }) let key = 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' // 写自己申请的key Taro.getLocation({ - type: 'wgs84', + // type: 'wgs84', + type: 'gcj02', isHighAccuracy: true, highAccuracyExpireTime: 1000 * 6, success: function (res) { + console.log(res); setLongitude(res.longitude) setLatitude(res.latitude) Taro.request({ url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=${key}`, success: function (res) { // 根据自己项目需求获取res内容 + console.log('地址信息:', res); let addresscity = '' addresscity = res.data.result.address_component.province