Commit d71d60e9 authored by 罗超's avatar 罗超

1

parent 87b24924
...@@ -150,7 +150,6 @@ ...@@ -150,7 +150,6 @@
selected(newVal) { selected(newVal) {
this.cale.setSelectInfo(this.nowDate.fullDate, newVal) this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
this.weeks = this.cale.weeks this.weeks = this.cale.weeks
console.log(this.weeks)
} }
}, },
created() { created() {
...@@ -166,14 +165,12 @@ ...@@ -166,14 +165,12 @@
// this.cale.setDate(this.date) // this.cale.setDate(this.date)
this.init(this.date) this.init(this.date)
// this.setDay // this.setDay
console.log(169,this.cale)
}, },
methods: { methods: {
// 取消穿透 // 取消穿透
clean() {}, clean() {},
bindDateChange(e) { bindDateChange(e) {
const value = e.detail.value + '-1' const value = e.detail.value + '-1'
console.log(this.cale.getDate(value));
this.init(value) this.init(value)
}, },
/** /**
......
...@@ -88,24 +88,24 @@ ...@@ -88,24 +88,24 @@
门票 门票
<text class="ticket-title-bg"></text> <text class="ticket-title-bg"></text>
</view> </view>
<view class="ticket-navs"> <view class="ticket-navs" v-if="TicketList.length>0">
<view class="ticket-nav" :class="{'check-ticket-nav':checkTicketNavIndex===1}" <view class="ticket-nav" :class="{'check-ticket-nav':checkTicketNavIndex===1}"
@click="changeCheckTicketNavIndex(1)" v-if="haveticket[0]"> @click="changeCheckTicketNavIndex(1)" v-if="haveticket[0].date">
{{haveticket[0].date}} {{haveticket[0].date}}
</view> </view>
<view class="ticket-nav" :class="{'check-ticket-nav':checkTicketNavIndex===2}" <view class="ticket-nav" :class="{'check-ticket-nav':checkTicketNavIndex===2}"
@click="changeCheckTicketNavIndex(2)" v-if="haveticket[1]"> @click="changeCheckTicketNavIndex(2)" v-if="haveticket[1].date">
{{haveticket[1].date}} {{haveticket[1].date}}
</view> </view>
<view class="ticket-nav" :class="{'check-ticket-nav':checkTicketNavIndex===3}" <view class="ticket-nav" :class="{'check-ticket-nav':checkTicketNavIndex===3}"
@click="changeCheckTicketNavIndex(3)"> @click="changeCheckTicketNavIndex(3)">
{{otherDate}} {{otherDate}}
</view> </view>
<calendar ref="calendar" :insert="false" :selected="calendar" @confirm="confirm"></calendar> <calendar ref="calendar" :insert="false" :selected="calendar" @confirm="confirm" @monthSwitch="changeMonth"></calendar>
</view> </view>
<view> <view>
<view class="no-data" v-if="details.mealList.length===0"> <view class="no-data" v-if="TicketList.length===0">
<image <image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/no-data.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/no-data.png"
mode="aspectFit" class="no-data-img"></image> mode="aspectFit" class="no-data-img"></image>
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
暂无数据 暂无数据
</view> </view>
</view> </view>
<view v-for="(item,index) in details.mealList" :key="index" class="ticket-list-box" <view v-for="(item,index) in TicketList" :key="index" class="ticket-list-box"
:class="{'last-item':index==details.mealList.length-1}" :class="{'last-item':index==TicketList.length-1}"
v-if="details.mealList.length>0"> v-if="TicketList.length>0">
<view class="ticket-key"> <view class="ticket-key">
{{item.Key}} {{item.Key}}
</view> </view>
...@@ -286,7 +286,8 @@ ...@@ -286,7 +286,8 @@
Up: 0, Up: 0,
nearbyType: 0, nearbyType: 0,
scenicArr: [], //推荐景点 scenicArr: [], //推荐景点
haveticket:[],//最近3天的票 haveticket:[{date:""},{date:""}],//最近3天的票
TicketList:[]
} }
}, },
onShareTimeline() { onShareTimeline() {
...@@ -379,15 +380,24 @@ ...@@ -379,15 +380,24 @@
this.Date = today this.Date = today
this.calendar.date = today this.calendar.date = today
this.getRecomHotel(); this.getRecomHotel();
this.getGoodsprice(); this.getGoodsprice(this.Date);
}, },
methods: { methods: {
//选择其他日期门票 //选择其他日期门票
confirm(e) { confirm(e) {
if(e.fulldate==this.haveticket[0].date){
this.checkTicketNavIndex = 1
this.otherDate ='其他日期'
}else if(e.fulldate==this.haveticket[1].date){
this.checkTicketNavIndex = 2
this.otherDate ='其他日期'
}else{
this.otherDate = e.fulldate
}
this.Date = e.fulldate this.Date = e.fulldate
// this.calendar[0].date = e.fulldate // this.calendar[0].date = e.fulldate
this.otherDate = e.fulldate
this.getDetailByDate(); this.getDetailByDate();
this.$forceUpdate(); this.$forceUpdate();
}, },
...@@ -422,6 +432,13 @@ ...@@ -422,6 +432,13 @@
res.data.ScenicSpotTag = res.data.ScenicSpotTag.split(',') res.data.ScenicSpotTag = res.data.ScenicSpotTag.split(',')
res.data.GeographicTag = res.data.GeographicTag.split(',') res.data.GeographicTag = res.data.GeographicTag.split(',')
this.details = res.data; this.details = res.data;
if(res.data.newMealList.length>0){
this.TicketList=[]
this.TicketList=res.data.newMealList[0].MealList
this.haveticket[0].date=res.data.newMealList[0].DayStr
this.haveticket[1].date=res.data.newMealList[1].DayStr
}
} }
}, },
err => { err => {
...@@ -440,11 +457,12 @@ ...@@ -440,11 +457,12 @@
}, },
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.details.mealList = res.data; this.TicketList = res.data;
} }
} }
); );
}, },
changeHandler(i) { changeHandler(i) {
this.active = i; this.active = i;
}, },
...@@ -474,10 +492,10 @@ ...@@ -474,10 +492,10 @@
name, name,
// address:"", // address:"",
success: (res) => { success: (res) => {
console.log(res)
}, },
fail: (err) => { fail: (err) => {
console.log(err)
} }
}) })
}, },
...@@ -497,6 +515,7 @@ ...@@ -497,6 +515,7 @@
// } // }
// let today = year + '-' + month + '-' + day // let today = year + '-' + month + '-' + day
// this.Date = today // this.Date = today
this.otherDate ='其他日期'
this.Date=this.haveticket[0].date this.Date=this.haveticket[0].date
this.getDetailByDate() this.getDetailByDate()
this.$forceUpdate() this.$forceUpdate()
...@@ -514,6 +533,7 @@ ...@@ -514,6 +533,7 @@
// } // }
// let tomorrow = year + '-' + month + '-' + day // let tomorrow = year + '-' + month + '-' + day
// this.Date = tomorrow // this.Date = tomorrow
this.otherDate ='其他日期'
this.Date=this.haveticket[1].date this.Date=this.haveticket[1].date
this.getDetailByDate() this.getDetailByDate()
this.$forceUpdate() this.$forceUpdate()
...@@ -529,12 +549,12 @@ ...@@ -529,12 +549,12 @@
changeNearbyType(t) { changeNearbyType(t) {
this.nearbyType = t this.nearbyType = t
}, },
getGoodsprice() { getGoodsprice(date) {
this.request2({ this.request2({
url: '/api/AppletDining/GetMonthTicketList', url: '/api/AppletDining/GetMonthTicketList',
data: { data: {
TicketID: 0, TicketID: 0,
BuyDate: this.Date, BuyDate:date,
TicketCounponID:this.ID TicketCounponID:this.ID
} }
}, },
...@@ -546,7 +566,6 @@ ...@@ -546,7 +566,6 @@
// info: '' // info: ''
// }], // }],
this.calendar=[] this.calendar=[]
this.haveticket=[]
let now=new Date(); let now=new Date();
now.setHours(0);//设置小时 now.setHours(0);//设置小时
now.setMinutes(0);//设置分钟 now.setMinutes(0);//设置分钟
...@@ -561,16 +580,9 @@ ...@@ -561,16 +580,9 @@
// info:"有票", // info:"有票",
} }
this.calendar.push(obj) this.calendar.push(obj)
if(this.haveticket.length<3){
this.haveticket.push({
...obj,...i
})
}
} }
}) })
console.log(571,this.haveticket)
} }
} }
...@@ -594,7 +606,6 @@ ...@@ -594,7 +606,6 @@
}, },
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log(res, '推荐景点');
this.scenicArr = []; this.scenicArr = [];
let tempHotel = res.data.pageData; let tempHotel = res.data.pageData;
tempHotel.forEach(x => { tempHotel.forEach(x => {
...@@ -606,8 +617,27 @@ ...@@ -606,8 +617,27 @@
} }
); );
}, },
changeMonth(val){
let now=new Date();
now.setDate(1);
now.setHours(0);//设置小时
now.setMinutes(0);//设置分钟
now.setSeconds(0);//设置秒
now.setMilliseconds(0);//设置毫妙
let curMonth= now.getTime();
let chooseYear=val.year
let chooseMonth= val.month
if(chooseMonth<10){
chooseMonth='0'+chooseMonth
}
let date = chooseYear+'-'+chooseMonth+'-01'
let changeMonth=Date.parse(date);
if(changeMonth>=curMonth){
this.getGoodsprice(date)
}
}
} }
} }
</script> </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