|
...
|
...
|
@@ -16,7 +16,7 @@ Component({ |
|
|
|
this.setData({
|
|
|
|
showYearMonth:this.getshowmonth(this.data.date)
|
|
|
|
})
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'defalut'})
|
|
|
|
this.hasNowInToday();
|
|
|
|
this.getweeklist();
|
|
|
|
this.getdaylist();
|
|
|
|
this.getFullDate();
|
|
...
|
...
|
@@ -25,6 +25,27 @@ Component({ |
|
|
|
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
//判断是否过了今天时段,并设置date
|
|
|
|
hasNowInToday(){
|
|
|
|
let daily=this.data.seller.daily
|
|
|
|
let maxDur='';
|
|
|
|
Object.keys(daily).forEach(k=>{
|
|
|
|
let dur=daily[k].split('-')
|
|
|
|
if(dur[1]>maxDur){
|
|
|
|
maxDur=dur[1]
|
|
|
|
}
|
|
|
|
})
|
|
|
|
let nowDur=util.unixtoTime(new Date()/1000,'HH:II')
|
|
|
|
let nowDate=this.data.date
|
|
|
|
if(nowDur>maxDur){
|
|
|
|
nowDate=util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')
|
|
|
|
this.setData({
|
|
|
|
date:nowDate
|
|
|
|
})
|
|
|
|
}
|
|
|
|
//console.log('hasNowInToday',maxDur)
|
|
|
|
this.triggerEvent('selectdate',{date:nowDate,action:'defalut'})
|
|
|
|
},
|
|
|
|
//获取当前选中日期年月
|
|
|
|
getshowmonth(selecteddate){
|
|
|
|
let datearr=selecteddate.split('-');
|
...
|
...
|
|