Showing
1 changed file
with
6 additions
and
9 deletions
| @@ -104,22 +104,19 @@ Component({ | @@ -104,22 +104,19 @@ Component({ | ||
| 104 | //通知时段 | 104 | //通知时段 |
| 105 | tellsection(selectsection,action,index){ | 105 | tellsection(selectsection,action,index){ |
| 106 | let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); | 106 | let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); |
| 107 | - let curtimestamp=new Date()/1000; | 107 | + let curtimestamp=Number(new Date().getTime().toString().substr(0,10)); |
| 108 | let sectionarr=this.data.sectionlist[index].sectiondur.split('-'); | 108 | let sectionarr=this.data.sectionlist[index].sectiondur.split('-'); |
| 109 | - let starttimestamp=Number(util.timetouUnix(today+' '+sectionarr[1]+':00')); | 109 | + let starttimestamp=Number(util.timetouUnix(today+' '+sectionarr[0]+':00')); |
| 110 | let endtimestamp=Number(util.timetouUnix(today+' '+sectionarr[1]+':00')); | 110 | let endtimestamp=Number(util.timetouUnix(today+' '+sectionarr[1]+':00')); |
| 111 | let obj={ | 111 | let obj={ |
| 112 | section:selectsection, | 112 | section:selectsection, |
| 113 | action:action | 113 | action:action |
| 114 | } | 114 | } |
| 115 | - if(curtimestamp>=starttimestamp && curtimestamp<endtimestamp){ | ||
| 116 | - obj.time=sectionarr[1] | 115 | + console.log(curtimestamp,starttimestamp) |
| 116 | + if(curtimestamp<starttimestamp){ | ||
| 117 | + obj.time=sectionarr[0] | ||
| 117 | }else{ | 118 | }else{ |
| 118 | - if(curtimestamp>=endtimestamp){ | ||
| 119 | - obj.time=sectionarr[1] | ||
| 120 | - }else{ | ||
| 121 | - obj.time=sectionarr[0] | ||
| 122 | - } | 119 | + obj.time=sectionarr[1] |
| 123 | } | 120 | } |
| 124 | this.triggerEvent('selectsection',obj) | 121 | this.triggerEvent('selectsection',obj) |
| 125 | 122 |
-
Please register or login to post a comment