Commit 8da4f052 by 王志慧

地图功能

1 parent cd8bfcf6
...@@ -114,6 +114,17 @@ const addFlagparkingSpace = params => { ...@@ -114,6 +114,17 @@ const addFlagparkingSpace = params => {
sign: true sign: true
}) })
} }
// 删除车位标记
const deleteFlagparkingSpaceparams =params=> {
params.method = 'marketing.api.charge.parkingSpace.deleteFlag'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
export default { export default {
getParkingSpaceListApi, getParkingSpaceListApi,
getHistoryListApi, getHistoryListApi,
...@@ -124,5 +135,7 @@ export default { ...@@ -124,5 +135,7 @@ export default {
getRadarListApi, getRadarListApi,
delParkingSpaceApi, delParkingSpaceApi,
updateParkingSpaceApi, updateParkingSpaceApi,
saveParkingSpacePicApi saveParkingSpacePicApi,
addFlagparkingSpace,
deleteFlagparkingSpaceparams
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.amap-info-content { .amap-info-content {
width: 314px; width: 314px;
height: 243px; height: auto;
background: #FFFFFF !important; background: #FFFFFF !important;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d !important; box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d !important;
border-radius: 4px !important; border-radius: 4px !important;
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
overflow: hidden!important; overflow: hidden!important;
} }
.custom-infowindow {
.title { .title {
width: 100%; width: 100%;
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
.custom-item { .custom-item {
padding: 12px 20px; padding: 12px 20px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #E5E5E5;
.item { .item {
display: flex; display: flex;
...@@ -71,6 +70,7 @@ ...@@ -71,6 +70,7 @@
align-items: center; align-items: center;
padding-right: 20px; padding-right: 20px;
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid #E5E5E5;
div { div {
width: 44px; width: 44px;
...@@ -97,4 +97,3 @@ ...@@ -97,4 +97,3 @@
color: #FFFFFF; color: #FFFFFF;
} }
} }
}
\ No newline at end of file \ No newline at end of file
...@@ -30,6 +30,7 @@ export default { ...@@ -30,6 +30,7 @@ export default {
placeSearch: '', placeSearch: '',
map: '', map: '',
address: '', address: '',
markerData:{},
contextMenuPositon: '', //右键菜单位置 contextMenuPositon: '', //右键菜单位置
controlList: [ controlList: [
{ {
...@@ -71,7 +72,7 @@ export default { ...@@ -71,7 +72,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.initMap() ;(this.merchantId = this.$globalState.session.merchantId), this.initMap()
}, },
methods: { methods: {
initMap() { initMap() {
...@@ -119,14 +120,17 @@ export default { ...@@ -119,14 +120,17 @@ export default {
}) })
}, },
initMarket(marker) { initMarket(marker) {
let { map, AMap, contextMenuPositon, address } = this, let { map, AMap, contextMenuPositon, address,markerData } = this,
that = this, that = this,
infoWindowContent, infoWindowContent,
infoWindow infoWindow
if (marker) { if (marker) {
marker.on('click', function (e) { marker.on('click', function (e) {
console.log('点击', e) console.log('点击', e)
markerData=marker.getExtData()
that.contextMenuPositon = e.lnglat that.contextMenuPositon = e.lnglat
that.getAddress() that.getAddress()
infoWindowContent = `<div class="custom-infowindow input-card"> infoWindowContent = `<div class="custom-infowindow input-card">
...@@ -142,7 +146,7 @@ export default { ...@@ -142,7 +146,7 @@ export default {
</div> </div>
<div class="item"> <div class="item">
<span>车位编号</span> <span>车位编号</span>
<span class="item-text" >124.214.124</span> <span class="item-text" >${markerData.parkingNumber}</span>
</div> </div>
<div class="item"> <div class="item">
<span>经纬度解析</span> <span>经纬度解析</span>
...@@ -257,20 +261,26 @@ export default { ...@@ -257,20 +261,26 @@ export default {
AMap, AMap,
map, map,
id, id,
merchantId,
contextMenuPositon: { lng, lat } contextMenuPositon: { lng, lat }
} = this, } = this,
marker marker
let params = { let params = {
id, id,
parkingAddressLng: lng, parkingAddressLng: lng,
parkingAddressLat: lat parkingAddressLat: lat,
merchantId
} }
this.$apis.parkingSpace.addFlagparkingSpace(params).then(res => { this.$apis.parkingSpace.addFlagparkingSpace(params).then(res => {
if (res) { if (res) {
marker = new AMap.Marker({ marker = new AMap.Marker({
icon: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png', icon: require('@/assets/default.png'),
position: [lng, lat], position: [lng, lat],
offset: new AMap.Pixel(-13, -30) anchor: 'bottom-left',
extData: {
id
},
style: { width: '48px', height: '48px' }
}) })
marker.setMap(map) marker.setMap(map)
this.initMarket(marker) this.initMarket(marker)
...@@ -402,8 +412,7 @@ export default { ...@@ -402,8 +412,7 @@ export default {
let { map } = this let { map } = this
map.zoomOut() map.zoomOut()
} }
}, }
} }
</script> </script>
......
...@@ -388,7 +388,10 @@ export default { ...@@ -388,7 +388,10 @@ export default {
methods: { methods: {
//车位标记 //车位标记
sign(row){ sign(row){
this.$router.push(`/parkingPlace/sign/${row.id}`) this.$router.push({
path:'/parkingPlace/sign',
query:row
})
}, },
openUploadDialog(row) { openUploadDialog(row) {
this.curId = row.id this.curId = row.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!