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