Commit 90f41e6f authored by zhengke's avatar zhengke

修改

parent c4123d03
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
.pageViewTrip .sideBarBtns .btnPage { .pageViewTrip .sideBarBtns .btnPage {
cursor: pointer; cursor: pointer;
height:27px;
margin-bottom: 5px; margin-bottom: 5px;
} }
...@@ -531,8 +532,7 @@ ...@@ -531,8 +532,7 @@
height: 150px; height: 150px;
color: #fff; color: #fff;
position: relative; position: relative;
background-size: cover; background-size: cover!important;
background-position: center !important;
} }
.tripViewAgendaList .agendaBox .txtCont { .tripViewAgendaList .agendaBox .txtCont {
...@@ -659,7 +659,7 @@ ...@@ -659,7 +659,7 @@
} }
.tripViewAgendaList .agendaPoi { .tripViewAgendaList .agendaPoi {
margin-top: 10px; margin: 10px 0 20px 0;
} }
.tripViewAgendaList .agendaBox .food { .tripViewAgendaList .agendaBox .food {
...@@ -818,6 +818,26 @@ ...@@ -818,6 +818,26 @@
.slideHeader .cities i:last-child { .slideHeader .cities i:last-child {
display: none; display: none;
} }
.tripViewAgendaList .agendaBox .showMore{
color: #00B2B4;
margin: 10px auto;
padding: 4px 2px;
border-radius: 2px;
border: 1px solid #00B2B4;
width: 100px;
text-align: center;
font-size: 12px;
cursor: pointer;
}
.tripViewAgendaList .agendaBox .hideAgendaDetails {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
padding:20px 0 0 0;
margin-bottom:20px;
-webkit-box-orient: vertical;
}
</style> </style>
<template> <template>
<div class="pageViewTrip" v-if="isShow"> <div class="pageViewTrip" v-if="isShow">
...@@ -1034,7 +1054,7 @@ ...@@ -1034,7 +1054,7 @@
<div class="agendaBox"> <div class="agendaBox">
<div class="indexNum numberList">{{index+1}}</div> <div class="indexNum numberList">{{index+1}}</div>
<div class="coverWrap" <div class="coverWrap"
:style="`background: url(${subItem.childItem.imaArray[0].url}) no-repeat 100% 100%`" :style="`background: url(${subItem.childItem.imaArray[0].url}) center`"
@click="bigImgShow(subItem.childItem.imaArray[0].url)"> @click="bigImgShow(subItem.childItem.imaArray[0].url)">
</div> </div>
<div class="txtCont icon-triangle"> <div class="txtCont icon-triangle">
...@@ -1070,7 +1090,7 @@ ...@@ -1070,7 +1090,7 @@
</div> </div>
<div class="coverWrap" v-if="subItem.childItem.imaArray.length>0" <div class="coverWrap" v-if="subItem.childItem.imaArray.length>0"
@click="bigImgShow(subItem.childItem.imaArray[0].url)" @click="bigImgShow(subItem.childItem.imaArray[0].url)"
:style="`background: url(${subItem.childItem.imaArray[0].url}) no-repeat 100% 100%`"> :style="`background: url(${subItem.childItem.imaArray[0].url}) center`">
</div> </div>
<div class="txtCont icon-triangle"> <div class="txtCont icon-triangle">
<div class="agendaPoi"> <div class="agendaPoi">
...@@ -1083,7 +1103,7 @@ ...@@ -1083,7 +1103,7 @@
</span> </span>
</div> </div>
<div class="detailBox"> <div class="detailBox">
<div class="detailSection"> <div class="detailSection" v-if="subItem.childItem.isShow">
<div class="item"> <div class="item">
<span class="label">酒店星级</span> <span class="label">酒店星级</span>
<span class="text"> <span class="text">
...@@ -1097,11 +1117,11 @@ ...@@ -1097,11 +1117,11 @@
class="text">{{getService(subItem.childItem.facilityServices)}}</span> class="text">{{getService(subItem.childItem.facilityServices)}}</span>
</div> </div>
</div> </div>
<div class="subSection" <div class="subSection" :class="{'hideAgendaDetails':!subItem.childItem.isShow}"
v-if="subItem.childItem.hotelNewDescriptionText" v-if="subItem.childItem.hotelNewDescriptionText"
v-html="subItem.childItem.hotelNewDescriptionText"> v-html="subItem.childItem.hotelNewDescriptionText">
</div> </div>
<div class="detailSection" style="margin-top:0;"> <div class="detailSection" style="margin-top:0;" v-if="subItem.childItem.isShow">
<div class="item" <div class="item"
v-if="subItem.childItem.hotelAddress!=''"> v-if="subItem.childItem.hotelAddress!=''">
<span class="label">地址</span> <span class="label">地址</span>
...@@ -1113,6 +1133,7 @@ ...@@ -1113,6 +1133,7 @@
<span class="text">{{subItem.childItem.url}}</span> <span class="text">{{subItem.childItem.url}}</span>
</div> </div>
</div> </div>
<div class="showMore" @click="getShowMore(subItem.childItem)">{{subItem.childItem.isShow==true?'点我收起':'点我展开详情'}}</div>
</div> </div>
<div class="Divtriangle"> <div class="Divtriangle">
<span></span> <span></span>
...@@ -1161,7 +1182,8 @@ ...@@ -1161,7 +1182,8 @@
navbar: false, navbar: false,
title: false title: false
}, },
FlightList: [],
StartData: ""
} }
}, },
mounted() { mounted() {
...@@ -1203,6 +1225,9 @@ ...@@ -1203,6 +1225,9 @@
this.apipost('b2b_get_GetB2BTravelInfoV1', this.msg, res => { this.apipost('b2b_get_GetB2BTravelInfoV1', this.msg, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data; this.dataList = res.data.data;
this.FlightList = res.data.data.currentPriceInfo.priceFlight;
this.StartData = res.data.data.currentPriceInfo.startDate;
console.log("this.dataList", this.dataList);
this.isShow = true; this.isShow = true;
this.getAllPoint(); this.getAllPoint();
//装载景点酒店图片以供预览 //装载景点酒店图片以供预览
...@@ -1213,6 +1238,7 @@ ...@@ -1213,6 +1238,7 @@
if (y.childItem.imaArray.length > 0) { if (y.childItem.imaArray.length > 0) {
this.images.push(y.childItem.imaArray[0].url); this.images.push(y.childItem.imaArray[0].url);
} }
y.childItem.isShow=true
} }
}) })
}) })
...@@ -1225,10 +1251,10 @@ ...@@ -1225,10 +1251,10 @@
getService(item) { getService(item) {
let Obj = JSON.parse(item); let Obj = JSON.parse(item);
let str = '' let str = ''
Obj[0].checked.forEach(ckItem=>{ Obj[0].checked.forEach(ckItem => {
Obj[0].list.forEach(x => { Obj[0].list.forEach(x => {
if(ckItem==x.ID){ if (ckItem == x.ID) {
str+=x.Content+' ' str += x.Content + ' '
} }
}); });
}) })
...@@ -1246,6 +1272,27 @@ ...@@ -1246,6 +1272,27 @@
this.crtnav = id; this.crtnav = id;
this.scrollobj.scrollTop = document.getElementById(id).offsetTop; this.scrollobj.scrollTop = document.getElementById(id).offsetTop;
}, },
addDate(date, days) {
if (days == 0) {
return date;
}
var date = new Date(date);
date.setDate(date.getDate() + days);
var month = date.getMonth() + 1;
var day = date.getDate();
return date.getFullYear() + '-' + this.getFormatDate(month) + '-' + this.getFormatDate(day);
},
// 日期月份/天的显示,如果是1位数,则在前面加上'0'
getFormatDate(arg) {
if (arg == undefined || arg == '') {
return '';
}
var re = arg + '';
if (re.length < 2) {
re = '0' + re;
}
return re;
},
//加载所有坐标点 //加载所有坐标点
getAllPoint() { getAllPoint() {
let Arr = []; let Arr = [];
...@@ -1283,7 +1330,9 @@ ...@@ -1283,7 +1330,9 @@
var arrivalTrafficArray = []; var arrivalTrafficArray = [];
var hotelArray = []; var hotelArray = [];
var scenicArray = []; var scenicArray = [];
this.dataList.dayList.forEach(item => { var YesterdayObj = {}; //前一天
var YesterdayHotelArray = [];
this.dataList.dayList.forEach((item, index) => {
if (item.dayNum == dayNum) { if (item.dayNum == dayNum) {
item.dayArray.forEach(x => { item.dayArray.forEach(x => {
if (x.type == 1) { if (x.type == 1) {
...@@ -1305,7 +1354,101 @@ ...@@ -1305,7 +1354,101 @@
}) })
} }
//放入景点 //放入景点
if (x.type == 2) { var tempScenicArray = this.getItemArray(item, 2);
if (tempScenicArray && tempScenicArray.length > 0) {
scenicArray.push(...tempScenicArray);
}
//放入住宿
var tempHotelArray = this.getItemArray(item, 3);
if (tempHotelArray && tempHotelArray.length > 0) {
hotelArray.push(...tempHotelArray);
}
});
if (item.dayNum > 1) {
YesterdayObj = this.dataList.dayList[index - 1];
//放入住宿
var tempHotelArray = this.getItemArray(YesterdayObj, 3);
if (tempHotelArray && tempHotelArray.length > 0) {
YesterdayHotelArray.push(...tempHotelArray);
}
}
}
})
console.log("dayNum", dayNum);
var newDayNum = dayNum - 1;
var newDate = this.addDate(this.StartData, newDayNum);
//第一天国内出发
if (dayNum == 1) {
if (this.FlightList && this.FlightList.length > 0) {
this.FlightList.forEach(subItem => {
if (subItem.startDate == newDate) {
Arr.push({
lat: subItem.dLat,
lng: subItem.dLng,
name: subItem.departureAirPortName,
type: 1
});
Arr.push({
lat: subItem.aLat,
lng: subItem.aLng,
name: subItem.arrivalAirPortName,
type: 1
})
}
});
}
else
{
}
}
//从酒店出发
else {
//最后一天
if (dayNum == this.dataList.dayList[this.dataList.dayList.length - 1].dayNum) {
if (this.FlightList && this.FlightList.length > 0) {
this.FlightList.forEach(subItem => {
if (subItem.startDate == newDate) {
Arr.push({
lat: subItem.dLat,
lng: subItem.dLng,
name: subItem.departureAirPortName,
type: 1
});
Arr.push({
lat: subItem.aLat,
lng: subItem.aLng,
name: subItem.arrivalAirPortName,
type: 1
})
}
});
}
} else {
}
}
if (scenicArray && scenicArray.length > 0) {
Arr.push(...scenicArray)
}
if (hotelArray && hotelArray.length > 0) {
Arr.push(...hotelArray)
}
console.log('day加载' + dayNum, Arr);
this.travelLngLat = Arr;
}
},
getItemArray(item, type) {
var newArray = [];
item.dayArray.forEach(x => {
//放入景点
if (x.type == type && type == 2) {
if (x.childItem.pointArray && x.childItem.pointArray.length > 0 && x if (x.childItem.pointArray && x.childItem.pointArray.length > 0 && x
.childItem.pointArray[1] != '' && x.childItem.pointArray[0] != .childItem.pointArray[1] != '' && x.childItem.pointArray[0] !=
"") { "") {
...@@ -1315,11 +1458,11 @@ ...@@ -1315,11 +1458,11 @@
name: x.childItem.couponsName, name: x.childItem.couponsName,
type: 2 type: 2
} }
scenicArray.push(obj3); newArray.push(obj3);
} }
} }
//放入住宿 //放入住宿
if (x.type == 3) { if (x.type == type && 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],
...@@ -1331,37 +1474,10 @@ ...@@ -1331,37 +1474,10 @@
} else { } else {
obj4.name = x.childItem.hotelName; obj4.name = x.childItem.hotelName;
} }
hotelArray.push(obj4); newArray.push(obj4);
}
})
} }
}) })
if (dayNum == 1 || dayNum == this.dataList.dayList[this.dataList.dayList.length - 1].dayNum) { return newArray;
if (startTrafficArray && startTrafficArray.length > 0) {
Arr.push(...startTrafficArray)
}
} else {
if (startTrafficArray && startTrafficArray.length > 0) {
Arr.push(startTrafficArray[0])
}
}
if (dayNum == 1 || dayNum == this.dataList.dayList[this.dataList.dayList.length - 1].dayNum) {
if (arrivalTrafficArray && arrivalTrafficArray.length > 0) {
Arr.push(...arrivalTrafficArray)
}
}
if (scenicArray && scenicArray.length > 0) {
Arr.push(...scenicArray)
}
if (hotelArray && hotelArray.length > 0) {
Arr.push(...hotelArray)
}
console.log('day加载' + dayNum, Arr);
this.travelLngLat = Arr;
}
}, },
getHotelArray(hotelArray) { getHotelArray(hotelArray) {
var newArray = []; var newArray = [];
...@@ -1395,6 +1511,11 @@ ...@@ -1395,6 +1511,11 @@
} }
} catch (error) {} } catch (error) {}
}, },
//隐藏显示
getShowMore(item){
item.isShow=!item.isShow;
this.$forceUpdate();
}
} }
} }
</script> </script>
\ No newline at end of file
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