Showing
1 changed file
with
25 additions
and
12 deletions
| @@ -23,7 +23,7 @@ Component({ | @@ -23,7 +23,7 @@ Component({ | ||
| 23 | attached(){ | 23 | attached(){ |
| 24 | //默认标记特殊日期 | 24 | //默认标记特殊日期 |
| 25 | this.getspeciallist(); | 25 | this.getspeciallist(); |
| 26 | - this.gethousefulldate(); | 26 | + this.gethousefulldate(this.data.curYear,this.data.curMonth,'defalut'); |
| 27 | }, | 27 | }, |
| 28 | ready(){ | 28 | ready(){ |
| 29 | }, | 29 | }, |
| @@ -39,26 +39,31 @@ Component({ | @@ -39,26 +39,31 @@ Component({ | ||
| 39 | }) | 39 | }) |
| 40 | }, | 40 | }, |
| 41 | //根据指定年份月份获取当月满房的日期 | 41 | //根据指定年份月份获取当月满房的日期 |
| 42 | - gethousefulldate(){ | 42 | + gethousefulldate(year,month,action){ |
| 43 | let parmdata={ | 43 | let parmdata={ |
| 44 | sid:this.data.seller.id, | 44 | sid:this.data.seller.id, |
| 45 | - date:this.data.date.split('-')[0]+'-'+this.data.date.split('-')[1] | 45 | + date:year+'-'+month |
| 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 | if(json.ret==200){ | 49 | if(json.ret==200){ |
| 50 | this.houseFullDate=json.data; | 50 | this.houseFullDate=json.data; |
| 51 | - if(this.houseFullDate.indexOf(this.data.date)==-1){ | ||
| 52 | - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:0,overdate:0}) | ||
| 53 | - }else{ //满房 | ||
| 54 | - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0}) | ||
| 55 | - } | ||
| 56 | - if(json.data.length>0){ | ||
| 57 | - this.changespeciallist(json.data) | 51 | + if(action=='defalut'){ |
| 52 | + if(this.houseFullDate.indexOf(this.data.date)==-1){ | ||
| 53 | + this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:0,overdate:0}) | ||
| 54 | + }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) | ||
| 59 | + } | ||
| 58 | } | 60 | } |
| 61 | + | ||
| 59 | }else{ | 62 | }else{ |
| 60 | - this.houseFullDate=null | ||
| 61 | - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0}) | 63 | + if(action=='defalut'){ |
| 64 | + this.houseFullDate=null | ||
| 65 | + this.triggerEvent('selectdate',{date:this.data.date,action:'defalut',houseFullStatus:1,overdate:0}) | ||
| 66 | + } | ||
| 62 | } | 67 | } |
| 63 | }) | 68 | }) |
| 64 | }, | 69 | }, |
| @@ -84,12 +89,20 @@ Component({ | @@ -84,12 +89,20 @@ Component({ | ||
| 84 | }, | 89 | }, |
| 85 | //下一月 | 90 | //下一月 |
| 86 | nextMonth(e){ | 91 | nextMonth(e){ |
| 92 | + console.log(e) | ||
| 93 | + this.gethousefulldate(e.detail.currentYear,e.detail.currentMonth,'click'); | ||
| 87 | this.setData({ | 94 | this.setData({ |
| 88 | nextNum:this.data.nextNum+1 | 95 | nextNum:this.data.nextNum+1 |
| 89 | }) | 96 | }) |
| 90 | }, | 97 | }, |
| 91 | //上一月 | 98 | //上一月 |
| 92 | prevMonth(e){ | 99 | prevMonth(e){ |
| 100 | + if(this.data.nextNum==1){ | ||
| 101 | + this.gethousefulldate(e.detail.currentYear,e.detail.currentMonth,'defalut'); | ||
| 102 | + }else{ | ||
| 103 | + this.gethousefulldate(e.detail.currentYear,e.detail.currentMonth,'click'); | ||
| 104 | + } | ||
| 105 | + | ||
| 93 | this.setData({ | 106 | this.setData({ |
| 94 | nextNum:this.data.nextNum-1 | 107 | nextNum:this.data.nextNum-1 |
| 95 | }) | 108 | }) |
-
Please register or login to post a comment