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,10 +1215,12 @@ ...@@ -1214,10 +1215,12 @@
} }
}, },
//加载当日坐标点 //加载当日坐标点
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 (item.dayNum == dayNum) {
item.dayArray.forEach(x => {
if (x.type == 1) { if (x.type == 1) {
x.childItem.subTraffic.forEach(z => { x.childItem.subTraffic.forEach(z => {
let obj1 = { let obj1 = {
...@@ -1237,25 +1240,33 @@ ...@@ -1237,25 +1240,33 @@
}) })
} }
//放入景点 //放入景点
if(x.type==2){ if (x.type == 2) {
if (x.childItem.pointArray && x.childItem.pointArray.length > 0 && x
.childItem.pointArray[1] != '' && x.childItem.pointArray[0] !=
"") {
let obj3 = { let obj3 = {
lat: x.childItem.pointArray[1], lat: x.childItem.pointArray[1],
lng: x.childItem.pointArray[0], lng: x.childItem.pointArray[0],
type:2 name: x.childItem.couponsName,
type: 2
} }
Arr.push(obj3); Arr.push(obj3);
} }
}
//放入住宿 //放入住宿
if(x.type==3){ if (x.type == 3) {
let obj4 = { let obj4 = {
lat: x.childItem.pointArray[1], lat: x.childItem.pointArray[1],
lng: x.childItem.pointArray[0], lng: x.childItem.pointArray[0],
type:3 name: x.childItem.newHotelName,
type: 3
} }
Arr.push(obj4); 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