Browse Source

地图问题

feature
李素 2 years ago
parent
commit
4254373872
  1. 59
      src/views/modules/communityParty/activity/index.vue
  2. 92
      src/views/modules/communityParty/activity/initiateActivity.vue

59
src/views/modules/communityParty/activity/index.vue

@ -79,10 +79,16 @@
<el-table-column prop="address" header-align="center" align="center" label="活动地点" min-width="230">
</el-table-column>
<el-table-column prop="assistingParty" header-align="center" align="center" label="协办方" width="100">
<el-table-column prop="assistingParty" header-align="center" align="center" label="协办方" width="230">
</el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="活动状态" width="230">
<el-table-column prop="participants" header-align="center" align="center" label="活动人数" width="100">
<template slot-scope="scope">
{{ scope.row.participants === 0 ? '不限' : scope.row.participants }}
</template>
</el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="活动状态" width="100">
<template slot-scope="scope">
{{ getStatusText(scope.row.status) }}
</template>
@ -100,19 +106,14 @@
<el-button type="text" style="color:#1C6AFD;text-decoration: underline;" size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" v-if="scope.row.status == 0" style="color:#1C6AFD;text-decoration: underline;" size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button type="text" v-if="scope.row.status == 0" style="color:#1C6AFD;text-decoration: underline;"
size="small" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="text" v-if="scope.row.status == 2" style="color:#1C6AFD;text-decoration: underline;" size="small"
@click="handleSumm(scope.row)">活动总结</el-button>
<el-button type="text" v-if="scope.row.status == 2" style="color:#1C6AFD;text-decoration: underline;"
size="small" @click="handleSumm(scope.row)">活动总结</el-button>
<!-- <el-button type="text"
style="color:#00A7A9;text-decoration: underline;" size="small"
@click="handleEdit(scope.row)">修改</el-button> -->
<el-button v-if="scope.row.status !== 2" type="text"
style="color:#D51010;text-decoration: underline;" size="small"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-if="scope.row.status == 2 || scope.row.status == 0" type="text" style="color:#D51010;text-decoration: underline;"
size="small" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -354,7 +355,7 @@
} else {
this.$message.error(msg)
}
console.log("饿么么么么么",this.typeList)
// console.log("饿",this.typeList)
},
diaClose () {
@ -471,26 +472,22 @@
async deleteActivity (row) {
// const url = "/actual/base/icpartyactivity/delete"//
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/delete"
// let params = {
// id: row.id
// }
const url = "/actual/base/communityActivity/delete"
let id = [row.id]
// const { data, code, msg } = await requestPost(url, params)
const { data, code, msg } = await requestPost(url, id)
// if (code === 0) {
// this.$message({
// type: "success",
// message: ""
// });
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
// // this.loadTable()
// this.communityActivityList()
// } else {
// this.$message.error(msg)
// }
// this.loadTable()
this.communityActivityList()
} else {
this.$message.error(msg)
}
},
//

92
src/views/modules/communityParty/activity/initiateActivity.vue

@ -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) {
if (e.length > 0) {
let item = e[0];
let ob = {
this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0',
fileUrl: item.response.data.url
};
this.fileList = [ob];
this.formData.coverPic = ob.fileUrl;
})) : []; // efileList
if (e.length > 0) {
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//
}
},

Loading…
Cancel
Save