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

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

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

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

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

Loading…
Cancel
Save