Commit cc532f612e0512ba320a9098f2357817e421bb45

Authored by liuxuqinfhp1220
1 parent d0a1f3a3

no message

... ... @@ -36,6 +36,10 @@ Component({
roomlist:this.data.roomlist
})
this.getroomtype();
}else{
this.setData({
roomlist:[]
})
}
}
},
... ...
... ... @@ -66,7 +66,7 @@ Component({
//今天日期
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
let curtimestamp=Math.ceil(new Date()/1000);
let interval=[];
let interval=[],flag=false;
sectionlist.forEach((v,i)=>{
let sectionarr=v.sectiondur.split('-');
if(curtimestamp>Number(util.timetouUnix(today+' '+sectionarr[1]+':00'))){
... ... @@ -82,13 +82,25 @@ Component({
this.setData({
section:null
})
flag=true;
}
})
if(!this.data.section){
if(interval.length>0){
sectionlist[interval[0].index].isselected=true;
this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index);
if(flag){
this.tellsection(sectionlist[interval[0].index].section,'click',interval[0].index);
}else{
this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index);
}
this.changesectionstyle(sectionlist[interval[0].index].section)
}else{
let obj={
section:'',
action:'click',
time:''
}
this.triggerEvent('selectsection',obj)
}
}else{
this.changesectionstyle(this.data.section)
... ...
... ... @@ -23,7 +23,7 @@ Page({
console.log(e);
let t=setTimeout(()=>{
this.setData({
reserveSection:e.detail.section,
reserveSection:e.detail.section!='' ? e.detail.section : null,
})
clearTimeout(t);
},0)
... ...
... ... @@ -4,5 +4,7 @@
<view style="height:40rpx;"></view>
<section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section>
<view style="height:80rpx;"></view>
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" usecondition="seller" bindchangeroom="setroom"></select-room>
<block wx:if="{{reserveSection}}">
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" usecondition="seller" bindchangeroom="setroom"></select-room>
</block>
</block>
\ No newline at end of file
... ...
... ... @@ -286,7 +286,7 @@ Page({
console.log(e);
setTimeout(()=>{
this.setData({
reserveSection:e.detail.section,
reserveSection:e.detail.section!='' ? e.detail.section : null,
seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist,
})
},0)
... ...
... ... @@ -214,7 +214,9 @@
<calendar seller="{{seller}}" bindselectdate="selectdate"></calendar>
<view class="reserve-time Semibold">预订时段</view>
<section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection" section="{{reserveSection}}"></section>
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" seletroomlist="{{seletroomlist}}" bindchangeroom="selectroom"></select-room>
<block wx:if="{{reserveSection}}">
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" seletroomlist="{{seletroomlist}}" bindchangeroom="selectroom"></select-room>
</block>
</view>
<view class="reserve-button-cover flex-cc">
<view class="white-font font32r reserve-button flex-cc" catchtap="complete">选好了</view>
... ...