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

页面修改

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