|
|
@ -189,8 +189,8 @@ export default { |
|
|
|
memberCount: 0, |
|
|
|
remark: '', //备注【最大500字】 |
|
|
|
address: '', //详细地址 |
|
|
|
longitude: 36.0722275, //经度 |
|
|
|
latitude: 120.38945519 //纬度 |
|
|
|
longitude: 120.38945519, //经度 |
|
|
|
latitude: 36.0722275//纬度 |
|
|
|
}, |
|
|
|
serviceList: [],//服务list |
|
|
|
|
|
|
@ -198,6 +198,7 @@ export default { |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
mounted () { |
|
|
|
|
|
|
|
this.initMap() |
|
|
|
}, |
|
|
|
|
|
|
@ -210,16 +211,27 @@ export default { |
|
|
|
//获取服务事项 |
|
|
|
await this.loadService() |
|
|
|
|
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
if (!latitude || latitude == "" || latitude == "0") { |
|
|
|
latitude = 39.9088810666821; |
|
|
|
longitude = 116.39743841556731; |
|
|
|
} |
|
|
|
|
|
|
|
this.formData.latitude = latitude |
|
|
|
this.formData.longitude = longitude |
|
|
|
|
|
|
|
this.formType = type |
|
|
|
if (unitId) { |
|
|
|
this.unitId = unitId |
|
|
|
this.formData.id = unitId |
|
|
|
await this.loadFormData() |
|
|
|
} else { |
|
|
|
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|
|
|
this.setMarker(36.0722275, 120.38945519) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|
|
|
this.setMarker(this.formData.latitude, this.formData.longitude) |
|
|
|
|
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
}, |
|
|
@ -259,8 +271,8 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
this.formData = { ...data } |
|
|
|
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|
|
|
this.setMarker(this.formData.latitude, this.formData.longitude) |
|
|
|
// map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|
|
|
// this.setMarker(this.formData.latitude, this.formData.longitude) |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
@ -329,7 +341,7 @@ export default { |
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap () { |
|
|
|
// 定义地图中心点坐标 |
|
|
|
var center = new window.TMap.LatLng(36.0722275, 120.38945519) |
|
|
|
var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude) |
|
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
|
map = new window.TMap.Map(document.getElementById('app'), { |
|
|
|
center: center, // 设置地图中心点坐标 |
|
|
|