Commit 71ebe3bdb91fa6bca8850fba13e1cc5bb93ebe0b

Authored by wangfan
1 parent efc0f8d8

fixbug year

@@ -30,6 +30,7 @@ Page({ @@ -30,6 +30,7 @@ Page({
30 }, 30 },
31 sellerid:0, 31 sellerid:0,
32 indexOpt:null, 32 indexOpt:null,
  33 + YYYY:'',
33 onLoad:async function(opt){ 34 onLoad:async function(opt){
34 let d=new Date()/1000; 35 let d=new Date()/1000;
35 let dateStr=util.unixtoTime(d,'MM-DD DAY'); 36 let dateStr=util.unixtoTime(d,'MM-DD DAY');
@@ -101,7 +102,7 @@ Page({ @@ -101,7 +102,7 @@ Page({
101 formdata.sid=this.sellerid; 102 formdata.sid=this.sellerid;
102 formdata.x=1; 103 formdata.x=1;
103 formdata.y=200; 104 formdata.y=200;
104 - let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time); 105 + let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);
105 formdata.rdate=rdate; 106 formdata.rdate=rdate;
106 if(isExport){ 107 if(isExport){
107 this.__exportFile(formdata); 108 this.__exportFile(formdata);
@@ -152,7 +153,9 @@ Page({ @@ -152,7 +153,9 @@ Page({
152 console.log(this.data.calendarMask) 153 console.log(this.data.calendarMask)
153 }, 154 },
154 dateChange(event){ 155 dateChange(event){
  156 + this.YYYY=event.detail.date.substr(0,4);
155 let cktime=util.timetouUnix(event.detail.date) 157 let cktime=util.timetouUnix(event.detail.date)
  158 + console.log('cktime',cktime,this.YYYY)
156 let clickDay = event.detail.date.substr(8,2); 159 let clickDay = event.detail.date.substr(8,2);
157 let changeDay = `dayStyle[1].day`; 160 let changeDay = `dayStyle[1].day`;
158 let changeBg = `dayStyle[1].background`; 161 let changeBg = `dayStyle[1].background`;
@@ -45,7 +45,7 @@ module.exports ={ @@ -45,7 +45,7 @@ module.exports ={
45 return timedate; 45 return timedate;
46 }, 46 },
47 //获得营业时段时间戳,用 - 链接 47 //获得营业时段时间戳,用 - 链接
48 - async getTimeSpace(mmdd='',timeIndex=0,stimestr=null,sc=null){ 48 + async getTimeSpace(mmdd='',timeIndex=0,stimestr=null,sc=null,YYYY='YYYY'){
49 try { 49 try {
50 let d=new Date()/1000; 50 let d=new Date()/1000;
51 if(!mmdd){ 51 if(!mmdd){
@@ -64,11 +64,11 @@ module.exports ={ @@ -64,11 +64,11 @@ module.exports ={
64 64
65 let stime 65 let stime
66 if(stimestr){ 66 if(stimestr){
67 - stime=util.unixtoTime(d,'YYYY-'+mmdd+' '+stimestr); 67 + stime=util.unixtoTime(d,YYYY+'-'+mmdd+' '+stimestr);
68 }else{ 68 }else{
69 - stime=util.unixtoTime(d,'YYYY-'+mmdd+' '+ts[0]+':00'); 69 + stime=util.unixtoTime(d,YYYY+'-'+mmdd+' '+ts[0]+':00');
70 } 70 }
71 - let etime=util.unixtoTime(d,'YYYY-'+mmdd+' '+ts[1]+':00'); 71 + let etime=util.unixtoTime(d,YYYY+'-'+mmdd+' '+ts[1]+':00');
72 console.log('stime',stime,etime); 72 console.log('stime',stime,etime);
73 return (util.timetouUnix(stime)||0)+'-'+(util.timetouUnix(etime)||0); 73 return (util.timetouUnix(stime)||0)+'-'+(util.timetouUnix(etime)||0);
74 } 74 }