Commit 8da4f052 by 王志慧

地图功能

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