From 7451cc9a95edde7be3d36ec2f675f175b089a442 Mon Sep 17 00:00:00 2001 From: kilo Date: Mon, 21 Aug 2023 15:27:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E9=80=81=E5=9C=B0=E5=9B=BEdemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/distribution/reservation/atlas1.vue | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/views/distribution/reservation/atlas1.vue b/src/views/distribution/reservation/atlas1.vue index ff4108ea..800e3aff 100644 --- a/src/views/distribution/reservation/atlas1.vue +++ b/src/views/distribution/reservation/atlas1.vue @@ -31,6 +31,7 @@ import { getDictionaryBiz } from '@/api/system/dict'; import { onMounted, reactive, toRefs, watchEffect } from 'vue'; import { useRouter } from 'vue-router'; + import { selectStockArticleAtlasInfo } from '@/api/distribution/distributionDeliveryList'; let router = useRouter(); let details = reactive({ name: 'BmapDemo', @@ -43,17 +44,22 @@ }); onMounted(() => { details.item = JSON.parse(router.currentRoute.value.query.item); - setTimeout(() => { - init(); - }, 1500); + selectStockArticleAtlasInfo(details.item.id).then(res => { + const data = res.data.data; + console.log('res------------->', data); + setTimeout(() => { + init(data); + }, 1500); + }); // setTimeout(()=>{ // details.mapLoc.clearOverlays(); // },9500) }); - function init() { + function init(data) { details.mapLoc = new BMapGL.Map('container'); // 创建地图实例 + let point = new BMapGL.Point(116.404, 39.915); // 创建点坐标 details.mapLoc.centerAndZoom(point, 12); details.mapLoc.enableScrollWheelZoom(true); @@ -61,7 +67,14 @@ if (details.mapLoc) { details.mapLoc.clearOverlays(); //清除地图的label } - maplabel('四川成都龙泉驿区','展示的内容', 0); + let a = data; + a.forEach((item,index)=>{ + console.log('item------------->', item); + maplabel(item.customerAddress, item.customerName+"--"+item.customerAddress+"--"+item.customerTelephone, index); + + // maplabel('中国四川省成都市简阳市石桥镇简阳市石桥镇红星美凯龙雄州商场-1-26-154', '周娅', 0); + }) + // maplabel('四川成都龙泉驿区','展示的内容', 0); } function maplabel(address,contents, index) { let myGeo = new BMapGL.Geocoder();