Commit 1dff556bfb2d3e656e971a908c91bd8d6acf4b51

Authored by wangfan
1 parent e78c06e0

快速预定

... ... @@ -33,7 +33,7 @@ Component({
* 组件的初始数据
*/
data: {
itemList:[],
},
/**
... ... @@ -45,9 +45,36 @@ Component({
if(!this.data.event) return;
this[this.data.event]()
},
boardClickCallback(e){
let board=this.data.board;
switch (e.detail.value){
case '查看详情':
wx.navigateTo({
url:'b_detail?id='+board.reserve_id,
});
break;
case '启用桌位':
this.boardEnable(1)
break;
case '停用桌位':
this.boardEnable(0)
break;
case '订座':
wx.navigateTo({
url:'b_addnew?hasQuick=1&tid='+board.id
+'&tnum='+(board.most_pnum>board.table_pnum?board.most_pnum:board.table_pnum)
+'&time='+1
+'&date=',
});
break;
}
},
//桌位操作
boardOpt(){
let itemList=[]
if(!this.data.board.reserve_id && this.data.board.enable==1){
itemList.push('订座')
}
if(this.data.board.reserve_id>0){
itemList.push('查看详情')
}
... ... @@ -57,23 +84,10 @@ Component({
itemList.push('取消')
}
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,
});
}
},
this.setData({
itemList:itemList,
})
this.selectComponent('#boardas').show();
},
//桌位选择
boardChoose(){
... ...
{
"component": true,
"usingComponents": {}
"usingComponents": {
"as":"../../actionSheet/index"
}
}
\ No newline at end of file
... ...
... ... @@ -12,3 +12,6 @@
<view class="status" wx:if="{{board.status_str}}" style="width: {{width}}rpx;">{{board.status_str}}</view>
<icon type="success" size="20" color="#199095" class="desk-active" wx:if="{{board.isselect==true}}"/>
</view>
<as items="{{itemList}}"
id="boardas"
bindclick="boardClickCallback"><view style="font-size: 30rpx;">{{board.name}}</view></as>
... ...
<view class="notice-mask" hidden="{{noticeHidden}}" bindtap="close"></view>
<view class="notice-fixed flex-lr {{noticeHidden==false ? 'notice-fixed-active' : ''}}">
<block wx:for="{{list}}">
<block wx:for="{{list}}" wx:key="list.key">
<block wx:if="{{index!=0}}">
<view class="notice-single flex-vc" bindtap="callcustom" data-idx="{{index}}">
<view class="notice-image flex-vc">
... ...
... ... @@ -20,7 +20,7 @@ Page({
}
})
this.enter_params=util.cache('enter_params');
this.sc=(await App.Reserve.SellerInfo(enter_params)).data;
this.sc=(await App.Reserve.SellerInfo(this.enter_params)).data;
console.log('this.sc',this.sc);
this.chooseManagerInit();
},
... ...
... ... @@ -19,7 +19,7 @@
<view class="flex-lr order-desk">
<view class="gray-deep-font font30r"></view>
<view class="flex-re" style="width:100%;flex-wrap:wrap;">
<block wx:for="{{tables}}">
<block wx:for="{{tables}}" wx:key="tables.key">
<board width="160" height="180" board="{{item}}" className="noBottom"
style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board>
</block>
... ... @@ -89,7 +89,7 @@
</view>
<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">
<block wx:for-items="{{actionSheetItems}}">
<block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">
<action-sheet-item>{{item}}</action-sheet-item>
</block>
<action-sheet-item>
... ...