Commit 1dff556bfb2d3e656e971a908c91bd8d6acf4b51

Authored by wangfan
1 parent e78c06e0

快速预定

@@ -33,7 +33,7 @@ Component({ @@ -33,7 +33,7 @@ Component({
33 * 组件的初始数据 33 * 组件的初始数据
34 */ 34 */
35 data: { 35 data: {
36 - 36 + itemList:[],
37 }, 37 },
38 38
39 /** 39 /**
@@ -45,9 +45,36 @@ Component({ @@ -45,9 +45,36 @@ Component({
45 if(!this.data.event) return; 45 if(!this.data.event) return;
46 this[this.data.event]() 46 this[this.data.event]()
47 }, 47 },
  48 + boardClickCallback(e){
  49 + let board=this.data.board;
  50 + switch (e.detail.value){
  51 + case '查看详情':
  52 + wx.navigateTo({
  53 + url:'b_detail?id='+board.reserve_id,
  54 + });
  55 + break;
  56 + case '启用桌位':
  57 + this.boardEnable(1)
  58 + break;
  59 + case '停用桌位':
  60 + this.boardEnable(0)
  61 + break;
  62 + case '订座':
  63 + wx.navigateTo({
  64 + url:'b_addnew?hasQuick=1&tid='+board.id
  65 + +'&tnum='+(board.most_pnum>board.table_pnum?board.most_pnum:board.table_pnum)
  66 + +'&time='+1
  67 + +'&date=',
  68 + });
  69 + break;
  70 + }
  71 + },
48 //桌位操作 72 //桌位操作
49 boardOpt(){ 73 boardOpt(){
50 let itemList=[] 74 let itemList=[]
  75 + if(!this.data.board.reserve_id && this.data.board.enable==1){
  76 + itemList.push('订座')
  77 + }
51 if(this.data.board.reserve_id>0){ 78 if(this.data.board.reserve_id>0){
52 itemList.push('查看详情') 79 itemList.push('查看详情')
53 } 80 }
@@ -57,23 +84,10 @@ Component({ @@ -57,23 +84,10 @@ Component({
57 itemList.push('取消') 84 itemList.push('取消')
58 } 85 }
59 this.itemList=itemList; 86 this.itemList=itemList;
60 - wx.showActionSheet({  
61 - itemList:this.itemList,  
62 - success:(res)=>{  
63 - console.log(res.tapIndex,this.itemList[res.tapIndex]);  
64 - if('启用桌位'==this.itemList[res.tapIndex]){  
65 - this.boardEnable(1)  
66 - }  
67 - if('停用桌位'==this.itemList[res.tapIndex]){  
68 - this.boardEnable(0)  
69 - }  
70 - if('查看详情'==this.itemList[res.tapIndex]){  
71 - wx.navigateTo({  
72 - url:'b_detail?id='+this.data.board.reserve_id,  
73 - });  
74 - }  
75 - }, 87 + this.setData({
  88 + itemList:itemList,
76 }) 89 })
  90 + this.selectComponent('#boardas').show();
77 }, 91 },
78 //桌位选择 92 //桌位选择
79 boardChoose(){ 93 boardChoose(){
1 { 1 {
2 "component": true, 2 "component": true,
3 - "usingComponents": {} 3 + "usingComponents": {
  4 + "as":"../../actionSheet/index"
  5 + }
4 } 6 }
@@ -12,3 +12,6 @@ @@ -12,3 +12,6 @@
12 <view class="status" wx:if="{{board.status_str}}" style="width: {{width}}rpx;">{{board.status_str}}</view> 12 <view class="status" wx:if="{{board.status_str}}" style="width: {{width}}rpx;">{{board.status_str}}</view>
13 <icon type="success" size="20" color="#199095" class="desk-active" wx:if="{{board.isselect==true}}"/> 13 <icon type="success" size="20" color="#199095" class="desk-active" wx:if="{{board.isselect==true}}"/>
14 </view> 14 </view>
  15 +<as items="{{itemList}}"
  16 + id="boardas"
  17 + bindclick="boardClickCallback"><view style="font-size: 30rpx;">{{board.name}}</view></as>
1 <view class="notice-mask" hidden="{{noticeHidden}}" bindtap="close"></view> 1 <view class="notice-mask" hidden="{{noticeHidden}}" bindtap="close"></view>
2 <view class="notice-fixed flex-lr {{noticeHidden==false ? 'notice-fixed-active' : ''}}"> 2 <view class="notice-fixed flex-lr {{noticeHidden==false ? 'notice-fixed-active' : ''}}">
3 - <block wx:for="{{list}}"> 3 + <block wx:for="{{list}}" wx:key="list.key">
4 <block wx:if="{{index!=0}}"> 4 <block wx:if="{{index!=0}}">
5 <view class="notice-single flex-vc" bindtap="callcustom" data-idx="{{index}}"> 5 <view class="notice-single flex-vc" bindtap="callcustom" data-idx="{{index}}">
6 <view class="notice-image flex-vc"> 6 <view class="notice-image flex-vc">
@@ -20,7 +20,7 @@ Page({ @@ -20,7 +20,7 @@ Page({
20 } 20 }
21 }) 21 })
22 this.enter_params=util.cache('enter_params'); 22 this.enter_params=util.cache('enter_params');
23 - this.sc=(await App.Reserve.SellerInfo(enter_params)).data; 23 + this.sc=(await App.Reserve.SellerInfo(this.enter_params)).data;
24 console.log('this.sc',this.sc); 24 console.log('this.sc',this.sc);
25 this.chooseManagerInit(); 25 this.chooseManagerInit();
26 }, 26 },
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 <view class="flex-lr order-desk"> 19 <view class="flex-lr order-desk">
20 <view class="gray-deep-font font30r"></view> 20 <view class="gray-deep-font font30r"></view>
21 <view class="flex-re" style="width:100%;flex-wrap:wrap;"> 21 <view class="flex-re" style="width:100%;flex-wrap:wrap;">
22 - <block wx:for="{{tables}}"> 22 + <block wx:for="{{tables}}" wx:key="tables.key">
23 <board width="160" height="180" board="{{item}}" className="noBottom" 23 <board width="160" height="180" board="{{item}}" className="noBottom"
24 style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board> 24 style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board>
25 </block> 25 </block>
@@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
89 </view> 89 </view>
90 <noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall> 90 <noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>
91 <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll"> 91 <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">
92 - <block wx:for-items="{{actionSheetItems}}"> 92 + <block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">
93 <action-sheet-item>{{item}}</action-sheet-item> 93 <action-sheet-item>{{item}}</action-sheet-item>
94 </block> 94 </block>
95 <action-sheet-item> 95 <action-sheet-item>