Showing
4 changed files
with
65 additions
and
5 deletions
| @@ -26,7 +26,11 @@ Component({ | @@ -26,7 +26,11 @@ Component({ | ||
| 26 | className:{ | 26 | className:{ |
| 27 | type:String, | 27 | type:String, |
| 28 | value:'', | 28 | value:'', |
| 29 | - } | 29 | + }, |
| 30 | + ddate:{ //带入预定时间 time1-time2 | ||
| 31 | + type:String, | ||
| 32 | + value:'', | ||
| 33 | + }, | ||
| 30 | }, | 34 | }, |
| 31 | 35 | ||
| 32 | /** | 36 | /** |
| @@ -62,9 +66,8 @@ Component({ | @@ -62,9 +66,8 @@ Component({ | ||
| 62 | case '订座': | 66 | case '订座': |
| 63 | wx.navigateTo({ | 67 | wx.navigateTo({ |
| 64 | url:'b_addnew?hasQuick=1&tid='+board.id | 68 | 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=', | 69 | + +'&pnum='+(board.most_pnum>board.table_pnum?board.most_pnum:board.table_pnum) |
| 70 | + +'&ddate='+this.data.ddate, | ||
| 68 | }); | 71 | }); |
| 69 | break; | 72 | break; |
| 70 | } | 73 | } |
| @@ -73,7 +76,13 @@ Component({ | @@ -73,7 +76,13 @@ Component({ | ||
| 73 | boardOpt(){ | 76 | boardOpt(){ |
| 74 | let itemList=[] | 77 | let itemList=[] |
| 75 | if(!this.data.board.reserve_id && this.data.board.enable==1){ | 78 | if(!this.data.board.reserve_id && this.data.board.enable==1){ |
| 76 | - itemList.push('订座') | 79 | + if(this.data.ddate){ |
| 80 | + let t=new Date()/1000; | ||
| 81 | + if(parseInt(this.data.ddate.substr(0,10))>t){ | ||
| 82 | + itemList.push('订座') | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + | ||
| 77 | } | 86 | } |
| 78 | if(this.data.board.reserve_id>0){ | 87 | if(this.data.board.reserve_id>0){ |
| 79 | itemList.push('查看详情') | 88 | itemList.push('查看详情') |
| @@ -88,6 +97,7 @@ Component({ | @@ -88,6 +97,7 @@ Component({ | ||
| 88 | itemList:itemList, | 97 | itemList:itemList, |
| 89 | }) | 98 | }) |
| 90 | this.selectComponent('#boardas').show(); | 99 | this.selectComponent('#boardas').show(); |
| 100 | + console.log('this.data.board',this.data.board) | ||
| 91 | }, | 101 | }, |
| 92 | //桌位选择 | 102 | //桌位选择 |
| 93 | boardChoose(){ | 103 | boardChoose(){ |
| @@ -104,6 +104,8 @@ Page({ | @@ -104,6 +104,8 @@ Page({ | ||
| 104 | }) | 104 | }) |
| 105 | if (this.reserve_id > 0) { | 105 | if (this.reserve_id > 0) { |
| 106 | this.initModify(this.reserve_id); | 106 | this.initModify(this.reserve_id); |
| 107 | + } else if(options.hasQuick==1){ | ||
| 108 | + this.initQuick(options); | ||
| 107 | } else { | 109 | } else { |
| 108 | this.getTables(); | 110 | this.getTables(); |
| 109 | } | 111 | } |
| @@ -648,4 +650,49 @@ Page({ | @@ -648,4 +650,49 @@ Page({ | ||
| 648 | [`calendar.nextNum`]: this.data.calendar.nextNum - 1 | 650 | [`calendar.nextNum`]: this.data.calendar.nextNum - 1 |
| 649 | }) | 651 | }) |
| 650 | }, | 652 | }, |
| 653 | + /** | ||
| 654 | + * 快速预定初始化 | ||
| 655 | + * tid | ||
| 656 | + * ddate | ||
| 657 | + * pnum | ||
| 658 | + */ | ||
| 659 | + async initQuick(options){ | ||
| 660 | + try { | ||
| 661 | + console.log('initQuick', options); | ||
| 662 | + options.ddate=options.ddate.substr(0,10); | ||
| 663 | + //设置日期 | ||
| 664 | + let obj = await this.setDateStr(options.ddate); | ||
| 665 | + //设置时间 | ||
| 666 | + let nd = util.unixtoTime(options.ddate, 'HH:II'); | ||
| 667 | + let timePickerIndex = this.data.timePickerIndex | ||
| 668 | + console.log('initQuick-', this.data.timePickerArray, obj.form.time, nd) | ||
| 669 | + this.data.timePickerArray[obj.form.time].forEach((dd, ii) => { | ||
| 670 | + console.log('initQuick-', nd, dd) | ||
| 671 | + if (nd == dd) { | ||
| 672 | + timePickerIndex[obj.form.time] = ii; | ||
| 673 | + return true; | ||
| 674 | + } | ||
| 675 | + }) | ||
| 676 | + | ||
| 677 | + console.log('initQuick-timePickerIndex', timePickerIndex); | ||
| 678 | + obj.form.pnum = options.pnum || 6; | ||
| 679 | + obj.form.rname = ""; | ||
| 680 | + obj.form.phone = ""; | ||
| 681 | + obj.form.sex = 1; | ||
| 682 | + obj.form.cusdem = ""; | ||
| 683 | + obj.form.rid = ""; | ||
| 684 | + obj.form.tid = [options.tid]; | ||
| 685 | + this.setData({ | ||
| 686 | + timePickerIndex: timePickerIndex, | ||
| 687 | + form: obj.form, | ||
| 688 | + hasUseDefDtime: false, | ||
| 689 | + }) | ||
| 690 | + setTimeout(() => { | ||
| 691 | + this.getTables(); | ||
| 692 | + }, 300) | ||
| 693 | + | ||
| 694 | + } catch (e) { | ||
| 695 | + console.log('initQuick', e) | ||
| 696 | + } | ||
| 697 | + }, | ||
| 651 | }) | 698 | }) |
| @@ -24,6 +24,7 @@ Page({ | @@ -24,6 +24,7 @@ Page({ | ||
| 24 | calendar:{ | 24 | calendar:{ |
| 25 | nextNum:0, | 25 | nextNum:0, |
| 26 | }, | 26 | }, |
| 27 | + rdate:'', | ||
| 27 | }, | 28 | }, |
| 28 | regions:[], | 29 | regions:[], |
| 29 | sellerid:0, | 30 | sellerid:0, |
| @@ -142,6 +143,7 @@ Page({ | @@ -142,6 +143,7 @@ Page({ | ||
| 142 | let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time); | 143 | let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time); |
| 143 | formdata.rdate=rdate; | 144 | formdata.rdate=rdate; |
| 144 | formdata.status='1,2'; | 145 | formdata.status='1,2'; |
| 146 | + obj.rdate=rdate; | ||
| 145 | let tids={}; | 147 | let tids={}; |
| 146 | let reserves=await App.Reserve.GetReserveList(formdata); | 148 | let reserves=await App.Reserve.GetReserveList(formdata); |
| 147 | if(reserves.data.length>0){ | 149 | if(reserves.data.length>0){ |
| @@ -35,6 +35,7 @@ | @@ -35,6 +35,7 @@ | ||
| 35 | <view class="items-disks flex-ll" style="flex-wrap: wrap" | 35 | <view class="items-disks flex-ll" style="flex-wrap: wrap" |
| 36 | wx:if="{{regions_active==item.name}}"> | 36 | wx:if="{{regions_active==item.name}}"> |
| 37 | <board width="160" height="180" board="{{item}}" | 37 | <board width="160" height="180" board="{{item}}" |
| 38 | + ddate="{{rdate}}" | ||
| 38 | style="margin: 20rpx 0 0 20rpx" | 39 | style="margin: 20rpx 0 0 20rpx" |
| 39 | bindboardEvent="boardEvent" | 40 | bindboardEvent="boardEvent" |
| 40 | event="boardOpt" | 41 | event="boardOpt" |
-
Please register or login to post a comment