|
@@ -15,17 +15,13 @@ Component({ |
|
@@ -15,17 +15,13 @@ Component({ |
|
15
|
},
|
15
|
},
|
|
16
|
observers: {
|
16
|
observers: {
|
|
17
|
'date'(newdate){
|
17
|
'date'(newdate){
|
|
18
|
- console.log('section',this.data.date,newdate)
|
18
|
+ console.log('section',this.data.date,newdate,this.data.section)
|
|
19
|
//今天日期
|
19
|
//今天日期
|
|
20
|
if(newdate){
|
20
|
if(newdate){
|
|
21
|
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
|
21
|
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
|
|
22
|
this.getsectionlist();
|
22
|
this.getsectionlist();
|
|
23
|
if(today==newdate){
|
23
|
if(today==newdate){
|
|
24
|
- console.log('xxxxxxx')
|
|
|
|
25
|
this.markoversection();
|
24
|
this.markoversection();
|
|
26
|
- if(this.data.section){
|
|
|
|
27
|
- this.changesectionstyle(this.data.section);
|
|
|
|
28
|
- }
|
|
|
|
29
|
}else{
|
25
|
}else{
|
|
30
|
if(this.data.section){
|
26
|
if(this.data.section){
|
|
31
|
this.changesectionstyle(this.data.section);
|
27
|
this.changesectionstyle(this.data.section);
|
|
@@ -69,7 +65,7 @@ Component({ |
|
@@ -69,7 +65,7 @@ Component({ |
|
69
|
let sectionlist=this.data.sectionlist;
|
65
|
let sectionlist=this.data.sectionlist;
|
|
70
|
//今天日期
|
66
|
//今天日期
|
|
71
|
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
|
67
|
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
|
|
72
|
- let curtimestamp=new Date()/1000;
|
68
|
+ let curtimestamp=Math.ceil(new Date()/1000);
|
|
73
|
let interval=[];
|
69
|
let interval=[];
|
|
74
|
sectionlist.forEach((v,i)=>{
|
70
|
sectionlist.forEach((v,i)=>{
|
|
75
|
let sectionarr=v.sectiondur.split('-');
|
71
|
let sectionarr=v.sectiondur.split('-');
|
|
@@ -82,13 +78,20 @@ Component({ |
|
@@ -82,13 +78,20 @@ Component({ |
|
82
|
index:i
|
78
|
index:i
|
|
83
|
})
|
79
|
})
|
|
84
|
}
|
80
|
}
|
|
|
|
81
|
+ if(this.data.section==v.section && v.overdate){
|
|
|
|
82
|
+ this.setData({
|
|
|
|
83
|
+ section:null
|
|
|
|
84
|
+ })
|
|
|
|
85
|
+ }
|
|
85
|
})
|
86
|
})
|
|
86
|
- console.log(interval)
|
|
|
|
87
|
if(!this.data.section){
|
87
|
if(!this.data.section){
|
|
88
|
if(interval.length>0){
|
88
|
if(interval.length>0){
|
|
89
|
sectionlist[interval[0].index].isselected=true;
|
89
|
sectionlist[interval[0].index].isselected=true;
|
|
90
|
- this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index)
|
90
|
+ this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index);
|
|
|
|
91
|
+ this.changesectionstyle(sectionlist[interval[0].index].section)
|
|
91
|
}
|
92
|
}
|
|
|
|
93
|
+ }else{
|
|
|
|
94
|
+ this.changesectionstyle(this.data.section)
|
|
92
|
}
|
95
|
}
|
|
93
|
this.setData({
|
96
|
this.setData({
|
|
94
|
sectionlist:sectionlist
|
97
|
sectionlist:sectionlist
|