|
...
|
...
|
@@ -46,17 +46,25 @@ Component({ |
|
|
|
}
|
|
|
|
App.Customer.GetHouseFullDate(parmdata).then((json)=>{
|
|
|
|
console.log(json)
|
|
|
|
let obj={
|
|
|
|
date:this.data.date,
|
|
|
|
action:'defalut',
|
|
|
|
overdate:0,
|
|
|
|
}
|
|
|
|
if(json.ret==200){
|
|
|
|
this.houseFullDate=json.data;
|
|
|
|
//默认
|
|
|
|
if(action=='defalut'){
|
|
|
|
if(this.houseFullDate.indexOf(this.data.date)==-1){
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:0,overdate:0})
|
|
|
|
obj.houseFullStatus=0;
|
|
|
|
}else{ //满房
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0})
|
|
|
|
}
|
|
|
|
if(json.data.length>0){
|
|
|
|
this.changespeciallist(json.data)
|
|
|
|
obj.houseFullStatus=1;
|
|
|
|
}
|
|
|
|
this.triggerEvent('selectdate',obj)
|
|
|
|
}
|
|
|
|
if(json.data.length>0){
|
|
|
|
console.log(json.data)
|
|
|
|
this.changespeciallist(json.data)
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
...
|
...
|
@@ -64,8 +72,9 @@ Component({ |
|
|
|
if(json.ret==401){
|
|
|
|
if(action=='defalut'){
|
|
|
|
this.houseFullDate=null
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0})
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'401',houseFullStatus:1,overdate:0})
|
|
|
|
this.triggerEvent('selectdate',obj);
|
|
|
|
obj.action=401;
|
|
|
|
this.triggerEvent('selectdate',obj);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -89,6 +98,7 @@ Component({ |
|
|
|
newspeciallist.push(v)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
console.log(newspeciallist)
|
|
|
|
this.setData({
|
|
|
|
speciallist:newspeciallist
|
|
|
|
})
|
|
...
|
...
|
@@ -117,22 +127,31 @@ Component({ |
|
|
|
this.setData({
|
|
|
|
date:e.detail.date
|
|
|
|
})
|
|
|
|
console.log(new Date()/1000-Number(util.timetouUnix(this.data.date,'-')))
|
|
|
|
if(Number(util.timetouUnix(this.data.date,'-'))-new Date()/1000>=-24*60*60){
|
|
|
|
let obj={
|
|
|
|
date:this.data.date,
|
|
|
|
action:'click',
|
|
|
|
}
|
|
|
|
if(Number(util.timetouUnix(this.data.date,'-'))-new Date()/1000>=-24*60*60){ //今天以及之后日期
|
|
|
|
obj.overdate=0;
|
|
|
|
//可预订
|
|
|
|
if(this.houseFullDate){
|
|
|
|
if(this.houseFullDate.indexOf(this.data.date)==-1){
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:0,overdate:0})
|
|
|
|
obj.houseFullStatus=0;
|
|
|
|
}else{ //满房
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:1,overdate:0})
|
|
|
|
obj.houseFullStatus=1;
|
|
|
|
}
|
|
|
|
this.triggerEvent('selectdate',obj)
|
|
|
|
}else{
|
|
|
|
//不可预订
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:1,overdate:0})
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'401',houseFullStatus:1,overdate:0})
|
|
|
|
obj.houseFullStatus=1;
|
|
|
|
this.triggerEvent('selectdate',obj);
|
|
|
|
obj.action=401
|
|
|
|
this.triggerEvent('selectdate',obj);
|
|
|
|
}
|
|
|
|
}else{ //overdate为1过期日期
|
|
|
|
this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:1,overdate:1})
|
|
|
|
obj.overdate=1;
|
|
|
|
obj.houseFullStatus=1;
|
|
|
|
this.triggerEvent('selectdate',obj)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
...
|
...
|
|