From cb429a55a72f46bc8b749e0870b4a006fd066c78 Mon Sep 17 00:00:00 2001 From: pyt <626651354@qq.com> Date: 星期四, 27 二月 2025 15:31:34 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/H5/threeSide --- H5/pages/location/location.vue | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/H5/pages/location/location.vue b/H5/pages/location/location.vue index 6bbc0c3..d25a23a 100644 --- a/H5/pages/location/location.vue +++ b/H5/pages/location/location.vue @@ -96,7 +96,7 @@ result.id = index + 1 return result }); - console.log(this.locationList); + } }) return @@ -111,7 +111,7 @@ ak: '3mHKIXMArjgIkgADzOlTYp4XssNSNkwr' // 替换为你自己的 AK }, success: (res) => { - console.log(res, '-------'); + if (res.data.status === 0) { this.searchResults = res.data.results; this.latitude = res.data.results[0].location.lat @@ -135,7 +135,7 @@ }, onReady() { this.map = new BMapGL.Map("container"); // 创建地图实例 - console.log(this.map); + // uni.getLocation({ // type: 'wgs84', // success: (res) => { @@ -146,12 +146,12 @@ const longitude = position.coords.longitude; const accuracy = position.coords.accuracy; // 精度,单位米 - console.log(`纬度: ${latitude}, 经度: ${longitude}, 精度: ${accuracy}`); + // 在这里可以使用获取到的经纬度信息,例如在地图上显示位置等。 } function error(err) { - console.log(err); + switch (err.code) { case err.PERMISSION_DENIED: console.error("用户拒绝了位置请求。"); @@ -191,7 +191,7 @@ item.id = index + 1 return item }) - console.log(this.locationList); + }) this.map.addEventListener('click', (e) => { this.clearMarkers() @@ -203,7 +203,7 @@ var myGeo = new BMapGL.Geocoder(); // 根据坐标得到地址描述 myGeo.getLocation(new BMapGL.Point(e.latlng.lng, e.latlng.lat), (result) => { - console.log(result, 'result'); + this.locationList = result.surroundingPois.map((item, index) => { item.id = index + 1 return item @@ -216,7 +216,7 @@ }); // }, // error:err=>{ - // console.log(err,'err'); + // // } // }); -- Gitblit v1.7.1