|
...
|
...
|
@@ -15,17 +15,13 @@ Component({ |
|
|
|
},
|
|
|
|
observers: {
|
|
|
|
'date'(newdate){
|
|
|
|
console.log('section',this.data.date,newdate)
|
|
|
|
console.log('section',this.data.date,newdate,this.data.section)
|
|
|
|
//今天日期
|
|
|
|
if(newdate){
|
|
|
|
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
|
|
|
|
this.getsectionlist();
|
|
|
|
if(today==newdate){
|
|
|
|
console.log('xxxxxxx')
|
|
|
|
this.markoversection();
|
|
|
|
if(this.data.section){
|
|
|
|
this.changesectionstyle(this.data.section);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
if(this.data.section){
|
|
|
|
this.changesectionstyle(this.data.section);
|
|
...
|
...
|
@@ -69,7 +65,7 @@ Component({ |
|
|
|
let sectionlist=this.data.sectionlist;
|
|
|
|
//今天日期
|
|
|
|
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
|
|
|
|
let curtimestamp=new Date()/1000;
|
|
|
|
let curtimestamp=Math.ceil(new Date()/1000);
|
|
|
|
let interval=[];
|
|
|
|
sectionlist.forEach((v,i)=>{
|
|
|
|
let sectionarr=v.sectiondur.split('-');
|
|
...
|
...
|
@@ -82,13 +78,20 @@ Component({ |
|
|
|
index:i
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(this.data.section==v.section && v.overdate){
|
|
|
|
this.setData({
|
|
|
|
section:null
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
console.log(interval)
|
|
|
|
if(!this.data.section){
|
|
|
|
if(interval.length>0){
|
|
|
|
sectionlist[interval[0].index].isselected=true;
|
|
|
|
this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index)
|
|
|
|
this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index);
|
|
|
|
this.changesectionstyle(sectionlist[interval[0].index].section)
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
this.changesectionstyle(this.data.section)
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
sectionlist:sectionlist
|
...
|
...
|
|