|
...
|
...
|
@@ -69,38 +69,43 @@ Component({ |
|
|
|
let _target=e.currentTarget.dataset;
|
|
|
|
console.log(typeof _target.selectnum,this.data.usecondition)
|
|
|
|
if(this.data.usecondition=='custom'){
|
|
|
|
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)
|
|
|
|
console.log(this.data.roomlist[_target.index].isorderFull,this.data.roomlist[_target.index].isFull)
|
|
|
|
if(this.data.roomlist[_target.index].isorderFull==1 || this.data.roomlist[_target.index].isFull==1){
|
|
|
|
}else{
|
|
|
|
util.toast('最多可选3个包间','none');
|
|
|
|
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');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
//////
|
|
|
|
console.log('置满')
|
|
|
|
let parmdata={
|
|
|
|
classid:_target.id,
|
|
|
|
day:util.timetouUnix(this.data.date+' 00:00:00'),
|
|
|
|
interval:dur.indexOf(this.data.section)+1
|
|
|
|
}
|
|
|
|
if(_target.fid){
|
|
|
|
parmdata.id=_target.fid;
|
|
|
|
}
|
|
|
|
App.Seller.SetTableClassFull(parmdata).then((json)=>{
|
|
|
|
console.log(json)
|
|
|
|
if(json.ret==200){
|
|
|
|
this.triggerEvent('changeroom',{id:_target.id,action:parmdata.id ? 'cancel' : 'confirm'})
|
|
|
|
this.getroomtype();
|
|
|
|
if(!this.data.roomlist[_target.index].isorderFull){
|
|
|
|
let parmdata={
|
|
|
|
classid:_target.id,
|
|
|
|
day:util.timetouUnix(this.data.date+' 00:00:00'),
|
|
|
|
interval:dur.indexOf(this.data.section)+1
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if(_target.fid){
|
|
|
|
parmdata.id=_target.fid;
|
|
|
|
}
|
|
|
|
App.Seller.SetTableClassFull(parmdata).then((json)=>{
|
|
|
|
console.log(json)
|
|
|
|
if(json.ret==200){
|
|
|
|
this.triggerEvent('changeroom',{id:_target.id,action:parmdata.id ? 'cancel' : 'confirm'})
|
|
|
|
this.getroomtype();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
cancelroom(id){
|
...
|
...
|
|