Commit bc8d444c authored by huangyuanyuan's avatar huangyuanyuan

门票景点

parent 0fb97810
...@@ -374,7 +374,8 @@ ...@@ -374,7 +374,8 @@
color: #333333; color: #333333;
text-align: center; text-align: center;
position: relative; position: relative;
top: -10px; top: 0px;
} }
.Localtourhome .VeContent{ .Localtourhome .VeContent{
margin-top: 24px; margin-top: 24px;
...@@ -944,7 +945,7 @@ ...@@ -944,7 +945,7 @@
width: 280px; width: 280px;
border-radius: 0px; border-radius: 0px;
} }
.Appointment .form .el-input-number__decrease,.el-input-number__increase{ .Appointment .form .el-input-number__decrease,.Appointment .form .el-input-number__increase{
border-radius: 0px; border-radius: 0px;
background: #4CB960; background: #4CB960;
color:#fff; color:#fff;
...@@ -1051,12 +1052,10 @@ ...@@ -1051,12 +1052,10 @@
position: relative; position: relative;
} }
.calendarDiv{ .calendarDiv{
position: absolute;
width:406px; width:406px;
height:284px;
background:rgba(255,255,255,1); background:rgba(255,255,255,1);
box-shadow:0px 1px 3px 2px rgba(153, 153, 153, 0.35);
z-index: 100; z-index: 100;
border: 1px solid #E1E1E1;
} }
.Appointment .formline .calendarSpan{ .Appointment .formline .calendarSpan{
width: 280px; width: 280px;
...@@ -1064,6 +1063,21 @@ ...@@ -1064,6 +1063,21 @@
line-height: 32px; line-height: 32px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
display: inline-block; display: inline-block;
padding-left:10px;
}
.calendarPopover{
padding:0;
}
.calendarDiv .month_circle{
display: inline-block;
width:28px;
height:28px;
background:rgba(227,227,227,1);
color: #fff;
text-align: center;
line-height: 28px;
border-radius: 2px;
cursor: pointer;
} }
......
...@@ -5,18 +5,14 @@ ...@@ -5,18 +5,14 @@
<div class="FirstDiv"> <div class="FirstDiv">
<p> <p>
<span class="colorTitle"></span> <span class="colorTitle"></span>
<span class="pfR">日本东京迪士尼陆地乐园1日成人门票>(18-64岁)(必打印 指定日入园 赠高岛屋大礼包!)</span> <span class="pfR"> {{dataDes.name}}{{Ticketinfo.ticketName}}>({{Ticketinfo.ticketDesc}})</span>
<span @click="show=!show" :class="show?'Rotate':''" class="font12" style="margin-left:10px;color:#666666;">预约须知 <span @click="show=!show" :class="show?'Rotate':''" class="font12" style="margin-left:10px;color:#666666;cursor: pointer;">预约须知
<i class="iconfont icon-more"></i> <i class="iconfont icon-more"></i>
</span> </span>
</p> </p>
<div v-show="show" style="width:740px;background:#f5f5f5;padding:15px 25px;box-sizing:border-box;margin:10px 0"> <div v-show="show" style="width:740px;background:#f5f5f5;padding:15px 25px;box-sizing:border-box;margin:10px 0;font-size:12px">
<div v-if="dataDes.bookingInfo&&dataDes.bookingInfo!=''">{{dataDes.bookingInfo}}</div>
预订时间 最晚需在【出行前1天16:00(当地时间)】前购买 <div v-else>暂无</div>
有效期 选择的使用日期当天有效。
预订时间 最晚需在【出行前1天16:00(当地时间)】前购买
有效期 选择的使用日期当天有效。
</div> </div>
...@@ -25,37 +21,47 @@ ...@@ -25,37 +21,47 @@
<div class="form"> <div class="form">
<el-form ref="form" :model="form" label-width="80px"> <el-form ref="form" :model="form" label-width="80px">
<el-form-item class="formline" label="使用日期"> <el-form-item class="formline" label="使用日期">
<el-popover <el-popover popper-class="calendarPopover" v-model="visible"
placement="bottom-start" placement="bottom-start"
width="400"
trigger="click"> trigger="click">
<div class="calendarDiv"> <div class="calendarDiv">
456456 <div style="font-size:16px;padding:10px;text-align:center;overflow:auto;">
<!-- <v-calendar ref="child" v-for="(item,index) in classArray" :key="index" v-bind:dateData="classArray" :day ="tomonth" v-on:SelectChild="SelectChild"> <el-col :span="8"><span @click="ChangeMonth(0)" class="month_circle">
</v-calendar> --> <i class="iconfont icon-xiangzuo"></i>
</span> </el-col>
<el-col :span="8" style="color:#333333;">
<span class="pfR" style="position:relative;top:5px">{{tomonth}}</span>
</el-col>
<el-col :span="8"><span @click="ChangeMonth(1)" class="month_circle">
<i class="iconfont icon-arrowright1"></i>
</span></el-col>
</div>
<v-calendar ref="child" v-on:SelectChild="SelectChild" v-for="(item,index) in classArray" :key="index" v-bind:dateData="classArray" :day ="tomonth">
</v-calendar>
</div> </div>
<span class="calendarSpan" slot="reference">click 激活</span> <span class="calendarSpan" slot="reference">{{form.useDate}}</span>
</el-popover> </el-popover>
</el-form-item> </el-form-item>
<el-form-item label="购买数量"> <el-form-item label="购买数量">
<el-input-number size="small" v-model="form.num" :min="1" :max="10" label="描述文字"></el-input-number> <el-input-number size="small" v-model="form.purchaseQuantity" :min="1" :max="10" label="描述文字"></el-input-number>
</el-form-item> </el-form-item>
<div class="fg"></div> <div class="fg"></div>
<div style="padding:0 20px"> <div style="padding:0 20px">
<p class="pfR" style="color:#000000;margin:30px 0">取票人/出行人信息</p> <p class="pfR" style="color:#000000;margin:30px 0">取票人/出行人信息</p>
<el-form-item class="formline" label="中文姓名"> <el-form-item class="formline" label="中文姓名">
<el-input size="small" v-model="form.name"></el-input> <el-input size="small" v-model="form.contactCNName"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="formline" label="英文姓名"> <el-form-item class="formline" label="英文姓名">
<el-input size="small" v-model="form.name"></el-input> <el-input size="small" v-model="form.contactENName"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="formline" label="手机号"> <el-form-item class="formline" label="手机号">
<el-input size="small" v-model="form.name"></el-input> <el-input size="small" v-model="form.contactMobile"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="formline" label="E-mail"> <el-form-item class="formline" label="E-mail">
<el-input size="small" v-model="form.name"></el-input> <el-input size="small" v-model="form.contactEmail"></el-input>
</el-form-item> </el-form-item>
</div> </div>
...@@ -66,12 +72,12 @@ ...@@ -66,12 +72,12 @@
<div class="Yhq"> <div class="Yhq">
<p class="pfR" style="color:#000000;padding-left:20px">优惠券使用</p> <p class="pfR" style="color:#000000;padding-left:20px">优惠券使用</p>
<ul class="yhqUl"> <ul class="yhqUl">
<li class="sawtooth"> <li v-for="(item,index) in CouponsList" :key="index+5000" class="sawtooth">
<span class="kdj">可叠加</span> <span class="kdj" v-if="item.overlapUse==1">可叠加</span>
<p style="margin-top:10px"><span>100</span></p> <p style="margin-top:10px"><span>100</span></p>
<p style="font-size:14px">200使用</p> <p style="font-size:14px">{{item.useCondition}}使用</p>
<p style="font-size:12px;color:#4C58A4"> <p style="font-size:12px;color:#4C58A4">
有效期:2019.03.30-2019.05.30 有效期:{{item.effectDate | YMD}}-{{item.expirationDate | YMD}}
<input class="input" type="checkbox" value="1" name="" /> <input class="input" type="checkbox" value="1" name="" />
</p> </p>
...@@ -99,19 +105,196 @@ ...@@ -99,19 +105,196 @@
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment'
import calendar from "@/components/mall/LocalTourCalendar.vue";
export default { export default {
components: {
"v-calendar": calendar
},
data () { data () {
return { return {
form:{}, visible:false,
show:false, form:{
useDate:'',
purchaseQuantity:1,
},
show:false,
idDes:0,
classArray: [],
other_date: {
flithtMonthDate: moment().format("YYYY-MM"),
},
tomonth: moment().format("YYYY-MM"),
currentMonthDays:0,
timeStr:[],
CouponsList:[],
Ticketinfo:{},
dataDes:{},
} }
}, },
created(){
this.dataDes=JSON.parse(sessionStorage.dataDes);
this.Ticketinfo=JSON.parse(sessionStorage.Ticketinfo);
},
mounted() { mounted() {
this.idDes=decodeURIComponent(this.$route.query.idDes);
this.GetTicketPrice();
this.GetCoupons();
}, },
methods: { methods: {
SelectChild(item) {
console.log(item);
this.form.useDate=item.date_str;
this.form.couponsId=item.couponsId;
this.form.ticketId=item.ticketId;
this.form.priceId=item.priceId;
this.visible=false;
//
},
// 获取优惠券
GetCoupons(){
let msg={
lineId:0,
lineteamId:0,
CouponsUseScope:5,
};
this.apiJavaPost("/api/b2b/user/getUserCanUseCouponList",msg,
res => {
console.log(res);
if(res.data.resultCode==1){
this.CouponsList=res.data.data;
}
},
null
);
},
// 改变月份
ChangeMonth(num){
if(num==1){
this.tomonth = moment(this.tomonth)
.add(1, "month")
.format("YYYY-MM");
}else{
this.tomonth = moment(this.tomonth)
.subtract(1, "month")
.format("YYYY-MM");
}
this.GetCurrentDays();
},
// 获取当月天数
GetCurrentDays(){
let MonthdayList=[];
this.currentMonthDays = moment(this.tomonth).daysInMonth();
for(let i=1;i<=this.currentMonthDays;i++){
if(i<10){
i=`0${i}`;
}
let month={};
month.dateStr=`${this.tomonth}-${i}`;
MonthdayList.push(month)
}
let DayList=[];
this.timeStr.forEach(time=>{
MonthdayList.forEach(item=>{
if(moment(time.startDate).isBefore(item.dateStr) && moment(item.dateStr).isBefore(time.endDate)){
let msg={
price:time.b2bPrice,
couponsId:time.couponsId,
id:time.id,
idDes:time.idDes,
ticketId:time.ticketId,
dateStr:item.dateStr,
};
DayList.push(msg)
}else{
let date={
dateStr:item.dateStr,
}
DayList.push(date)
}
})
})
this.creatCalendar(DayList);
},
GetTicketPrice(){
this.apiJavaPost('/api/b2b/scenic/getCouponsTicketPriceList',{idDes:this.idDes},res=>{
if(res.data.resultCode==1){
this.timeStr=res.data.data;
this.GetCurrentDays();
}else{
this.Error(res.data.message);
}
},null)
},
creatCalendar(list) {
// 创建日历
let dateList =list;
// if (list && list.length > 0) {
// list.forEach((x, index) => {
// // if(parseFloat(999) > 0){
// let msg = {
// dateStr: x.timeStr,
// cDate: x.timeStr.replace("-", "年").replace("-", "月"),
// price: x.price,
// b2BMemberPrice: x.price,
// b2BPrice: x.price,
// b2CMemberPrice: x.price,
// id: index,
// dateStrS: x.timeStr.substring(0, x.timeStr.length - 3)
// };
// dateList.push(msg);
// // }
// });
// }
let monthArray = [];
for (var i in dateList) {
var data = dateList[i];
var dateDict = {
mounth: data.dateStr.substring(0, data.dateStr.length - 3)
};
monthArray.push(dateDict);
}
//数组去重,获取有几个月
var hash = {};
monthArray = monthArray.reduce(function(item, next) {
hash[next.mounth] ? "" : (hash[next.mounth] = true && item.push(next));
return item;
}, []);
//数据分组
let classArray = [];
for (var j in monthArray) {
var newArray = new Array();
for (var i in dateList) {
var data = dateList[i];
if (
data.dateStr.substring(0, data.dateStr.length - 3) ==
monthArray[j].mounth
) {
newArray.push(data);
}
}
classArray.push(newArray);
}
this.classArray = classArray;
var hash = {};
dateList = dateList.reduce(function(item, next) {
hash[next.dateStrS]
? ""
: (hash[next.dateStrS] = true && item.push(next));
return item;
}, []);
this.calendarTit = dateList;
this.$nextTick(() => {
this.$refs.child[0].getYearMonthDay(this.classArray);
});
}
} }
} }
</script> </script>
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> </div>
<div class="basefix dayContent" style="margin-top:17px"> <div class="basefix dayContent" style="margin-top:17px">
<div class="dayConDiv1"> <div class="dayConDiv1">
<div v-if="index<2" v-for="(item,index) in abroadList" :key="index+300"> <div @click="goOneDayDetail(item)" v-if="index<2" v-for="(item,index) in abroadList" :key="index+300">
<img v-if="index==0" :key="img.url" v-for="(img,index) in item.imgCover" :src="img.url" alt=""> <img v-if="index==0" :key="img.url" v-for="(img,index) in item.imgCover" :src="img.url" alt="">
<span class="daydes">{{item.lineName}}</span> <span class="daydes">{{item.lineName}}</span>
<span class="price"><span class="pfR font18">{{item.b2BPrice}}</span></span> <span class="price"><span class="pfR font18">{{item.b2BPrice}}</span></span>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</div> </div>
<div class="dayConDiv2"> <div class="dayConDiv2">
<ul> <ul>
<li v-if="index>1" v-for="(item,index) in abroadList" :key="index+200"> <li @click="goOneDayDetail(item)" v-if="index>1" v-for="(item,index) in abroadList" :key="index+200">
<div class="imgDiv"> <div class="imgDiv">
<img v-if="index==0" :key="img.url" v-for="(img,index) in item.imgCover" :src="img.url" alt=""> <img v-if="index==0" :key="img.url" v-for="(img,index) in item.imgCover" :src="img.url" alt="">
<span class="country">{{item.lineShortName}}</span> <span class="country">{{item.lineShortName}}</span>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<span style="font-size:14px;position: relative;top:-3px;left:5px">/ / / / / / / / / </span> <span style="font-size:14px;position: relative;top:-3px;left:5px">/ / / / / / / / / </span>
</div> </div>
<ul class="hottour_ul"> <ul class="hottour_ul">
<li v-for="(item,index) in abroadhotList" :key="index+100"> <li @click="goOneDayDetail(item)" v-for="(item,index) in abroadhotList" :key="index+100">
<img v-if="index==0" :key="img.url" v-for="(img,index) in item.imgCover" :src="img.url" alt=""> <img v-if="index==0" :key="img.url" v-for="(img,index) in item.imgCover" :src="img.url" alt="">
<div class="hotcontent"> <div class="hotcontent">
<span class="textHidden font12">{{item.title}}</span> <span class="textHidden font12">{{item.title}}</span>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</div> --> </div> -->
<div class="bottom"> <div class="bottom">
<span>{{item.name}}</span> <span>{{item.name}}</span>
<span class="font12">¥<a class="font14">{{item.b2bPrice}}</a>起/人</span> <span class="font12 textHidden1">¥<a class="font14">{{item.b2bPrice | priceFormat}}</a>起/人</span>
</div> </div>
</li> </li>
</ul> </ul>
...@@ -324,6 +324,11 @@ export default { ...@@ -324,6 +324,11 @@ export default {
this.GetCuntryTicket(); this.GetCuntryTicket();
}, },
methods: { methods: {
goOneDayDetail(item){
let path = 'OneDayDetailTwo';
path=`${path}/${encodeURIComponent(item.idDes)}/${item.tcid}`;
this.$router.push({ path })
},
GoTicket(item){ GoTicket(item){
this.$router.push({ path:'/TicketDetails', this.$router.push({ path:'/TicketDetails',
query:{idDes:encodeURIComponent(item.idDes)} }) query:{idDes:encodeURIComponent(item.idDes)} })
......
<template> <template>
<div class="OnedayList"> <div class="OnedayList">
<ul class="oneList"> <ul class="oneList">
<li v-for="item in dataList"> <li v-for="(item,index) in dataList" :key="index+200">
<div> <div>
<img style="width:199px;height:148px;" :src="item.imgCover[0].url" alt=""> <img style="width:199px;height:148px;" :src="item.imgCover[0].url" alt="">
</div> </div>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</ul> </ul>
<ul class="hottour_ul"> <ul class="hottour_ul">
<p class="pfR font14" style="margin-bottom:8px">历史浏览</p> <p class="pfR font14" style="margin-bottom:8px">历史浏览</p>
<li v-for="item in Historylist"> <li v-for="(item,index) in Historylist" :key="index+2000">
<img :src="item.imgCover[0].url" alt=""> <img :src="item.imgCover[0].url" alt="">
<div class="hotcontent"> <div class="hotcontent">
<span class="textHidden font12">{{item.title}}</span> <span class="textHidden font12">{{item.title}}</span>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<p class="pfR" style="color:#2A5532;font-size:20px;">{{dataDes.name}}</p> <p class="pfR" style="color:#2A5532;font-size:20px;">{{dataDes.name}}</p>
<!-- <p style="margin-top:20px" class="ticketSpan">票类包括:<span>大小同价</span><span>大小价</span></p> --> <!-- <p style="margin-top:20px" class="ticketSpan">票类包括:<span>大小同价</span><span>大小价</span></p> -->
<div class="price"> <div class="price">
{{dataDes.minPrice}}~¥{{dataDes.maxPrice}} {{dataDes.minPrice | priceFormat}}~¥{{dataDes.maxPrice | priceFormat}}
</div> </div>
<p> <p>
<span style="color:#666666">景点地址:</span> <span style="color:#666666">景点地址:</span>
...@@ -76,9 +76,9 @@ ...@@ -76,9 +76,9 @@
<!-- <span class="colorG">可订今日</span> <!-- <span class="colorG">可订今日</span>
<span class="colorG">可订今日</span> --> <span class="colorG">可订今日</span> -->
</el-col> </el-col>
<el-col class="pfR" :span="3" style="color:#FDAC11"><span class="font22">{{item.b2bPrice}}</span></el-col> <el-col class="pfR" :span="3" style="color:#FDAC11"><span class="font22">{{item.b2bPrice | priceFormat}}</span></el-col>
<el-col :span="2"> <el-col :span="2">
<span class="ydBtn">预定</span> <span @click="YdUrl(dataDes,item)" class="ydBtn">预定</span>
</el-col> </el-col>
</el-row> </el-row>
</li> </li>
...@@ -213,6 +213,12 @@ export default { ...@@ -213,6 +213,12 @@ export default {
}, },
methods: { methods: {
YdUrl(dataDes,item){
sessionStorage.dataDes=JSON.stringify(dataDes);
sessionStorage.Ticketinfo=JSON.stringify(item);
this.$router.push({ path:'/Appointment',
query:{idDes:encodeURIComponent(item.idDes)} })
},
LiHover(item,index){ LiHover(item,index){
this.imgHover=index; this.imgHover=index;
this.imgHoverSrc=item; this.imgHoverSrc=item;
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<i class="iconfont icon-arrowright1"></i> <i class="iconfont icon-arrowright1"></i>
</div> </div>
<div class="font_12" style="margin-top:20px;color:#FF680B;width:6%;position:relative"> <div class="font_12" style="margin-top:20px;color:#FF680B;width:6%;position:relative">
<el-popover <el-popover popper-class="calendarPopover"
placement="bottom" placement="bottom"
trigger="click"> trigger="click">
<div ref="otherdate" class="otherdate"> <div ref="otherdate" class="otherdate">
...@@ -561,6 +561,7 @@ export default { ...@@ -561,6 +561,7 @@ export default {
"/api/dmc/airticket/getB2BAirticketForMonthMinPrice", "/api/dmc/airticket/getB2BAirticketForMonthMinPrice",
this.other_date, this.other_date,
res => { res => {
let list = res.data.data; let list = res.data.data;
this.tomonth = moment(list[0].timeStr).format("YYYY-MM"); this.tomonth = moment(list[0].timeStr).format("YYYY-MM");
this.creatCalendar(list); this.creatCalendar(list);
...@@ -697,6 +698,7 @@ export default { ...@@ -697,6 +698,7 @@ export default {
}; };
monthArray.push(dateDict); monthArray.push(dateDict);
} }
console.log("monthArray",monthArray)
//数组去重,获取有几个月 //数组去重,获取有几个月
var hash = {}; var hash = {};
monthArray = monthArray.reduce(function(item, next) { monthArray = monthArray.reduce(function(item, next) {
...@@ -892,7 +894,7 @@ li { ...@@ -892,7 +894,7 @@ li {
border-radius: 50%; border-radius: 50%;
cursor: pointer; cursor: pointer;
} }
.cilcle { .TicketList .cilcle {
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
...@@ -905,8 +907,11 @@ li { ...@@ -905,8 +907,11 @@ li {
.TicketList .el-popover { .TicketList .el-popover {
border: none; border: none;
} }
.TicketList .calendarPopover{
padding:0;
}
.otherdate { .otherdate {
width: 500px; width: 406px;
position: absolute; position: absolute;
right: 0; right: 0;
z-index: 5; z-index: 5;
...@@ -916,7 +921,7 @@ li { ...@@ -916,7 +921,7 @@ li {
box-sizing: border-box; box-sizing: border-box;
color: #333; color: #333;
} }
.active_data { .TicketList .active_data {
margin: 0; margin: 0;
border-top: 6px solid #ee4454; border-top: 6px solid #ee4454;
box-shadow: 0px 2px 6px 3px rgba(149, 149, 149, 0.23); box-shadow: 0px 2px 6px 3px rgba(149, 149, 149, 0.23);
......
<style>
.LocalTourCalendar .calendar{
width: 100%;
overflow: hidden;
table-layout: fixed;
}
.LocalTourCalendar .calendar th{
height: 20px;
padding: 10px 0;
line-height: 20px;
color: #999999;
text-align: center;
font-size: 14px;
}
.LocalTourCalendar .dayList{
position: relative;
float: left;
width: 58px;
height: 44px;
cursor: pointer;
border: 1px solid transparent;
background-color: #F5F5F5;
font-size: 12px;
border-bottom:1px solid #E1E1E1;
border-right:1px solid #E1E1E1;
box-sizing: border-box;
}
.LocalTourCalendar .dayList:nth-child(7n){
border-right: none;
}
.LocalTourCalendar .dayList.noPrice{
cursor: default;
color: #ccc;
background-color: #FFFFFF;
}
.LocalTourCalendar .dayList.selectDay{
border: 1px solid #ff4646;
background-color: #f9f7f6;
}
.LocalTourCalendar .dayList.yesPrice{
font-weight: bold;
font-family: 'PingFangR';
}
.LocalTourCalendar .dayList p{
float: initial;
width: 100%;
text-align: left;
padding-left:5px;
margin: 2px 0;
box-sizing: border-box;
}
.LocalTourCalendar .dayList p.price{
float: initial;
width: 100%;
text-align: right;
padding:0;
margin: 2px 0;
color: #FF5A00;
font-size: 12px;
padding-right: 5px;
box-sizing: border-box;
}
.LocalTourCalendar .monthDayList{
overflow: auto;
border-top:1px solid #E1E1E1;
}
.LocalTourCalendar .dayList.yesPrice:hover{
background: #FF680B;
color:#fff!important;
}
.LocalTourCalendar .dayList.yesPrice:hover .price{
color:#fff!important;
}
</style>
<template>
<div class="LocalTourCalendar" id='LocalTourCalendar'>
<table class="calendar" cellspacing=0 cellpadding=0>
<thead>
<th style="color:#666666;font-size:12px;" 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(item):''" :class="{selectDay:isSelect == index,noPrice:!item.price,yesPrice:item.price}">
<p>{{item.day}}</p>
<!-- -->
<p class="price" v-if="item.price!='0.00' && item.price">{{item.price | priceFormat}}</p>
</div>
</div>
</div>
</template>
<script>
import moment from 'moment'
import bus from '../../plugins/event-bus'
export default {
props:{
dateData: Array,
day:String,
},
data(){
return{
week:['周日','周一','周二','周三','周四','周五','周六'],
// priceData:this.dateData[0],
priceData:[],
currentDay: this.day,
DaysInMonth:[],
daysData:[],
isSelect:-1,
mydate:-1,
}
},mounted(){
},created(){
// this.getYearMonthDay();
},methods:{
selectDate(item){
if(item.price=="0.00"){
return;
}else{
this.$emit('SelectChild',item);
}
},
getYearMonthDay(list){
this.priceData=list[0];
let day=this.day;
let currentYear = day.substring(0,4); //当前年份
let currentMonth =day.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 (let i = 0 ;i < Number(monthDay) ;i++) {
var priceDict = {'day':String(i+1),'price':0,'dis':false,date_str:''};
daysData.push(priceDict);
}
this.daysData = daysData;
var currentDay = `${currentYear}-${currentMonth}-01`;
var dateObject = new Date(currentDay);
var firstDay = dateObject.getDay();//得到每个月1号是周几
// for (let i in this.priceData) {
let today=moment().format("YYYY-MM-DD");
for (let i=0;i<this.priceData.length;i++) {
let price = this.priceData[i];
let dateStr=moment(price.dateStr).format("YYYY-MM-DD");
var dayIndex = price.dateStr.substring(price.dateStr.length-2,price.dateStr.length);
var dayDict = daysData[Number(dayIndex)-1];
if (moment(dateStr).isBefore(today)){
dayDict.price='';
}else{
dayDict.price = price.price;
}
// dayDict.price = price.price;
dayDict.date_str=price.dateStr;
dayDict.couponsId=price.couponsId;
dayDict.id=price.id;
dayDict.ticketId=price.ticketId;
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>
...@@ -794,6 +794,7 @@ export default { ...@@ -794,6 +794,7 @@ export default {
let data = (r.data.data); let data = (r.data.data);
this.sonData = data; this.sonData = data;
this.dayList = data.dayList; this.dayList = data.dayList;
// console.log("this.dayList",this.dayList);
this.feature = data.feature; this.feature = data.feature;
this.isDirect = data.isDirect; this.isDirect = data.isDirect;
if (data.videoStr) { if (data.videoStr) {
...@@ -826,6 +827,7 @@ export default { ...@@ -826,6 +827,7 @@ export default {
this.clickDate = data.currentPriceInfo && data.currentPriceInfo.startDate ? data.currentPriceInfo.startDate : ''; this.clickDate = data.currentPriceInfo && data.currentPriceInfo.startDate ? data.currentPriceInfo.startDate : '';
this.FlightList = data.currentPriceInfo && data.currentPriceInfo.priceFlight ? data.currentPriceInfo.priceFlight : ''; this.FlightList = data.currentPriceInfo && data.currentPriceInfo.priceFlight ? data.currentPriceInfo.priceFlight : '';
this.dataList = data; this.dataList = data;
console.log("dataList",this.dataList)
this.toDayObj = this.priceList && this.priceList.length>0?this.priceList[0]:null; this.toDayObj = this.priceList && this.priceList.length>0?this.priceList[0]:null;
this.imgCover = JSON.parse(this.dataList.imgCover); this.imgCover = JSON.parse(this.dataList.imgCover);
this.showType = this.feature.featureType; this.showType = this.feature.featureType;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
.newcalendar-box .dayList{ .newcalendar-box .dayList{
position: relative; position: relative;
float: left; float: left;
width: 13.88%; width: 13.7%;
height: 57px; height: 57px;
cursor: pointer; cursor: pointer;
border: 1px solid transparent; border: 1px solid transparent;
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
getYearMonthDay(list){ getYearMonthDay(list){
this.priceData=list[0]; this.priceData=list[0];
let day=this.day; let day=this.day;
console.log("day",day);
let currentYear = day.substring(0,4); //当前年份 let currentYear = day.substring(0,4); //当前年份
let currentMonth =day.substring(5,7); //当前月份 let currentMonth =day.substring(5,7); //当前月份
// console.log("currentMonth",currentMonth) // console.log("currentMonth",currentMonth)
......
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