Commit 17a1b135 authored by 黄奎's avatar 黄奎

页面修改

parent 5510727f
...@@ -831,7 +831,8 @@ ...@@ -831,7 +831,8 @@
</div> </div>
<ul> <ul>
<li v-for="(item,index) in dataList.dayList" :key="index" <li v-for="(item,index) in dataList.dayList" :key="index"
:class="crtnav=='dayList'+(index+1)?'active':''" @click="goScroll('dayList'+(index+1),index)"> :class="crtnav=='dayList'+(item.dayNum)?'active':''"
@click="goScroll('dayList'+(item.dayNum),item.dayNum)">
<span class="dayIndex">D{{index+1}}</span> <span class="dayIndex">D{{index+1}}</span>
<template v-for="(suItem,subIndex) in item.dayArray"> <template v-for="(suItem,subIndex) in item.dayArray">
<template v-if="suItem.type==1" <template v-if="suItem.type==1"
...@@ -1173,12 +1174,12 @@ ...@@ -1173,12 +1174,12 @@
return str; return str;
}, },
//滚动定位 //滚动定位
goScroll(id, index) { goScroll(id, dayNum) {
if (id == 'tripLine' || id == 'aboutTrip' || id == 'tripArrange') { if (id == 'tripLine' || id == 'aboutTrip' || id == 'tripArrange') {
this.$refs.tripMap.mapBuild(); this.$refs.tripMap.mapBuild();
} }
if (Number(index) >= 0) { if (Number(dayNum) >= 0) {
this.getDayPoint(index); this.getDayPoint(dayNum);
this.$refs.tripMap.mapBuild(); this.$refs.tripMap.mapBuild();
} }
this.crtnav = id; this.crtnav = id;
...@@ -1214,48 +1215,58 @@ ...@@ -1214,48 +1215,58 @@
} }
}, },
//加载当日坐标点 //加载当日坐标点
getDayPoint(index) { getDayPoint(dayNum) {
let Arr = []; let Arr = [];
if (this.dataList && this.dataList.dayList && this.dataList.dayList.length > 0) { if (this.dataList && this.dataList.dayList && this.dataList.dayList.length > 0) {
this.dataList.dayList[index].dayArray.forEach(x => { this.dataList.dayList.forEach(item => {
if (x.type == 1) { if (item.dayNum == dayNum) {
x.childItem.subTraffic.forEach(z => { item.dayArray.forEach(x => {
let obj1 = { if (x.type == 1) {
lat: z.startCityPoint[1], x.childItem.subTraffic.forEach(z => {
lng: z.startCityPoint[0], let obj1 = {
name: z.arrivalCityName, lat: z.startCityPoint[1],
type: 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);
})
} }
let obj2 = { //放入景点
lat: z.arrivalCityPoint[1], if (x.type == 2) {
lng: z.arrivalCityPoint[0], if (x.childItem.pointArray && x.childItem.pointArray.length > 0 && x
name: z.startCityName, .childItem.pointArray[1] != '' && x.childItem.pointArray[0] !=
type: 1 "") {
let obj3 = {
lat: x.childItem.pointArray[1],
lng: x.childItem.pointArray[0],
name: x.childItem.couponsName,
type: 2
}
Arr.push(obj3);
}
}
//放入住宿
if (x.type == 3) {
let obj4 = {
lat: x.childItem.pointArray[1],
lng: x.childItem.pointArray[0],
name: x.childItem.newHotelName,
type: 3
}
Arr.push(obj4);
} }
Arr.push(obj1);
Arr.push(obj2);
}) })
} }
//放入景点
if(x.type==2){
let obj3 = {
lat: x.childItem.pointArray[1],
lng: x.childItem.pointArray[0],
type:2
}
Arr.push(obj3);
}
//放入住宿
if(x.type==3){
let obj4 = {
lat: x.childItem.pointArray[1],
lng: x.childItem.pointArray[0],
type:3
}
Arr.push(obj4);
}
}) })
console.log('day加载' + index, Arr); console.log('day加载' + dayNum, Arr);
this.travelLngLat = Arr; this.travelLngLat = Arr;
} }
}, },
...@@ -1264,7 +1275,7 @@ ...@@ -1264,7 +1275,7 @@
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' + x.dayNum)
}) })
let current = '' let current = ''
navs.forEach(x => { navs.forEach(x => {
...@@ -1276,7 +1287,7 @@ ...@@ -1276,7 +1287,7 @@
this.crtnav = current this.crtnav = current
if (current.indexOf("dayList") != -1) { if (current.indexOf("dayList") != -1) {
let index = current.split('dayList')[1]; let index = current.split('dayList')[1];
this.dataindex = index-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