刘翔宇-旅管家 3 years ago
commit 77e6c91607

@ -174,11 +174,14 @@
res.isCanBook = that.$moment(nt).isBefore(res.end_plan);
that.list = res;
let numberArr = []
let nowTime = that.getNowTime()
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) + ")"
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
}
numberArr.push(m)
}
that.numbers = numberArr
@ -195,6 +198,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) {
var that = this;
this.topSwiperIndex = Number(e.target.current);

Loading…
Cancel
Save