Commit 9827533b7adc828631878d9f676bbcd2cf870f73

Authored by liuxuqinfhp1220
1 parent fe5f3668

no message

@@ -46,17 +46,25 @@ Component({ @@ -46,17 +46,25 @@ Component({
46 } 46 }
47 App.Customer.GetHouseFullDate(parmdata).then((json)=>{ 47 App.Customer.GetHouseFullDate(parmdata).then((json)=>{
48 console.log(json) 48 console.log(json)
  49 + let obj={
  50 + date:this.data.date,
  51 + action:'defalut',
  52 + overdate:0,
  53 + }
49 if(json.ret==200){ 54 if(json.ret==200){
50 this.houseFullDate=json.data; 55 this.houseFullDate=json.data;
  56 + //默认
51 if(action=='defalut'){ 57 if(action=='defalut'){
52 if(this.houseFullDate.indexOf(this.data.date)==-1){ 58 if(this.houseFullDate.indexOf(this.data.date)==-1){
53 - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:0,overdate:0}) 59 + obj.houseFullStatus=0;
54 }else{ //满房 60 }else{ //满房
55 - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0})  
56 - }  
57 - if(json.data.length>0){  
58 - this.changespeciallist(json.data) 61 + obj.houseFullStatus=1;
59 } 62 }
  63 + this.triggerEvent('selectdate',obj)
  64 + }
  65 + if(json.data.length>0){
  66 + console.log(json.data)
  67 + this.changespeciallist(json.data)
60 } 68 }
61 69
62 }else{ 70 }else{
@@ -64,8 +72,9 @@ Component({ @@ -64,8 +72,9 @@ Component({
64 if(json.ret==401){ 72 if(json.ret==401){
65 if(action=='defalut'){ 73 if(action=='defalut'){
66 this.houseFullDate=null 74 this.houseFullDate=null
67 - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0})  
68 - this.triggerEvent('selectdate',{date:this.data.date,action:'401',houseFullStatus:1,overdate:0}) 75 + this.triggerEvent('selectdate',obj);
  76 + obj.action=401;
  77 + this.triggerEvent('selectdate',obj);
69 78
70 } 79 }
71 } 80 }
@@ -89,6 +98,7 @@ Component({ @@ -89,6 +98,7 @@ Component({
89 newspeciallist.push(v) 98 newspeciallist.push(v)
90 } 99 }
91 }) 100 })
  101 + console.log(newspeciallist)
92 this.setData({ 102 this.setData({
93 speciallist:newspeciallist 103 speciallist:newspeciallist
94 }) 104 })
@@ -117,22 +127,31 @@ Component({ @@ -117,22 +127,31 @@ Component({
117 this.setData({ 127 this.setData({
118 date:e.detail.date 128 date:e.detail.date
119 }) 129 })
120 - console.log(new Date()/1000-Number(util.timetouUnix(this.data.date,'-')))  
121 - if(Number(util.timetouUnix(this.data.date,'-'))-new Date()/1000>=-24*60*60){ 130 + let obj={
  131 + date:this.data.date,
  132 + action:'click',
  133 + }
  134 + if(Number(util.timetouUnix(this.data.date,'-'))-new Date()/1000>=-24*60*60){ //今天以及之后日期
  135 + obj.overdate=0;
122 //可预订 136 //可预订
123 if(this.houseFullDate){ 137 if(this.houseFullDate){
124 if(this.houseFullDate.indexOf(this.data.date)==-1){ 138 if(this.houseFullDate.indexOf(this.data.date)==-1){
125 - this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:0,overdate:0}) 139 + obj.houseFullStatus=0;
126 }else{ //满房 140 }else{ //满房
127 - this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:1,overdate:0}) 141 + obj.houseFullStatus=1;
128 } 142 }
  143 + this.triggerEvent('selectdate',obj)
129 }else{ 144 }else{
130 //不可预订 145 //不可预订
131 - this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:1,overdate:0})  
132 - this.triggerEvent('selectdate',{date:this.data.date,action:'401',houseFullStatus:1,overdate:0}) 146 + obj.houseFullStatus=1;
  147 + this.triggerEvent('selectdate',obj);
  148 + obj.action=401
  149 + this.triggerEvent('selectdate',obj);
133 } 150 }
134 }else{ //overdate为1过期日期 151 }else{ //overdate为1过期日期
135 - this.triggerEvent('selectdate',{date:this.data.date,action:'click',houseFullStatus:1,overdate:1}) 152 + obj.overdate=1;
  153 + obj.houseFullStatus=1;
  154 + this.triggerEvent('selectdate',obj)
136 } 155 }
137 } 156 }
138 } 157 }