Commit 14766622 authored by 罗超's avatar 罗超

1

parent ceff2b75
...@@ -228,7 +228,8 @@ ...@@ -228,7 +228,8 @@
fail: function(err) { fail: function(err) {
console.log('fail:', err); console.log('fail:', err);
uni.showToast({ uni.showToast({
title: "支付失败" title: "支付失败",
icon:'none'
}) })
} }
}); });
......
...@@ -133,7 +133,6 @@ ...@@ -133,7 +133,6 @@
methods:{ methods:{
headItemTap(index,month){ headItemTap(index,month){
this.current = index this.current = index
console.log(month)
this.$emit('changeMonth',momth) this.$emit('changeMonth',momth)
}, },
getDefaultData(d){ //设置初始值 getDefaultData(d){ //设置初始值
...@@ -147,6 +146,7 @@ ...@@ -147,6 +146,7 @@
}else{ }else{
obj = false obj = false
} }
return obj; return obj;
}, },
isToday(date){ isToday(date){
...@@ -210,7 +210,22 @@ ...@@ -210,7 +210,22 @@
selectDate(data){ //选择日期 selectDate(data){ //选择日期
//多选模式请在这改造 //多选模式请在这改造
/* this.$set(this.dayActive,"date",date) */ /* this.$set(this.dayActive,"date",date) */
if(data.price){ console.log(data)
let resDay=Date.parse(data.date);
let now=new Date();
now.setHours(0);//设置小时
now.setMinutes(0);//设置分钟
now.setSeconds(0);//设置秒
now.setMilliseconds(0);//设置毫妙
let today= now.getTime();
if(resDay<today){
uni.showToast({
title: "不能选择今天以前的日期",
icon: "none",
});
return
}
if(data.price||data.price===0){
this.dayActive = { this.dayActive = {
date:data.date, date:data.date,
price:data.price price:data.price
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<view class="subscribeTicket"> <view class="subscribeTicket">
<view class="title"> <view class="title">
选择日期和人数 选择日期和人数
<u-icon name="cross" size="28" class="close-icon" @click="close"></u-icon>
</view> </view>
<view> <view>
<z-calendar ref="calendar" :datePrice="datePrice" :curryear='curryear' :currmonth='currmonth' <z-calendar ref="calendar" :datePrice="datePrice" :curryear='curryear' :currmonth='currmonth'
...@@ -86,10 +87,10 @@ ...@@ -86,10 +87,10 @@
}, },
watch: { watch: {
dateStr(val, oldVal) { dateStr(val, oldVal) {
this.defaultSelect = val;
let newMonth = val.split('-')[1] let newMonth = val.split('-')[1]
let oldMonth = oldVal.split('-')[1] let oldMonth = oldVal.split('-')[1]
if(newMonth!=oldMonth&&oldMonth!=undefined){ if(newMonth!=oldMonth&&oldMonth!=undefined){
console.log(newMonth!=oldMonth)
this.getGoodsDateList(val) this.getGoodsDateList(val)
} }
...@@ -108,7 +109,7 @@ ...@@ -108,7 +109,7 @@
} }
this.curryear= year this.curryear= year
this.currmonth= month this.currmonth= month
this.defaultSelect = this.dateStr;
}, },
methods: { methods: {
valChange(e) { valChange(e) {
...@@ -138,6 +139,9 @@ ...@@ -138,6 +139,9 @@
datePrice.push(obj) datePrice.push(obj)
}) })
this.datePrice = datePrice this.datePrice = datePrice
let list = this.datePrice.filter(item=>item.date==this.dateStr);
this.price=list[0].price
console.log(144,list,this.datePrice,this.dateStr)
} }
); );
}, },
...@@ -189,7 +193,9 @@ ...@@ -189,7 +193,9 @@
goback() { goback() {
uni.navigateBack() uni.navigateBack()
}, },
close(){
this.$emit("close")
}
} }
} }
...@@ -208,6 +214,12 @@ ...@@ -208,6 +214,12 @@
font-weight: 500; font-weight: 500;
color: #111111; color: #111111;
margin-bottom: 10rpx; margin-bottom: 10rpx;
position: relative;
.close-icon{
position: absolute;
right: 30rpx;
top: 0;
}
} }
.chooseTicketAndNum{ .chooseTicketAndNum{
height: 335rpx; height: 335rpx;
......
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
</view> </view>
<!-- 填写订单弹出层 --> <!-- 填写订单弹出层 -->
<view> <view>
<u-popup v-model="showSubscribeTicketPop" mode="bottom" border-radius="40" :closeable="true"> <u-popup v-model="showSubscribeTicketPop" mode="bottom" border-radius="40" :closeable="true" >
<subscribeTicket :dateStr="Date" :TicketID="TicketID" :TitekCounponId="ID" :TicketName="TicketName"></subscribeTicket> <subscribeTicket :dateStr="Date" :TicketID="TicketID" :TitekCounponId="ID" :TicketName="TicketName" @close="showSubscribeTicketPop=false"></subscribeTicket>
</u-popup> </u-popup>
</view> </view>
</view> </view>
...@@ -268,7 +268,16 @@ ...@@ -268,7 +268,16 @@
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
let d = new Date(); let d = new Date();
let today = `${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()}` let year=d.getFullYear();
let month=d.getMonth()+1;
if(month<10){
month='0'+month
}
let day=d.getDate();
if(day<10){
day='0'+day
}
let today = year+'-'+month+'-'+day
this.Date = today this.Date = today
this.calendar.date = today this.calendar.date = today
}, },
......
...@@ -91,8 +91,6 @@ ...@@ -91,8 +91,6 @@
this.Final_Price=this.ticketdData.PeopleNumber*this.ticketdData.Unit_Price this.Final_Price=this.ticketdData.PeopleNumber*this.ticketdData.Unit_Price
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "订单填写", title: "订单填写",
...@@ -153,7 +151,6 @@ ...@@ -153,7 +151,6 @@
console.log('订阅失败',err) console.log('订阅失败',err)
}, },
complete(_res) { complete(_res) {
console.log(_res)
that.queren(res.data.OrderId) that.queren(res.data.OrderId)
} }
}); });
...@@ -162,7 +159,6 @@ ...@@ -162,7 +159,6 @@
}, },
err=>{ err=>{
console.log(err)
uni.hideLoading(); uni.hideLoading();
} }
); );
...@@ -189,7 +185,6 @@ ...@@ -189,7 +185,6 @@
}, },
Pay(){ Pay(){
let that=this; let that=this;
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: 'wxpay',
timeStamp: this.orderInfo.timeStamp, timeStamp: this.orderInfo.timeStamp,
...@@ -204,16 +199,22 @@ ...@@ -204,16 +199,22 @@
}) })
setTimeout(()=>{ setTimeout(()=>{
uni.redirectTo({ uni.redirectTo({
url: '/pages/jiuzhai/allorderList' url: '/pages/jiuzhai/paysuccess?PreferPrice='+that.Final_Price
}); });
}, 100 ) }, 100 )
}, },
fail: function(err) { fail: function(err) {
console.log('fail:', err); console.log('fail:', err);
uni.showToast({ uni.showToast({
title: "支付失败" title: "支付失败",
icon:'none'
}) })
setTimeout(()=>{
uni.redirectTo({
url: '/pages/jiuzhai/allorderList'
});
}, 100 )
} }
}); });
}, },
......
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