刘翔宇-旅管家 3 years ago
parent b07f3613eb
commit 113381c87a

@ -50,7 +50,7 @@
<view class="book-box-row-dateitem-status">
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked">
</u-icon>
<text v-else>{{item.is_open==1?'':""}}</text>
<text v-else>{{item.is_open==1?'':""}}</text>
</view>
<view>{{item.week}}</view>
<view>{{item.datef}}</view>
@ -198,9 +198,18 @@
this.showCalendar = false;
},
handleSelectDate(e) {
let that = this;
if (e.length != 0) {
this.load3Day(e[0]);
this.showCalendar = false;
var date = e[0]
this.load3Day(date, function(isCanbook) {
if (isCanbook) {
that.showCalendar = false;
} else {
that.util.toast("您选择的日期已经闭馆")
}
});
}
},
openCalendar() {
@ -219,7 +228,7 @@
if (m.is_open == 1)
day.bottomInfo = '余票'
else {
day.bottomInfo = '售罄'
day.bottomInfo = '闭馆'
}
}
}
@ -363,7 +372,7 @@
})
},
load3Day(sdate) { //7
load3Day(sdate, callbak) { //7
var that = this;
that.listDatePrice = [];
var edate = this.$moment(sdate).add('days', 2).format("yyyy-MM-DD");
@ -375,6 +384,7 @@
this.loadCalendar(sdate, edate, function(res) {
that.listDatePrice = res;
var i = 0;
let isOpenDate = false;
for (var m of that.listDatePrice) {
m.checked = false;
m.datef = that.$moment(m.date).format("MM月DD日");
@ -388,16 +398,16 @@
} else {
m.week = week;
}
if (m.date == selectDate) {
if (m.is_open == 1) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
that.loadDefaultTime(m.rules);
isOpenDate = true;
} else {
uni.showToast({
isOpenDate = false;
/* uni.showToast({
icon: "none",
title: selectDate + "不可以预约",
complete() {
@ -406,12 +416,17 @@
.format("yyyy-MM-DD"))
}, 2000)
}
}, 2000)
}, 2000) */
}
}
i++;
}
if (callbak)
callbak(isOpenDate);
})
},
loadDefaultTime(rules) {
var that = this;

@ -9,7 +9,7 @@
<block v-for="(item,index) in listOrder" :key="index">
<view class="orderBox" @click="toinfo(item.id)">
<view class="orderBoxTitle flex-row">
<text class="orderBoxTitleTxt">苏E44444</text>
<text class="orderBoxTitleTxt">{{item.plate}}</text>
<view class="orderBoxStatus">待参观</view>
</view>
@ -88,11 +88,8 @@
utilSuccess: function(res) {
that.loadOrder()
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
utilFail: function(res) {
that.util.toast(res);
}
})
console.log('用户点击确定');

@ -464,10 +464,7 @@
})
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
that.util.toast(res);
}
})
@ -535,8 +532,10 @@
}
that.form.details_list.push(that.formUser);
that.addUserAfter();
that.showAdd = false;
}).catch(errors => {
}).catch(errors => {
console.log(errors)
uni.showToast({
icon: "none",
title: "观众信息提交不正确"
@ -549,11 +548,17 @@
}
},
addUserAfter() {
if (this.type == "user") {
var user = this.form.details_list[0];
this.form.leader = user.name;
}
},
closecalendar() {
this.showCalendar = false;
},
handleSelectDate(e) {
if (this.showCalendar && e.length != 0 ) {
if (this.showCalendar && e.length != 0) {
this.load3Day(e[0]);
this.showCalendar = false;
}
@ -605,7 +610,7 @@
m.checked = false;
}
cdate.checked = true;
this.loadDefaultTime(cdate.rules);
this.currentDate = cdate;
@ -613,16 +618,16 @@
this.$forceUpdate();
},
handleSelectTime(index) {
var mod = this.currentDate.rules[index];
if (mod.remain_count == 0) {
this.util.toast("该时段已售罄");
return false
}
for (var m of this.currentDate.rules) {
m.checked = false;
}
mod.checked = true;
this.currentTime = mod;
var mod = this.currentDate.rules[index];
if (mod.remain_count == 0) {
this.util.toast("该时段已售罄");
return false
}
for (var m of this.currentDate.rules) {
m.checked = false;
}
mod.checked = true;
this.currentTime = mod;
this.$forceUpdate();
},
load3Day(sdate) { //7
@ -654,25 +659,25 @@
m.week = week;
}
if (m.date == selectDate) {
if (m.is_open == 1) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
that.loadDefaultTime(m.rules);
} else {
uni.showToast({
icon: "none",
title: selectDate + "不可以预约",
complete() {
setTimeout(function() {
that.load3Day(that.$moment(selectDate).add('days', 1)
.format("yyyy-MM-DD"))
}, 2000)
}
}, 2000)
}
if (m.date == selectDate) {
if (m.is_open == 1) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
that.loadDefaultTime(m.rules);
} else {
uni.showToast({
icon: "none",
title: selectDate + "不可以预约",
complete() {
setTimeout(function() {
that.load3Day(that.$moment(selectDate).add('days', 1)
.format("yyyy-MM-DD"))
}, 2000)
}
}, 2000)
}
}
i++;
}
@ -734,6 +739,7 @@
.timeitem-none {
color: #ccc;
}
.box-visitor-item {
display: flex;
justify-content: space-between;

@ -112,11 +112,20 @@ const alert = msg => {
}; // 订单状态
const toast = msg => {
uni.showToast({
icon: "none",
title: msg,
duration: 2000
})
// setTimeout(function() {
// uni.showToast({
// icon: "none",
// title: msg,
// duration: 2000
// })
// }, 2000)
uni.showModal({
title: '',
content: msg,
showCancel: false
});
}; // 订单状态
@ -173,6 +182,7 @@ const request = options => {
uni.request({
...options,
success: function(res) {
uni.hideLoading();
if (res.statusCode != 200) {
if (options.utilFail != undefined) {
if (res.statusCode == 401) {
@ -203,7 +213,7 @@ const request = options => {
complete: function(res) {
if (!options.customLoading) {
uni.hideNavigationBarLoading();
uni.hideLoading();
} else {
// 当前页面请求数量-1
if (options.bindThis) {

Loading…
Cancel
Save