master
lion 3 years ago
parent 07db3d92d9
commit 4b0d29b3bd

@ -174,11 +174,14 @@
res.isCanBook = that.$moment(nt).isBefore(res.end_plan); res.isCanBook = that.$moment(nt).isBefore(res.end_plan);
that.list = res; that.list = res;
let numberArr = [] let numberArr = []
let nowTime = that.getNowTime()
for(var m of res.numbers){ for(var m of res.numbers){
m.label = m.name + "(" + that.timeFormat(m.start_time,"yyyy年MM月DD日") + " " + that.getHm(m.start_time)+"-"+that.getHm(m.end_time) + ")" m.label = m.name + "(" + that.timeFormat(m.start_time,"yyyy年MM月DD日") + " " + that.getHm(m.start_time)+"-"+that.getHm(m.end_time) + ")"
if(m.has_total==m.total&&m.total!=0){ if(m.has_total==m.total&&m.total!=0 || that.compareDate(nowTime,m.end_plan)){
m.disabled = true m.disabled = true
} }
numberArr.push(m) numberArr.push(m)
} }
that.numbers = numberArr that.numbers = numberArr
@ -194,6 +197,23 @@
} }
}) })
},
//
getNowTime(){
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let hours = date.getHours()
let minutes = date.getMinutes()
let seconds =date.getSeconds()
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
compareDate(d1, d2) {
let reg = new RegExp('-', 'g')
return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))
}, },
topSwiperTab(e) { topSwiperTab(e) {
var that = this; var that = this;

Loading…
Cancel
Save