|
...
|
...
|
@@ -25,6 +25,16 @@ Component({ |
|
|
|
'date,section': function(newdate,newsection) {
|
|
|
|
console.log('room',newdate,newsection)
|
|
|
|
if(newdate && newsection){
|
|
|
|
if(this.data.roomlist.length>0){
|
|
|
|
this.data.roomlist.forEach((v,i)=>{
|
|
|
|
if(v.selectnum>0){
|
|
|
|
v.selectnum=0;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
roomlist:this.data.roomlist
|
|
|
|
})
|
|
|
|
this.getroomtype();
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -59,15 +69,20 @@ Component({ |
|
|
|
let _target=e.currentTarget.dataset;
|
|
|
|
console.log(typeof _target.selectnum,this.data.usecondition)
|
|
|
|
if(this.data.usecondition=='custom'){
|
|
|
|
let setkey='roomlist['+_target.index+'].selectnum';
|
|
|
|
this.setData({
|
|
|
|
[setkey]:_target.selectnum+1
|
|
|
|
})
|
|
|
|
let obj={
|
|
|
|
id:_target.id,
|
|
|
|
name:this.data.roomlist[_target.index].name
|
|
|
|
if((this.data.seletroomlist && this.data.seletroomlist.length<3) || !this.data.seletroomlist){
|
|
|
|
let setkey='roomlist['+_target.index+'].selectnum';
|
|
|
|
this.setData({
|
|
|
|
[setkey]:_target.selectnum+1
|
|
|
|
})
|
|
|
|
let obj={
|
|
|
|
id:_target.id,
|
|
|
|
name:this.data.roomlist[_target.index].name
|
|
|
|
}
|
|
|
|
this.triggerEvent('selectroom',obj)
|
|
|
|
}else{
|
|
|
|
util.toast('最多可选3个包间','none');
|
|
|
|
}
|
|
|
|
this.triggerEvent('selectroom',obj)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
//////
|
|
|
|
console.log('置满')
|
...
|
...
|
|