Commit 194ba08a authored by lihui's avatar lihui

feat:fix-little-problem

parent 3e365632
...@@ -114,7 +114,6 @@ import { ElMessage } from "element-plus"; ...@@ -114,7 +114,6 @@ import { ElMessage } from "element-plus";
import dayJs from "dayjs"; import dayJs from "dayjs";
export default { export default {
components: {},
props: {}, props: {},
data() { data() {
return { return {
...@@ -141,10 +140,6 @@ export default { ...@@ -141,10 +140,6 @@ export default {
marketing_id: this.$route.query.marketing_id marketing_id: this.$route.query.marketing_id
}) })
]); ]);
// let data = await ActivityService.checkActivityDetail({
// marketing_id: this.$route.query.marketing_id,
// marketing_type: this.$route.query.marketing_type
// });
this.pageLoading = false; this.pageLoading = false;
this.goodsList = dataArr[0].result.goods_list; this.goodsList = dataArr[0].result.goods_list;
......
...@@ -281,7 +281,8 @@ export default { ...@@ -281,7 +281,8 @@ export default {
handleEnd(val) { handleEnd(val) {
this.storeQuery = { this.storeQuery = {
marketing_id: val.activiteId, marketing_id: val.activiteId,
online_status: 2 // 1 启用 2 关闭 online_status: 2, // 1 启用 2 关闭
end_time: dayJs().format("YYYY-MM-DD HH:mm:ss")
}; };
}, },
// 开始 // 开始
......
<template> <template>
<div id="map" class="mapContainer"> <div id="map" class="mapContainer">
<!-- map -->
<div class="mapWrapper"> <div class="mapWrapper">
<div class="search"> <div class="search">
<el-form-item label-position="left"> <el-form ref="form" label-width="80px">
<el-button @click="handleSearch">搜索</el-button> <el-form-item label-position="left">
<el-input <el-button @click="handleSearch">搜索</el-button>
class="dialog-input" <el-input
v-model="searchKey" class="dialog-input"
placeholder="请输入关键字" v-model="searchKey"
autocomplete="on" placeholder="请输入关键字"
> autocomplete="on"
<template #suffix> >
<i <template #suffix>
@click="searchKey = ''" <i
class="el-input__icon el-icon-close" @click="searchKey = ''"
></i> class="el-input__icon el-icon-close"
</template> ></i>
</el-input> </template>
</el-form-item> </el-input>
</el-form-item>
</el-form>
<div id="js-result" v-show="searchKey" class="result"></div> <div id="js-result" v-show="searchKey" class="result"></div>
</div> </div>
<div id="js-container" class="myMap"> <div id="js-container" class="myMap">
正在加载数据 ... 正在加载数据 ...
</div> </div>
</div> </div>
<!-- info -->
<div class="mapInfo"> <div class="mapInfo">
<h3 class="title">拖拽选址</h3> <h3 class="title">拖拽选址</h3>
<ul class="info"> <ul class="info">
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
<li><span>地址:</span>{{ dragData.address }}</li> <li><span>地址:</span>{{ dragData.address }}</li>
</ul> </ul>
</div> </div>
<div class="confirmButton">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
</div> </div>
</template> </template>
...@@ -44,6 +48,7 @@ export default { ...@@ -44,6 +48,7 @@ export default {
name: "app", name: "app",
data() { data() {
return { return {
dialogVisible: true,
MapCityName: "北京", MapCityName: "北京",
searchKey: "", searchKey: "",
dragData: { dragData: {
...@@ -57,6 +62,15 @@ export default { ...@@ -57,6 +62,15 @@ export default {
}; };
}, },
methods: { methods: {
// 取消
cancel() {
this.$emit("hideMapDialog", false);
},
// 确认
confirm() {
this.$emit("getMapInfo", this.dragData);
this.$emit("hideMapDialog", false);
},
// 搜索 // 搜索
handleSearch() { handleSearch() {
if (this.searchKey) { if (this.searchKey) {
...@@ -76,7 +90,6 @@ export default { ...@@ -76,7 +90,6 @@ export default {
// 初始化地图 // 初始化地图
initMap() { initMap() {
let that = this;
// 加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分 // 加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
let AMapUI = (this.AMapUI = window.AMapUI); let AMapUI = (this.AMapUI = window.AMapUI);
let AMap = (this.AMap = window.AMap); let AMap = (this.AMap = window.AMap);
...@@ -157,7 +170,6 @@ export default { ...@@ -157,7 +170,6 @@ export default {
// 拖拽完成发送自定义 drag 事件 // 拖拽完成发送自定义 drag 事件
positionPicker.on("success", positionResult => { positionPicker.on("success", positionResult => {
this.dragMap(positionResult); this.dragMap(positionResult);
that.$emit("getMapInfo", this.dragData);
}); });
// 启动拖放 // 启动拖放
positionPicker.start(); positionPicker.start();
...@@ -181,6 +193,15 @@ export default { ...@@ -181,6 +193,15 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mapDialog {
margin-top: 11vh !important;
display: flex !important;
flex-direction: column !important;
background: red !important;
/deep/ .el-dialog__body {
height: 90%;
}
}
.mapContainer { .mapContainer {
height: 100%; height: 100%;
width: 100%; width: 100%;
...@@ -201,7 +222,7 @@ export default { ...@@ -201,7 +222,7 @@ export default {
} }
.myMap { .myMap {
height: 100%; height: 100%;
height: 500px; height: 100%;
} }
} }
.mapInfo { .mapInfo {
...@@ -215,6 +236,11 @@ export default { ...@@ -215,6 +236,11 @@ export default {
text-align: left; text-align: left;
} }
} }
.confirmButton {
position: absolute;
bottom: 100px;
right: 100px;
}
} }
.m-map .search { .m-map .search {
position: absolute; position: absolute;
......
...@@ -209,13 +209,11 @@ ...@@ -209,13 +209,11 @@
<!-- 地图 dialog --> <!-- 地图 dialog -->
<el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%"> <el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%">
<my-map class="my-map" @getMapInfo="getMapInfo" /> <my-map
<div class="confirmButton"> class="my-map"
<el-button @click="mapDialogVisible = false"> </el-button> @getMapInfo="getMapInfo"
<el-button type="primary" @click="mapDialogVisible = false" @hideMapDialog="mapDialogVisible = false"
> </el-button />
>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -246,7 +244,6 @@ export default { ...@@ -246,7 +244,6 @@ export default {
pickerOptions: { pickerOptions: {
disabledDateStart(time) { disabledDateStart(time) {
let _now = Date.now(); let _now = Date.now();
// let three = 3 * 24 * 60 * 60 * 1000;
let threeDays = _now + 3 * 24 * 60 * 60 * 1000; let threeDays = _now + 3 * 24 * 60 * 60 * 1000;
return time.getTime() < _now || time.getTime() > threeDays; //大于当前的禁止,小于3天前的禁止 return time.getTime() < _now || time.getTime() > threeDays; //大于当前的禁止,小于3天前的禁止
}, },
...@@ -408,6 +405,7 @@ export default { ...@@ -408,6 +405,7 @@ export default {
try { try {
this.pageLoading = true; this.pageLoading = true;
await ActivityService.addPlace(params); await ActivityService.addPlace(params);
await this.getPlaceList();
this.pageLoading = false; this.pageLoading = false;
} catch { } catch {
this.pageLoading = false; this.pageLoading = false;
...@@ -420,7 +418,7 @@ export default { ...@@ -420,7 +418,7 @@ export default {
let result = data.map(item => { let result = data.map(item => {
return { return {
name: item.take_place_name, name: item.take_place_name,
location: item.province + item.city + item.area, // p + c + a location: item.location, // p + c + a
address: item.address, address: item.address,
contactor: item.contact_name, contactor: item.contact_name,
id: item.take_place_id id: item.take_place_id
...@@ -570,17 +568,14 @@ export default { ...@@ -570,17 +568,14 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
// mapDialog
.mapDialog { .mapDialog {
height: 80%; height: 80%;
margin-top: 10vh !important; margin-top: 10vh !important;
.my-map { .el-dialog__body {
height: 10%; height: 85% !important;
} }
.confirmButton { .my-map {
position: absolute; height: 100%;
bottom: 100px;
right: 100px;
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment