Commit 8c96661c6211fb6cddfb11232270b2f9d212bd3c

Authored by liuxuqinfhp1220
1 parent dc49086e

no message

... ... @@ -83,7 +83,8 @@ Component({
})
let obj={
id:_target.id,
name:this.data.roomlist[_target.index].name
name:this.data.roomlist[_target.index].name,
action:'confirm'
}
this.triggerEvent('selectroom',obj)
}else{
... ... @@ -129,7 +130,17 @@ Component({
seletroomlist.forEach((v,i)=>{
roomlist.forEach((r,n)=>{
if(v.id==r.id){
r.selectnum+=1;
if(r.isFull || r.isorderFull){
this.cancelroom(r.id);
let obj={
id:r.id,
name:r.name,
action:'cancel'
}
this.triggerEvent('selectroom',obj)
}else{
r.selectnum+=1;
}
}
})
})
... ...
... ... @@ -24,7 +24,15 @@ Component({
console.log(e)
let _target=e.detail;
let seletroomlist=this.data.seletroomlist;
seletroomlist.push(_target);
if(e.detail.action=='cancel'){
seletroomlist.forEach((v,i)=>{
if(v.id==_target.id){
seletroomlist.splice(i,1)
}
})
}else{
seletroomlist.push(_target);
}
this.setData({
seletroomlist:this.data.seletroomlist
})
... ... @@ -38,6 +46,7 @@ Component({
})
this.room.cancelroom(_target.id);
this.triggerEvent('changeroom',{selectroom:this.data.seletroomlist});
}
},
}
})
\ No newline at end of file
... ...