|
|
|
// components/book/board/board.js
|
|
|
|
import util from '../../../utils/util';
|
|
|
|
import App from '../../../utils/api';
|
|
|
|
const {regeneratorRuntime} = global
|
|
|
|
Component({
|
|
|
|
/**
|
|
|
|
* 组件的属性列表
|
|
...
|
...
|
@@ -28,7 +31,47 @@ Component({ |
|
|
|
/**
|
|
|
|
* 组件的方法列表
|
|
|
|
*/
|
|
|
|
itemList:[],
|
|
|
|
methods: {
|
|
|
|
boardClick(){
|
|
|
|
this.boardOpt()
|
|
|
|
},
|
|
|
|
//桌位操作
|
|
|
|
boardOpt(){
|
|
|
|
let itemList=[]
|
|
|
|
if(this.data.board.reserve_id>0){
|
|
|
|
itemList.push('查看详情')
|
|
|
|
}
|
|
|
|
itemList.push(this.data.board.enable==1?'停用桌位':'启用桌位')
|
|
|
|
this.itemList=itemList;
|
|
|
|
wx.showActionSheet({
|
|
|
|
itemList:this.itemList,
|
|
|
|
success:(res)=>{
|
|
|
|
console.log(res.tapIndex,this.itemList[res.tapIndex]);
|
|
|
|
if('启用桌位'==this.itemList[res.tapIndex]){
|
|
|
|
this.boardEnable(1)
|
|
|
|
}
|
|
|
|
if('停用桌位'==this.itemList[res.tapIndex]){
|
|
|
|
this.boardEnable(0)
|
|
|
|
}
|
|
|
|
if('查看详情'==this.itemList[res.tapIndex]){
|
|
|
|
wx.navigateTo({
|
|
|
|
url:'b_detail?id='+this.data.board.reserve_id,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
//启停座位
|
|
|
|
boardEnable(status){
|
|
|
|
App.Reserve.SetSwitchStatus({
|
|
|
|
id:this.data.board.id,
|
|
|
|
status:status
|
|
|
|
}).then(()=>{
|
|
|
|
this.triggerEvent('boardEvent',{type:'boardEnable'})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}) |
...
|
...
|
|