shop-applet/pages/nongKe/supply_chain/maps.vue

67 lines
1.4 KiB
Vue

<template>
<view class="">
<map id="map" :enable-zoom="true" :markers="markers" :scale="19" :latitude="28.908447" :enable-scroll="true"
:longitude="105.439304" style="width: 100vw;height: 100vh;">
<!-- <cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
</cover-image> -->
</map>
</view>
</template>
<script>
import {
vicinityStoreApi,
supAgoodsApi
} from '@/api/store.js';
export default {
data() {
return {
markers: [{
id: 1,
latitude: 28.908447,
longitude: 105.439304,
title: "测试商家名称",
iconPath: "/static/images/GXSC/SJicon.png"
}, {
id: 2,
latitude: 28.909447,
longitude: 105.439304,
title: "测试商家名称",
iconPath: "/static/images/GXSC/SJicon.png"
}, {
id: 3,
latitude: 28.908447,
longitude: 105.459304,
title: "测试商家名称",
iconPath: "/static/images/GXSC/SJicon.png"
}, ]
}
}
,
onLoad(options) {
let that = this
// supAgoodsApi()
vicinityStoreApi(options.street_id).then(res => {
// console.log(res.data.list)
res.data.list.forEach(item => {
if (!item.lat) return
this.markers = []
// console.log(item)
that.markers.push({
id: item.mer_id,
latitude: item.lat,
longitude: item.long,
title: item.mer_name,
iconPath: "/static/images/GXSC/SJicon.png"
})
})
})
}
}
</script>
<style>
</style>