|
@@ -16,7 +16,7 @@ Component({ |
|
@@ -16,7 +16,7 @@ Component({ |
|
16
|
this.setData({
|
16
|
this.setData({
|
|
17
|
showYearMonth:this.getshowmonth(this.data.date)
|
17
|
showYearMonth:this.getshowmonth(this.data.date)
|
|
18
|
})
|
18
|
})
|
|
19
|
- this.triggerEvent('selectdate',{date:this.data.date,action:'defalut'})
|
19
|
+ this.hasNowInToday();
|
|
20
|
this.getweeklist();
|
20
|
this.getweeklist();
|
|
21
|
this.getdaylist();
|
21
|
this.getdaylist();
|
|
22
|
this.getFullDate();
|
22
|
this.getFullDate();
|
|
@@ -25,6 +25,27 @@ Component({ |
|
@@ -25,6 +25,27 @@ Component({ |
|
25
|
|
25
|
|
|
26
|
},
|
26
|
},
|
|
27
|
methods:{
|
27
|
methods:{
|
|
|
|
28
|
+ //判断是否过了今天时段,并设置date
|
|
|
|
29
|
+ hasNowInToday(){
|
|
|
|
30
|
+ let daily=this.data.seller.daily
|
|
|
|
31
|
+ let maxDur='';
|
|
|
|
32
|
+ Object.keys(daily).forEach(k=>{
|
|
|
|
33
|
+ let dur=daily[k].split('-')
|
|
|
|
34
|
+ if(dur[1]>maxDur){
|
|
|
|
35
|
+ maxDur=dur[1]
|
|
|
|
36
|
+ }
|
|
|
|
37
|
+ })
|
|
|
|
38
|
+ let nowDur=util.unixtoTime(new Date()/1000,'HH:II')
|
|
|
|
39
|
+ let nowDate=this.data.date
|
|
|
|
40
|
+ if(nowDur>maxDur){
|
|
|
|
41
|
+ nowDate=util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')
|
|
|
|
42
|
+ this.setData({
|
|
|
|
43
|
+ date:nowDate
|
|
|
|
44
|
+ })
|
|
|
|
45
|
+ }
|
|
|
|
46
|
+ //console.log('hasNowInToday',maxDur)
|
|
|
|
47
|
+ this.triggerEvent('selectdate',{date:nowDate,action:'defalut'})
|
|
|
|
48
|
+ },
|
|
28
|
//获取当前选中日期年月
|
49
|
//获取当前选中日期年月
|
|
29
|
getshowmonth(selecteddate){
|
50
|
getshowmonth(selecteddate){
|
|
30
|
let datearr=selecteddate.split('-');
|
51
|
let datearr=selecteddate.split('-');
|