Browse Source

默认经纬度问题

feature/dev/vaccine_prarmeter
jiangyy 3 years ago
parent
commit
c96f313ccf
  1. 26
      src/views/modules/communityParty/regionalParty/activitysForm.vue
  2. 26
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  3. 14
      src/views/modules/shequzhili/event/cpts/add.vue

26
src/views/modules/communityParty/regionalParty/activitysForm.vue

@ -254,8 +254,8 @@ export default {
peopleCount: 0,//
result: '', //
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
longitude: 120.38945519, //
latitude: 36.0722275 //
},
serviceList: [],
// gridList: [],
@ -274,23 +274,31 @@ export default {
async initForm (type, activityId) {
this.startLoading()
this.$refs.ref_form.resetFields();
// const { user } = this.$store.state
// this.agencyId = user.agencyId
// await this.loadGrid()
//
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 (activityId) {
this.activityId = activityId
this.formData.id = activityId
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()
},
@ -353,8 +361,8 @@ export default {
}
console.log(this.formData.content)
map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude)))
this.setMarker(this.formData.latitude, this.formData.longitude)
// map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude)))
// this.setMarker(this.formData.latitude, this.formData.longitude)
} else {
this.$message.error(msg)
}

26
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -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, //

14
src/views/modules/shequzhili/event/cpts/add.vue

@ -402,10 +402,20 @@ export default {
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
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.initMap()
this.loadGrid();
this.getCategoryList()
this.initMap()
},
@ -597,7 +607,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, //

Loading…
Cancel
Save