From d46c73777ee0507f21ac3273d2751cfa1f7ab84e Mon Sep 17 00:00:00 2001 From: liuye Date: Wed, 14 Aug 2024 16:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A5=E6=88=BF=E6=89=BE=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppBuilding/components/searchMap.vue | 23 ++-- src/project/weiyang/AppBuilding/list.vue | 10 +- src/project/weiyang/AppBuilding/map.vue | 121 ++++++++++++------ src/project/weiyang/AppWorkTask/detail.vue | 4 +- 4 files changed, 100 insertions(+), 58 deletions(-) diff --git a/src/project/weiyang/AppBuilding/components/searchMap.vue b/src/project/weiyang/AppBuilding/components/searchMap.vue index 8b4653c..67da0e8 100644 --- a/src/project/weiyang/AppBuilding/components/searchMap.vue +++ b/src/project/weiyang/AppBuilding/components/searchMap.vue @@ -131,11 +131,10 @@ export default { retryMapCount: 0, building: {}, buildPopup: false, - - latitude: 30.606355, - longitude: 114.429633, - // latitude: 23.099994, - // longitude: 113.324520, + // latitude: 30.606355, + // longitude: 114.429633, + latitude: '', + longitude: '', _mapContext: null, markList: [], statusBarHeight: uni.getSystemInfoSync().statusBarHeight, @@ -143,13 +142,13 @@ export default { }, computed: {...mapState(['user'])}, mounted() { - // uni.getLocation({ - // type: 'wgs84', - // success: (res) => { - // this.latitude = res.latitude - // this.longitude = res.longitude - // } - // }); + uni.getLocation({ + type: 'wgs84', + success: (res) => { + this.latitude = res.latitude + this.longitude = res.longitude + } + }); this._mapContext = uni.createMapContext("map", this); // 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {}) this._mapContext.initMarkerCluster({ diff --git a/src/project/weiyang/AppBuilding/list.vue b/src/project/weiyang/AppBuilding/list.vue index 26f7932..1e51524 100644 --- a/src/project/weiyang/AppBuilding/list.vue +++ b/src/project/weiyang/AppBuilding/list.vue @@ -18,12 +18,12 @@ - + @@ -92,8 +92,8 @@ export default { toDetail(id) { uni.navigateTo({url: `./detail?id=${id}`}) }, - toMap(id, areaId) { - uni.navigateTo({url: `./map?id=${id}&areaId=${areaId}`}) + toMap(id, lat, lng) { + uni.navigateTo({url: `./map?id=${id}&lat=${lat}&lng=${lng}`}) } }, diff --git a/src/project/weiyang/AppBuilding/map.vue b/src/project/weiyang/AppBuilding/map.vue index 127d3de..f5e44c3 100644 --- a/src/project/weiyang/AppBuilding/map.vue +++ b/src/project/weiyang/AppBuilding/map.vue @@ -1,10 +1,13 @@