Commit 4bcea807 authored by 华国豪's avatar 华国豪 🙄
parents 0c20c8e6 0a57a597
......@@ -8,19 +8,27 @@
<el-col :span="5">
<div class="city" style="margin-bottom:15px">
<span>出发地 | </span>
<el-input
placeholder="请输入内容"
v-model="input10"
clearable>
</el-input>
<el-select style="width:80%" v-model="choose_info.departure_city" filterable placeholder="请选择">
<el-option :value=0 label="不限"></el-option>
<el-option
v-for="item in cawei"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="city">
<span>目的地 | </span>
<el-input
placeholder="请输入内容"
v-model="input10"
clearable>
</el-input>
<el-select style="width:80%" v-model="choose_info.arrival_city" filterable placeholder="请选择">
<el-option :value=0 label="不限"></el-option>
<el-option
v-for="item in cawei"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="6">
......@@ -47,22 +55,22 @@
<div style="margin-bottom:15px">
<div class="number">
<span>成人 | </span>
<el-input-number size="mini" v-model="num1" @change="handleChange" :min="0" :max="10" label="描述文字"></el-input-number>
<el-input-number size="mini" v-model="choose_info.cr" @change="handleChange" :min="0" :max="10" label="描述文字"></el-input-number>
</div>
<div class="number">
<span>儿童 | </span>
<el-input-number size="mini" v-model="num1" @change="handleChange" :min="0" :max="10" label="描述文字"></el-input-number>
<el-input-number size="mini" v-model="choose_info.child" @change="handleChange" :min="0" :max="10" label="描述文字"></el-input-number>
</div>
<div class="number">
<span>婴儿 | </span>
<el-input-number size="mini" v-model="num1" @change="handleChange" :min="0" :max="10" label="描述文字"></el-input-number>
<el-input-number size="mini" v-model="choose_info.ye" @change="handleChange" :min="0" :max="10" label="描述文字"></el-input-number>
</div>
<el-button @click="Search" size="small">搜索</el-button>
</div>
<div>
<div class="city" style="width:200px;display:inline-block;margin-right:10px">
<span>舱位选择 | </span>
<el-select v-model="value" placeholder="请选择">
<el-select v-model="choose_info.freightSpace" placeholder="请选择">
<el-option
v-for="item in cawei"
:key="item.id"
......@@ -73,7 +81,8 @@
</div>
<div class="city" style="width:250px;display:inline-block">
<span>航空公司 | </span>
<el-select style="width:180px" filterable v-model="value" placeholder="请选择">
<el-select style="width:180px" filterable v-model="choose_info.airLineID" placeholder="请选择">
<el-option :value=0 label="不限"></el-option>
<el-option v-for="item in airlineList" :label="item.AlName" :value="item.AirLineId"
:key="item.AirLineId"></el-option>
</el-select>
......@@ -99,12 +108,16 @@ export default {
qFlightDateEnd:"",
flight_number:"",
airLineID:0,
ticketType:1,
ticketType:0,
lineId:0,
isPayOrder:0,
departure_city:0,
arrival_city:0,
freightSpace:1
freightSpace:0,
airTicketScatterNum:0,
cr:0,
child:0,
ye:0,
},
startweek:"",
......@@ -174,16 +187,24 @@ export default {
changeStart(val){
let num=moment(val,'YYYY-MM-DD').format('E');
this.startweek=this.Weekday(num);
this.choose_info.qFlightDateStart=moment(val).format('YYYY-MM-DD');
},
changeEnd(val){
let num=moment(val,'YYYY-MM-DD').format('E');
this.endweek=this.Weekday(num);
this.choose_info.qFlightDateEnd=moment(val).format('YYYY-MM-DD');
},
// moment("2018-10-29",'YYYY-MM-DD').format('E')
handleChange(){},
Search(){
this.choose_info.airTicketScatterNum=this.choose_info.cr+this.choose_info.child+this.choose_info.ye;
console.log(this.choose_info,'choose_info');
this.$emit("ChooseInfo",this.choose_info)
this.$router.push({
path: 'TicketList',
query:this.choose_info
})
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,6 +48,7 @@
<!-- <el-menu-item index="2-3">单团</el-menu-item>
<el-menu-item index="2-4">私人订制</el-menu-item> -->
</el-submenu>
<el-menu-item index="3"><a href="javascript:void(0);">机票</a></el-menu-item>
<!-- <el-menu-item index="5"><a href="javascript:void(0);">机票</a></el-menu-item>
<el-menu-item index="2"><a href="javascript:void(0);">酒店</a></el-menu-item>
<el-menu-item index="4"><a href="javascript:void(0);">餐厅</a></el-menu-item>
......
......@@ -147,6 +147,7 @@ export default {
for (var i in this.priceData) {
var price = this.priceData[i];
var dayIndex = price.dateStr.substring(price.dateStr.length-2,price.dateStr.length);
console.log(dayIndex)
var dayDict = daysData[Number(dayIndex)-1];
dayDict.price = price.price;
if(dayIndex<strDate&&strMonth==currentMonth){
......
......@@ -922,6 +922,7 @@ export default {
let dateList = [];
if(list && list.length>0){
list.forEach((x,index)=>{
console.log(list)
if(x.tcState==3){
let msg = {
dateStr:x.startDate,
......
<style>
.calendar-box .calendar{
width: 100%;
overflow: hidden;
table-layout: fixed;
}
.calendar-box .calendar th{
height: 20px;
padding: 10px 0;
line-height: 20px;
background: #eee;
color: #333;
text-align: center;
font-size: 14px;
font-family: 'PingFangR';
}
.dayList{
position: relative;
float: left;
width: 13.88%;
height: 65px;
cursor: pointer;
border: 1px solid transparent;
background-color: #F5F5F5;
font-size: 12px;
}
.dayList.noPrice{
cursor: default;
color: #ccc;
background-color: #FFFFFF;
}
.dayList.selectDay{
border: 1px solid #ff4646;
background-color: #f9f7f6;
}
.dayList.yesPrice{
font-weight: bold;
font-family: 'PingFangR'
}
.dayList p{
float: initial;
width: 100%;
text-align: center;
padding:0;
margin: 10px 0;
}
.dayList p.price{
float: initial;
width: 100%;
text-align: center;
padding:0;
margin: 10px 0;
color: #ff4646;
}
</style>
<template>
<div class="calendar-box" id='calendar'>
<table class="calendar" cellspacing=0 cellpadding=0>
<thead>
<th v-for="(i,index) in week" :key="index">{{i}}</th>
</thead>
</table>
<div class="monthDayList">
<div v-for="(item,index) in daysData" class="dayList" :key="index" @click="item.price?selectDate(index):''" :class="{selectDay:isSelect == index,noPrice:!item.price,yesPrice:item.price}">
<p>{{item.day}}</p>
<p v-if="item.price!='0.00' && item.price" class="price">{{item.price}}</p>
</div>
</div>
</div>
</template>
<script>
import bus from '../../plugins/event-bus'
export default {
props:{
dateData: Array,
day:String,
},
data(){
return{
week:['日','一','二','三','四','五','六'],
priceData:this.dateData,
currentDay: this.day,
DaysInMonth:[],
daysData:[],
isSelect:-1,
mydate:-1,
}
},mounted(){
},created(){
this.getYearMonthDay();
},methods:{
selectDate(index){
if(this.$data.daysData[index].day == 0) {
bus.$emit('chosen-tripdate', null)
return;
}
if(this.isSelect == index){
this.isSelect = -1;
bus.$emit('chosen-tripdate', null)
return;
}
this.isSelect = index;
let currentDay = this.currentDay.split('-')
let clickDay = parseInt(this.$data.daysData[index].day)
clickDay = clickDay < 10 ? ('0' + clickDay) : clickDay
let clickDate = currentDay[0] + '-' + currentDay[1] + '-' + clickDay
this.$emit('ChildrenSelect', clickDate)
bus.$emit('chosen-tripdate', this.currentDay.substring(0,7) + '-' + clickDay)
},
getYearMonthDay(){
// console.log("day",this.day);
let currentYear = this.currentDay.substring(0,4); //当前年份
let currentMonth = this.currentDay.substring(5,7); //当前月份
// console.log("currentMonth",currentMonth)
let date = new Date();
let strDate = date.getDate();
let strMonth = (date.getMonth()+1).toString();
// alert(typeof strMonth)
//判断是否是闰年
if (this.isleapYears(currentYear)) {
this.$data.DaysInMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
}else{
this.$data.DaysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
}
let monthDay = this.$data.DaysInMonth[Number(currentMonth)-1];//当前月的天数
let daysData = [];
//给数据源赋值
for (var i = 0 ;i < Number(monthDay) ;i++) {
var priceDict = {'day':String(i+1),'price':0,'dis':false};
daysData.push(priceDict);
}
this.daysData = daysData;
var currentDay = `${currentYear}-${currentMonth}-01`;
var dateObject = new Date(currentDay);
var firstDay = dateObject.getDay();//得到每个月1号是周几
for (var i in this.priceData) {
var price = this.priceData[i];
var dayIndex = price.dateStr.substring(price.dateStr.length-2,price.dateStr.length);
// console.log(dayIndex)
var dayDict = daysData[Number(dayIndex)-1];
dayDict.price = price.price;
if(dayIndex<strDate&&strMonth==currentMonth){
dayDict.price='';
}
}
if (firstDay > 0) {
var firstDayData = [];
for (var i=0; i< firstDay;i++) {
var dict = {'day':' ',price:'','dis':true};
firstDayData.push(dict);
}
this.daysData = firstDayData.concat(daysData);
}else{
this.daysData = daysData;
}
},
isleapYears(year){
if (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)) {
return true;
} else{
return false;
}
},
}
}
</script>
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