|
|
|
@ -178,7 +178,7 @@ export default { |
|
|
|
online: 0,//开关 |
|
|
|
cutOffTime: "",//截止时间 |
|
|
|
points: 0,//积分 |
|
|
|
participants: 1,//活动人数 |
|
|
|
participants: 0,//活动人数 |
|
|
|
sendMessage: 0,//推送数 |
|
|
|
sumUp: "",//活动总结 |
|
|
|
activityImgs: [],//图片列表 |
|
|
|
@ -222,8 +222,6 @@ export default { |
|
|
|
mounted() { |
|
|
|
this.activityType() |
|
|
|
this.listServerOrg() |
|
|
|
// this.initForm() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
@ -333,15 +331,27 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// onChangeFileList(e) { |
|
|
|
// if (e.length > 0) { |
|
|
|
// let item = e[0]; |
|
|
|
// let ob = { |
|
|
|
// fileType: '0', |
|
|
|
// fileUrl: item.response.data.url |
|
|
|
// }; |
|
|
|
// this.fileList = [ob]; |
|
|
|
// this.formData.coverPic = ob.fileUrl; |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
onChangeFileList(e) { |
|
|
|
this.fileList = e.length > 0 ? e.map(item => ({ |
|
|
|
fileType: '0', |
|
|
|
fileUrl: item.response.data.url |
|
|
|
})) : []; // 当e为空时清空fileList |
|
|
|
if (e.length > 0) { |
|
|
|
let item = e[0]; |
|
|
|
let ob = { |
|
|
|
fileType: '0', |
|
|
|
fileUrl: item.response.data.url |
|
|
|
}; |
|
|
|
this.fileList = [ob]; |
|
|
|
this.formData.coverPic = ob.fileUrl; |
|
|
|
this.formData.coverPic = e[0].response.data.url; |
|
|
|
} else { |
|
|
|
this.formData.coverPic = ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -391,34 +401,26 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// async initForm(row) { |
|
|
|
// this.startLoading(); |
|
|
|
// this.formData = JSON.parse(JSON.stringify(row)); |
|
|
|
// this.initLoading = true; |
|
|
|
// console.log('this.formData,',this.formData); |
|
|
|
|
|
|
|
// let { latitude, longitude } = this.$store.state.user; |
|
|
|
// console.log("lat" + latitude + ",lon" + longitude); |
|
|
|
// if (this.formData.latitude && this.formData.longitude) { |
|
|
|
// latitude = this.formData.latitude; |
|
|
|
// longitude = this.formData.longitude; |
|
|
|
// } |
|
|
|
// if (!latitude || latitude == "" || latitude == "0") { |
|
|
|
// latitude = 39.9088810666821; |
|
|
|
// longitude = 116.39743841556731; |
|
|
|
// } |
|
|
|
// this.endLoading(); |
|
|
|
// }, |
|
|
|
async initForm(type, activityId) { |
|
|
|
this.startLoading() |
|
|
|
console.log("啊实打实的", type, activityId) |
|
|
|
// console.log("啊实打实的", type, activityId) |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
if (!map) { |
|
|
|
this.initMap(this.formData.latitude, this.formData.longitude); |
|
|
|
console.log("map", map) |
|
|
|
} else { |
|
|
|
map.setCenter(this.formData.latitude, this.formData.longitude); |
|
|
|
map.setMarker(this.formData.latitude, this.formData.longitude); |
|
|
|
console.log("mapmapmap", map) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
this.formType = type |
|
|
|
if (type === 'edit') { |
|
|
|
if(activityId.activityImgs || activityId.sumUp){ |
|
|
|
this.records = true |
|
|
|
} |
|
|
|
// this.records = false |
|
|
|
this.formData = activityId |
|
|
|
this.timeRange = [this.formData.startTime, this.formData.endTime] |
|
|
|
if (activityId.coverPic) { |
|
|
|
@ -432,37 +434,9 @@ export default { |
|
|
|
this.online = true |
|
|
|
} |
|
|
|
} |
|
|
|
// this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
|
|
|
|
// //获取服务事项 |
|
|
|
// await this.getDemandOptions() |
|
|
|
|
|
|
|
// let { latitude, longitude } = this.$store.state.user; |
|
|
|
// if (activityId) { |
|
|
|
// this.activityId = activityId |
|
|
|
// this.formData.id = activityId |
|
|
|
// await this.loadFormData() |
|
|
|
// } else { |
|
|
|
// this.formData.latitude = latitude |
|
|
|
// this.formData.longitude = longitude |
|
|
|
// } |
|
|
|
this.$nextTick(() => { |
|
|
|
if (!map) { |
|
|
|
this.initMap(this.formData.latitude, this.formData.longitude); |
|
|
|
console.log("map", map) |
|
|
|
} else { |
|
|
|
map.setCenter(this.formData.latitude, this.formData.longitude); |
|
|
|
map.setMarker(this.formData.latitude, this.formData.longitude); |
|
|
|
console.log("mapmapmap", map) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if (type === 'records') { |
|
|
|
this.records = true |
|
|
|
} |
|
|
|
// this.initMap(this.dataForm.latitude, this.dataForm.longitude); |
|
|
|
this.initMap(this.formData.latitude, this.formData.longitude); |
|
|
|
console.log("mapmapmap", map) |
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
}, |
|
|
|
@ -729,6 +703,8 @@ export default { |
|
|
|
activityImgs: [],//图片列表 |
|
|
|
longitude: this.$store.state.user.longitude, //经度 |
|
|
|
latitude: this.$store.state.user.latitude//纬度 |
|
|
|
// longitude: null, //经度 |
|
|
|
// latitude: null//纬度 |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|