Commit a85a2891 authored by liudong1993's avatar liudong1993
parents 8305891a b39f5daf
......@@ -28,6 +28,11 @@
{{$t('sm.chanpintese')}}
</div>
<div class="TravelLine" v-if="TeamType!=3"></div>
<div class="TravelNavList" v-if="(TeamType!=3)" :class="{'TravelCked':ckedNav==6}"
@click.prevent="custormAnchor('thirdMap',6)">
地图
</div>
<div class="TravelLine" v-if="TeamType!=3"></div>
<div class="TravelNavList" v-if="TeamType!=3" :class="{'TravelCked':ckedNav==4}"
@click.prevent="custormAnchor('fourAnchor',4)">
{{$t('sm.buchongxinxi')}}
......@@ -51,23 +56,25 @@
:isNewConfig="isNewConfig" @unlockFormCommit="unlockFormCommit" :CurrentUserInfo="CurrentUserInfo">
</TravelFeature>
<!-- 地图 -->
<div class="TravelPrice clearfix" style="padding: 25px;">
<div class="mapImg-buttom">
<span class="TMTitle"><i></i>地图</span>
<span class="foldList" @click="ShowMap=!ShowMap">编辑地图</span>
</div>
<div class="mapImg-Img marginT20">
<div v-if="PostConfig&&PostConfig.MapUrl">
<el-image
style="width: 100%; height: auto;"
:src="PostConfig.MapUrl"
:preview-src-list="[PostConfig.MapUrl]">
</el-image>
<div id="thirdMap">
<div class="TravelPrice clearfix" style="padding: 25px;">
<div class="mapImg-buttom">
<span class="TMTitle"><i></i>地图</span>
<span class="foldList" @click="ShowMap=!ShowMap">编辑地图</span>
</div>
<div class="mapImg-Img marginT20">
<div v-if="PostConfig&&PostConfig.MapUrl">
<el-image
style="width: 100%; height: auto;"
:src="PostConfig.MapUrl"
:preview-src-list="[PostConfig.MapUrl]">
</el-image>
</div>
<p v-else @click="ShowMap=!ShowMap" style="cursor: pointer;">地图暂未生成图</p>
</div>
<p v-else @click="ShowMap=!ShowMap" style="cursor: pointer;">地图暂未生成图</p>
</div>
<Tripmap v-if="ShowMap" :dataAll="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false" @Success="getMapImgSuccess"></Tripmap>
</div>
<Tripmap v-if="ShowMap" :dataAll="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false" @Success="getMapImgSuccess"></Tripmap>
<TravelNotice :class="{'showOther':TeamType==3}" ref="TravelNotice" id="fourAnchor" @headCallBack="getNotice"
:subArray="NoticeParameters" :NoticeData="NoticeData" v-bind:PostConfig="PostConfig"
v-bind:AllCityList="AllCityList" v-bind:CountryID="PostConfig.CountryID"></TravelNotice>
......
......@@ -5,7 +5,7 @@
style="display: flex;align-items: start; justify-content: space-between;"
>
<div style="display: flex;flex-wrap: wrap; flex-grow: 1;">
<div v-for="(x, index) in TripMapList" ::key="x.Id" class="row-aic">
<div v-for="(x, index) in TripMapList" :key="index" class="row-aic">
<el-select
class="w100"
size="mini"
......@@ -35,7 +35,7 @@
v-for="(item, i) in x.CityListAll"
:label="item.Name"
:value="item.ID"
:key="item.ID"
:key="i"
>
</el-option>
</el-select>
......@@ -241,7 +241,7 @@ export default {
this.TripMapList.push(JSON.parse(JSON.stringify(obj)));
}
console.log(this.TripMapList, "----TripMapList");
// console.log(this.TripMapList, "----TripMapList");
},
deep: true,
immediate: true
......@@ -354,19 +354,20 @@ export default {
x.CityList.forEach(y => {
listCity.push(y.MName);
this.listCity.push({
PMName: x.MName,
MName: y.MName,
MId: y.MId
});
});
});
this.pois = listCity.join(",");
this.citys = [...new Set(this.pois.split(","))];
this.citys = [...new Set(this.listCity)];//[...new Set(this.pois.split(","))]
this.clearCitiesMarkersHandler();
this.citiesData = this.citiesData.filter(
x => this.citys.indexOf(x.name) != -1
);
this.citys = this.citys.filter(
x => this.citiesData.findIndex(y => y.name == x) == -1
x => this.citiesData.findIndex(y => y.name == x.MName) == -1
);
// console.log(this.citys,'-----222')
// console.log(this.citiesData,'-----111')
......@@ -746,6 +747,7 @@ export default {
marker.addTo(this.map);
marker.on("dragend", function() {
let currentMarkerLngLat = marker.getLngLat();
console.log(currentMarkerLngLat,'------currentMarkerLngLat')
that.citiesData[i].Lng = currentMarkerLngLat.lng;
that.citiesData[i].Lat = currentMarkerLngLat.lat;
that.setCitiesPosition()
......@@ -753,10 +755,10 @@ export default {
this.deviceMarkers.push(marker);
},
async getCoordinates(cityName) {
async getCoordinates(x) {
try {
const response = await fetch(
`https://api.mapbox.com/geocoding/v5/mapbox.places/${cityName}.json?types=place&access_token=pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q`
`https://api.mapbox.com/geocoding/v5/mapbox.places/${x.PMName}/${x.MName}.json?types=place&access_token=pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q`
);
if (!response.ok) {
......@@ -766,9 +768,9 @@ export default {
const data = await response.json();
if (data.features.length > 0) {
const [longitude, latitude] = data.features[0].center;
let tempI = this.citiesData.findIndex(y=>y.name==cityName)
let tempI = this.citiesData.findIndex(y=>y.name==x.MName)
if(tempI==-1) this.citiesData.push({
name: cityName,
name: x.MName,
longitude,
latitude,
Lng: "",
......
......@@ -337,7 +337,7 @@
watch: {
item: {
handler(val, oldVal) {
console.log("changeScenic",this.item.ScenicArray);
// console.log("changeScenic",this.item.ScenicArray);
this.RenderingOk = false;
this.ScenicArrayList = []
this.item.ScenicArray.forEach((x, index) => {
......@@ -387,7 +387,7 @@
immediate: true
},
},
};
</script>
......
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