Commit 71ebe3bdb91fa6bca8850fba13e1cc5bb93ebe0b

Authored by wangfan
1 parent efc0f8d8

fixbug year

... ... @@ -30,6 +30,7 @@ Page({
},
sellerid:0,
indexOpt:null,
YYYY:'',
onLoad:async function(opt){
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
... ... @@ -101,7 +102,7 @@ Page({
formdata.sid=this.sellerid;
formdata.x=1;
formdata.y=200;
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);
formdata.rdate=rdate;
if(isExport){
this.__exportFile(formdata);
... ... @@ -152,7 +153,9 @@ Page({
console.log(this.data.calendarMask)
},
dateChange(event){
this.YYYY=event.detail.date.substr(0,4);
let cktime=util.timetouUnix(event.detail.date)
console.log('cktime',cktime,this.YYYY)
let clickDay = event.detail.date.substr(8,2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
... ...
... ... @@ -45,7 +45,7 @@ module.exports ={
return timedate;
},
//获得营业时段时间戳,用 - 链接
async getTimeSpace(mmdd='',timeIndex=0,stimestr=null,sc=null){
async getTimeSpace(mmdd='',timeIndex=0,stimestr=null,sc=null,YYYY='YYYY'){
try {
let d=new Date()/1000;
if(!mmdd){
... ... @@ -64,11 +64,11 @@ module.exports ={
let stime
if(stimestr){
stime=util.unixtoTime(d,'YYYY-'+mmdd+' '+stimestr);
stime=util.unixtoTime(d,YYYY+'-'+mmdd+' '+stimestr);
}else{
stime=util.unixtoTime(d,'YYYY-'+mmdd+' '+ts[0]+':00');
stime=util.unixtoTime(d,YYYY+'-'+mmdd+' '+ts[0]+':00');
}
let etime=util.unixtoTime(d,'YYYY-'+mmdd+' '+ts[1]+':00');
let etime=util.unixtoTime(d,YYYY+'-'+mmdd+' '+ts[1]+':00');
console.log('stime',stime,etime);
return (util.timetouUnix(stime)||0)+'-'+(util.timetouUnix(etime)||0);
}
... ...