Commit cc532f612e0512ba320a9098f2357817e421bb45

Authored by liuxuqinfhp1220
1 parent d0a1f3a3

no message

@@ -36,6 +36,10 @@ Component({ @@ -36,6 +36,10 @@ Component({
36 roomlist:this.data.roomlist 36 roomlist:this.data.roomlist
37 }) 37 })
38 this.getroomtype(); 38 this.getroomtype();
  39 + }else{
  40 + this.setData({
  41 + roomlist:[]
  42 + })
39 } 43 }
40 } 44 }
41 }, 45 },
@@ -66,7 +66,7 @@ Component({ @@ -66,7 +66,7 @@ Component({
66 //今天日期 66 //今天日期
67 let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); 67 let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
68 let curtimestamp=Math.ceil(new Date()/1000); 68 let curtimestamp=Math.ceil(new Date()/1000);
69 - let interval=[]; 69 + let interval=[],flag=false;
70 sectionlist.forEach((v,i)=>{ 70 sectionlist.forEach((v,i)=>{
71 let sectionarr=v.sectiondur.split('-'); 71 let sectionarr=v.sectiondur.split('-');
72 if(curtimestamp>Number(util.timetouUnix(today+' '+sectionarr[1]+':00'))){ 72 if(curtimestamp>Number(util.timetouUnix(today+' '+sectionarr[1]+':00'))){
@@ -82,13 +82,25 @@ Component({ @@ -82,13 +82,25 @@ Component({
82 this.setData({ 82 this.setData({
83 section:null 83 section:null
84 }) 84 })
  85 + flag=true;
85 } 86 }
86 }) 87 })
87 if(!this.data.section){ 88 if(!this.data.section){
88 if(interval.length>0){ 89 if(interval.length>0){
89 sectionlist[interval[0].index].isselected=true; 90 sectionlist[interval[0].index].isselected=true;
90 - this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index); 91 + if(flag){
  92 + this.tellsection(sectionlist[interval[0].index].section,'click',interval[0].index);
  93 + }else{
  94 + this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index);
  95 + }
91 this.changesectionstyle(sectionlist[interval[0].index].section) 96 this.changesectionstyle(sectionlist[interval[0].index].section)
  97 + }else{
  98 + let obj={
  99 + section:'',
  100 + action:'click',
  101 + time:''
  102 + }
  103 + this.triggerEvent('selectsection',obj)
92 } 104 }
93 }else{ 105 }else{
94 this.changesectionstyle(this.data.section) 106 this.changesectionstyle(this.data.section)
@@ -23,7 +23,7 @@ Page({ @@ -23,7 +23,7 @@ Page({
23 console.log(e); 23 console.log(e);
24 let t=setTimeout(()=>{ 24 let t=setTimeout(()=>{
25 this.setData({ 25 this.setData({
26 - reserveSection:e.detail.section, 26 + reserveSection:e.detail.section!='' ? e.detail.section : null,
27 }) 27 })
28 clearTimeout(t); 28 clearTimeout(t);
29 },0) 29 },0)
@@ -4,5 +4,7 @@ @@ -4,5 +4,7 @@
4 <view style="height:40rpx;"></view> 4 <view style="height:40rpx;"></view>
5 <section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section> 5 <section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section>
6 <view style="height:80rpx;"></view> 6 <view style="height:80rpx;"></view>
7 - <select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" usecondition="seller" bindchangeroom="setroom"></select-room> 7 + <block wx:if="{{reserveSection}}">
  8 + <select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" usecondition="seller" bindchangeroom="setroom"></select-room>
  9 + </block>
8 </block> 10 </block>
@@ -286,7 +286,7 @@ Page({ @@ -286,7 +286,7 @@ Page({
286 console.log(e); 286 console.log(e);
287 setTimeout(()=>{ 287 setTimeout(()=>{
288 this.setData({ 288 this.setData({
289 - reserveSection:e.detail.section, 289 + reserveSection:e.detail.section!='' ? e.detail.section : null,
290 seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist, 290 seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist,
291 }) 291 })
292 },0) 292 },0)
@@ -214,7 +214,9 @@ @@ -214,7 +214,9 @@
214 <calendar seller="{{seller}}" bindselectdate="selectdate"></calendar> 214 <calendar seller="{{seller}}" bindselectdate="selectdate"></calendar>
215 <view class="reserve-time Semibold">预订时段</view> 215 <view class="reserve-time Semibold">预订时段</view>
216 <section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section> 216 <section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section>
217 - <select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" seletroomlist="{{seletroomlist}}" bindchangeroom="selectroom"></select-room> 217 + <block wx:if="{{reserveSection}}">
  218 + <select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" seletroomlist="{{seletroomlist}}" bindchangeroom="selectroom"></select-room>
  219 + </block>
218 </view> 220 </view>
219 <view class="reserve-button-cover flex-cc"> 221 <view class="reserve-button-cover flex-cc">
220 <view class="white-font font32r reserve-button flex-cc" catchtap="complete">选好了</view> 222 <view class="white-font font32r reserve-button flex-cc" catchtap="complete">选好了</view>