This commit is contained in:
yanran200730
2023-04-20 14:56:16 +08:00
parent 32f819f16a
commit 7539d38294

View File

@@ -161,6 +161,8 @@ export default {
lat: '', lat: '',
address: '' address: ''
}, },
lng: '',
lat: '',
showMap: false, showMap: false,
searchPlace: '', searchPlace: '',
timeOption: { timeOption: {
@@ -198,6 +200,18 @@ export default {
} }
} }
}, },
mounted () {
this.$nextTick(() => {
this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => {
if (res.code == 0) {
this.lng = res.data.lng
this.lat = res.data.lat
}
})
})
},
methods: { methods: {
selectMap() { selectMap() {
this.form.lng = this.placeDetail.lng this.form.lng = this.placeDetail.lng
@@ -214,7 +228,7 @@ export default {
this.map = new AMap.Map('map', { this.map = new AMap.Map('map', {
resizeEnable: true, resizeEnable: true,
zooms: [6, 20], zooms: [6, 20],
center:[107.73,29.86], center:[this.lng, this.lat],
zoom: 11, zoom: 11,
}) })
this.placeSearch = new AMap.PlaceSearch({ map: this.map }) this.placeSearch = new AMap.PlaceSearch({ map: this.map })
@@ -271,7 +285,6 @@ export default {
this.mapDetail = new AMap.Map(document.getElementById("mapDetail"), { this.mapDetail = new AMap.Map(document.getElementById("mapDetail"), {
resizeEnable: true, resizeEnable: true,
zooms: [6, 20], zooms: [6, 20],
center:[104.067923463,30.6799428454],
zoom: 11, zoom: 11,
}) })
let marker = new AMap.Marker({ let marker = new AMap.Marker({