Commit 8f84ecc37d4b9575c92b29d36b6869538749805a

Authored by liuxuqinfhp1220
1 parent 200a5e5b

no message

@@ -129,10 +129,12 @@ Component({ @@ -129,10 +129,12 @@ Component({
129 overdate:thistimestamp<(new Date()/1000)-86400 ? true : false, //日期是否过期, 129 overdate:thistimestamp<(new Date()/1000)-86400 ? true : false, //日期是否过期,
130 } 130 }
131 if(thisdate==this.today.curdate){ 131 if(thisdate==this.today.curdate){
  132 + thisdayobj.automark=true;
132 thisdayobj.istoday=true; 133 thisdayobj.istoday=true;
133 thisdayobj.mark='今' 134 thisdayobj.mark='今'
134 } 135 }
135 if(util.unixtoTime(this.today.curtimestamp+86400,'YYYY-MM-DD')==thisdate){ 136 if(util.unixtoTime(this.today.curtimestamp+86400,'YYYY-MM-DD')==thisdate){
  137 + thisdayobj.automark=true;
136 thisdayobj.mark='明' 138 thisdayobj.mark='明'
137 } 139 }
138 thisdayobj.isselected=this.data.date==thisdate ? true : false; 140 thisdayobj.isselected=this.data.date==thisdate ? true : false;
@@ -239,6 +241,19 @@ Component({ @@ -239,6 +241,19 @@ Component({
239 let daylist=this.data.daylist; 241 let daylist=this.data.daylist;
240 daylist.forEach((v,i)=>{ 242 daylist.forEach((v,i)=>{
241 v.list.forEach((r,n)=>{ 243 v.list.forEach((r,n)=>{
  244 + if(r.mark){
  245 + if(r.automark){
  246 + if(r.mark!='今' || r.mark!='明'){
  247 + if(r.mark.istoday){
  248 + r.mark='今'
  249 + }else{
  250 + r.mark='明'
  251 + }
  252 + }
  253 + }else{
  254 + r.mark=null
  255 + }
  256 + }
242 marklist.forEach((r1,n1)=>{ 257 marklist.forEach((r1,n1)=>{
243 if(r.date && r1.date==r.date){ 258 if(r.date && r1.date==r.date){
244 r.mark=r1.mark 259 r.mark=r1.mark
@@ -16,20 +16,20 @@ Component({ @@ -16,20 +16,20 @@ Component({
16 marklist:[] 16 marklist:[]
17 }, 17 },
18 attached(){ 18 attached(){
  19 + this.marklist=[];
19 this.setData({ 20 this.setData({
20 date:util.unixtoTime(new Date()/1000,'YYYY-MM-DD') 21 date:util.unixtoTime(new Date()/1000,'YYYY-MM-DD')
21 }) 22 })
22 this.showYearMonth=this.getshowmonth(); 23 this.showYearMonth=this.getshowmonth();
23 this.gethousefulldate(this.data.seller,this.showYearMonth); 24 this.gethousefulldate(this.data.seller,this.showYearMonth);
24 - this.getFillDate(this.data.seller,this.showYearMonth);  
25 this.triggerEvent('tellselectdate',{date:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),action:'defalut'}); 25 this.triggerEvent('tellselectdate',{date:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),action:'defalut'});
26 }, 26 },
27 observers: { 27 observers: {
28 'setroom'(newsetroom){ 28 'setroom'(newsetroom){
29 console.log('calendar-room',newsetroom) 29 console.log('calendar-room',newsetroom)
30 if(newsetroom && newsetroom.id){ 30 if(newsetroom && newsetroom.id){
  31 + this.marklist=[];
31 this.gethousefulldate(this.data.seller,this.showYearMonth); 32 this.gethousefulldate(this.data.seller,this.showYearMonth);
32 - this.getFillDate(this.data.seller,this.showYearMonth);  
33 } 33 }
34 } 34 }
35 }, 35 },
@@ -48,7 +48,6 @@ Component({ @@ -48,7 +48,6 @@ Component({
48 this.showYearMonth=e.detail; 48 this.showYearMonth=e.detail;
49 if(e.detail.action='click'){ 49 if(e.detail.action='click'){
50 this.gethousefulldate(this.data.seller,this.showYearMonth); 50 this.gethousefulldate(this.data.seller,this.showYearMonth);
51 - this.getFillDate(this.data.seller,this.showYearMonth);  
52 } 51 }
53 }, 52 },
54 //根据指定年份月份获取当月满房的日期 53 //根据指定年份月份获取当月满房的日期
@@ -61,19 +60,18 @@ Component({ @@ -61,19 +60,18 @@ Component({
61 App.Customer.GetHouseFullDate(parmdata).then((json)=>{ 60 App.Customer.GetHouseFullDate(parmdata).then((json)=>{
62 console.log(json) 61 console.log(json)
63 if(json.ret==200){ 62 if(json.ret==200){
  63 + let marklist=this.marklist;
  64 + console.log(marklist)
64 if(json.data && json.data.length>0){ 65 if(json.data && json.data.length>0){
65 - let marklist=this.data.marklist;  
66 json.data.forEach((v,i)=>{ 66 json.data.forEach((v,i)=>{
67 marklist.push({ 67 marklist.push({
68 date:v, 68 date:v,
69 mark:'满' 69 mark:'满'
70 }) 70 })
71 }) 71 })
72 - this.setData({  
73 - marklist:marklist  
74 - }) 72 + this.marklist=marklist;
75 } 73 }
76 - 74 + this.getFillDate(seller,showYearMonth);
77 } 75 }
78 }) 76 })
79 }, 77 },
@@ -84,18 +82,20 @@ Component({ @@ -84,18 +82,20 @@ Component({
84 date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth) 82 date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth)
85 } 83 }
86 App.Customer.GetTableFillUpDate(parmdata).then((json)=>{ 84 App.Customer.GetTableFillUpDate(parmdata).then((json)=>{
87 - if(json.data && json.data.length>0){  
88 - let marklist=this.data.marklist; 85 + if(json.ret==200){
  86 + let marklist=this.marklist;
89 json.data.forEach((v,i)=>{ 87 json.data.forEach((v,i)=>{
90 marklist.push({ 88 marklist.push({
91 date:v, 89 date:v,
92 mark:'置' 90 mark:'置'
93 }) 91 })
94 }) 92 })
  93 + this.marklist=marklist;
95 this.setData({ 94 this.setData({
96 - marklist:marklist 95 + marklist:this.marklist
97 }) 96 })
98 } 97 }
  98 +
99 }) 99 })
100 }, 100 },
101 tellselectdate(e){ 101 tellselectdate(e){
1 -<nav id="nav">订座</nav> 1 +<nav id="nav">{{seller.sellername}}</nav>
2 <block wx:if="{{seller && seller.id}}"> 2 <block wx:if="{{seller && seller.id}}">
3 <calendar seller="{{seller}}" date="{{reserveDate}}" bindtellselectdate="selectdate" setroom="{{reserveRoom}}"></calendar> 3 <calendar seller="{{seller}}" date="{{reserveDate}}" bindtellselectdate="selectdate" setroom="{{reserveRoom}}"></calendar>
4 <view style="height:40rpx;"></view> 4 <view style="height:40rpx;"></view>