Commit 61562acc authored by zhengke's avatar zhengke

修改

parent 7f727df7
...@@ -670,7 +670,7 @@ ...@@ -670,7 +670,7 @@
<div class="border"></div> <div class="border"></div>
</div> </div>
<ul> <ul>
<li v-for="(item,index) in dataList.dayList" :class="crtnav=='dayList'+(index+1)?'active':''" @click="goScroll('dayList'+(index+1),(index+1))"> <li v-for="(item,index) in dataList.dayList" :class="crtnav=='dayList'+(index+1)?'active':''" @click="goScroll('dayList'+(index+1),index)">
<span class="dayIndex">D{{index+1}}</span> <span class="dayIndex">D{{index+1}}</span>
<template v-for="suItem in item.dayArray"> <template v-for="suItem in item.dayArray">
<template v-if="suItem.type==1" v-for="(childItem,index) in suItem.childItem.subTraffic"> <template v-if="suItem.type==1" v-for="(childItem,index) in suItem.childItem.subTraffic">
...@@ -1043,7 +1043,8 @@ export default { ...@@ -1043,7 +1043,8 @@ export default {
dataList:{}, dataList:{},
scrollobj: null, scrollobj: null,
crtnav:'', crtnav:'',
isShow:false isShow:false,
dataindex:0
} }
}, },
mounted () { mounted () {
...@@ -1058,6 +1059,19 @@ export default { ...@@ -1058,6 +1059,19 @@ export default {
components: { components: {
tripMap tripMap
}, },
watch:{
//滚动检测day滚动
dataindex(newValue,old){
this.getDayPoint(this.dataindex);
},
//滚动检测头部三个
crtnav(newValue,old){
if(newValue=='tripLine'||newValue=='aboutTrip'||newValue=='tripArrange'){
this.getAllPoint();
}
}
},
methods: { methods: {
//加载数据 //加载数据
getTrip(){ getTrip(){
...@@ -1088,7 +1102,10 @@ export default { ...@@ -1088,7 +1102,10 @@ export default {
if(id=='tripLine'||id=='aboutTrip'||id=='tripArrange'){ if(id=='tripLine'||id=='aboutTrip'||id=='tripArrange'){
this.$refs.tripMap.mapBuild(); this.$refs.tripMap.mapBuild();
} }
if(index>=0&&index!=''){
this.getDayPoint(index);
this.$refs.tripMap.mapBuild();
}
this.crtnav=id; this.crtnav=id;
this.scrollobj.scrollTop = document.getElementById(id).offsetTop; this.scrollobj.scrollTop = document.getElementById(id).offsetTop;
...@@ -1121,13 +1138,40 @@ export default { ...@@ -1121,13 +1138,40 @@ export default {
console.log(Arr,'Arrrr'); console.log(Arr,'Arrrr');
this.travelLngLat=Arr; this.travelLngLat=Arr;
}, },
//加载当日坐标点
getDayPoint(index){
let Arr=[];
this.dataList.dayList[index].dayArray.forEach(x=>{
if(x.type==1){
x.childItem.subTraffic.forEach(z=>{
let obj1={
lat:z.startCityPoint[1],
lng:z.startCityPoint[0],
name:z.arrivalCityName,
type:1
}
let obj2={
lat:z.arrivalCityPoint[1],
lng:z.arrivalCityPoint[0],
name:z.startCityName,
type:1
}
Arr.push(obj1);
Arr.push(obj2);
})
}
})
console.log(Arr,'day加载');
this.travelLngLat=Arr;
},
//滚动选中 //滚动选中
handleScroll() { handleScroll() {
try { try {
let navs=['tripLine','aboutTrip','tripArrange']; let navs=['tripLine','aboutTrip','tripArrange'];
this.dataList.dayList.forEach((x,index)=>{ this.dataList.dayList.forEach((x,index)=>{
navs.push('dayList'+index+1) navs.push('dayList'+(index+1))
}) })
let current = '' let current = ''
navs.forEach(x => { navs.forEach(x => {
...@@ -1137,6 +1181,13 @@ export default { ...@@ -1137,6 +1181,13 @@ export default {
} }
}) })
this.crtnav = current this.crtnav = current
// if(current=='tripLine'||current=='aboutTrip'||current=='tripArrange'){
// this.getAllPoint();
// }
if(current.indexOf("dayList") != -1){
let index=current.split('dayList')[1];
this.dataindex=index;
}
} catch (error) { } catch (error) {
} }
......
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