Showing
100 changed files
with
49 additions
and
3960 deletions
Too many changes to show.
To preserve performance only 100 of 100+ files are displayed.
| 1 | { | 1 | { |
| 2 | "component": true, | 2 | "component": true, |
| 3 | "usingComponents": { | 3 | "usingComponents": { |
| 4 | - "service":"/components/book/smsbatch/service", | 4 | + "service":"./service", |
| 5 | "formids":"/components/formids/formids", | 5 | "formids":"/components/formids/formids", |
| 6 | - "sendsms":"/components/book/smsbatch/sendsms" | 6 | + "sendsms":"./sendsms" |
| 7 | } | 7 | } |
| 8 | } | 8 | } |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | "navigationBarBackgroundColor": "#fff", | 3 | "navigationBarBackgroundColor": "#fff", |
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "timeDuration":"/components/book/time/time", | 6 | + "timeDuration":"../../components/book/time/time", |
| 7 | "nav":"/components/nav/nav" | 7 | "nav":"/components/nav/nav" |
| 8 | } | 8 | } |
| 9 | 9 |
| @@ -3,13 +3,13 @@ | @@ -3,13 +3,13 @@ | ||
| 3 | "navigationBarBackgroundColor": "#fff", | 3 | "navigationBarBackgroundColor": "#fff", |
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "nothingBook":"/components/book/nothing/nothing", | ||
| 7 | - "bookList":"/components/book/list/list", | 6 | + "nothingBook":"../../components/book/nothing/nothing", |
| 7 | + "bookList":"../components/book/list/list", | ||
| 8 | "nav":"/components/nav/nav", | 8 | "nav":"/components/nav/nav", |
| 9 | - "tabBar":"/components/book/tabBar/tabBar", | 9 | + "tabBar":"../../components/book/tabBar/tabBar", |
| 10 | "searchList":"/components/searchlist/searchlist", | 10 | "searchList":"/components/searchlist/searchlist", |
| 11 | "calendar": "plugin://bmCalendar/calendar", | 11 | "calendar": "plugin://bmCalendar/calendar", |
| 12 | - "board":"/components/book/board/board", | 12 | + "board":"../../components/book/board/board", |
| 13 | "formids":"/components/formids/formids", | 13 | "formids":"/components/formids/formids", |
| 14 | "a2l":"/components/tips/add-to-lite" | 14 | "a2l":"/components/tips/add-to-lite" |
| 15 | } | 15 | } |
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | "navigationBarBackgroundColor": "#fff", | 3 | "navigationBarBackgroundColor": "#fff", |
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "selectPeople":"/components/book/people/people", | ||
| 7 | - "orderDesk":"/components/book/desk/desk", | 6 | + "selectPeople":"../../components/book/people/people", |
| 7 | + "orderDesk":"../../components/book/desk/desk", | ||
| 8 | "nav":"/components/nav/nav" | 8 | "nav":"/components/nav/nav" |
| 9 | } | 9 | } |
| 10 | } | 10 | } |
| @@ -3,10 +3,10 @@ | @@ -3,10 +3,10 @@ | ||
| 3 | "navigationBarBackgroundColor": "#fff", | 3 | "navigationBarBackgroundColor": "#fff", |
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "noticeCall":"/components/book/notice/notice", | ||
| 7 | - "step":"/components/book/step/step", | ||
| 8 | - "board":"/components/book/board/board", | ||
| 9 | - "cancel":"/components/book/reserveCancel/cancel", | 6 | + "noticeCall":"../../components/book/notice/notice", |
| 7 | + "step":"../../components/book/step/step", | ||
| 8 | + "board":"../../components/book/board/board", | ||
| 9 | + "cancel":"../../components/book/reserveCancel/cancel", | ||
| 10 | "nav":"/components/nav/nav", | 10 | "nav":"/components/nav/nav", |
| 11 | "formids":"/components/formids/formids" | 11 | "formids":"/components/formids/formids" |
| 12 | } | 12 | } |
| @@ -3,10 +3,10 @@ | @@ -3,10 +3,10 @@ | ||
| 3 | "navigationBarBackgroundColor": "#fff", | 3 | "navigationBarBackgroundColor": "#fff", |
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "nothingBook":"/components/book/nothing/nothing", | ||
| 7 | - "bookList":"/components/book/list/list", | 6 | + "nothingBook":"../../components/book/nothing/nothing", |
| 7 | + "bookList":"../../components/book/list/list", | ||
| 8 | "nav":"/components/nav/nav", | 8 | "nav":"/components/nav/nav", |
| 9 | - "tabBar":"/components/book/tabBar/tabBar", | 9 | + "tabBar":"../../components/book/tabBar/tabBar", |
| 10 | "calendar": "plugin://bmCalendar/calendar", | 10 | "calendar": "plugin://bmCalendar/calendar", |
| 11 | "formids":"/components/formids/formids" | 11 | "formids":"/components/formids/formids" |
| 12 | } | 12 | } |
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | "navigationBarBackgroundColor": "#fff", | 3 | "navigationBarBackgroundColor": "#fff", |
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "selectPeople":"/components/book/people/people", | ||
| 7 | - "step":"/components/book/step/step", | 6 | + "selectPeople":"../../components/book/people/people", |
| 7 | + "step":"../../components/book/step/step", | ||
| 8 | "nav":"/components/nav/nav" | 8 | "nav":"/components/nav/nav" |
| 9 | } | 9 | } |
| 10 | } | 10 | } |
| @@ -4,9 +4,9 @@ | @@ -4,9 +4,9 @@ | ||
| 4 | "navigationBarTextStyle":"black", | 4 | "navigationBarTextStyle":"black", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | - "tabBar":"/components/book/tabBar/tabBar", | 7 | + "tabBar":"../../components/book/tabBar/tabBar", |
| 8 | "calendar": "plugin://bmCalendar/calendar", | 8 | "calendar": "plugin://bmCalendar/calendar", |
| 9 | - "board":"/components/book/board/board", | 9 | + "board":"../../components/book/board/board", |
| 10 | "formids":"/components/formids/formids" | 10 | "formids":"/components/formids/formids" |
| 11 | } | 11 | } |
| 12 | } | 12 | } |
| 1 | // pages/book/b_sms.js | 1 | // pages/book/b_sms.js |
| 2 | -var util = require('../../utils/util.js') | ||
| 3 | -import App from '../../utils/api'; | ||
| 4 | -import bcm from '../../utils/bookCommon'; | 2 | +var util = require('/utils/util.js') |
| 3 | +import App from '/utils/api'; | ||
| 4 | +import bcm from '/utils/bookCommon'; | ||
| 5 | const {regeneratorRuntime} = global | 5 | const {regeneratorRuntime} = global |
| 6 | -import ST from './b_sms_tpls'; | 6 | +import ST from '/utils/sms_tpls'; |
| 7 | const tpls = { | 7 | const tpls = { |
| 8 | SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!', | 8 | SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!', |
| 9 | SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!', | 9 | SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!', |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | "navigationBarTextStyle":"white", | 4 | "navigationBarTextStyle":"white", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | - "tabBar":"/components/book/tabBar/tabBar", | 7 | + "tabBar":"../../../components/book/tabBar/tabBar", |
| 8 | "formids":"/components/formids/formids" | 8 | "formids":"/components/formids/formids" |
| 9 | } | 9 | } |
| 10 | } | 10 | } |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | "navigationBarTextStyle":"white", | 4 | "navigationBarTextStyle":"white", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | - "tabBar":"/components/book/tabBar/tabBar", | 7 | + "tabBar":"../../../components/book/tabBar/tabBar", |
| 8 | "formids":"/components/formids/formids" | 8 | "formids":"/components/formids/formids" |
| 9 | } | 9 | } |
| 10 | } | 10 | } |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | "navigationBarTextStyle":"white", | 4 | "navigationBarTextStyle":"white", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | - "tabBar":"/components/book/tabBar/tabBar", | 7 | + "tabBar":"../../../components/book/tabBar/tabBar", |
| 8 | "formids":"/components/formids/formids" | 8 | "formids":"/components/formids/formids" |
| 9 | } | 9 | } |
| 10 | } | 10 | } |
| @@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
| 6 | "userinfo":"/components/userinfo/userinfo", | 6 | "userinfo":"/components/userinfo/userinfo", |
| 7 | "nav":"/components/nav/nav", | 7 | "nav":"/components/nav/nav", |
| 8 | "formids":"/components/formids/formids", | 8 | "formids":"/components/formids/formids", |
| 9 | - "service":"/components/book/smsbatch/service", | ||
| 10 | - "sendsms":"/components/book/smsbatch/sendsms" | 9 | + "service":"../../../components/book/smsbatch/service", |
| 10 | + "sendsms":"../../../components/book/smsbatch/sendsms" | ||
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | } | 13 | } |
| @@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
| 6 | "userinfo":"/components/userinfo/userinfo", | 6 | "userinfo":"/components/userinfo/userinfo", |
| 7 | "nav":"/components/nav/nav", | 7 | "nav":"/components/nav/nav", |
| 8 | "formids":"/components/formids/formids", | 8 | "formids":"/components/formids/formids", |
| 9 | - "rows":"/components/book/smsbatch/rows", | ||
| 10 | - "service":"/components/book/smsbatch/service" | 9 | + "rows":"../../../components/book/smsbatch/rows", |
| 10 | + "service":"../../../components/book/smsbatch/service" | ||
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | } | 13 | } |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | "userinfo":"/components/userinfo/userinfo", | 6 | "userinfo":"/components/userinfo/userinfo", |
| 7 | "nav":"/components/nav/nav", | 7 | "nav":"/components/nav/nav", |
| 8 | "formids":"/components/formids/formids", | 8 | "formids":"/components/formids/formids", |
| 9 | - "rows":"/components/book/smsbatch/rows" | 9 | + "rows":"../../../components/book/smsbatch/rows" |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | } | 12 | } |
pages/book/b_add.js
deleted
100644 → 0
| 1 | -var util = require('../../utils/util.js') | ||
| 2 | -var uri=require('../../utils/uri.js') | ||
| 3 | -var bookOrder=require('../../utils/bookCommon.js') | ||
| 4 | -Page({ | ||
| 5 | - data:{ | ||
| 6 | - }, | ||
| 7 | - onLoad:function(){ | ||
| 8 | - util.setBarTitle('选择用餐时间'); | ||
| 9 | - this.getdatelist() | ||
| 10 | - this.getimelist(); | ||
| 11 | - wx.removeStorage({ | ||
| 12 | - key:'order_pnum', | ||
| 13 | - }) | ||
| 14 | - wx.removeStorage({ | ||
| 15 | - key:'tabletype', | ||
| 16 | - }) | ||
| 17 | - }, | ||
| 18 | - onShow:function(){ | ||
| 19 | - | ||
| 20 | - }, | ||
| 21 | - changelist:function(e){ | ||
| 22 | - console.log('xxxx',e) | ||
| 23 | - var timelist=this.data.timeList; | ||
| 24 | - timelist.forEach(function(v,i){ | ||
| 25 | - v.list.forEach(function(r,n){ | ||
| 26 | - r.isselect=false | ||
| 27 | - }) | ||
| 28 | - }) | ||
| 29 | - this.setData({ | ||
| 30 | - timeList:timelist, | ||
| 31 | - time_dur:e.detail | ||
| 32 | - }) | ||
| 33 | - }, | ||
| 34 | - //日期选择 | ||
| 35 | - selectdate:function(e){ | ||
| 36 | - var title=e.currentTarget.dataset.title; | ||
| 37 | - var datelist=this.data.dateList; | ||
| 38 | - var selectdate='' | ||
| 39 | - datelist.forEach(function(v,i){ | ||
| 40 | - v.isActive=false | ||
| 41 | - if(v.title==title){ | ||
| 42 | - v.isActive=true; | ||
| 43 | - selectdate=v.date | ||
| 44 | - } | ||
| 45 | - }) | ||
| 46 | - this.setData({ | ||
| 47 | - dateList:datelist, | ||
| 48 | - selectdate:selectdate, | ||
| 49 | - time_dur:null | ||
| 50 | - }) | ||
| 51 | - this.getimelist(); | ||
| 52 | - }, | ||
| 53 | - selectOther:function(){ | ||
| 54 | - var currentTime=Date.parse(new Date()); | ||
| 55 | - var timeobj=bookOrder.changedate(currentTime) | ||
| 56 | - console.log(this.data.selectdate,this.data.time_dur) | ||
| 57 | - wx.navigateTo({ | ||
| 58 | - url:'b_info?year='+timeobj.year+'&date='+this.data.selectdate+'&time='+this.data.time_dur | ||
| 59 | - }) | ||
| 60 | - }, | ||
| 61 | - //获取日期列表 | ||
| 62 | - getdatelist:function(){ | ||
| 63 | - var currentTime=Date.parse(new Date()); | ||
| 64 | - var dur=24*60*60*1000; | ||
| 65 | - var list=[currentTime,currentTime+dur,currentTime+2*dur]; | ||
| 66 | - var desklist=[]; | ||
| 67 | - for(var i=0;i<list.length;i++){ | ||
| 68 | - var dd=bookOrder.changedate(list[i]); | ||
| 69 | - if(i==0){ | ||
| 70 | - var title='今天'; | ||
| 71 | - var isselect=true | ||
| 72 | - } | ||
| 73 | - if(i==1){ | ||
| 74 | - var title='明天'; | ||
| 75 | - var isselect=false | ||
| 76 | - } | ||
| 77 | - if(i==2){ | ||
| 78 | - var myDate = new Date(list[2]); | ||
| 79 | - var title=bookOrder.getweek(myDate.getDay()); | ||
| 80 | - var isselect=false | ||
| 81 | - } | ||
| 82 | - desklist.push({ | ||
| 83 | - title:title, | ||
| 84 | - date:'0'+dd.month+(dd.day<10 ? '-0'+dd.day : '-'+dd.day), | ||
| 85 | - isActive:isselect, | ||
| 86 | - year:dd.year | ||
| 87 | - }) | ||
| 88 | - } | ||
| 89 | - this.setData({ | ||
| 90 | - dateList:desklist, | ||
| 91 | - selectdate:desklist[0].date | ||
| 92 | - }) | ||
| 93 | - console.log(this.data.selectdate) | ||
| 94 | - }, | ||
| 95 | - //获取时间列表 | ||
| 96 | - getimelist:function(){ | ||
| 97 | - var currentTime=Date.parse(new Date()); | ||
| 98 | - var timeobj=bookOrder.changedate(currentTime) | ||
| 99 | - var timelist=[ | ||
| 100 | - { | ||
| 101 | - title:'早市', | ||
| 102 | - time_dur:'6:00-10:00', | ||
| 103 | - list:[ | ||
| 104 | - { | ||
| 105 | - time_dur:'6:00', | ||
| 106 | - isselect:false, | ||
| 107 | - time_mask:6 | ||
| 108 | - } | ||
| 109 | - ], | ||
| 110 | - starttime:6, | ||
| 111 | - endtime:10 | ||
| 112 | - }, | ||
| 113 | - { | ||
| 114 | - title:'午市', | ||
| 115 | - time_dur:'11:00-15:00', | ||
| 116 | - list:[ | ||
| 117 | - { | ||
| 118 | - time_dur:'11:00', | ||
| 119 | - isselect:false, | ||
| 120 | - time_mask:11 | ||
| 121 | - } | ||
| 122 | - ], | ||
| 123 | - starttime:11, | ||
| 124 | - endtime:15 | ||
| 125 | - }, | ||
| 126 | - { | ||
| 127 | - title:'晚市', | ||
| 128 | - time_dur:'17:00-22:00', | ||
| 129 | - list:[ | ||
| 130 | - { | ||
| 131 | - time_dur:'17:00', | ||
| 132 | - isselect:false, | ||
| 133 | - time_mask:17 | ||
| 134 | - } | ||
| 135 | - ], | ||
| 136 | - starttime:17, | ||
| 137 | - endtime:22 | ||
| 138 | - }, | ||
| 139 | - ]; | ||
| 140 | - var that=this; | ||
| 141 | - timelist.forEach(function(v,i){ | ||
| 142 | - var len=(v.endtime-v.starttime)/0.5; | ||
| 143 | - var time=v.starttime; | ||
| 144 | - console.log(len) | ||
| 145 | - for(var j=0;j<len;j++){ | ||
| 146 | - time+=0.5; | ||
| 147 | - if(bookOrder.isInteger(time)==true){ | ||
| 148 | - v.list.push( | ||
| 149 | - { | ||
| 150 | - time_dur:time+':00', | ||
| 151 | - isselect:false, | ||
| 152 | - time_mask:time | ||
| 153 | - } | ||
| 154 | - ) | ||
| 155 | - }else{ | ||
| 156 | - v.list.push( | ||
| 157 | - { | ||
| 158 | - time_dur:Math.floor(time)+':30', | ||
| 159 | - isselect:false, | ||
| 160 | - time_mask:time | ||
| 161 | - } | ||
| 162 | - ) | ||
| 163 | - } | ||
| 164 | - } | ||
| 165 | - }) | ||
| 166 | - var thisdate=0; | ||
| 167 | - if(that.data.selectdate.split('-')[1].length>1){ | ||
| 168 | - thisdate=parseInt(that.data.selectdate.split('-')[1][0]=='0' ? that.data.selectdate.split('-')[1].slice(1,2) : that.data.selectdate.split('-')[1]) | ||
| 169 | - }else{ | ||
| 170 | - thisdate=parseInt(that.data.selectdate.split('-')[1]) | ||
| 171 | - } | ||
| 172 | - if(thisdate==timeobj.day){ | ||
| 173 | - var thistime=timeobj.hour+timeobj.minute/60; | ||
| 174 | - var dd=[] | ||
| 175 | - timelist.forEach(function(v,i){ | ||
| 176 | - if(thistime<v.endtime){ | ||
| 177 | - dd.push(v) | ||
| 178 | - } | ||
| 179 | - }) | ||
| 180 | - timelist=dd; | ||
| 181 | - timelist.forEach(function(v,i){ | ||
| 182 | - if(thistime>=v.starttime && thistime<=v.endtime){ | ||
| 183 | - var list=[] | ||
| 184 | - v.list.forEach(function(r,n){ | ||
| 185 | - if(thistime<r.time_mask){ | ||
| 186 | - list.push(r) | ||
| 187 | - } | ||
| 188 | - }) | ||
| 189 | - v.list=list | ||
| 190 | - } | ||
| 191 | - }) | ||
| 192 | - | ||
| 193 | - } | ||
| 194 | - | ||
| 195 | - this.setData({ | ||
| 196 | - timeList:timelist | ||
| 197 | - }) | ||
| 198 | - | ||
| 199 | - }, | ||
| 200 | -}) |
pages/book/b_add.json
deleted
100644 → 0
pages/book/b_add.wxml
deleted
100644 → 0
| 1 | -<nav>点餐商户端</nav> | ||
| 2 | -<!--日期--> | ||
| 3 | -<view style="padding-bottom:160rpx;"> | ||
| 4 | - <view class="select-date flex-lr smooth"> | ||
| 5 | - <block wx:for="{{dateList}}"> | ||
| 6 | - <view class="single-date gray-deep-font flex-vc" bindtap="selectdate" data-title="{{item.title}}"> | ||
| 7 | - <view class="font30r {{item.isActive==true ? 'black-font' : ''}}">{{item.title}}</view> | ||
| 8 | - <view class="font34r date-num flex-cc {{item.isActive==true ? 'select-date-active black-font' : ''}}">{{item.date}}</view> | ||
| 9 | - </view> | ||
| 10 | - </block> | ||
| 11 | - <view class="single-date gray-deep-font flex-vc"> | ||
| 12 | - <view class="font30r">更多</view> | ||
| 13 | - <view class="date-num flex-vc"> | ||
| 14 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/more-dot.png" class="more-dot"></image> | ||
| 15 | - </view> | ||
| 16 | - </view> | ||
| 17 | - </view> | ||
| 18 | - <block wx:for="{{timeList}}"> | ||
| 19 | - <timeDuration item="{{item}}" bind:changelist="changelist"></timeDuration> | ||
| 20 | - </block> | ||
| 21 | -</view> | ||
| 22 | -<view class="confirm-button white-font flex-vc font34r {{time_dur ? 'confirm-button-active' : ''}}" bindtap="{{time_dur ? 'selectOther' : ''}}">确定</view> | ||
| 23 | - | ||
| 24 | - | ||
| 25 | -<date-picker | ||
| 26 | - startTime="{{startTime}}" | ||
| 27 | - endTime="{{endTime}}" | ||
| 28 | - unit="{{unit}}" | ||
| 29 | - reserveUnit="{{reserveUnit}}" | ||
| 30 | - unreserveTime="{{unreserveTime}}" | ||
| 31 | - activedConst="{{activedConst}}" | ||
| 32 | - disabledConst="{{disabledConst}}" | ||
| 33 | - themeColor="#1f78d1" | ||
| 34 | - bind:selectTime="onSelectTime" | ||
| 35 | -/> |
pages/book/b_add.wxss
deleted
100644 → 0
| 1 | -.select-date{ | ||
| 2 | - width:680rpx; | ||
| 3 | - height:180rpx; | ||
| 4 | - margin:0 auto; | ||
| 5 | -} | ||
| 6 | -.more-dot{ | ||
| 7 | - width:50rpx; | ||
| 8 | - height:10rpx; | ||
| 9 | -} | ||
| 10 | -.date-num{ | ||
| 11 | - padding:0 10rpx; | ||
| 12 | - height:70rpx; | ||
| 13 | -} | ||
| 14 | -.select-date-active{ | ||
| 15 | - border-bottom:2px solid #199095; | ||
| 16 | - box-sizing:border-box; | ||
| 17 | -} | ||
| 18 | -.confirm-button{ | ||
| 19 | - width:680rpx; | ||
| 20 | - height:85rpx; | ||
| 21 | - background:#74BBBE; | ||
| 22 | - position:fixed; | ||
| 23 | - left:0; | ||
| 24 | - right:0; | ||
| 25 | - bottom:60rpx; | ||
| 26 | - margin:0 auto; | ||
| 27 | - border-radius:10rpx; | ||
| 28 | -} | ||
| 29 | -.confirm-button-active{ | ||
| 30 | - background:#199095; | ||
| 31 | -} |
pages/book/b_addnew.js
deleted
100644 → 0
| 1 | -// pages/book/b_addnew.js | ||
| 2 | -import util from '../../utils/util'; | ||
| 3 | -import comm from '../../utils/bookCommon'; | ||
| 4 | -import App from '../../utils/api'; | ||
| 5 | -const {regeneratorRuntime} = global | ||
| 6 | -const formTpl = { | ||
| 7 | - rid: '', | ||
| 8 | - date: 0, | ||
| 9 | - time: 0, | ||
| 10 | - //pnum_str:'1-4', | ||
| 11 | - pnum: 6, | ||
| 12 | - tabid: 0, | ||
| 13 | - | ||
| 14 | - rname: '', | ||
| 15 | - phone: '', | ||
| 16 | - sex: 1, | ||
| 17 | - cusdem: '', | ||
| 18 | - | ||
| 19 | - tid: [], | ||
| 20 | - | ||
| 21 | -} | ||
| 22 | -Page({ | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 页面的初始数据 | ||
| 26 | - */ | ||
| 27 | - data: { | ||
| 28 | - dateStr: [], | ||
| 29 | - form: JSON.parse(JSON.stringify(formTpl)), | ||
| 30 | - tables: [], | ||
| 31 | - grand: [ | ||
| 32 | - { | ||
| 33 | - sex: 1, | ||
| 34 | - grand_title: '先生', | ||
| 35 | - isselect: true | ||
| 36 | - }, | ||
| 37 | - { | ||
| 38 | - sex: 2, | ||
| 39 | - grand_title: '女士', | ||
| 40 | - isselect: false | ||
| 41 | - }, | ||
| 42 | - { | ||
| 43 | - sex: 3, | ||
| 44 | - grand_title: '公司', | ||
| 45 | - isselect: false | ||
| 46 | - } | ||
| 47 | - ], | ||
| 48 | - buttonhide: true, | ||
| 49 | - | ||
| 50 | - calendarMaskLoad: false, | ||
| 51 | - calendarMask: false, | ||
| 52 | - dayStyle: [ | ||
| 53 | - {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'}, | ||
| 54 | - {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'} | ||
| 55 | - ], | ||
| 56 | - timePickerArray: [ | ||
| 57 | - [], | ||
| 58 | - [], | ||
| 59 | - [], | ||
| 60 | - ], | ||
| 61 | - timePickerIndex: [0, 0, 0], | ||
| 62 | - tablesLength: 0, | ||
| 63 | - | ||
| 64 | - timePickerMask: false, | ||
| 65 | - pnumInputFocus: false, | ||
| 66 | - pageMarginBottom: 0, | ||
| 67 | - speciallist: [], | ||
| 68 | - calendar: { | ||
| 69 | - nextNum: 0, | ||
| 70 | - }, | ||
| 71 | - defDtime: ['', '12:00', '18:30'], | ||
| 72 | - hasUseDefDtime: true, | ||
| 73 | - CustomRemark:[], | ||
| 74 | - CustomRemarkMoreMask:false, | ||
| 75 | - }, | ||
| 76 | - /** | ||
| 77 | - * 生命周期函数--监听页面加载 | ||
| 78 | - */ | ||
| 79 | - reserve_id: '', | ||
| 80 | - checkedTables:{},//已选中的桌子集合 | ||
| 81 | - onLoad: async function (options) { | ||
| 82 | - this.initLoad(options) | ||
| 83 | - this.getCustomRemark(); | ||
| 84 | - }, | ||
| 85 | - async initLoad(options = {}){ | ||
| 86 | - let nt = new Date() / 1000; | ||
| 87 | - let speciallist = [ | ||
| 88 | - {date: util.unixtoTime(nt, 'YYYY-MM-DD'), background: '', text: '今 天'}, | ||
| 89 | - {date: util.unixtoTime(nt + 86400, 'YYYY-MM-DD'), background: '', text: '明 天'}, | ||
| 90 | - {date: util.unixtoTime(nt + 86400 * 2, 'YYYY-MM-DD'), background: '', text: '后 天'}, | ||
| 91 | - ]; | ||
| 92 | - this.reserve_id = options.id || ''; | ||
| 93 | - await this.setDateStr(); | ||
| 94 | - this.sellerid = util.cache('enter_params')['seller_id']; | ||
| 95 | - let timePickerArray = await comm.getDayTimeSpace(); | ||
| 96 | - //判断hasUseDefDtime | ||
| 97 | - let hasUseDefDtime = true; | ||
| 98 | - let mmii = util.unixtoTime(new Date() / 1000, 'HH:II'); | ||
| 99 | - if (mmii > this.data.defDtime[this.data.form.time]) { | ||
| 100 | - hasUseDefDtime = false; | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - this.setData({ | ||
| 104 | - timePickerArray: timePickerArray, | ||
| 105 | - speciallist: speciallist, | ||
| 106 | - hasUseDefDtime: hasUseDefDtime, | ||
| 107 | - }) | ||
| 108 | - if (this.reserve_id > 0) { | ||
| 109 | - this.initModify(this.reserve_id); | ||
| 110 | - } else if(options.hasQuick==1){ | ||
| 111 | - this.initQuick(options); | ||
| 112 | - } else { | ||
| 113 | - this.getTables(); | ||
| 114 | - } | ||
| 115 | - }, | ||
| 116 | - /** | ||
| 117 | - * | ||
| 118 | - * @param d | ||
| 119 | - * | ||
| 120 | - */ | ||
| 121 | - async setDateStr(d = new Date() / 1000){ | ||
| 122 | - let ns = new Date() / 1000; | ||
| 123 | - let dateStr = [ | ||
| 124 | - util.unixtoTime(ns, 'MM-DD `DAY/周WW`'), | ||
| 125 | - util.unixtoTime(parseInt(ns) + 86400, 'MM-DD `DAY/周WW`'), | ||
| 126 | - ]; | ||
| 127 | - //let dateStr=this.data.dateStr; | ||
| 128 | - let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`') | ||
| 129 | - let form = this.data.form; | ||
| 130 | - | ||
| 131 | - let timeObj = await comm.getTimeSpaceIndexData(d); | ||
| 132 | - //form.time=await comm.getTimeSpaceIndex(d); | ||
| 133 | - form.time = timeObj.timeIndex; | ||
| 134 | - | ||
| 135 | - let ind = dateStr._indexOf(nowStr); | ||
| 136 | - if (ind > -1) { | ||
| 137 | - form.date = ind | ||
| 138 | - } else { | ||
| 139 | - dateStr.push(nowStr.substr(0, 5)); | ||
| 140 | - form.date = 2; | ||
| 141 | - } | ||
| 142 | - let timePickerIndex = this.data.timePickerIndex; | ||
| 143 | - timePickerIndex[timeObj.timeIndex] = timeObj.timeMatchIndex; | ||
| 144 | - let obj = { | ||
| 145 | - dateStr: dateStr, | ||
| 146 | - form: form, | ||
| 147 | - timePickerIndex: timePickerIndex, | ||
| 148 | - timeOpt: timeObj.timeOpt, | ||
| 149 | - }; | ||
| 150 | - this.setData(obj) | ||
| 151 | - return obj; | ||
| 152 | - | ||
| 153 | - }, | ||
| 154 | - | ||
| 155 | - /** | ||
| 156 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 157 | - */ | ||
| 158 | - onReady: function () { | ||
| 159 | - | ||
| 160 | - }, | ||
| 161 | - | ||
| 162 | - /** | ||
| 163 | - * 生命周期函数--监听页面显示 | ||
| 164 | - */ | ||
| 165 | - onShow: function () { | ||
| 166 | - //if(!this.reserve_id || util.cache('tableid').length>0){ | ||
| 167 | - //if (util.cache('tableid').length > 0) { | ||
| 168 | - this.getTables(); | ||
| 169 | - //} | ||
| 170 | - setTimeout(() => { | ||
| 171 | - this.setData({ | ||
| 172 | - calendarMaskLoad: true, | ||
| 173 | - }) | ||
| 174 | - }, 1000); | ||
| 175 | - this.conditionInfo() | ||
| 176 | - }, | ||
| 177 | - | ||
| 178 | - /** | ||
| 179 | - * 生命周期函数--监听页面隐藏 | ||
| 180 | - */ | ||
| 181 | - onHide: function () { | ||
| 182 | - | ||
| 183 | - }, | ||
| 184 | - | ||
| 185 | - /** | ||
| 186 | - * 生命周期函数--监听页面卸载 | ||
| 187 | - */ | ||
| 188 | - onUnload: function () { | ||
| 189 | - | ||
| 190 | - }, | ||
| 191 | - | ||
| 192 | - /** | ||
| 193 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 194 | - */ | ||
| 195 | - onPullDownRefresh: function () { | ||
| 196 | - | ||
| 197 | - }, | ||
| 198 | - | ||
| 199 | - /** | ||
| 200 | - * 页面上拉触底事件的处理函数 | ||
| 201 | - */ | ||
| 202 | - onReachBottom: function () { | ||
| 203 | - | ||
| 204 | - }, | ||
| 205 | - | ||
| 206 | - /** | ||
| 207 | - * 用户点击右上角分享 | ||
| 208 | - */ | ||
| 209 | - onShareAppMessage: function () { | ||
| 210 | - | ||
| 211 | - }, | ||
| 212 | - selectedValue(e){ | ||
| 213 | - console.log(e); | ||
| 214 | - let key = util.attr(e, 'key'); | ||
| 215 | - let val; | ||
| 216 | - let sobj = {}; | ||
| 217 | - if (e.type == 'input' || e.type == 'confirm') { | ||
| 218 | - val = util.val(e); | ||
| 219 | - if (key == 'phone') { | ||
| 220 | - var that = this; | ||
| 221 | - if (e.detail.value != '' && e.detail.value.length >= 3) { | ||
| 222 | - App.Reserve.GetReserveUser( | ||
| 223 | - { | ||
| 224 | - keywords: e.detail.value, | ||
| 225 | - sid: this.sellerid | ||
| 226 | - } | ||
| 227 | - ).then(function (json) { | ||
| 228 | - if (json.ret == 200 && json.data.length > 0) { | ||
| 229 | - that.setData({ | ||
| 230 | - searchlist: json.data | ||
| 231 | - }) | ||
| 232 | - } else { | ||
| 233 | - that.setData({ | ||
| 234 | - searchlist: null | ||
| 235 | - }) | ||
| 236 | - } | ||
| 237 | - }) | ||
| 238 | - } else { | ||
| 239 | - this.setData({ | ||
| 240 | - searchlist: null | ||
| 241 | - }) | ||
| 242 | - } | ||
| 243 | - } | ||
| 244 | - if (key == 'pnum') { | ||
| 245 | - sobj.pnumInputFocus = true; | ||
| 246 | - } | ||
| 247 | - } else { | ||
| 248 | - val = util.attr(e, 'value'); | ||
| 249 | - } | ||
| 250 | - if (key == 'time') { | ||
| 251 | - if (this.data.timeOpt[val]) return; | ||
| 252 | - } | ||
| 253 | - if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) { | ||
| 254 | - if (util.attr(e, 'display') != 'block') { | ||
| 255 | - return; | ||
| 256 | - } | ||
| 257 | - } | ||
| 258 | - let form = this.data.form; | ||
| 259 | - | ||
| 260 | - if (key == 'tid') { | ||
| 261 | - let ts = this.data.tables; | ||
| 262 | - if (ts[val].isselect) { | ||
| 263 | - ts[val].isselect = false; | ||
| 264 | - form.tid.remove(ts[val].id); | ||
| 265 | - delete this.checkedTables[ts[val].id] | ||
| 266 | - } else { | ||
| 267 | - ts[val].isselect = true; | ||
| 268 | - form.tid.push(ts[val].id); | ||
| 269 | - this.checkedTables[ts[val].id]=ts[val].name | ||
| 270 | - } | ||
| 271 | - sobj.tables = ts; | ||
| 272 | - } else { | ||
| 273 | - form[key] = val; | ||
| 274 | - } | ||
| 275 | - console.log('ts', sobj.tables,this.checkedTables); | ||
| 276 | - //console.log(e.type,key,val,form); | ||
| 277 | - sobj.form = form; | ||
| 278 | - sobj.buttonhide = this.data.buttonhide; | ||
| 279 | - if (form.tid.length > 0 && form.rname.length > 0) { | ||
| 280 | - sobj.buttonhide = false; | ||
| 281 | - }else{ | ||
| 282 | - sobj.buttonhide = true; | ||
| 283 | - } | ||
| 284 | - let displayTimes = false; | ||
| 285 | - if (key == 'time') { | ||
| 286 | - if (util.attr(e, 'display') == 'block') { | ||
| 287 | - displayTimes = true; | ||
| 288 | - sobj.timePickerMask = true; | ||
| 289 | - } | ||
| 290 | - } | ||
| 291 | - if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) { | ||
| 292 | - if (!displayTimes) { | ||
| 293 | - //sobj.form.tid = []; //切换日期时间清空桌位 | ||
| 294 | - //sobj.buttonhide = true; | ||
| 295 | - this.getTables(); | ||
| 296 | - } | ||
| 297 | - if (key == 'date') { | ||
| 298 | - let xtime = util.unixtoTime(new Date() / 1000, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS'); | ||
| 299 | - this.setDateStr(util.timetouUnix(xtime)); | ||
| 300 | - } | ||
| 301 | - } | ||
| 302 | - //判断hasUseDefDtime | ||
| 303 | - if ((key == 'time' || key == 'date') && !sobj.timePickerMask) { | ||
| 304 | - sobj.hasUseDefDtime = true | ||
| 305 | - } | ||
| 306 | - if (this.data.form.date == 0) {// | ||
| 307 | - let mmii = util.unixtoTime(new Date() / 1000, 'HH:II'); | ||
| 308 | - if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) { | ||
| 309 | - sobj.hasUseDefDtime = false; | ||
| 310 | - } | ||
| 311 | - } | ||
| 312 | - this.setData(sobj) | ||
| 313 | - }, | ||
| 314 | - async getTables(){ | ||
| 315 | - let form = this.data.form; | ||
| 316 | - let tableid = util.cache('tableid'); | ||
| 317 | - console.log('getTables-tableid', tableid.length, this.reserve_id); | ||
| 318 | - //if (tableid.length < 1 && this.reserve_id) { | ||
| 319 | - if (tableid.length < 1) { | ||
| 320 | - tableid = this.data.form.tid; | ||
| 321 | - } | ||
| 322 | - console.log('getTables-tableid', tableid, tableid.length); | ||
| 323 | - try { | ||
| 324 | - let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time); | ||
| 325 | - console.log('rdate', this.data.dateStr[this.data.form.date], rdate); | ||
| 326 | - App.Reserve.GetTableList({ | ||
| 327 | - sid: util.cache('enter_params')['seller_id'], | ||
| 328 | - //pnum_str:form.pnum_str, | ||
| 329 | - pnum: form.pnum, | ||
| 330 | - rdate: rdate, | ||
| 331 | - tid: form.tabid, | ||
| 332 | - rid: this.reserve_id, | ||
| 333 | - }).then(res => { | ||
| 334 | - let tables = []; | ||
| 335 | - let tablesLength = 0; | ||
| 336 | - if (tableid.length > 0) { | ||
| 337 | - let toastTables={...this.checkedTables} | ||
| 338 | - let resData=res.data.slice(1,res.data.length); | ||
| 339 | - console.log('resData',resData) | ||
| 340 | - resData.forEach(p => { | ||
| 341 | - //if(tables.length>=3) return true; | ||
| 342 | - p.list.forEach(t => { | ||
| 343 | - delete toastTables[t.id] | ||
| 344 | - tablesLength++; | ||
| 345 | - if (tables.length >= 3) return true; | ||
| 346 | - if (tableid._indexOf(t.id) > -1) { | ||
| 347 | - t.isselect = true; | ||
| 348 | - tables.push(t); | ||
| 349 | - } | ||
| 350 | - }) | ||
| 351 | - }) | ||
| 352 | - console.log('toastTables',toastTables,this.data.form.tid,this.checkedTables); | ||
| 353 | - //清理已选中的桌位 | ||
| 354 | - let toastTablesInfo=[]; | ||
| 355 | - let tid=this.data.form.tid | ||
| 356 | - Object.keys(this.checkedTables).forEach(ckid=>{ | ||
| 357 | - if(toastTables[ckid]){ | ||
| 358 | - delete this.checkedTables[ckid] | ||
| 359 | - tid.remove(ckid); | ||
| 360 | - toastTablesInfo.push(toastTables[ckid]); | ||
| 361 | - } | ||
| 362 | - }) | ||
| 363 | - if(toastTablesInfo.length>0){ | ||
| 364 | - this.setData({ | ||
| 365 | - [`form.tid`]:tid, | ||
| 366 | - }) | ||
| 367 | - util.toast(toastTablesInfo.toString()+'已被占用啦','none'); | ||
| 368 | - } | ||
| 369 | - wx.removeStorage({key: 'tableid'}) | ||
| 370 | - } | ||
| 371 | - console.log('tables-first',tables); | ||
| 372 | - if(tables.length<1){ | ||
| 373 | - tablesLength=0; | ||
| 374 | - let fortids=[]; | ||
| 375 | - res.data.forEach((p,ri) => { | ||
| 376 | - p.list.forEach(t => { | ||
| 377 | - if(fortids._indexOf(t.id)<0) { | ||
| 378 | - tablesLength++; | ||
| 379 | - tables.push(t); | ||
| 380 | - fortids.push(t.id); | ||
| 381 | - } | ||
| 382 | - }) | ||
| 383 | - }) | ||
| 384 | - if (tables.length >= 3) { | ||
| 385 | - tables = tables.slice(0, 3); | ||
| 386 | - } | ||
| 387 | - } | ||
| 388 | - this.tablesLength = tablesLength; | ||
| 389 | - this.setData({ | ||
| 390 | - tables: tables, | ||
| 391 | - tablesLength: tablesLength | ||
| 392 | - }) | ||
| 393 | - }) | ||
| 394 | - } catch (e) { | ||
| 395 | - this.setData({ | ||
| 396 | - tables: [] | ||
| 397 | - }) | ||
| 398 | - } | ||
| 399 | - }, | ||
| 400 | - async formsubmit(){ | ||
| 401 | - if (this.data.buttonhide) return; | ||
| 402 | - try { | ||
| 403 | - let d_stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]]; | ||
| 404 | - let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], | ||
| 405 | - this.data.form.time, d_stimestr); | ||
| 406 | - let stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]]; | ||
| 407 | - let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], | ||
| 408 | - this.data.form.time, stimestr); | ||
| 409 | - console.log('stimestr', stimestr, this.data.form.time, this.data.timePickerIndex); | ||
| 410 | - console.log('rdate', rdate); | ||
| 411 | - this.setData({ | ||
| 412 | - buttonhide: true, | ||
| 413 | - }) | ||
| 414 | - let form = JSON.parse(JSON.stringify(this.data.form)); | ||
| 415 | - console.log('typeof form.tid', typeof form.tid); | ||
| 416 | - if (typeof form.tid == 'object') { | ||
| 417 | - let tid = new Set(form.tid);//tid 去重 | ||
| 418 | - form.tid = [...tid].toString(); | ||
| 419 | - } | ||
| 420 | - if (!form.tid) { | ||
| 421 | - return util.toast('请选择桌子', 'none'); | ||
| 422 | - } | ||
| 423 | - if (!form.rname) { | ||
| 424 | - return util.toast('请填写预订人', 'none'); | ||
| 425 | - } | ||
| 426 | - form.sid = this.sellerid; | ||
| 427 | - form.rdate = rdate | ||
| 428 | - | ||
| 429 | - try { | ||
| 430 | - let enter_params = util.cache('enter_params'); | ||
| 431 | - let sc = (await App.Reserve.SellerInfo(enter_params)).data | ||
| 432 | - let note_openid = enter_params.seller_openid; | ||
| 433 | - let note_name = sc.seller_user.nick_name || sc.seller_user.nickname; | ||
| 434 | - form.note_openid = note_openid || ''; | ||
| 435 | - if (form.rid) {//修改时传递uid | ||
| 436 | - form.note_openid = enter_params.manager_id || ''; | ||
| 437 | - } | ||
| 438 | - form.note_name = note_name || ''; | ||
| 439 | - } catch (e) {} | ||
| 440 | - | ||
| 441 | - form.ddate = d_rdate.substr(0, 10); | ||
| 442 | - if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间 | ||
| 443 | - let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00"); | ||
| 444 | - form.ddate = util.timetouUnix(ddateStr); | ||
| 445 | - } | ||
| 446 | - App.Reserve.SetReserveInfo(form).then(res => { | ||
| 447 | - if (res.ret == 200) { | ||
| 448 | - this.getCustomRemark() | ||
| 449 | - let _id = (res.data.id || res.data) | ||
| 450 | - this.setData({ | ||
| 451 | - form: JSON.parse(JSON.stringify(formTpl)), | ||
| 452 | - tables: [], | ||
| 453 | - timePickerIndex: [0, 0, 0], | ||
| 454 | - }) | ||
| 455 | - this.initLoad(); | ||
| 456 | - this.checkedTables={}; | ||
| 457 | - App.Reserve.Detail({rid: _id, openid: ''}, 'clear') | ||
| 458 | - wx.navigateTo({ | ||
| 459 | - url: util.http_build_query({id:_id,tplid:1},'b_invitation'), | ||
| 460 | - }); | ||
| 461 | - } else { | ||
| 462 | - util.toast(res.msg, 'none') | ||
| 463 | - } | ||
| 464 | - }) | ||
| 465 | - } catch (e) { | ||
| 466 | - } | ||
| 467 | - }, | ||
| 468 | - selectphone: function (e) { | ||
| 469 | - this.data.form.phone = e.detail.phone; | ||
| 470 | - this.data.form.rname = e.detail.rname; | ||
| 471 | - this.data.form.cusdem = e.detail.cusdem; | ||
| 472 | - var form = this.data.form | ||
| 473 | - this.data.form.sex = e.detail.sex; | ||
| 474 | - this.setData({ | ||
| 475 | - form: this.data.form, | ||
| 476 | - searchlist: null | ||
| 477 | - }) | ||
| 478 | - this.conditionInfo(); | ||
| 479 | - }, | ||
| 480 | - calendarShow(){ | ||
| 481 | - this.setData({ | ||
| 482 | - calendarMask: true | ||
| 483 | - }) | ||
| 484 | - }, | ||
| 485 | - dateChange(event){ | ||
| 486 | - console.log(event); | ||
| 487 | - //let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day) | ||
| 488 | - let cktime = util.timetouUnix(event.detail.date) | ||
| 489 | - let day0 = parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000); | ||
| 490 | - // if (cktime < day0) { | ||
| 491 | - // util.toast('请选择有效日期', 'none'); | ||
| 492 | - // return; | ||
| 493 | - // } | ||
| 494 | - let clickDay = event.detail.date.substr(8, 2); | ||
| 495 | - let changeDay = `dayStyle[1].day`; | ||
| 496 | - let changeBg = `dayStyle[1].background`; | ||
| 497 | - this.setData({ | ||
| 498 | - [changeDay]: clickDay, | ||
| 499 | - [changeBg]: "#84e7d0", | ||
| 500 | - //[`form.tid`]: [], //切换日期时间清空桌位 | ||
| 501 | - //buttonhide: true, | ||
| 502 | - }) | ||
| 503 | - console.log('cktime',cktime,util.unixtoTime(cktime,'YYYY-MM-DD')) | ||
| 504 | - this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime) | ||
| 505 | - this.calendarClose(); | ||
| 506 | - setTimeout(res=>{ | ||
| 507 | - this.getTables(); | ||
| 508 | - },10) | ||
| 509 | - | ||
| 510 | - }, | ||
| 511 | - calendarClose(){ | ||
| 512 | - this.setData({ | ||
| 513 | - calendarMask: false, | ||
| 514 | - timePickerMask: false, | ||
| 515 | - }) | ||
| 516 | - }, | ||
| 517 | - async selectdesk(){ | ||
| 518 | - let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time); | ||
| 519 | - console.log(this.data.form) | ||
| 520 | - wx.navigateTo({ | ||
| 521 | - url: 'b_desk?rdate=' + rdate + '&tid=' + this.data.form.tabid | ||
| 522 | - //+'&pnum_str='+this.data.form.pnum_str | ||
| 523 | - + '&pnum=' + this.data.form.pnum | ||
| 524 | - + '&checked_tids=' + this.data.form.tid | ||
| 525 | - + '&rid=' + this.reserve_id | ||
| 526 | - }) | ||
| 527 | - }, | ||
| 528 | - conditionInfo: function () { | ||
| 529 | - var form = this.data.form | ||
| 530 | - if (form.tid.length > 0 && form.rname.length > 0) { | ||
| 531 | - this.data.buttonhide = false; | ||
| 532 | - } | ||
| 533 | - this.setData({ | ||
| 534 | - buttonhide: this.data.buttonhide | ||
| 535 | - }) | ||
| 536 | - }, | ||
| 537 | - /** | ||
| 538 | - * 选中时间区域 | ||
| 539 | - */ | ||
| 540 | - bindTimePickerChange(e){ | ||
| 541 | - let timeIndex = util.attr(e, 'timeIndex'); | ||
| 542 | - if (timeIndex < 0) return; | ||
| 543 | - let timePickerIndex = this.data.timePickerIndex; | ||
| 544 | - //timePickerIndex[timeIndex]=util.val(e); | ||
| 545 | - timePickerIndex[timeIndex] = util.attr(e, 'val'); | ||
| 546 | - | ||
| 547 | - console.log(e, timeIndex, util.attr(e, 'val')); | ||
| 548 | - this.setData({ | ||
| 549 | - timePickerIndex: timePickerIndex, | ||
| 550 | - hasUseDefDtime: false, | ||
| 551 | - }) | ||
| 552 | - }, | ||
| 553 | - /** | ||
| 554 | - * 修改初始化 | ||
| 555 | - */ | ||
| 556 | - async initModify(id){ | ||
| 557 | - try { | ||
| 558 | - let res = await App.Reserve.Detail({rid: id, openid: ''}); | ||
| 559 | - | ||
| 560 | - console.log('initModify', res); | ||
| 561 | - //设置日期 | ||
| 562 | - let obj = await this.setDateStr(res.data.ddate); | ||
| 563 | - //设置时间 | ||
| 564 | - let nd = util.unixtoTime(res.data.ddate, 'HH:II'); | ||
| 565 | - let timePickerIndex = this.data.timePickerIndex | ||
| 566 | - console.log('initModify-', this.data.timePickerArray, obj.form.time, nd) | ||
| 567 | - this.data.timePickerArray[obj.form.time].forEach((dd, ii) => { | ||
| 568 | - console.log('initModify-', nd, dd) | ||
| 569 | - if (nd == dd) { | ||
| 570 | - timePickerIndex[obj.form.time] = ii; | ||
| 571 | - return true; | ||
| 572 | - } | ||
| 573 | - }) | ||
| 574 | - | ||
| 575 | - console.log('initModify-timePickerIndex', timePickerIndex); | ||
| 576 | - //obj.form.pnum_str=res.data.pnum_str; | ||
| 577 | - obj.form.pnum = res.data.pnum || 6; | ||
| 578 | - obj.form.rname = res.data.rname; | ||
| 579 | - obj.form.phone = res.data.phone || ""; | ||
| 580 | - obj.form.sex = res.data.sex; | ||
| 581 | - obj.form.cusdem = res.data.cusdem; | ||
| 582 | - obj.form.rid = id; | ||
| 583 | - obj.form.tid = []; | ||
| 584 | - let tablesed = []; | ||
| 585 | - res.data.tables.forEach((t, ti) => { | ||
| 586 | - obj.form.tid.push(t.id) | ||
| 587 | - if (ti >= 3) return; | ||
| 588 | - t.isselect = true | ||
| 589 | - t["isselected"] = 1 | ||
| 590 | - tablesed.push(t); | ||
| 591 | - this.checkedTables[t.id]=t.name; | ||
| 592 | - }) | ||
| 593 | - this.setData({ | ||
| 594 | - timePickerIndex: timePickerIndex, | ||
| 595 | - form: obj.form, | ||
| 596 | - //tablesed:tablesed, | ||
| 597 | - hasUseDefDtime: false, | ||
| 598 | - }) | ||
| 599 | - setTimeout(() => { | ||
| 600 | - this.getTables(); | ||
| 601 | - }, 300) | ||
| 602 | - | ||
| 603 | - } catch (e) { | ||
| 604 | - console.log('initModify', e) | ||
| 605 | - } | ||
| 606 | - }, | ||
| 607 | - pnumInputFocusEvent(e){ | ||
| 608 | - console.log(e); | ||
| 609 | - this.setData({ | ||
| 610 | - pnumInputFocus: 'focus' == e.type | ||
| 611 | - }) | ||
| 612 | - }, | ||
| 613 | - inputFocusTime: 0, | ||
| 614 | - blurTime: 0, | ||
| 615 | - inputFocus(e){ | ||
| 616 | - console.log(e, this.inputFocusTime); | ||
| 617 | - return; | ||
| 618 | - if (e.timeStamp > this.inputFocusTime) { | ||
| 619 | - this.inputFocusTime = e.timeStamp; | ||
| 620 | - if (e.type == 'focus' && this.data.pageMarginBottom == 0) { | ||
| 621 | - this.setData({ | ||
| 622 | - pageMarginBottom: 300 | ||
| 623 | - }) | ||
| 624 | - setTimeout(res => { | ||
| 625 | - this.pageScrollToBottom(); | ||
| 626 | - }, 100) | ||
| 627 | - } else { | ||
| 628 | - if (this.blurTime > 5) { | ||
| 629 | - this.blurTime = 0; | ||
| 630 | - this.setData({ | ||
| 631 | - pageMarginBottom: 0 | ||
| 632 | - }) | ||
| 633 | - } else { | ||
| 634 | - setTimeout(res => { | ||
| 635 | - this.blurTime += 1; | ||
| 636 | - this.inputFocus(e); | ||
| 637 | - }, 300) | ||
| 638 | - } | ||
| 639 | - | ||
| 640 | - } | ||
| 641 | - | ||
| 642 | - } | ||
| 643 | - }, | ||
| 644 | - pageScrollToBottom: function () { | ||
| 645 | - wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) { | ||
| 646 | - // 使页面滚动到底部 | ||
| 647 | - wx.pageScrollTo({ | ||
| 648 | - scrollTop: rect.bottom | ||
| 649 | - }) | ||
| 650 | - }).exec() | ||
| 651 | - }, | ||
| 652 | - gotoday(e){ | ||
| 653 | - this.setData({ | ||
| 654 | - [`calendar.nextNum`]: 0 | ||
| 655 | - }) | ||
| 656 | - }, | ||
| 657 | - nextMonth(e){ | ||
| 658 | - this.setData({ | ||
| 659 | - [`calendar.nextNum`]: this.data.calendar.nextNum + 1 | ||
| 660 | - }) | ||
| 661 | - }, | ||
| 662 | - prevMonth(e){ | ||
| 663 | - this.setData({ | ||
| 664 | - [`calendar.nextNum`]: this.data.calendar.nextNum - 1 | ||
| 665 | - }) | ||
| 666 | - }, | ||
| 667 | - /** | ||
| 668 | - * 快速预定初始化 | ||
| 669 | - * tid | ||
| 670 | - * tname | ||
| 671 | - * ddate | ||
| 672 | - * pnum | ||
| 673 | - */ | ||
| 674 | - async initQuick(options){ | ||
| 675 | - try { | ||
| 676 | - console.log('initQuick', options); | ||
| 677 | - this.checkedTables[options.tid]=options.tname | ||
| 678 | - options.ddate=options.ddate.substr(0,10); | ||
| 679 | - //设置日期 | ||
| 680 | - let obj = await this.setDateStr(options.ddate); | ||
| 681 | - //设置时间 | ||
| 682 | - let nd = util.unixtoTime(options.ddate, 'HH:II'); | ||
| 683 | - let timePickerIndex = this.data.timePickerIndex | ||
| 684 | - console.log('initQuick-', this.data.timePickerArray, obj.form.time, nd) | ||
| 685 | - this.data.timePickerArray[obj.form.time].forEach((dd, ii) => { | ||
| 686 | - console.log('initQuick-', nd, dd) | ||
| 687 | - if (nd == dd) { | ||
| 688 | - timePickerIndex[obj.form.time] = ii; | ||
| 689 | - return true; | ||
| 690 | - } | ||
| 691 | - }) | ||
| 692 | - | ||
| 693 | - console.log('initQuick-timePickerIndex', timePickerIndex); | ||
| 694 | - obj.form.pnum = options.pnum || 6; | ||
| 695 | - obj.form.rname = ""; | ||
| 696 | - obj.form.phone = ""; | ||
| 697 | - obj.form.sex = 1; | ||
| 698 | - obj.form.cusdem = ""; | ||
| 699 | - obj.form.rid = ""; | ||
| 700 | - obj.form.tid = [options.tid]; | ||
| 701 | - this.setData({ | ||
| 702 | - timePickerIndex: timePickerIndex, | ||
| 703 | - form: obj.form, | ||
| 704 | - hasUseDefDtime: false, | ||
| 705 | - }) | ||
| 706 | - setTimeout(() => { | ||
| 707 | - this.getTables(); | ||
| 708 | - }, 300) | ||
| 709 | - | ||
| 710 | - } catch (e) { | ||
| 711 | - console.log('initQuick', e) | ||
| 712 | - } | ||
| 713 | - }, | ||
| 714 | - getCustomRemark(){ | ||
| 715 | - App.User.GetCustomRemark({ | ||
| 716 | - uid:util.cache('enter_params')['manager_id'], | ||
| 717 | - }).then(res=>{ | ||
| 718 | - let CustomRemark=[]; | ||
| 719 | - res.data.forEach(r=>{ | ||
| 720 | - if(r.often_use){ | ||
| 721 | - CustomRemark.push(r); | ||
| 722 | - } | ||
| 723 | - }) | ||
| 724 | - this.setData({ | ||
| 725 | - CustomRemark:CustomRemark, | ||
| 726 | - }) | ||
| 727 | - }) | ||
| 728 | - }, | ||
| 729 | - oftenUse(e){ | ||
| 730 | - let id=util.attr(e,'id'); | ||
| 731 | - let val=util.attr(e,'value'); | ||
| 732 | - let CustomRemark=this.data.CustomRemark; | ||
| 733 | - let form=this.data.form; | ||
| 734 | - CustomRemark.forEach(r=>{ | ||
| 735 | - if(id==r.id){ | ||
| 736 | - if(r.active){ | ||
| 737 | - form.cusdem=form.cusdem.replace(val+'、','') | ||
| 738 | - } | ||
| 739 | - r.active=!r.active | ||
| 740 | - if(r.active){ | ||
| 741 | - form.cusdem+=val+'、' | ||
| 742 | - } | ||
| 743 | - } | ||
| 744 | - }) | ||
| 745 | - this.setData({ | ||
| 746 | - CustomRemark:CustomRemark, | ||
| 747 | - form:form, | ||
| 748 | - }) | ||
| 749 | - this.conditionInfo() | ||
| 750 | - }, | ||
| 751 | - CustomRemarkMore(){ | ||
| 752 | - this.setData({ | ||
| 753 | - CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask | ||
| 754 | - }) | ||
| 755 | - } | ||
| 756 | -}) |
pages/book/b_addnew.json
deleted
100644 → 0
| 1 | -{ | ||
| 2 | - "backgroundTextStyle":"light", | ||
| 3 | - "navigationBarBackgroundColor": "#fff", | ||
| 4 | - "navigationBarTextStyle":"black", | ||
| 5 | - "usingComponents": { | ||
| 6 | - "nothingBook":"/components/book/nothing/nothing", | ||
| 7 | - "bookList":"/components/book/list/list", | ||
| 8 | - "nav":"/components/nav/nav", | ||
| 9 | - "tabBar":"/components/book/tabBar/tabBar", | ||
| 10 | - "searchList":"/components/searchlist/searchlist", | ||
| 11 | - "calendar": "plugin://bmCalendar/calendar", | ||
| 12 | - "board":"/components/book/board/board", | ||
| 13 | - "formids":"/components/formids/formids", | ||
| 14 | - "a2l":"/components/tips/add-to-lite" | ||
| 15 | - } | ||
| 16 | -} |
pages/book/b_addnew.wxml
deleted
100644 → 0
| 1 | -<!--pages/book/b_addnew.wxml--> | ||
| 2 | -<nav>录入订座信息</nav> | ||
| 3 | -<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page"> | ||
| 4 | - <view class="base-info"> | ||
| 5 | - <!-- | ||
| 6 | - <view class="section flex-lr date"> | ||
| 7 | - <view class="flex-rr" style="width:100%;"> | ||
| 8 | - <item class="date-item {{form.date==0?'checked':''}}" | ||
| 9 | - bindtap="selectedValue" data-key="date" data-value="0"> | ||
| 10 | - <view class="date-item-text">{{dateStr[0]}}</view> | ||
| 11 | - </item> | ||
| 12 | - <item class="date-item {{form.date==1?'checked':''}}" | ||
| 13 | - bindtap="selectedValue" data-key="date" data-value="1"> | ||
| 14 | - <view class="date-item-text">{{dateStr[1]}}</view> | ||
| 15 | - </item> | ||
| 16 | - </view> | ||
| 17 | - <view class="more flex-ll" bindtap="calendarShow"> | ||
| 18 | - <view></view> | ||
| 19 | - <view></view> | ||
| 20 | - <view></view> | ||
| 21 | - </view> | ||
| 22 | - </view> | ||
| 23 | - --> | ||
| 24 | - <view class="section"> | ||
| 25 | - <view class="tab flex-ll"> | ||
| 26 | - <formids class="item {{form.date==0?'checked':''}}" | ||
| 27 | - bindtap="selectedValue" data-key="date" data-value="0"> | ||
| 28 | - {{dateStr[0]}} | ||
| 29 | - </formids> | ||
| 30 | - <formids class="item {{form.date==1?'checked':''}}" | ||
| 31 | - bindtap="selectedValue" data-key="date" data-value="1"> | ||
| 32 | - {{dateStr[1]}} | ||
| 33 | - </formids> | ||
| 34 | - <view class="item {{form.date==2?'checked':''}} flex-lr" | ||
| 35 | - bindtap="selectedValue" data-key="date" data-value="2" bindtap="calendarShow"> | ||
| 36 | - <view style="width: 80%" class="item-text">{{dateStr[2]||'其他'}}</view> | ||
| 37 | - <image | ||
| 38 | - src="http://qn.colorcun.com/custom/lite-yd/image/date{{dateStr[2]?'.selected':''}}.png" | ||
| 39 | - style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image> | ||
| 40 | - </view> | ||
| 41 | - </view> | ||
| 42 | - </view> | ||
| 43 | - <view class="section "> | ||
| 44 | - <view class="tab flex-ll"> | ||
| 45 | - <formids class="item {{form.time==0?'checked':''}} {{timeOpt[0]}}" | ||
| 46 | - wx:if="{{timePickerArray[0].length>0}}" | ||
| 47 | - bindtap="selectedValue" data-key="time" data-value="0"> | ||
| 48 | - <view class="picker">早市</view> | ||
| 49 | - </formids> | ||
| 50 | - <formids class="item {{form.time==1?'checked':''}} {{timeOpt[1]}}" | ||
| 51 | - wx:if="{{timePickerArray[1].length>0}}" | ||
| 52 | - bindtap="selectedValue" data-key="time" data-value="1"> | ||
| 53 | - <view class="picker">午市</view> | ||
| 54 | - </formids> | ||
| 55 | - <formids class="item {{form.time==2?'checked':''}} {{timeOpt[2]}}" | ||
| 56 | - wx:if="{{timePickerArray[2].length>0}}" | ||
| 57 | - bindtap="selectedValue" data-key="time" data-value="2"> | ||
| 58 | - <view class="picker">晚市</view> | ||
| 59 | - </formids> | ||
| 60 | - </view> | ||
| 61 | - </view> | ||
| 62 | - <view class="section" style="height: 90rpx;"> | ||
| 63 | - <view class="tab flex-lr"> | ||
| 64 | - <view class="tab flex-ll"> | ||
| 65 | - <formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key" | ||
| 66 | - bindtap="selectedValue" data-key="pnum" data-value="{{item}}"> | ||
| 67 | - <view class="pnum">{{item}}</view> | ||
| 68 | - </formids> | ||
| 69 | - </view> | ||
| 70 | - <view class="tab" style="margin-left: 20rpx;"> | ||
| 71 | - <view class="item {{form.pnum<6 || form.pnum>10?'checked':''}} flex-lr" | ||
| 72 | - data-key="pnum" data-value="{{form.pnum}}"> | ||
| 73 | - <view style="width: 80%" class="pnum"> | ||
| 74 | - <input | ||
| 75 | - bindinput="selectedValue" bindconfirm="selectedValue" | ||
| 76 | - bindblur="pnumInputFocusEvent" | ||
| 77 | - data-key="pnum" value="{{(form.pnum<6 || form.pnum>10) || pnumInputFocus?form.pnum:''}}" | ||
| 78 | - placeholder-class="placeholder-class-pnum" | ||
| 79 | - maxlength="3" type="number" | ||
| 80 | - placeholder="{{form.pnum<6 || form.pnum>10?form.pnum:''}} 更多"/> | ||
| 81 | - | ||
| 82 | - </view> | ||
| 83 | - <image | ||
| 84 | - src="http://qn.colorcun.com/custom/lite-yd/image/pnum{{form.pnum<6 || form.pnum>10?'.selected':''}}.png" | ||
| 85 | - style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image> | ||
| 86 | - </view> | ||
| 87 | - </view> | ||
| 88 | - </view> | ||
| 89 | - </view> | ||
| 90 | - <!-- | ||
| 91 | - <view class="section "> | ||
| 92 | - <view class="tab flex-ll"> | ||
| 93 | - <view class="item {{form.pnum_str=='1-4'?'checked':''}}" | ||
| 94 | - bindtap="selectedValue" data-key="pnum_str" data-value="1-4"> | ||
| 95 | - 4人以下 | ||
| 96 | - </view> | ||
| 97 | - <view class="item {{form.pnum_str=='5-9'?'checked':''}}" | ||
| 98 | - bindtap="selectedValue" data-key="pnum_str" data-value="5-9"> | ||
| 99 | - 5~9人 | ||
| 100 | - </view> | ||
| 101 | - <view class="item {{form.pnum_str=='10-99'?'checked':''}}" | ||
| 102 | - bindtap="selectedValue" data-key="pnum_str" data-value="10-99"> | ||
| 103 | - 10人以上 | ||
| 104 | - </view> | ||
| 105 | - </view> | ||
| 106 | - </view> | ||
| 107 | - <view class="section "> | ||
| 108 | - <view class="tab flex-ll"> | ||
| 109 | - <view class="item {{form.tabid=='2'?'checked':''}}" | ||
| 110 | - bindtap="selectedValue" data-key="tabid" data-value="2"> | ||
| 111 | - 包间 | ||
| 112 | - </view> | ||
| 113 | - <view class="item {{form.tabid=='1'?'checked':''}}" | ||
| 114 | - bindtap="selectedValue" data-key="tabid" data-value="1"> | ||
| 115 | - 散座 | ||
| 116 | - </view> | ||
| 117 | - </view> | ||
| 118 | - </view> | ||
| 119 | - --> | ||
| 120 | - </view> | ||
| 121 | - | ||
| 122 | - <view class="page-full tables"> | ||
| 123 | - <view class="page" style="margin-top: 0"> | ||
| 124 | - <view class="title flex-lr"> | ||
| 125 | - <view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view> | ||
| 126 | - <view class="flex-rr advice-more" bindtap="selectdesk" wx:if="{{tablesLength>1}}"> | ||
| 127 | - <view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view> | ||
| 128 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image> | ||
| 129 | - </view> | ||
| 130 | - </view> | ||
| 131 | - <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}"> | ||
| 132 | - <block wx:for="{{tablesed||tables}}" wx:key="tables.key"> | ||
| 133 | - <board width="160" height="180" board="{{item}}" | ||
| 134 | - style="margin: 20rpx 0 0 20rpx" | ||
| 135 | - event="boardChoose" className="noBottom" | ||
| 136 | - data-value="{{index}}" | ||
| 137 | - bindtap="selectedValue" | ||
| 138 | - data-key="tid"></board> | ||
| 139 | - </block> | ||
| 140 | - </view> | ||
| 141 | - <view class="advice-desk-detail flex-cc" wx:else=""> | ||
| 142 | - 没有符合条件的桌位! | ||
| 143 | - </view> | ||
| 144 | - </view> | ||
| 145 | - </view> | ||
| 146 | - <view class="book-info"> | ||
| 147 | - <view class="book-info-single flex-lr" style="align-items:flex-start;position:relative;z-index:10;"> | ||
| 148 | - <input placeholder="客户电话" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11" | ||
| 149 | - bindinput="selectedValue" | ||
| 150 | - bindconfirm="selectedValue" | ||
| 151 | - data-key="phone" | ||
| 152 | - value="{{form.phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;" cursor-spacing="260"/> | ||
| 153 | - <view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095"> | ||
| 154 | - <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:if="{{hasUseDefDtime && form.time>0}}">{{defDtime[form.time]}}</view> | ||
| 155 | - <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:else="">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view> | ||
| 156 | - </view> | ||
| 157 | - <block wx:if="{{searchlist}}"> | ||
| 158 | - <searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList> | ||
| 159 | - </block> | ||
| 160 | - </view> | ||
| 161 | - <view class="book-info-single flex-lr" style="align-items:flex-start;"> | ||
| 162 | - <input placeholder="客户姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" | ||
| 163 | - maxlength="12" style="width:450rpx;" value="{{form.rname}}" | ||
| 164 | - bindinput="selectedValue" | ||
| 165 | - bindconfirm="selectedValue" | ||
| 166 | - bindfocus="inputFocus" | ||
| 167 | - bindblur="inputFocus" | ||
| 168 | - data-key="rname"/> | ||
| 169 | - <view class="book-info-grand flex-rr font28r gray-deep-font"> | ||
| 170 | - <block wx:for="{{grand}}" wx:key="grand.key"> | ||
| 171 | - <view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}" | ||
| 172 | - bindtap="selectedValue" | ||
| 173 | - data-value="{{item.sex}}" | ||
| 174 | - data-key="sex">{{item.grand_title}}</view> | ||
| 175 | - </block> | ||
| 176 | - </view> | ||
| 177 | - </view> | ||
| 178 | - | ||
| 179 | - <view class="book-info-single flex-lr"> | ||
| 180 | - <input placeholder="客户要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}" | ||
| 181 | - bindinput="selectedValue" | ||
| 182 | - bindconfirm="selectedValue" | ||
| 183 | - bindfocus="inputFocus" | ||
| 184 | - bindblur="inputFocus" | ||
| 185 | - data-key="cusdem"/> | ||
| 186 | - <view class="CustomRemarkMore flex-rr"> | ||
| 187 | - <view bindtap="CustomRemarkMore">快速备注</view> | ||
| 188 | - </view> | ||
| 189 | - </view> | ||
| 190 | - <view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;"> | ||
| 191 | - <view class="flex-lr CustomRemark"> | ||
| 192 | - <view class="CustomRemarks"> | ||
| 193 | - <view class="CustomRemarksView"> | ||
| 194 | - <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" | ||
| 195 | - bindtap="oftenUse" | ||
| 196 | - data-id="{{item.id}}" | ||
| 197 | - data-value="{{item.often_use}}">{{item.often_use}}</view> | ||
| 198 | - </view> | ||
| 199 | - </view> | ||
| 200 | - </view> | ||
| 201 | - </view> | ||
| 202 | - </view> | ||
| 203 | - <view class="page-full submit"> | ||
| 204 | - <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">完成预订</view> | ||
| 205 | - </view> | ||
| 206 | -</view> | ||
| 207 | -<tabBar></tabBar> | ||
| 208 | -<view class="calendar-mask" bindtap="calendarClose" | ||
| 209 | - style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}"> | ||
| 210 | - <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;"> | ||
| 211 | - <calendar catchtap="catchtap" | ||
| 212 | - isTodaybtn="{{true}}" todaybtn_txt="回到今天" | ||
| 213 | - custom="{{false}}" | ||
| 214 | - switchover="{{['上一月','下个月']}}" | ||
| 215 | - active-coloro="active-coloro" | ||
| 216 | - active-colort="active-colort" | ||
| 217 | - speciallist="{{speciallist}}" | ||
| 218 | - txt_style="txt-style" | ||
| 219 | - calendar-style="calendar" | ||
| 220 | - header-style="calendar-header" | ||
| 221 | - weektitle-style="weektitle-style" | ||
| 222 | - restcolor-style="restcolor-style" | ||
| 223 | - txt_type="cn-d" | ||
| 224 | - | ||
| 225 | - datefont-style="datefont-style" | ||
| 226 | - todaybtn-style="todaybtn-style" | ||
| 227 | - | ||
| 228 | - bindnextMonth="nextMonth" | ||
| 229 | - bindprevMonth="prevMonth" | ||
| 230 | - bindselectDate="dateChange" | ||
| 231 | - bindgotoday="gotoday" | ||
| 232 | - | ||
| 233 | - prev="{{true||calendar.nextNum>0}}" | ||
| 234 | - circle_show="{{false}}" | ||
| 235 | - closelaststyle="{{true}}" | ||
| 236 | - ></calendar> | ||
| 237 | - </view> | ||
| 238 | -</view> | ||
| 239 | -<view class="calendar-mask" bindtap="calendarClose" | ||
| 240 | - style="height:100%;" wx:if="{{timePickerMask}}"> | ||
| 241 | - <view class="timePicker"> | ||
| 242 | - <view class="flex-rr"> | ||
| 243 | - <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="calendarClose"></image> | ||
| 244 | - </view> | ||
| 245 | - <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;"> | ||
| 246 | - <view bindtap="calendarClose">{{form.time==1?'午市':form.time==2?'晚市':'早市'}}</view> | ||
| 247 | - </view> | ||
| 248 | - <view class="flex-ll" style="flex-wrap:wrap"> | ||
| 249 | - <view class="time-item {{timePickerIndex[form.time]==index?'checked':''}}" | ||
| 250 | - style="{{(index+1)%3==0?'margin-right:0;':''}}" | ||
| 251 | - wx:for="{{timePickerArray[form.time]}}" wx:key="" | ||
| 252 | - bindtap="bindTimePickerChange" | ||
| 253 | - data-time-index="{{form.time}}" | ||
| 254 | - data-val="{{index}}" | ||
| 255 | - >{{item}}</view> | ||
| 256 | - </view> | ||
| 257 | - </view> | ||
| 258 | -</view> | ||
| 259 | - | ||
| 260 | -<view class="calendar-mask" bindtap="CustomRemarkMore" | ||
| 261 | - style="height:100%;" wx:if="{{CustomRemarkMoreMask}}"> | ||
| 262 | - <view class="timePicker" catchtap="catchtap"> | ||
| 263 | - <view class="flex-rr"> | ||
| 264 | - <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image> | ||
| 265 | - </view> | ||
| 266 | - <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;"> | ||
| 267 | - <view bindtap="calendarClose">更多标签</view> | ||
| 268 | - </view> | ||
| 269 | - <view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;"> | ||
| 270 | - <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" | ||
| 271 | - wx:if="{{item.often_use}}" bindtap="oftenUse" | ||
| 272 | - data-id="{{item.id}}" | ||
| 273 | - data-value="{{item.often_use}}">{{item.often_use}}</view> | ||
| 274 | - </view> | ||
| 275 | - </view> | ||
| 276 | -</view> | ||
| 277 | -<a2l bgColor="#199095"></a2l> |
pages/book/b_addnew.wxss
deleted
100644 → 0
| 1 | -/* pages/book/b_addnew.wxss */ | ||
| 2 | -.page{ | ||
| 3 | - width: 90%; | ||
| 4 | - margin: 20rpx 4% 0; | ||
| 5 | - | ||
| 6 | -} | ||
| 7 | -.base-info{ | ||
| 8 | - | ||
| 9 | -} | ||
| 10 | -.section{ | ||
| 11 | - height: 110rpx; | ||
| 12 | -} | ||
| 13 | -.section .label{ | ||
| 14 | - width: 60rpx; | ||
| 15 | - font-size: 30rpx; | ||
| 16 | - margin-right: 38rpx; | ||
| 17 | -} | ||
| 18 | -.date{ | ||
| 19 | - color:#199095; | ||
| 20 | - width: 100%; | ||
| 21 | - font-size: 38rpx; | ||
| 22 | - font-weight: bold; | ||
| 23 | -} | ||
| 24 | -.date-item{ | ||
| 25 | - width: 50%; | ||
| 26 | -} | ||
| 27 | -.date-item-text{ | ||
| 28 | - height: 60rpx; | ||
| 29 | - line-height: 60rpx; | ||
| 30 | - border-bottom: 4rpx solid rgba(0,0,0,0); | ||
| 31 | - width: 200rpx; | ||
| 32 | - text-align: center; | ||
| 33 | - color: #666666; | ||
| 34 | -} | ||
| 35 | -.checked .date-item-text{ | ||
| 36 | - border-bottom: 4rpx solid #199095; | ||
| 37 | - color: #199095; | ||
| 38 | -} | ||
| 39 | -.date .more{ | ||
| 40 | - width: 65rpx; | ||
| 41 | - min-width: 65rpx; | ||
| 42 | - height: 60rpx; | ||
| 43 | -} | ||
| 44 | -.date .more view{ | ||
| 45 | - width: 12rpx; | ||
| 46 | - height: 12rpx; | ||
| 47 | - border-radius: 50%; | ||
| 48 | - margin-right: 12rpx; | ||
| 49 | - background-color: #999; | ||
| 50 | -} | ||
| 51 | -.section .tab{ | ||
| 52 | - font-size: 34rpx; | ||
| 53 | - color: #199095; | ||
| 54 | -} | ||
| 55 | -.section .tab .item{ | ||
| 56 | - height: 50rpx; | ||
| 57 | - line-height: 49rpx; | ||
| 58 | - width: 210rpx !important; | ||
| 59 | - min-width: 210rpx !important; | ||
| 60 | - border-radius: 10rpx; | ||
| 61 | - border: 2rpx solid #199095; | ||
| 62 | - margin-right: 20rpx; | ||
| 63 | - text-align: center; | ||
| 64 | -} | ||
| 65 | -.section .tab .item .item-text,.section .tab .item .picker{ | ||
| 66 | - height: 46rpx; | ||
| 67 | - line-height: 46rpx; | ||
| 68 | -} | ||
| 69 | -.section .tab .item .picker{ | ||
| 70 | - width:210rpx; | ||
| 71 | - text-align: center; | ||
| 72 | -} | ||
| 73 | -.section .tab .item-pnum{ | ||
| 74 | - height: 50rpx; | ||
| 75 | - line-height: 50rpx; | ||
| 76 | - width: 60rpx !important; | ||
| 77 | - min-width: 60rpx !important; | ||
| 78 | - border-radius: 10rpx; | ||
| 79 | - border: 2rpx solid #199095; | ||
| 80 | - margin-right: 32rpx; | ||
| 81 | - text-align: center; | ||
| 82 | -} | ||
| 83 | -.section .tab .item-pnum .pnum,.section .tab .item .pnum input{ | ||
| 84 | - height: 46rpx; | ||
| 85 | - line-height: 46rpx; | ||
| 86 | - font-size: 34rpx; | ||
| 87 | -} | ||
| 88 | -.section .tab .item:last-child{ | ||
| 89 | - margin-right: 0; | ||
| 90 | -} | ||
| 91 | -.section .tab .item-pnum:last-child{ | ||
| 92 | - margin-right: 0; | ||
| 93 | -} | ||
| 94 | -.section .tab .checked{ | ||
| 95 | - background-color:#199095; | ||
| 96 | - color: #FEFEFE; | ||
| 97 | - border: 2rpx solid #199095; | ||
| 98 | -} | ||
| 99 | -.section .tab .disabled{ | ||
| 100 | - background-color:#999999; | ||
| 101 | - color: #efefef; | ||
| 102 | - border: 2rpx solid #999999; | ||
| 103 | -} | ||
| 104 | - | ||
| 105 | -/** | ||
| 106 | -可定桌位 | ||
| 107 | - */ | ||
| 108 | -.page-full{ | ||
| 109 | - width: 112%; | ||
| 110 | - margin-left: -6%; | ||
| 111 | - background-color: #F5F5F5; | ||
| 112 | -} | ||
| 113 | -.tables{ | ||
| 114 | - height: 314rpx; | ||
| 115 | - font-size: 30rpx; | ||
| 116 | -} | ||
| 117 | -.tables .title{ | ||
| 118 | - padding-top: 36rpx; | ||
| 119 | - height: 42rpx; | ||
| 120 | - line-height: 42rpx; | ||
| 121 | -} | ||
| 122 | -.advice-desk-detail{ | ||
| 123 | - height: 220rpx; | ||
| 124 | - width:100%; | ||
| 125 | -} | ||
| 126 | -.order-desk-info{ | ||
| 127 | - width:160rpx; | ||
| 128 | - min-width: 160rpx; | ||
| 129 | - height:160rpx; | ||
| 130 | - background:#A9E3E6; | ||
| 131 | - border:1px solid #A9E3E6; | ||
| 132 | - border-radius:10rpx; | ||
| 133 | - position:relative; | ||
| 134 | - overflow:hidden; | ||
| 135 | - margin-left:22rpx; | ||
| 136 | -} | ||
| 137 | -.desk-checked{ | ||
| 138 | - border:1px solid #199095; | ||
| 139 | -} | ||
| 140 | -.advice-desk-detail .order-desk-info:first-child{ | ||
| 141 | - margin-left:0; | ||
| 142 | -} | ||
| 143 | -.desk-active{ | ||
| 144 | - position: absolute; | ||
| 145 | - top: -2rpx; | ||
| 146 | - right: -2rpx; | ||
| 147 | -} | ||
| 148 | -.order-desk-type{ | ||
| 149 | - height:30rpx; | ||
| 150 | - line-height: 30rpx; | ||
| 151 | - background:#61A5D1; | ||
| 152 | - position:absolute; | ||
| 153 | - left:0; | ||
| 154 | - top:0; | ||
| 155 | - font-size: 26rpx; | ||
| 156 | - padding: 0 12rpx 4rpx 8rpx; | ||
| 157 | - border-radius: 0 16rpx 16rpx 0; | ||
| 158 | -} | ||
| 159 | -.advice-more{ | ||
| 160 | - padding:20rpx 0; | ||
| 161 | - padding-left:30rpx; | ||
| 162 | -} | ||
| 163 | -.cut{ | ||
| 164 | - width:100%; | ||
| 165 | - height:4px; | ||
| 166 | - background:#efeef3; | ||
| 167 | -} | ||
| 168 | - | ||
| 169 | - | ||
| 170 | - | ||
| 171 | -/** | ||
| 172 | -预定人信息 | ||
| 173 | - */ | ||
| 174 | -.book-info{ | ||
| 175 | - width:100%; | ||
| 176 | - padding-top:20rpx; | ||
| 177 | - margin:0 auto; | ||
| 178 | - padding-bottom: 300rpx; | ||
| 179 | -} | ||
| 180 | -.book-info-single{ | ||
| 181 | - width:100%; | ||
| 182 | - height:120rpx; | ||
| 183 | - padding-top:40rpx; | ||
| 184 | - border-bottom:1px solid #efeef3; | ||
| 185 | -} | ||
| 186 | -.book-info-single>input{ | ||
| 187 | - width:100%; | ||
| 188 | - height:100rpx; | ||
| 189 | -} | ||
| 190 | -.book-info-grand{ | ||
| 191 | - height:50rpx; | ||
| 192 | - border:1px solid #199095; | ||
| 193 | - margin-top:20rpx; | ||
| 194 | -} | ||
| 195 | -.book-grand{ | ||
| 196 | - width:90rpx; | ||
| 197 | - height:100%; | ||
| 198 | - box-sizing:border-box; | ||
| 199 | -} | ||
| 200 | -.book-grand-active{ | ||
| 201 | - background:rgba(25,153,149,.8); | ||
| 202 | -} | ||
| 203 | -.book-grand-border{ | ||
| 204 | - border-right:1px solid #199095; | ||
| 205 | -} | ||
| 206 | -.book-grand-border:last-child{ | ||
| 207 | - border-width: 0; | ||
| 208 | -} | ||
| 209 | -.phone-reminder{ | ||
| 210 | - width:32rpx; | ||
| 211 | - height:32rpx; | ||
| 212 | - margin-left:20rpx; | ||
| 213 | -} | ||
| 214 | - | ||
| 215 | - | ||
| 216 | -/** | ||
| 217 | -提交按钮 | ||
| 218 | - */ | ||
| 219 | -.submit{ | ||
| 220 | - position: fixed; | ||
| 221 | - bottom: 120rpx; | ||
| 222 | - left: 0; | ||
| 223 | - right: 0; | ||
| 224 | - height: 150rpx; | ||
| 225 | - background-color: #fefefe; | ||
| 226 | - z-index: 9; | ||
| 227 | -} | ||
| 228 | -.confirm-button{ | ||
| 229 | - width:680rpx; | ||
| 230 | - height:85rpx; | ||
| 231 | - background:#199095; | ||
| 232 | - margin:42rpx auto 0; | ||
| 233 | - border-radius:10rpx; | ||
| 234 | - opacity:.6; | ||
| 235 | -} | ||
| 236 | -.confirm-button-active{ | ||
| 237 | - opacity:1; | ||
| 238 | -} | ||
| 239 | - | ||
| 240 | - | ||
| 241 | -@import "common/calendar.wxss"; | ||
| 242 | - | ||
| 243 | - | ||
| 244 | - | ||
| 245 | - | ||
| 246 | -.placeholder-class-pnum{ | ||
| 247 | - color:#199095; | ||
| 248 | - font-size: 34rpx; | ||
| 249 | -} | ||
| 250 | - | ||
| 251 | -.timePicker{ | ||
| 252 | - width: 80%; | ||
| 253 | - overflow: hidden; | ||
| 254 | - position: absolute; | ||
| 255 | - bottom: 0; | ||
| 256 | - border-top: 2rpx solid #ccc; | ||
| 257 | - background-color: #FEFEFE; | ||
| 258 | - padding: 20rpx 10% 80rpx; | ||
| 259 | -} | ||
| 260 | -.timePicker .time-item{ | ||
| 261 | - width: 150rpx; | ||
| 262 | - height: 60rpx; | ||
| 263 | - line-height: 60rpx; | ||
| 264 | - font-size: 40rpx; | ||
| 265 | - font-weight: bold; | ||
| 266 | - color:#199095; | ||
| 267 | - border: 2rpx solid #199095; | ||
| 268 | - border-radius: 10rpx; | ||
| 269 | - text-align: center; | ||
| 270 | - margin-right: 66rpx; | ||
| 271 | - margin-bottom: 60rpx; | ||
| 272 | -} | ||
| 273 | -.timePicker .time-item.checked{ | ||
| 274 | - background-color: #199095; | ||
| 275 | - color:#fefefe; | ||
| 276 | -} | ||
| 277 | -.timePicker .close{ | ||
| 278 | - width: 50rpx; | ||
| 279 | - height: 50rpx; | ||
| 280 | - transform:rotate(45deg); | ||
| 281 | - margin-top: -10rpx; | ||
| 282 | - margin-right: -10%; | ||
| 283 | -} | ||
| 284 | - | ||
| 285 | -.CustomRemark{ | ||
| 286 | - line-height: 60rpx; | ||
| 287 | - overflow: hidden; | ||
| 288 | -} | ||
| 289 | -.CustomRemarks{ | ||
| 290 | - width: 100%; | ||
| 291 | -} | ||
| 292 | -.CustomRemarksView{ | ||
| 293 | - height: 60rpx; | ||
| 294 | - overflow: hidden; | ||
| 295 | -} | ||
| 296 | -.CustomRemarkMore{ | ||
| 297 | - width: 200rpx; | ||
| 298 | - min-width: 200rpx; | ||
| 299 | - color:#199095; | ||
| 300 | - font-size: 30rpx; | ||
| 301 | -} | ||
| 302 | -.CustomRemarkItem{ | ||
| 303 | - height: 48rpx; | ||
| 304 | - line-height: 48rpx; | ||
| 305 | - padding: 4rpx 14rpx; | ||
| 306 | - background-color: #F5F5F5; | ||
| 307 | - font-size: 30rpx; | ||
| 308 | - color: #999999; | ||
| 309 | - border-radius: 10rpx; | ||
| 310 | - margin-right: 20rpx; | ||
| 311 | - float: left; | ||
| 312 | - margin-bottom: 40rpx; | ||
| 313 | -} | ||
| 314 | -.CustomRemarkItem:last-child{ | ||
| 315 | - margin-right: 0; | ||
| 316 | -} | ||
| 317 | -.CustomRemarkMore .CustomRemarkItem{ | ||
| 318 | - padding: 4rpx 24rpx; | ||
| 319 | -} | ||
| 320 | -.book-info-single.last{ | ||
| 321 | - border-width: 0; | ||
| 322 | -} | ||
| 323 | -.CustomRemarkItem.active{ | ||
| 324 | - background-color: #6AB6B9; | ||
| 325 | - color: #FFFFFF; | ||
| 326 | -} |
pages/book/b_desk.js
deleted
100644 → 0
| 1 | -import util from '../../utils/util'; | ||
| 2 | -import comm from '../../utils/bookCommon'; | ||
| 3 | -import App from '../../utils/api'; | ||
| 4 | -const {regeneratorRuntime} = global | ||
| 5 | -Page({ | ||
| 6 | - data:{ | ||
| 7 | - menu_active_id:'' | ||
| 8 | - }, | ||
| 9 | - checked_tids:[], | ||
| 10 | - desks:[], | ||
| 11 | - onLoad:function(opt){ | ||
| 12 | - console.log('onLoad',opt) | ||
| 13 | - util.setBarTitle('选择桌位'); | ||
| 14 | - var radio=750/util.getsystem().windowWidth; | ||
| 15 | - var contentHeight=util.getsystem().windowHeight-Math.ceil(350/radio); | ||
| 16 | - if(opt.tid==0){ | ||
| 17 | - delete opt.tid | ||
| 18 | - } | ||
| 19 | - if(opt.checked_tids){ | ||
| 20 | - this.checked_tids=opt.checked_tids.split(',') | ||
| 21 | - util.cache('tableid',this.checked_tids) | ||
| 22 | - } | ||
| 23 | - this.setData({ | ||
| 24 | - sellerid:util.cache('sellerid'), | ||
| 25 | - opt:opt, | ||
| 26 | - hasCheckedTable:this.checked_tids.length>0 | ||
| 27 | - }) | ||
| 28 | - this.getdesklist(); | ||
| 29 | - }, | ||
| 30 | - onShow:function(){ | ||
| 31 | - this.setData({ | ||
| 32 | - height:getApp().system.windowHeight-55 | ||
| 33 | - }) | ||
| 34 | - }, | ||
| 35 | - changedesk:function(e){ | ||
| 36 | - let tableid=util.cache('tableid'); | ||
| 37 | - this.checked_tids= tableid && tableid.length>0?tableid:[]; | ||
| 38 | - this.setData({ | ||
| 39 | - hasCheckedTable:this.checked_tids.length>0 | ||
| 40 | - }) | ||
| 41 | - }, | ||
| 42 | - back:function(){ | ||
| 43 | - this.setData({ | ||
| 44 | - buttonClick:true | ||
| 45 | - }) | ||
| 46 | - //wx.removeStorage({key:'tableid'}) | ||
| 47 | - wx.navigateBack(); | ||
| 48 | - }, | ||
| 49 | - getdesklist:function(){ | ||
| 50 | - var formdata=this.data.opt; | ||
| 51 | - formdata.sid=this.data.sellerid; | ||
| 52 | - var that=this; | ||
| 53 | - App.Reserve.GetTableList(formdata).then(function (json) { | ||
| 54 | - if(json.ret==200){ | ||
| 55 | - console.log('this.checked_tids',that.checked_tids); | ||
| 56 | - that.desks=json.data | ||
| 57 | - that.formatDesklist(true) | ||
| 58 | - } | ||
| 59 | - }) | ||
| 60 | - }, | ||
| 61 | - formatDesklist(hasFirst=true){ | ||
| 62 | - let desks=this.desks; | ||
| 63 | - if(desks.length>0){ | ||
| 64 | - desks.forEach((v,i)=>{ | ||
| 65 | - v.list.forEach((r,n)=>{ | ||
| 66 | - r.isselect=false | ||
| 67 | - if(this.checked_tids._indexOf(r.id)>-1){ | ||
| 68 | - r.isselect=true; | ||
| 69 | - } | ||
| 70 | - }) | ||
| 71 | - }) | ||
| 72 | - let param={ | ||
| 73 | - desklist:desks, | ||
| 74 | - } | ||
| 75 | - if(hasFirst){ | ||
| 76 | - param.menu_active_id=desks[0].name | ||
| 77 | - } | ||
| 78 | - this.setData(param) | ||
| 79 | - } | ||
| 80 | - return desks; | ||
| 81 | - }, | ||
| 82 | - switchMenu(e){ | ||
| 83 | - | ||
| 84 | - this.formatDesklist(false) | ||
| 85 | - this.setData({ | ||
| 86 | - menu_active_id:util.attr(e,'id') | ||
| 87 | - }) | ||
| 88 | - }, | ||
| 89 | -}) |
pages/book/b_desk.json
deleted
100644 → 0
pages/book/b_desk.wxml
deleted
100644 → 0
| 1 | -<nav>选择桌位</nav> | ||
| 2 | -<!--桌位状态--> | ||
| 3 | -<view class="flex-lr" style="border-top:1rpx solid #E0E0E0"> | ||
| 4 | - <view class="menus" style="height: {{height}}px; overflow-y: auto;overflow-x: hidden;align-self:flex-start "> | ||
| 5 | - <view class="menus-item flex-cc {{item.name==menu_active_id?'active':''}}" | ||
| 6 | - wx:for="{{desklist}}" wx:key="desklist.key" | ||
| 7 | - bindtap="switchMenu" data-id="{{item.name}}"> | ||
| 8 | - <view class="name">{{item.name}}</view> | ||
| 9 | - <view class="hip" wx:if="{{item.chenkNum>0}}">{{item.chenkNum}}</view> | ||
| 10 | - </view> | ||
| 11 | - </view> | ||
| 12 | - <view style="height: {{height-80}}px;overflow-y: auto;padding-bottom: 160rpx;overflow-x: hidden;width: 100%;"> | ||
| 13 | - <block wx:for="{{desklist}}" wx:key="desklist.key"> | ||
| 14 | - <orderDesk list="{{item.list}}" bind:changedesk="changedesk" wx:if="{{item.name==menu_active_id}}"></orderDesk> | ||
| 15 | - </block> | ||
| 16 | - | ||
| 17 | - </view> | ||
| 18 | -</view> | ||
| 19 | -<view class="confirm-button white-font flex-vc font34r {{hasCheckedTable ? 'confirm-button-active' : ''}}" bindtap="back">确定</view> | ||
| 20 | - | ||
| 21 | - |
pages/book/b_desk.wxss
deleted
100644 → 0
| 1 | -view{ | ||
| 2 | - line-height:1.2; | ||
| 3 | -} | ||
| 4 | -.other-info{ | ||
| 5 | - width:100%; | ||
| 6 | - height:220rpx; | ||
| 7 | - padding:20rpx 0; | ||
| 8 | - box-sizing:border-box; | ||
| 9 | -} | ||
| 10 | -.selected-time{ | ||
| 11 | - width:375rpx; | ||
| 12 | - height:100%; | ||
| 13 | - border-right:1px solid #efeef3; | ||
| 14 | - box-sizing:border-box; | ||
| 15 | -} | ||
| 16 | -.actual-time{ | ||
| 17 | - margin-top:10rpx; | ||
| 18 | -} | ||
| 19 | -.cut{ | ||
| 20 | - width:100%; | ||
| 21 | - height:4px; | ||
| 22 | - background:#efeef3; | ||
| 23 | -} | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | -.desk-type{ | ||
| 28 | - width:680rpx; | ||
| 29 | - padding:40rpx 0 20rpx; | ||
| 30 | - margin:0 auto; | ||
| 31 | -} | ||
| 32 | -.desk-type-single{ | ||
| 33 | - width:160rpx; | ||
| 34 | - height:60rpx; | ||
| 35 | - border:1px solid #199095; | ||
| 36 | - border-radius:30rpx; | ||
| 37 | - background:#EBF8F8; | ||
| 38 | -} | ||
| 39 | -.desk-type-single-active{ | ||
| 40 | - background:#199095; | ||
| 41 | -} | ||
| 42 | - | ||
| 43 | -.desk-list{ | ||
| 44 | - width:100%; | ||
| 45 | -} | ||
| 46 | -.desk-region{ | ||
| 47 | - width:680rpx; | ||
| 48 | - padding-top:40rpx; | ||
| 49 | - margin:0 auto; | ||
| 50 | -} | ||
| 51 | - | ||
| 52 | -.confirm-button{ | ||
| 53 | - width:460rpx; | ||
| 54 | - height:85rpx; | ||
| 55 | - background:#74BBBE; | ||
| 56 | - position:fixed; | ||
| 57 | - left:250rpx; | ||
| 58 | - bottom:40rpx; | ||
| 59 | - margin:0 auto; | ||
| 60 | - border-radius:10rpx; | ||
| 61 | -} | ||
| 62 | -.confirm-button-active{ | ||
| 63 | - background:#199095; | ||
| 64 | -} | ||
| 65 | - | ||
| 66 | -.menus{ | ||
| 67 | - width: 168rpx; | ||
| 68 | - min-width: 168rpx; | ||
| 69 | - background-color: #F5F5F5; | ||
| 70 | -} | ||
| 71 | -.menus-item{ | ||
| 72 | - width: 168rpx; | ||
| 73 | - height: 158rpx; | ||
| 74 | - line-height: 158rpx; | ||
| 75 | - font-size: 34rpx; | ||
| 76 | - border: 1rpx solid #E0E0E0; | ||
| 77 | - border-top-width: 0; | ||
| 78 | - border-left-width: 0; | ||
| 79 | - position: relative; | ||
| 80 | -} | ||
| 81 | -.menus-item.active{ | ||
| 82 | - background-color: #FEFEFE; | ||
| 83 | -} | ||
| 84 | -.menus-item .name{ | ||
| 85 | - width: 140rpx; | ||
| 86 | - max-height: 96rpx; | ||
| 87 | - line-height: 48rpx; | ||
| 88 | - overflow: hidden; | ||
| 89 | - text-align: center; | ||
| 90 | -} | ||
| 91 | -.menus-item .hip{ | ||
| 92 | - background-color: #f00; | ||
| 93 | - width: 40rpx; | ||
| 94 | - height: 40rpx; | ||
| 95 | - position: absolute; | ||
| 96 | - border-radius: 50%; | ||
| 97 | - color: #fefefe; | ||
| 98 | - text-align: center; | ||
| 99 | - line-height: 40rpx; | ||
| 100 | - font-size: 22rpx; | ||
| 101 | - top:10rpx; | ||
| 102 | - right: 10rpx; | ||
| 103 | -} |
pages/book/b_detail.js
deleted
100644 → 0
| 1 | -var util = require('../../utils/util.js') | ||
| 2 | -var uri=require('../../utils/uri.js') | ||
| 3 | -import App from '../../utils/api'; | ||
| 4 | -const {regeneratorRuntime} = global | ||
| 5 | -import TP from '../../utils/tpls'; | ||
| 6 | -Page({ | ||
| 7 | - data:{ | ||
| 8 | - actionSheetHidden:true, | ||
| 9 | - actionSheetItems:['客户取消','客户行程改变'] | ||
| 10 | - }, | ||
| 11 | - sc:{}, | ||
| 12 | - tpls:TP.tpls(), | ||
| 13 | - enter_params:{}, | ||
| 14 | - onLoad:async function (opt) { | ||
| 15 | - util.setBarTitle('预定详情'); | ||
| 16 | - console.log(opt) | ||
| 17 | - this.getDetail(opt.id); | ||
| 18 | - wx.showShareMenu({ | ||
| 19 | - withShareTicket: true, | ||
| 20 | - success:function(res){ | ||
| 21 | - console.log(res) | ||
| 22 | - } | ||
| 23 | - }) | ||
| 24 | - this.enter_params=util.cache('enter_params'); | ||
| 25 | - this.sc=(await App.Reserve.SellerInfo(this.enter_params)).data; | ||
| 26 | - console.log('this.sc',this.sc); | ||
| 27 | - this.chooseManagerInit(); | ||
| 28 | - }, | ||
| 29 | - onShow:function(){ | ||
| 30 | - this.notice=this.selectComponent('#notice'); | ||
| 31 | - }, | ||
| 32 | - noticeCall:function(){ | ||
| 33 | - this.selectComponent('#notice').show(); | ||
| 34 | - }, | ||
| 35 | - onShareAppMessage: function () { | ||
| 36 | - this.selectComponent('#notice').close(); | ||
| 37 | - var obj=this.data.bookInfo; | ||
| 38 | - let path=util.http_build_query({ | ||
| 39 | - id:this.data.bookInfo.id, | ||
| 40 | - fromid:getApp().openid, | ||
| 41 | - hasSellerShare:1, | ||
| 42 | - hasInvitation:1, | ||
| 43 | - tplid:1 | ||
| 44 | - },'/pages/customer/index') | ||
| 45 | - return { | ||
| 46 | - //title: (nickname||'')+'给你发送了一个订座信息,点击查看详情', | ||
| 47 | - title: this.tpls[0].shareFirstTitle, | ||
| 48 | - path: path, | ||
| 49 | - imageUrl:this.tpls[0].shareFirstImage, | ||
| 50 | - success: function (res) { | ||
| 51 | - console.log(res,666666) | ||
| 52 | - }, | ||
| 53 | - fail:function(){ | ||
| 54 | - console.log('ccccc') | ||
| 55 | - }, | ||
| 56 | - complete:function(){ | ||
| 57 | - console.log('ccccc') | ||
| 58 | - } | ||
| 59 | - }; | ||
| 60 | - }, | ||
| 61 | - getcall:function(){ | ||
| 62 | - if(!this.detailData.hasOwner){ | ||
| 63 | - return util.toast('只有记录人可以拨打','none'); | ||
| 64 | - } | ||
| 65 | - if(this.data.bookInfo.phone.length<3){ | ||
| 66 | - return util.toast('号码错误','none'); | ||
| 67 | - } | ||
| 68 | - wx.makePhoneCall({ | ||
| 69 | - phoneNumber: this.data.bookInfo.phone, //仅为示例,并非真实的电话号码 | ||
| 70 | - complete:()=>{ | ||
| 71 | - this.selectComponent('#notice').close(); | ||
| 72 | - } | ||
| 73 | - }) | ||
| 74 | - }, | ||
| 75 | - chooseManagerInit(){ | ||
| 76 | - try{ | ||
| 77 | - let managers=this.sc.manager; | ||
| 78 | - let mans=[]; | ||
| 79 | - let mans_role=[]; | ||
| 80 | - // let space=''; | ||
| 81 | - // for(let i=0;i<50;i++){ | ||
| 82 | - // space+=' '; | ||
| 83 | - // } | ||
| 84 | - if(managers.length>0){ | ||
| 85 | - managers.forEach(man=>{ | ||
| 86 | - let nickname=man.nick_name||man.user_name; | ||
| 87 | - mans.push(nickname); | ||
| 88 | - //mans_role.push(' ['+man.role_name+'] -- '+man.user_name+space); | ||
| 89 | - mans_role.push('['+man.role_name+'] -- '+nickname); | ||
| 90 | - }) | ||
| 91 | - } | ||
| 92 | - this.setData({mans:mans,mans_role:mans_role}) | ||
| 93 | - }catch(e){ | ||
| 94 | - wx.showToast({ | ||
| 95 | - title:'无客户经理', | ||
| 96 | - icon:'none' | ||
| 97 | - }); | ||
| 98 | - } | ||
| 99 | - }, | ||
| 100 | - chooseManager(e){ | ||
| 101 | - let mansIndex=util.val(e); | ||
| 102 | - this.setData({mansIndex:mansIndex}); | ||
| 103 | - try{ | ||
| 104 | - let managers=this.sc.manager; | ||
| 105 | - let man=managers[mansIndex]; | ||
| 106 | - if(man){ | ||
| 107 | - App.Reserve.SetReserveCusman({ | ||
| 108 | - rid:this.data.bookInfo.id, | ||
| 109 | - cusman_id:man.id, | ||
| 110 | - cusman:man.nick_name||man.user_name, | ||
| 111 | - cusman_phone:man.user_phone?man.user_phone:'', | ||
| 112 | - cusman_account:man.user_wechat?man.user_wechat:'', | ||
| 113 | - cusman_openid:man.seat_openid?man.seat_openid:'' | ||
| 114 | - }).then(()=>{ | ||
| 115 | - this.getDetail(this.data.bookInfo.id,true); | ||
| 116 | - }); | ||
| 117 | - } | ||
| 118 | - }catch(e){ | ||
| 119 | - console.log(e); | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - }, | ||
| 123 | - flushSellerInfo(){ | ||
| 124 | - App.Reserve.SellerInfo(util.cache('enter_params'),true); | ||
| 125 | - }, | ||
| 126 | - detailData:null, | ||
| 127 | - async getDetail(id,force=false){ | ||
| 128 | - let res=await App.Reserve.Detail({rid:id,openid:''},force); | ||
| 129 | - res.data.rdateStr=util.unixtoTime(res.data.ddate,"MM月DD日 HH:II") | ||
| 130 | - res.data.phoneStr=res.data.phone||''; | ||
| 131 | - let enter_params=util.cache('enter_params'); | ||
| 132 | - let sc=(await App.Reserve.SellerInfo(enter_params)).data | ||
| 133 | - let note_openid=enter_params.seller_openid; | ||
| 134 | - res.data.hasOwner=false; | ||
| 135 | - if(note_openid==res.data.note_openid || sc.seller_user.role_name=='管理员'){ | ||
| 136 | - res.data.hasOwner=true; | ||
| 137 | - } | ||
| 138 | - if(!res.data.hasOwner){ | ||
| 139 | - res.data.phoneStr=res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){ | ||
| 140 | - return $1+'**'+$3; | ||
| 141 | - }) | ||
| 142 | - } | ||
| 143 | - if(res.data.status==4 && res.data.cancel){ | ||
| 144 | - res.data.cancel.cdateStr=util.unixtoTime(res.data.cancel.cdate,"YYYY.MM.DD HH:II") | ||
| 145 | - } | ||
| 146 | - this.detailData=res.data; | ||
| 147 | - | ||
| 148 | - this.setData({ | ||
| 149 | - tables:res.data.tables, | ||
| 150 | - bookInfo:res.data, | ||
| 151 | - }) | ||
| 152 | - }, | ||
| 153 | - gotoModify(){ | ||
| 154 | - wx.redirectTo({ | ||
| 155 | - url:'./b_addnew?id='+this.data.bookInfo.id | ||
| 156 | - }) | ||
| 157 | - }, | ||
| 158 | - cancelReserve(){ | ||
| 159 | - this.selectComponent('#cancel').show(); | ||
| 160 | - }, | ||
| 161 | - reserveCancel(e){ | ||
| 162 | - console.log('reserveCancel',e.detail); | ||
| 163 | - this.getDetail(this.data.bookInfo.id,true); | ||
| 164 | - }, | ||
| 165 | - actionSheetChange(e){ | ||
| 166 | - this.setData({ | ||
| 167 | - actionSheetHidden:true | ||
| 168 | - }) | ||
| 169 | - }, | ||
| 170 | - async startDinner(e){ | ||
| 171 | - let cause={}; | ||
| 172 | - let enter_params=util.cache('enter_params'); | ||
| 173 | - let sc=(await App.Reserve.SellerInfo(enter_params)).data | ||
| 174 | - cause={desc:""} | ||
| 175 | - if(enter_params){ | ||
| 176 | - cause.uid=enter_params.manager_id; | ||
| 177 | - } | ||
| 178 | - if(sc.seller_user){ | ||
| 179 | - cause.uname=(sc.seller_user.nick_name||sc.seller_user.nickname) | ||
| 180 | - } | ||
| 181 | - App.Reserve.SetReserveStatus({ | ||
| 182 | - rid:this.data.bookInfo.id, | ||
| 183 | - status:util.attr(e,'status'), | ||
| 184 | - cause:JSON.stringify(cause), | ||
| 185 | - }).then(()=>{ | ||
| 186 | - this.getDetail(this.data.bookInfo.id,true); | ||
| 187 | - }); | ||
| 188 | - }, | ||
| 189 | - showOrder(){ | ||
| 190 | - wx.navigateTo({ | ||
| 191 | - url:util.http_build_query({rid:this.data.bookInfo.id,oid:this.data.bookInfo.orderid,identity:2},'/pack-cookbook/pages/success') | ||
| 192 | - }); | ||
| 193 | - }, | ||
| 194 | -}) |
pages/book/b_detail.json
deleted
100644 → 0
| 1 | -{ | ||
| 2 | - "backgroundTextStyle":"light", | ||
| 3 | - "navigationBarBackgroundColor": "#fff", | ||
| 4 | - "navigationBarTextStyle":"black", | ||
| 5 | - "usingComponents": { | ||
| 6 | - "noticeCall":"/components/book/notice/notice", | ||
| 7 | - "step":"/components/book/step/step", | ||
| 8 | - "board":"/components/book/board/board", | ||
| 9 | - "cancel":"/components/book/reserveCancel/cancel", | ||
| 10 | - "nav":"/components/nav/nav", | ||
| 11 | - "formids":"/components/formids/formids" | ||
| 12 | - } | ||
| 13 | -} |
pages/book/b_detail.wxml
deleted
100644 → 0
| 1 | -<nav hasHome>订座详情</nav> | ||
| 2 | -<!--订单信息--> | ||
| 3 | -<view class="order-info"> | ||
| 4 | - <view class="flex-lr order-detail"> | ||
| 5 | - <view class="gray-deep-font font30r">到店时间</view> | ||
| 6 | - <view class="black-font font34r">{{bookInfo.rdateStr}}</view> | ||
| 7 | - </view> | ||
| 8 | - <view class="flex-lr order-detail"> | ||
| 9 | - <view class="gray-deep-font font30r">用餐人数</view> | ||
| 10 | - <view class="black-font font34r">{{bookInfo.pnum_str||bookInfo.pnum}}人</view> | ||
| 11 | - </view> | ||
| 12 | - <view class="reserve-status-tip" wx:if="{{bookInfo.status!=null}}"> | ||
| 13 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/reserve-status-{{bookInfo.status}}.png"></image> | ||
| 14 | - </view> | ||
| 15 | - <view class="flex-lr order-detail"> | ||
| 16 | - <view class="gray-deep-font font30r">预订座位</view> | ||
| 17 | - <view class="black-font font34r">{{tables.length}}个</view> | ||
| 18 | - </view> | ||
| 19 | - <view class="flex-lr order-desk"> | ||
| 20 | - <view class="gray-deep-font font30r"></view> | ||
| 21 | - <view class="flex-re" style="width:100%;flex-wrap:wrap;"> | ||
| 22 | - <block wx:for="{{tables}}" wx:key="tables.key"> | ||
| 23 | - <board width="160" height="180" board="{{item}}" className="noBottom" | ||
| 24 | - style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board> | ||
| 25 | - </block> | ||
| 26 | - </view> | ||
| 27 | - </view> | ||
| 28 | - <view class="flex-lr order-detail"> | ||
| 29 | - <text class="gray-deep-font font30r" space="true" decode="true">客户姓名</text> | ||
| 30 | - <view class="black-font font34r">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view> | ||
| 31 | - </view> | ||
| 32 | - <view class="flex-lr order-detail"> | ||
| 33 | - <view class="gray-deep-font font30r">客户电话</view> | ||
| 34 | - <view class="black-font font34r" bindtap="getcall">{{bookInfo.phoneStr||''}}</view> | ||
| 35 | - </view> | ||
| 36 | - <block wx:if="{{bookInfo.cusdem!='' && bookInfo.cusdem!='null'}}"> | ||
| 37 | - <view class="flex-lr order-detail"> | ||
| 38 | - <view class="gray-deep-font font30r">备注信息</view> | ||
| 39 | - <view class="black-font font34r">{{bookInfo.cusdem}}</view> | ||
| 40 | - </view> | ||
| 41 | - </block> | ||
| 42 | -</view> | ||
| 43 | -<view class="order-info"> | ||
| 44 | - <view class="flex-lr order-detail"> | ||
| 45 | - <view class="gray-deep-font font30r">客户经理</view> | ||
| 46 | - <view class="flex-lr black-font font34r" style=" border-bottom: 2rpx solid #999;"> | ||
| 47 | - <picker bindchange="chooseManager" catchtap="flushSellerInfo" value="{{mansIndex}}" range="{{mans_role}}"> | ||
| 48 | - <view class="picker"> | ||
| 49 | - {{mans[mansIndex]?mans[mansIndex]:bookInfo.cusman?bookInfo.cusman:'请选择'}} | ||
| 50 | - </view> | ||
| 51 | - </picker> | ||
| 52 | - </view> | ||
| 53 | - </view> | ||
| 54 | - <view class="flex-lr order-detail"> | ||
| 55 | - <view class="gray-deep-font font30r">记录人</view> | ||
| 56 | - <view class="black-font font34r">{{bookInfo.note_name}}</view> | ||
| 57 | - </view> | ||
| 58 | -</view> | ||
| 59 | -<view class="order-info" wx:if="{{bookInfo.status==4 && bookInfo.cancel}}"> | ||
| 60 | - <view class="flex-lr order-detail"> | ||
| 61 | - <view class="gray-deep-font font30r">取消原因</view> | ||
| 62 | - <view class="flex-lr black-font font34r"> | ||
| 63 | - {{bookInfo.cancel.desc}} | ||
| 64 | - </view> | ||
| 65 | - </view> | ||
| 66 | - <view class="flex-lr order-detail"> | ||
| 67 | - <view class="gray-deep-font font30r">取消时间</view> | ||
| 68 | - <view class="black-font font34r">{{bookInfo.cancel.cdateStr}}</view> | ||
| 69 | - </view> | ||
| 70 | - <view class="flex-lr order-detail"> | ||
| 71 | - <view class="gray-deep-font font30r">操作人</view> | ||
| 72 | - <view class="black-font font34r">{{bookInfo.cancel.uname}}</view> | ||
| 73 | - </view> | ||
| 74 | -</view> | ||
| 75 | - | ||
| 76 | -<view style="height: 250rpx;"></view> | ||
| 77 | - | ||
| 78 | -<!--通知预订人--> | ||
| 79 | -<view class="notice-opt" wx:if="{{bookInfo.status==1}}"> | ||
| 80 | - <view class="notice-button-border font34r flex-lr"> | ||
| 81 | - <view> | ||
| 82 | - <formids bindclick="noticeCall">通知客户</formids> | ||
| 83 | - </view> | ||
| 84 | - <view wx:if="{{bookInfo.order && bookInfo.order.cookbooklist.length>0}}"> | ||
| 85 | - <formids bindclick="showOrder">查看菜品</formids> | ||
| 86 | - </view> | ||
| 87 | - </view> | ||
| 88 | - <view class="notice-button-border font34r flex-lr"> | ||
| 89 | - <view> | ||
| 90 | - <formids bindclick="gotoModify">变更预订</formids> | ||
| 91 | - </view> | ||
| 92 | - <view > | ||
| 93 | - <formids bindclick="cancelReserve">取消预订</formids> | ||
| 94 | - </view> | ||
| 95 | - <view> | ||
| 96 | - <formids bindclick="startDinner" data-status="2">确认到店</formids> | ||
| 97 | - </view> | ||
| 98 | - </view> | ||
| 99 | -</view> | ||
| 100 | -<view class="notice-opt" wx:if="{{bookInfo.status==2}}"> | ||
| 101 | - <formids class="notice-button white-font font34r flex-cc" bindclick="startDinner" data-status="3">客户就餐完毕</formids> | ||
| 102 | -</view> | ||
| 103 | -<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall> | ||
| 104 | -<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll"> | ||
| 105 | - <block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key"> | ||
| 106 | - <action-sheet-item>{{item}}</action-sheet-item> | ||
| 107 | - </block> | ||
| 108 | - <action-sheet-item> | ||
| 109 | - <input placeholder="请输入" style="width:100%"/> | ||
| 110 | - </action-sheet-item> | ||
| 111 | - <action-sheet-cancel >取消</action-sheet-cancel> | ||
| 112 | - | ||
| 113 | -</action-sheet> | ||
| 114 | -<cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel> |
pages/book/b_detail.wxss
deleted
100644 → 0
| 1 | -view{ | ||
| 2 | - line-height:1.2; | ||
| 3 | -} | ||
| 4 | - | ||
| 5 | - | ||
| 6 | -/*商家信息*/ | ||
| 7 | -.seller-info{ | ||
| 8 | - width:680rpx; | ||
| 9 | - height:auto; | ||
| 10 | - padding:40rpx 0; | ||
| 11 | - margin:0 auto; | ||
| 12 | - border-bottom:1px solid #efeef3; | ||
| 13 | -} | ||
| 14 | -.seller-image{ | ||
| 15 | - width:60rpx; | ||
| 16 | - height:60rpx; | ||
| 17 | - border-radius:50%; | ||
| 18 | - margin-right:20rpx; | ||
| 19 | -} | ||
| 20 | -.seller-address{ | ||
| 21 | - margin-top:10rpx; | ||
| 22 | -} | ||
| 23 | -.seller-location{ | ||
| 24 | - width:32rpx; | ||
| 25 | - height:34rpx; | ||
| 26 | -} | ||
| 27 | - | ||
| 28 | - | ||
| 29 | -/*订单信息*/ | ||
| 30 | -.order-info{ | ||
| 31 | - width:680rpx; | ||
| 32 | - height:auto; | ||
| 33 | - padding:0 20rpx; | ||
| 34 | - margin:0 auto; | ||
| 35 | - border-bottom:1px solid #efeef3; | ||
| 36 | - box-sizing:border-box; | ||
| 37 | -} | ||
| 38 | -.order-detail{ | ||
| 39 | - width:100%; | ||
| 40 | - padding:40rpx 0; | ||
| 41 | -} | ||
| 42 | -.order-desk{ | ||
| 43 | - width:100%; | ||
| 44 | - height:auto; | ||
| 45 | - position:relative; | ||
| 46 | -} | ||
| 47 | -.order-status{ | ||
| 48 | - width:172rpx; | ||
| 49 | - height:100rpx; | ||
| 50 | - position:absolute; | ||
| 51 | - left:0; | ||
| 52 | - right:0; | ||
| 53 | - top:0; | ||
| 54 | - bottom:0; | ||
| 55 | - margin:auto; | ||
| 56 | - z-index:2; | ||
| 57 | -} | ||
| 58 | -.order-desk-info{ | ||
| 59 | - width:120rpx; | ||
| 60 | - height:120rpx; | ||
| 61 | - background:#A9E3E6; | ||
| 62 | - border:1px solid #199095; | ||
| 63 | - border-radius:10rpx; | ||
| 64 | - position:relative; | ||
| 65 | - overflow:hidden; | ||
| 66 | - margin-left:20rpx; | ||
| 67 | - margin-top:20rpx; | ||
| 68 | -} | ||
| 69 | -.order-desk-detail{ | ||
| 70 | - width:100%; | ||
| 71 | - height:90rpx; | ||
| 72 | -} | ||
| 73 | -.order-desk-type{ | ||
| 74 | - width:100%; | ||
| 75 | - height:30rpx; | ||
| 76 | - background:#199095; | ||
| 77 | - position:absolute; | ||
| 78 | - left:0; | ||
| 79 | - bottom:0; | ||
| 80 | -} | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - | ||
| 84 | -.seller-staff{ | ||
| 85 | - width:680rpx; | ||
| 86 | - padding:40rpx 20rpx; | ||
| 87 | - box-sizing:border-box; | ||
| 88 | - margin:0 auto; | ||
| 89 | -} | ||
| 90 | - | ||
| 91 | -.notice-opt{ | ||
| 92 | - position:fixed; | ||
| 93 | - left:0; | ||
| 94 | - right:0; | ||
| 95 | - bottom: 0; | ||
| 96 | - padding-bottom: 50rpx; | ||
| 97 | - background-color: #fefefe; | ||
| 98 | -} | ||
| 99 | -.notice-button{ | ||
| 100 | - height:85rpx; | ||
| 101 | - width:90%; | ||
| 102 | - background:#199095; | ||
| 103 | - border-radius:0; | ||
| 104 | - margin:20rpx auto 0; | ||
| 105 | -} | ||
| 106 | -.notice-button-border{ | ||
| 107 | - height:85rpx; | ||
| 108 | - width:90%; | ||
| 109 | - border:solid 2rpx #199095; | ||
| 110 | - border-radius:0; | ||
| 111 | - margin:20rpx auto 0; | ||
| 112 | - color: #199095; | ||
| 113 | -} | ||
| 114 | -.notice-button-border view{ | ||
| 115 | - width: 100%; | ||
| 116 | - border-right: 2rpx solid #199095; | ||
| 117 | - text-align: center; | ||
| 118 | - height: 50rpx; | ||
| 119 | - line-height: 50rpx; | ||
| 120 | -} | ||
| 121 | -.notice-button-border view:last-child{ | ||
| 122 | - border-right-width: 0; | ||
| 123 | -} | ||
| 124 | -.reserve-status-tip{ | ||
| 125 | - position: absolute; | ||
| 126 | - top:300rpx; | ||
| 127 | - right:200rpx; | ||
| 128 | - width: 82rpx; | ||
| 129 | - height: 52rpx; | ||
| 130 | -} | ||
| 131 | -.reserve-status-tip image{ | ||
| 132 | - width: 100%; | ||
| 133 | - height: 100%; | ||
| 134 | -} |
pages/book/b_index.js
deleted
100644 → 0
| 1 | -var mta=require('mta-wechat-analysis') | ||
| 2 | -var util = require('../../utils/util.js') | ||
| 3 | -var uri=require('../../utils/uri.js') | ||
| 4 | -var bookOrder=require('../../utils/bookCommon.js') | ||
| 5 | -import App from '../../utils/api'; | ||
| 6 | -const {regeneratorRuntime} = global | ||
| 7 | -Page({ | ||
| 8 | - data:{ | ||
| 9 | - isloading:false, | ||
| 10 | - pagex:1, | ||
| 11 | - pagey:10, | ||
| 12 | - sort:null, | ||
| 13 | - dateStr:'', | ||
| 14 | - calendarMaskLoad:false, | ||
| 15 | - calendarMask:false, | ||
| 16 | - dayStyle:[ | ||
| 17 | - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }, | ||
| 18 | - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' } | ||
| 19 | - ], | ||
| 20 | - keywords:'', | ||
| 21 | - sort:'', | ||
| 22 | - form:{ | ||
| 23 | - time:-1, | ||
| 24 | - }, | ||
| 25 | - timePickerArray:[ | ||
| 26 | - [], | ||
| 27 | - [], | ||
| 28 | - [], | ||
| 29 | - ], | ||
| 30 | - speciallist:[], | ||
| 31 | - ReservesCountMonth:[], | ||
| 32 | - ReservesTotal:0, | ||
| 33 | - timeStrLabel:bookOrder.timeStrLabel | ||
| 34 | - }, | ||
| 35 | - sellerid:0, | ||
| 36 | - indexOpt:null, | ||
| 37 | - YYYY:'YYYY', | ||
| 38 | - onLoad:async function(opt){ | ||
| 39 | - this.indexOpt=opt; | ||
| 40 | - mta.Page.init({ | ||
| 41 | - "appID":"500667280", | ||
| 42 | - "eventID":"500667287", | ||
| 43 | - "statPullDownFresh":true, | ||
| 44 | - "statShareApp":true, | ||
| 45 | - "statReachBottom":true, | ||
| 46 | - "lauchOpts":opt, //渠道分析 | ||
| 47 | - }); | ||
| 48 | - let d=new Date()/1000; | ||
| 49 | - let dateStr=util.unixtoTime(d,'MM-DD DAY'); | ||
| 50 | - var radio=750/util.getsystem().windowWidth; | ||
| 51 | - var contentHeight=util.getsystem().windowHeight-Math.ceil(120/radio) | ||
| 52 | - if(opt.seller_id){ | ||
| 53 | - this.sellerid=opt.seller_id; | ||
| 54 | - util.cache('sellerid',opt.seller_id) | ||
| 55 | - util.cache('enter_params',opt) | ||
| 56 | - App.Reserve.SellerInfo(opt) | ||
| 57 | - }else{ | ||
| 58 | - this.sellerid=util.cache('sellerid'); | ||
| 59 | - } | ||
| 60 | - //this.sellerid=opt.seller_id ? opt.seller_id : util.cache('sellerid'); | ||
| 61 | - let timePickerArray= await bookOrder.getDayTimeSpace(); | ||
| 62 | - let speciallist=[ | ||
| 63 | - { date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' }, | ||
| 64 | - { date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' }, | ||
| 65 | - { date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' }, | ||
| 66 | - ]; | ||
| 67 | - this.setData({ | ||
| 68 | - sellerid:this.sellerid, | ||
| 69 | - listHeight:contentHeight-Math.ceil(210/radio), | ||
| 70 | - dateStr:dateStr, | ||
| 71 | - timePickerArray: timePickerArray, | ||
| 72 | - speciallist:speciallist, | ||
| 73 | - }) | ||
| 74 | - //util.setBarTitle('预定本'); | ||
| 75 | - this.indexOpt=opt; | ||
| 76 | - this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD')); | ||
| 77 | - this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM')); | ||
| 78 | - }, | ||
| 79 | - onShow:function(){ | ||
| 80 | - this.setData({ | ||
| 81 | - isloading:false, | ||
| 82 | - }) | ||
| 83 | - this.getbooklist(); | ||
| 84 | - this.selectComponent('#nav').init(); | ||
| 85 | - setTimeout(()=>{ | ||
| 86 | - this.setData({ | ||
| 87 | - calendarMaskLoad:true, | ||
| 88 | - }) | ||
| 89 | - let openid=getApp().openid; | ||
| 90 | - if(openid && this.indexOpt.seller_id){ | ||
| 91 | - App.Reserve.SellerForOpenid({openid:openid,sedata:JSON.stringify(this.indexOpt)}) | ||
| 92 | - //客户经理=>人人都是客户经理 | ||
| 93 | - //if(this.indexOpt.manager_id){ | ||
| 94 | - App.Reserve.UpdateSellerUser({seat_openid:openid,kid:this.indexOpt.manager_id}); | ||
| 95 | - //} | ||
| 96 | - }else{ | ||
| 97 | - console.log('index-opt',openid,this.indexOpt); | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - },1000); | ||
| 101 | - }, | ||
| 102 | - async getbooklist(isExport=false){ | ||
| 103 | - let time=0; | ||
| 104 | - if(this.data.form.time<0){ | ||
| 105 | - let sid=await bookOrder.getTimeSpaceIndexData(); | ||
| 106 | - time=sid.timeIndex | ||
| 107 | - }else{ | ||
| 108 | - time=this.data.form.time; | ||
| 109 | - } | ||
| 110 | - var formdata={}; | ||
| 111 | - if(this.data.sort!=''){ | ||
| 112 | - formdata.sort=this.data.sort | ||
| 113 | - } | ||
| 114 | - if(this.data.keywords!=''){ | ||
| 115 | - formdata.keywords=this.data.keywords | ||
| 116 | - } | ||
| 117 | - formdata.sid=this.sellerid; | ||
| 118 | - formdata.x=1; | ||
| 119 | - formdata.y=200; | ||
| 120 | - let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY); | ||
| 121 | - formdata.rdate=rdate; | ||
| 122 | - if(isExport){ | ||
| 123 | - this.__exportFile(formdata); | ||
| 124 | - }else{ | ||
| 125 | - var that=this; | ||
| 126 | - App.Reserve.GetReserveList(formdata).then(function(json){ | ||
| 127 | - console.log(json) | ||
| 128 | - if(json.ret==200){ | ||
| 129 | - that.setData({ | ||
| 130 | - isloading:true, | ||
| 131 | - bookList:json.data.length==0 ? null : json.data, | ||
| 132 | - form:{time:time}, | ||
| 133 | - }) | ||
| 134 | - that.boolists=that.selectAllComponents('.orderbook'); | ||
| 135 | - that.boolists.forEach(function(v,i){ | ||
| 136 | - v.changeitem(); | ||
| 137 | - }) | ||
| 138 | - } | ||
| 139 | - }).catch(e=>{}) | ||
| 140 | - } | ||
| 141 | - }, | ||
| 142 | - timeorder:function(){ | ||
| 143 | - if(this.data.sort==''){ | ||
| 144 | - this.data.sort=1; | ||
| 145 | - }else{ | ||
| 146 | - this.data.sort=''; | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | - this.setData({ | ||
| 150 | - sort:this.data.sort | ||
| 151 | - }) | ||
| 152 | - this.getbooklist(); | ||
| 153 | - }, | ||
| 154 | - searchinput:function(e){ | ||
| 155 | - this.data.keywords=e.detail.value; | ||
| 156 | - this.setData({ | ||
| 157 | - keywords:this.data.keywords | ||
| 158 | - }) | ||
| 159 | - if(e.detail.value==''){ | ||
| 160 | - this.getbooklist(); | ||
| 161 | - } | ||
| 162 | - }, | ||
| 163 | - calendarShow(){ | ||
| 164 | - console.log('xxxxx') | ||
| 165 | - this.setData({ | ||
| 166 | - calendarMask:true | ||
| 167 | - }) | ||
| 168 | - console.log(this.data.calendarMask) | ||
| 169 | - }, | ||
| 170 | - dateChange(event){ | ||
| 171 | - this.YYYY=event.detail.date.substr(0,4); | ||
| 172 | - let cktime=util.timetouUnix(event.detail.date) | ||
| 173 | - console.log('cktime',cktime,this.YYYY) | ||
| 174 | - let clickDay = event.detail.date.substr(8,2); | ||
| 175 | - let changeDay = `dayStyle[1].day`; | ||
| 176 | - let changeBg = `dayStyle[1].background`; | ||
| 177 | - this.setData({ | ||
| 178 | - dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'), | ||
| 179 | - [changeDay]: clickDay, | ||
| 180 | - [changeBg]: "#84e7d0" | ||
| 181 | - }) | ||
| 182 | - this.getbooklist(); | ||
| 183 | - this.calendarClose(); | ||
| 184 | - this.ReservesCountDay(event.detail.date); | ||
| 185 | - }, | ||
| 186 | - calendarClose(){ | ||
| 187 | - this.setData({ | ||
| 188 | - calendarMask:false | ||
| 189 | - }) | ||
| 190 | - }, | ||
| 191 | - selectedValue:function (e) { | ||
| 192 | - this.setData({ | ||
| 193 | - form:{time:e.currentTarget.dataset.value} | ||
| 194 | - }) | ||
| 195 | - this.getbooklist(); | ||
| 196 | - }, | ||
| 197 | - searchbook:function(e){ | ||
| 198 | - console.log(this.data.form) | ||
| 199 | - this.getbooklist(); | ||
| 200 | - }, | ||
| 201 | - __exportFile(formdata){ | ||
| 202 | - App.Reserve.ExportReserve(formdata).then(res=>{ | ||
| 203 | - let url=res.data; | ||
| 204 | - if(!url){ | ||
| 205 | - return util.toast('没有预订数据','none') | ||
| 206 | - } | ||
| 207 | - wx.downloadFile({ | ||
| 208 | - url: url, | ||
| 209 | - success: function(res) { | ||
| 210 | - const filePath = res.tempFilePath; | ||
| 211 | - console.log('filePath',filePath); | ||
| 212 | - wx.previewImage({ | ||
| 213 | - current: filePath, | ||
| 214 | - urls: [filePath] | ||
| 215 | - }) | ||
| 216 | - wx.saveImageToPhotosAlbum({ | ||
| 217 | - filePath:filePath, | ||
| 218 | - fail (res) { | ||
| 219 | - util.toast('保存失败','none') | ||
| 220 | - } | ||
| 221 | - }) | ||
| 222 | - } | ||
| 223 | - }) | ||
| 224 | - }); | ||
| 225 | - | ||
| 226 | - }, | ||
| 227 | - exportFile(){ | ||
| 228 | - this.getbooklist(true); | ||
| 229 | - }, | ||
| 230 | - ReservesCountDay(day){ | ||
| 231 | - App.Reserve.ReservesCountDay({ | ||
| 232 | - sid:this.sellerid, | ||
| 233 | - day:day | ||
| 234 | - }).then(res=>{ | ||
| 235 | - | ||
| 236 | - let ReservesTotal=0; | ||
| 237 | - let ReservesCountDay={}; | ||
| 238 | - if(res.ret==200){ | ||
| 239 | - ReservesCountDay=res.data; | ||
| 240 | - Object.keys(res.data).forEach(k=>{ | ||
| 241 | - if(res.data[k]!=-1){ | ||
| 242 | - ReservesTotal+=parseInt(res.data[k]) | ||
| 243 | - } | ||
| 244 | - }) | ||
| 245 | - } | ||
| 246 | - this.setData({ | ||
| 247 | - ReservesTotal:ReservesTotal, | ||
| 248 | - ReservesCountDay:ReservesCountDay, | ||
| 249 | - }) | ||
| 250 | - }) | ||
| 251 | - }, | ||
| 252 | - ReservesCountMonth(month){ | ||
| 253 | - App.Reserve.ReservesCountMonth({ | ||
| 254 | - sid:this.sellerid, | ||
| 255 | - month:month | ||
| 256 | - }).then(res=>{ | ||
| 257 | - let ReservesCountMonth=[]; | ||
| 258 | - if(res.ret==200){ | ||
| 259 | - res.data.forEach(v=>{ | ||
| 260 | - ReservesCountMonth.push(v>=1?1:0) | ||
| 261 | - }) | ||
| 262 | - } | ||
| 263 | - this.setData({ | ||
| 264 | - ReservesCountMonth:ReservesCountMonth, | ||
| 265 | - }) | ||
| 266 | - }) | ||
| 267 | - }, | ||
| 268 | - clickMonth(e){ | ||
| 269 | - this.ReservesCountMonth(e.detail.currentYear+'-'+e.detail.currentMonth); | ||
| 270 | - }, | ||
| 271 | - gotoday(e){ | ||
| 272 | - this.ReservesCountMonth(e.detail.date.substr(0,7)); | ||
| 273 | - } | ||
| 274 | -}) |
pages/book/b_index.json
deleted
100644 → 0
| 1 | -{ | ||
| 2 | - "backgroundTextStyle":"light", | ||
| 3 | - "navigationBarBackgroundColor": "#fff", | ||
| 4 | - "navigationBarTextStyle":"black", | ||
| 5 | - "usingComponents": { | ||
| 6 | - "nothingBook":"/components/book/nothing/nothing", | ||
| 7 | - "bookList":"/components/book/list/list", | ||
| 8 | - "nav":"/components/nav/nav", | ||
| 9 | - "tabBar":"/components/book/tabBar/tabBar", | ||
| 10 | - "calendar": "plugin://bmCalendar/calendar", | ||
| 11 | - "formids":"/components/formids/formids" | ||
| 12 | - } | ||
| 13 | -} |
pages/book/b_index.wxml
deleted
100644 → 0
| 1 | -<nav id="nav">订座</nav> | ||
| 2 | -<view class="page"> | ||
| 3 | -<block wx:if="{{isloading==true}}"> | ||
| 4 | - <view class="book-page bg_white"> | ||
| 5 | - <view class="book-search flex-lr"> | ||
| 6 | - <view class="flex-ll book-search-left"> | ||
| 7 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/search.png" class="search-icon"></image> | ||
| 8 | - <input placeholder="桌位/客户姓名/手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/> | ||
| 9 | - </view> | ||
| 10 | - <view bindtap="exportFile" class="exportFile flex-vc"> | ||
| 11 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/export.png" class="search-icon"></image> | ||
| 12 | - <view>导出</view> | ||
| 13 | - </view> | ||
| 14 | - </view> | ||
| 15 | - <view class="search-easy flex-lr"> | ||
| 16 | - <formids class="block flex-vc" bindtap="calendarShow"> | ||
| 17 | - <view class="flex-vc" > | ||
| 18 | - <view class="green-font font34r font-bold flex-cc">{{dateStr}}</view> | ||
| 19 | - </view> | ||
| 20 | - </formids> | ||
| 21 | - <view class="block section flex-vc"> | ||
| 22 | - <view class="tab flex-cc"> | ||
| 23 | - <formids class="item flex-vc {{form.time==0?'checked':''}}" | ||
| 24 | - wx:if="{{timePickerArray[0].length>0}}" | ||
| 25 | - bindtap="selectedValue" data-key="time" data-value="0">早市</formids> | ||
| 26 | - <formids class="item flex-cc {{form.time==1?'checked':''}}" | ||
| 27 | - wx:if="{{timePickerArray[1].length>0}}" | ||
| 28 | - bindtap="selectedValue" data-key="time" data-value="1">午市</formids> | ||
| 29 | - <formids class="item flex-cc {{form.time==2?'checked':''}}" | ||
| 30 | - wx:if="{{timePickerArray[2].length>0}}" | ||
| 31 | - bindtap="selectedValue" data-key="time" data-value="2">晚市</formids> | ||
| 32 | - </view> | ||
| 33 | - </view> | ||
| 34 | - </view> | ||
| 35 | - </view> | ||
| 36 | - <view class="book-list-cut flex-ll font26r black-font"> | ||
| 37 | - <text>已订 {{ReservesTotal}}</text> | ||
| 38 | - <text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDay.key">{{timeStrLabel[index]}} {{item}}</text> | ||
| 39 | - </view> | ||
| 40 | - <block wx:if="{{!bookList}}"> | ||
| 41 | - <nothingBook height="{{listHeight}}"></nothingBook> | ||
| 42 | - </block> | ||
| 43 | - <block wx:else> | ||
| 44 | - | ||
| 45 | - <view bindcsroll="onPullDownRefresh" class="bg_white"> | ||
| 46 | - | ||
| 47 | - <view class="book-list-thead flex-lr font34r black-font"> | ||
| 48 | - <view>桌号</view> | ||
| 49 | - <view class="flex-cc">客户姓名</view> | ||
| 50 | - <view class="flex-cc" bindtap="timeorder">时间<image src="http://qn.colorcun.com/custom/lite-yd/image/direction.png" class="icon22-26" background-size="cover"></image></view> | ||
| 51 | - <view class="flex-rr">操作</view> | ||
| 52 | - </view> | ||
| 53 | - <view class="book-list" style="padding-bottom:118rpx;"> | ||
| 54 | - <view class="book-list-body"> | ||
| 55 | - <block wx:for="{{bookList}}" wx:key="bookList.key"> | ||
| 56 | - <bookList item="{{item}}" class="orderbook"></bookList> | ||
| 57 | - </block> | ||
| 58 | - </view> | ||
| 59 | - </view> | ||
| 60 | - </view> | ||
| 61 | - </block> | ||
| 62 | -</block> | ||
| 63 | -</view> | ||
| 64 | -<tabBar></tabBar> | ||
| 65 | - | ||
| 66 | -<view class="calendar-mask" bindtap="calendarClose" | ||
| 67 | - style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}"> | ||
| 68 | - <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;"> | ||
| 69 | - <calendar catchtap="catchtap" | ||
| 70 | - isTodaybtn="{{true}}" todaybtn_txt="回到今天" | ||
| 71 | - custom="{{false}}" | ||
| 72 | - switchover="{{['上一月','下个月']}}" | ||
| 73 | - active-coloro="active-coloro" | ||
| 74 | - active-colort="active-colort" | ||
| 75 | - speciallist="{{speciallist}}" | ||
| 76 | - txt_style="txt-style" | ||
| 77 | - calendar-style="calendar" | ||
| 78 | - header-style="calendar-header" | ||
| 79 | - weektitle-style="weektitle-style" | ||
| 80 | - restcolor-style="restcolor-style" | ||
| 81 | - txt_type="cn-d" | ||
| 82 | - | ||
| 83 | - datefont-style="datefont-style" | ||
| 84 | - todaybtn-style="todaybtn-style" | ||
| 85 | - | ||
| 86 | - bindnextMonth="clickMonth" | ||
| 87 | - bindprevMonth="clickMonth" | ||
| 88 | - bindselectDate="dateChange" | ||
| 89 | - bindgotoday="gotoday" | ||
| 90 | - | ||
| 91 | - colored="#199095" | ||
| 92 | - circle_show="{{true}}" | ||
| 93 | - mystatus="{{ReservesCountMonth}}" | ||
| 94 | - dotcolor-o="dotcolor-o" | ||
| 95 | - dotcolor-t="dotcolor-t" | ||
| 96 | - allshow="{{true}}" | ||
| 97 | - ></calendar> | ||
| 98 | - </view> | ||
| 99 | -</view> |
pages/book/b_index.wxss
deleted
100644 → 0
| 1 | -page{ | ||
| 2 | - background:#efeef3; | ||
| 3 | -} | ||
| 4 | -.page{ | ||
| 5 | - width: 100%; | ||
| 6 | - margin: 0; | ||
| 7 | - overflow: hidden; | ||
| 8 | -} | ||
| 9 | -.book-page{ | ||
| 10 | - width:100%; | ||
| 11 | - padding-top:20rpx; | ||
| 12 | -} | ||
| 13 | -.book-search{ | ||
| 14 | - width:675rpx; | ||
| 15 | - height:80rpx; | ||
| 16 | - margin:0 auto; | ||
| 17 | -} | ||
| 18 | -.book-search-left{ | ||
| 19 | - width:590rpx; | ||
| 20 | - height:80rpx; | ||
| 21 | - border-radius:40rpx; | ||
| 22 | - box-shadow: 0 0 8px #ccc; | ||
| 23 | - margin:0 auto; | ||
| 24 | - margin-bottom:10rpx; | ||
| 25 | -} | ||
| 26 | -.search-icon{ | ||
| 27 | - width:40rpx; | ||
| 28 | - height:40rpx; | ||
| 29 | - margin-left:30rpx; | ||
| 30 | -} | ||
| 31 | -.search-input{ | ||
| 32 | - width:520rpx; | ||
| 33 | - height:100%; | ||
| 34 | - padding:10rpx; | ||
| 35 | - box-sizing:border-box; | ||
| 36 | -} | ||
| 37 | -.book-list-thead{ | ||
| 38 | - width:100%; | ||
| 39 | - height:120rpx; | ||
| 40 | - padding:0 40rpx; | ||
| 41 | - box-sizing:border-box; | ||
| 42 | - font-weight:400; | ||
| 43 | - border-bottom: 2rpx solid #F1F0F4; | ||
| 44 | -} | ||
| 45 | -.book-list-thead>view{ | ||
| 46 | - width:25%; | ||
| 47 | -} | ||
| 48 | -.icon22-26{ | ||
| 49 | - width:22rpx; | ||
| 50 | - height:26rpx; | ||
| 51 | - margin-left:8rpx; | ||
| 52 | -} | ||
| 53 | -.book-list-body{ | ||
| 54 | - width:100%; | ||
| 55 | - height:auto; | ||
| 56 | - box-sizing:border-box; | ||
| 57 | -} | ||
| 58 | -.book-list-cut{ | ||
| 59 | - height:66rpx; | ||
| 60 | - background:#F5F5F5; | ||
| 61 | - padding-left:44rpx; | ||
| 62 | - font-size: 26rpx; | ||
| 63 | - line-height: 66rpx; | ||
| 64 | -} | ||
| 65 | -.book-list-cut text{ | ||
| 66 | - margin-right: 50rpx; | ||
| 67 | -} | ||
| 68 | -.border-line{ | ||
| 69 | - width:670rpx; | ||
| 70 | - height:1px; | ||
| 71 | - background:#efeef3; | ||
| 72 | - margin:0 auto; | ||
| 73 | -} | ||
| 74 | - | ||
| 75 | -.search-easy{ | ||
| 76 | - height:80rpx; | ||
| 77 | - padding:20rpx 0; | ||
| 78 | -} | ||
| 79 | -.search-easy .block{ | ||
| 80 | - width: 50%; | ||
| 81 | - min-width: 50%; | ||
| 82 | - height: 100%; | ||
| 83 | -} | ||
| 84 | -.search-easy .block:first-child{ | ||
| 85 | - border-right: 1px solid #E0E0E0; | ||
| 86 | -} | ||
| 87 | -.section .tab{ | ||
| 88 | - font-size: 34rpx; | ||
| 89 | - color: #199095; | ||
| 90 | - height: 50rpx; | ||
| 91 | -} | ||
| 92 | -.section .tab .item{ | ||
| 93 | - height: 50rpx; | ||
| 94 | - line-height: 49rpx; | ||
| 95 | - width: 94rpx !important; | ||
| 96 | - min-width: 94rpx !important; | ||
| 97 | - border-radius: 10rpx; | ||
| 98 | - border: 2rpx solid #199095; | ||
| 99 | - margin-right: 16rpx; | ||
| 100 | - text-align: center; | ||
| 101 | - display: block; | ||
| 102 | -} | ||
| 103 | -.section .tab .item:after{ | ||
| 104 | - padding-right: 5rpx; | ||
| 105 | -} | ||
| 106 | -.section .tab .checked{ | ||
| 107 | - background-color:#199095; | ||
| 108 | - color: #FEFEFE; | ||
| 109 | -} | ||
| 110 | -.exportFile{ | ||
| 111 | - font-size: 26rpx; | ||
| 112 | - color:#353535; | ||
| 113 | -} | ||
| 114 | -.exportFile image{ | ||
| 115 | - width: 32rpx; | ||
| 116 | - height: 32rpx; | ||
| 117 | - margin: 0 auto 8rpx; | ||
| 118 | -} | ||
| 119 | - | ||
| 120 | - | ||
| 121 | -@import "common/calendar.wxss"; |
pages/book/b_info.js
deleted
100644 → 0
| 1 | -var util = require('../../utils/util.js') | ||
| 2 | -var uri=require('../../utils/uri.js') | ||
| 3 | -var bookOrder=require('../../utils/bookCommon.js') | ||
| 4 | -const {regeneratorRuntime} = global | ||
| 5 | -Page({ | ||
| 6 | - data:{ | ||
| 7 | - grand:[ | ||
| 8 | - { | ||
| 9 | - sex:1, | ||
| 10 | - grand_title:'先生', | ||
| 11 | - isselect:true | ||
| 12 | - }, | ||
| 13 | - { | ||
| 14 | - sex:2, | ||
| 15 | - grand_title:'女士', | ||
| 16 | - isselect:false | ||
| 17 | - } | ||
| 18 | - ], | ||
| 19 | - name:'', | ||
| 20 | - sex:1, | ||
| 21 | - phone:'', | ||
| 22 | - remark:'', | ||
| 23 | - buttonhide:true, | ||
| 24 | - pnum:'6' | ||
| 25 | - }, | ||
| 26 | - onLoad:function(opt){ | ||
| 27 | - wx.removeStorage({ | ||
| 28 | - key:'tableid', | ||
| 29 | - }) | ||
| 30 | - wx.removeStorage({ | ||
| 31 | - key:'tabletype', | ||
| 32 | - }) | ||
| 33 | - util.setBarTitle('录入订座信息'); | ||
| 34 | - var selectmonth=opt.date.split('-')[0][0]=='0' ? opt.date.split('-')[0][1] : opt.date.split('-')[0]; | ||
| 35 | - var selectday=opt.date.split('-')[1][0]=='0' ? opt.date.split('-')[1][1] : opt.date.split('-')[1]; | ||
| 36 | - console.log(opt) | ||
| 37 | - var stringTime =opt.year+'-'+opt.date+' ' +opt.time+':00'; | ||
| 38 | - console.log(stringTime) | ||
| 39 | - var time=bookOrder.gettimestamp(stringTime); | ||
| 40 | - console.log(time) | ||
| 41 | - this.setData({ | ||
| 42 | - thisyear:opt.year, | ||
| 43 | - selectdate:selectmonth+'月'+selectday+'日', | ||
| 44 | - time_dur:opt.time, | ||
| 45 | - sellerid:util.cache('sellerid'), | ||
| 46 | - time:time, | ||
| 47 | - pnum:util.cache('order_pnum') ? util.cache('order_pnum') : this.data.pnum, | ||
| 48 | - }) | ||
| 49 | - this.getdesklist(); | ||
| 50 | - }, | ||
| 51 | - onShow:function(){ | ||
| 52 | - var that=this; | ||
| 53 | - if(util.cache('tableid')){ | ||
| 54 | - var tables=util.cache('tableid'); | ||
| 55 | - var templist=this.data.templist; | ||
| 56 | - var showdesk=[]; | ||
| 57 | - for(var i=0;i<tables.length;i++){ | ||
| 58 | - templist.forEach(function(r,n){ | ||
| 59 | - if(tables[i]==r.id){ | ||
| 60 | - r.isselect=true; | ||
| 61 | - if(r.tid==2){ | ||
| 62 | - r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name; | ||
| 63 | - showdesk.unshift(r); | ||
| 64 | - }else { | ||
| 65 | - r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name; | ||
| 66 | - showdesk.push(r); | ||
| 67 | - } | ||
| 68 | - } | ||
| 69 | - }) | ||
| 70 | - } | ||
| 71 | - this.setData({ | ||
| 72 | - showdesk:showdesk.slice(0,2) | ||
| 73 | - }) | ||
| 74 | - } | ||
| 75 | - if(util.cache('tableid') && util.cache('tableid').length>0){ | ||
| 76 | - if(this.data.name!='' && this.data.phone!='' && !this.data.reminder){ | ||
| 77 | - this.setData({ | ||
| 78 | - buttonhide:false | ||
| 79 | - }) | ||
| 80 | - } | ||
| 81 | - } | ||
| 82 | - util.postSuccessFun=function(json,uri_code){ | ||
| 83 | - switch (uri_code) { | ||
| 84 | - case uri.CGI_USER_SETRESERVEINFO__CODE: | ||
| 85 | - wx.hideLoading() | ||
| 86 | - if(json.ret==200){ | ||
| 87 | - wx.reLaunch({ | ||
| 88 | - url:util.http_build_query(json.data,'b_detail') | ||
| 89 | - }) | ||
| 90 | - } | ||
| 91 | - break; | ||
| 92 | - case uri.CGI_USER_GETTABLELIST__CODE: | ||
| 93 | - console.log('xxxx',json.data); | ||
| 94 | - var list=json.data; | ||
| 95 | - var templist=[]; | ||
| 96 | - for(var key in list){ | ||
| 97 | - if(key!='typex' && key!='typey'){ | ||
| 98 | - list[key].list.forEach(function(v,i){ | ||
| 99 | - templist.push(v) | ||
| 100 | - }) | ||
| 101 | - | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | - var tempsan=[]; | ||
| 105 | - var tempbao=[]; | ||
| 106 | - var showdesk=[]; | ||
| 107 | - var temp={}; | ||
| 108 | - templist.forEach(function(v,i){ | ||
| 109 | - v.name=v.name.length>4 ? v.name.slice(0,3)+'...' : v.name; | ||
| 110 | - if(!v.r_status){ | ||
| 111 | - if(v.tid==2){ | ||
| 112 | - tempbao.push(v); | ||
| 113 | - v.isselect=false; | ||
| 114 | - showdesk.unshift(v); | ||
| 115 | - }else{ | ||
| 116 | - tempsan.push(v); | ||
| 117 | - v.isselect=false; | ||
| 118 | - showdesk.push(v); | ||
| 119 | - } | ||
| 120 | - } | ||
| 121 | - if(v.tid==2){ | ||
| 122 | - if(!temp.hasOwnProperty("tabletype_2")){ | ||
| 123 | - temp['tabletype_2']=true | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - }else{ | ||
| 127 | - if(!temp.hasOwnProperty("tabletype_1")){ | ||
| 128 | - temp['tabletype_1']=true | ||
| 129 | - } | ||
| 130 | - } | ||
| 131 | - }) | ||
| 132 | - util.cache('tabletype',temp); | ||
| 133 | - console.log(showdesk) | ||
| 134 | - that.setData({ | ||
| 135 | - sancount:list.typex, //typex散座 | ||
| 136 | - baocount:list.typey, //typey包间 | ||
| 137 | - showdesk:showdesk.slice(0,2), | ||
| 138 | - templist:templist | ||
| 139 | - | ||
| 140 | - }) | ||
| 141 | - break; | ||
| 142 | - } | ||
| 143 | - } | ||
| 144 | - }, | ||
| 145 | - changetime:function(){ | ||
| 146 | - wx.navigateBack() | ||
| 147 | - }, | ||
| 148 | - selectgrand:function(e){ | ||
| 149 | - var sex=e.currentTarget.dataset.sex; | ||
| 150 | - console.log(sex) | ||
| 151 | - var grandlist=this.data.grand; | ||
| 152 | - grandlist.forEach(function(v,i){ | ||
| 153 | - v.isselect=false; | ||
| 154 | - if(v.sex==sex){ | ||
| 155 | - v.isselect=true; | ||
| 156 | - } | ||
| 157 | - }) | ||
| 158 | - this.setData({ | ||
| 159 | - grand:grandlist, | ||
| 160 | - sex:sex | ||
| 161 | - }) | ||
| 162 | - }, | ||
| 163 | - condition:function(e){ | ||
| 164 | - var name=this.data.name; | ||
| 165 | - var phone=e.detail.value; | ||
| 166 | - var regExp = /^(86)?((13\d{9})|(15[0,1,2,3,5,6,7,8,9]\d{8})|(18[0,5,6,7,8,9]\d{8}))$/ | ||
| 167 | - if(!(regExp.test(phone))){ | ||
| 168 | - this.setData({ | ||
| 169 | - reminder:'手机格式不正确' | ||
| 170 | - }) | ||
| 171 | - }else{ | ||
| 172 | - this.setData({ | ||
| 173 | - reminder:null | ||
| 174 | - }) | ||
| 175 | - } | ||
| 176 | - if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){ | ||
| 177 | - this.setData({ | ||
| 178 | - buttonhide:false | ||
| 179 | - }) | ||
| 180 | - } | ||
| 181 | - }, | ||
| 182 | - changename:function(e){ | ||
| 183 | - this.setData({ | ||
| 184 | - name:e.detail.value | ||
| 185 | - }) | ||
| 186 | - }, | ||
| 187 | - changephone:function(e){ | ||
| 188 | - this.setData({ | ||
| 189 | - phone:e.detail.value | ||
| 190 | - }) | ||
| 191 | - }, | ||
| 192 | - changeremark:function(e){ | ||
| 193 | - this.setData({ | ||
| 194 | - remark:e.detail.value | ||
| 195 | - }) | ||
| 196 | - }, | ||
| 197 | - ifAll:function(){ | ||
| 198 | - var name=this.data.name; | ||
| 199 | - var phone=this.data.phone; | ||
| 200 | - if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){ | ||
| 201 | - this.setData({ | ||
| 202 | - buttonhide:false | ||
| 203 | - }) | ||
| 204 | - } | ||
| 205 | - }, | ||
| 206 | - formsubmit:async function(){ | ||
| 207 | - wx.showLoading({ | ||
| 208 | - title:'正在预定', | ||
| 209 | - mask:true | ||
| 210 | - }); | ||
| 211 | - console.log(this.data.time) | ||
| 212 | - var formData={ | ||
| 213 | - sid:this.data.sellerid, | ||
| 214 | - tid:util.cache('tableid').toString(), | ||
| 215 | - rname:this.data.name, //姓名 | ||
| 216 | - phone:this.data.phone, //手机号 | ||
| 217 | - sex:this.data.sex, //性别 | ||
| 218 | - pnum:this.data.pnum, //人数 | ||
| 219 | - rdate:this.data.time, //时间 | ||
| 220 | - cusdem:this.data.remark //备注 | ||
| 221 | - } | ||
| 222 | - try{ | ||
| 223 | - let enter_params=util.cache('enter_params'); | ||
| 224 | - let manager_id=enter_params.manager_id; | ||
| 225 | - if(manager_id){ | ||
| 226 | - let sc=(await App.Reserve.SellerInfo(enter_params)).data | ||
| 227 | - let managers=sc.manager; | ||
| 228 | - managers.forEach(man=>{ | ||
| 229 | - if(manager_id==man.id){ | ||
| 230 | - formData.cusman_id=man.id; | ||
| 231 | - formData.cusman=man.user_name; | ||
| 232 | - formData.cusman_phone=man.user_phone?man.user_phone:''; | ||
| 233 | - formData.cusman_account=man.user_wechat?man.user_wechat:''; | ||
| 234 | - } | ||
| 235 | - }) | ||
| 236 | - } | ||
| 237 | - | ||
| 238 | - | ||
| 239 | - let man=managers[mansIndex]; | ||
| 240 | - if(man){ | ||
| 241 | - App.Reserve.SetReserveCusman({ | ||
| 242 | - rid:this.data.bookInfo.id, | ||
| 243 | - cusman_id:man.id, | ||
| 244 | - cusman:man.user_name, | ||
| 245 | - cusman_phone:man.user_phone?man.user_phone:'158777556369', | ||
| 246 | - cusman_account:man.user_wechat?man.user_wechat:'', | ||
| 247 | - }); | ||
| 248 | - } | ||
| 249 | - }catch (e){} | ||
| 250 | - console.log(formData) | ||
| 251 | - util.post(uri.CGI_USER_SETRESERVEINFO,formData,uri.CGI_USER_SETRESERVEINFO__CODE) | ||
| 252 | - }, | ||
| 253 | - changepnum:function(e){ | ||
| 254 | - console.log(e) | ||
| 255 | - this.setData({ | ||
| 256 | - pnum:e.detail | ||
| 257 | - }) | ||
| 258 | - this.getdesklist(); | ||
| 259 | - }, | ||
| 260 | - selectdesk:function(){ | ||
| 261 | - wx.navigateTo({ | ||
| 262 | - url:'b_desk?pnum='+this.data.pnum+'&year='+this.data.thisyear+'&date='+this.data.selectdate+'&time_dur='+this.data.time_dur | ||
| 263 | - }) | ||
| 264 | - }, | ||
| 265 | - getdesklist:function(){ | ||
| 266 | - util.post(uri.CGI_USER_GETTABLELIST,{sid:this.data.sellerid,pnum:parseInt(this.data.pnum),rdate:this.data.time},uri.CGI_USER_GETTABLELIST__CODE) | ||
| 267 | - }, | ||
| 268 | - binddesk:function(e){ | ||
| 269 | - var id=e.currentTarget.dataset.id; | ||
| 270 | - var tables=util.cache('tableid') ? util.cache('tableid') : []; | ||
| 271 | - var showdesk=this.data.showdesk; | ||
| 272 | - showdesk.forEach(function(v,i){ | ||
| 273 | - if(v.id==id){ | ||
| 274 | - if(v.isselect==true){ | ||
| 275 | - var thisindex=tables.indexOf(id); | ||
| 276 | - tables.splice(thisindex,1) | ||
| 277 | - }else{ | ||
| 278 | - tables.push(id) | ||
| 279 | - } | ||
| 280 | - v.isselect=!v.isselect | ||
| 281 | - } | ||
| 282 | - }) | ||
| 283 | - util.cache('tableid',tables); | ||
| 284 | - this.setData({ | ||
| 285 | - showdesk:showdesk | ||
| 286 | - }) | ||
| 287 | - var name=this.data.name; | ||
| 288 | - var phone=this.data.phone; | ||
| 289 | - if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){ | ||
| 290 | - this.setData({ | ||
| 291 | - buttonhide:false | ||
| 292 | - }) | ||
| 293 | - } | ||
| 294 | - } | ||
| 295 | -}) |
pages/book/b_info.json
deleted
100644 → 0
pages/book/b_info.wxml
deleted
100644 → 0
| 1 | -<nav>点餐商户端</nav> | ||
| 2 | -<step step="1"></step> | ||
| 3 | -<view class="other-info flex-lr"> | ||
| 4 | - <view class="selected-time flex-vc" bindtap="changetime"> | ||
| 5 | - <view class="font30r black-font">时间</view> | ||
| 6 | - <view class="actual-time green-font font34r">{{selectdate}} {{time_dur}}</view> | ||
| 7 | - </view> | ||
| 8 | - <selectPeople bind:changepnum="changepnum" pnum="{{pnum}}"></selectPeople> | ||
| 9 | -</view> | ||
| 10 | -<view class="border-line"></view> | ||
| 11 | - | ||
| 12 | -<view class="advice-desk flex-lr"> | ||
| 13 | - <view class="black-font font30r">桌位</view> | ||
| 14 | - <view> | ||
| 15 | - <view class="font26r gray-deep-font flex-rr">(包间余{{baocount}}个,散座余{{sancount}}个)</view> | ||
| 16 | - <view class="advice-desk-detail flex-rr"> | ||
| 17 | - <block wx:for="{{showdesk}}"> | ||
| 18 | - <block wx:if="{{item.tid==2}}"> | ||
| 19 | - <view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}"> | ||
| 20 | - <view class="flex-vc order-desk-detail"> | ||
| 21 | - <view class="font28r black-font smooth">{{item.name}}</view> | ||
| 22 | - <view class="font26r black-font" style="margin-top:6rpx;">{{item.table_pnum}}人</view> | ||
| 23 | - </view> | ||
| 24 | - <view class="order-desk-type flex-cc white-font font20r">包间</view> | ||
| 25 | - </view> | ||
| 26 | - </block> | ||
| 27 | - <block wx:else> | ||
| 28 | - <view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}"> | ||
| 29 | - <view class="flex-vc order-desk-detail" style="height:100%;"> | ||
| 30 | - <view class="font28r black-font smooth">{{item.name}}</view> | ||
| 31 | - <view class="font26r black-font" style="margin-top:6rpx;">6人</view> | ||
| 32 | - </view> | ||
| 33 | - </view> | ||
| 34 | - </block> | ||
| 35 | - </block> | ||
| 36 | - <view class="flex-rr advice-more" bindtap="selectdesk"> | ||
| 37 | - <view style="padding-right:30rpx;" class="gray-deep-font font26r">更多</view> | ||
| 38 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image> | ||
| 39 | - </view> | ||
| 40 | - </view> | ||
| 41 | - </view> | ||
| 42 | -</view> | ||
| 43 | -<view class="cut"></view> | ||
| 44 | - | ||
| 45 | - | ||
| 46 | -<view class="book-info" style="margin-bottom: 205rpx;"> | ||
| 47 | - <view class="book-info-single flex-lr" style="align-items:flex-start;"> | ||
| 48 | - <input placeholder="请输入预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{name}}" bindinput="changename" bindblur="ifAll"/> | ||
| 49 | - <view class="book-info-grand flex-rr font28r gray-deep-font"> | ||
| 50 | - <block wx:for="{{grand}}"> | ||
| 51 | - <view class="book-grand flex-cc {{index==0 ? 'book-grand-border' : ''}} {{item.isselect==true ? 'book-grand-active white-font' : ''}}" bindtap="selectgrand" data-sex="{{item.sex}}">{{item.grand_title}}</view> | ||
| 52 | - </block> | ||
| 53 | - </view> | ||
| 54 | - </view> | ||
| 55 | - <view class="book-info-single flex-lr" style="align-items:flex-start;"> | ||
| 56 | - <input placeholder="请输入预订人手机号码(必填)" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11" bindblur="condition" bindinput="changephone" value="{{phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;"/> | ||
| 57 | - <block wx:if="{{reminder}}"> | ||
| 58 | - <view class="flex-rr" style="height:100rpx;"> | ||
| 59 | - <view style="color:#E14553;" class="font28r">{{reminder}}</view> | ||
| 60 | - <image src="http://qn.colorcun.com/custom/lite-yd/image/name-have.png" class="phone-reminder"></image> | ||
| 61 | - </view> | ||
| 62 | - </block> | ||
| 63 | - </view> | ||
| 64 | - <view class="book-info-single"> | ||
| 65 | - <input placeholder="请输入顾客要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{remark}}" bindinput="changeremark"/> | ||
| 66 | - </view> | ||
| 67 | -</view> | ||
| 68 | -<view class="zhanwei"> | ||
| 69 | - <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view> | ||
| 70 | -</view> |
pages/book/b_info.wxss
deleted
100644 → 0
| 1 | -view{ | ||
| 2 | - line-height:1.2; | ||
| 3 | -} | ||
| 4 | -.other-info{ | ||
| 5 | - width:100%; | ||
| 6 | - height:220rpx; | ||
| 7 | - padding:20rpx 0; | ||
| 8 | - box-sizing:border-box; | ||
| 9 | -} | ||
| 10 | -.selected-time{ | ||
| 11 | - width:375rpx; | ||
| 12 | - height:100%; | ||
| 13 | - border-right:1px solid #efeef3; | ||
| 14 | - box-sizing:border-box; | ||
| 15 | -} | ||
| 16 | -.actual-time{ | ||
| 17 | - margin-top:30rpx; | ||
| 18 | -} | ||
| 19 | -.border-line{ | ||
| 20 | - width:680rpx; | ||
| 21 | - height:1px; | ||
| 22 | - background:#efeef3; | ||
| 23 | - margin:0 auto; | ||
| 24 | -} | ||
| 25 | -.advice-desk{ | ||
| 26 | - width:680rpx; | ||
| 27 | - height:auto; | ||
| 28 | - padding:40rpx 0; | ||
| 29 | - margin:0 auto; | ||
| 30 | -} | ||
| 31 | -.advice-desk-detail{ | ||
| 32 | - margin-top:30rpx; | ||
| 33 | -} | ||
| 34 | -.order-desk-info{ | ||
| 35 | - width:120rpx; | ||
| 36 | - height:120rpx; | ||
| 37 | - background:#EBF8F8; | ||
| 38 | - border:1px solid #199095; | ||
| 39 | - border-radius:10rpx; | ||
| 40 | - position:relative; | ||
| 41 | - overflow:hidden; | ||
| 42 | - margin-right:40rpx; | ||
| 43 | -} | ||
| 44 | -.desk-active{ | ||
| 45 | - background:#A9E3E6; | ||
| 46 | -} | ||
| 47 | -.order-desk-detail{ | ||
| 48 | - width:100%; | ||
| 49 | - height:90rpx; | ||
| 50 | -} | ||
| 51 | -.order-desk-type{ | ||
| 52 | - width:100%; | ||
| 53 | - height:30rpx; | ||
| 54 | - background:#199095; | ||
| 55 | - position:absolute; | ||
| 56 | - left:0; | ||
| 57 | - bottom:0; | ||
| 58 | -} | ||
| 59 | -.advice-more{ | ||
| 60 | - padding:20rpx 0; | ||
| 61 | - padding-left:30rpx; | ||
| 62 | -} | ||
| 63 | -.cut{ | ||
| 64 | - width:100%; | ||
| 65 | - height:4px; | ||
| 66 | - background:#efeef3; | ||
| 67 | -} | ||
| 68 | - | ||
| 69 | - | ||
| 70 | - | ||
| 71 | -.book-info{ | ||
| 72 | - width:680rpx; | ||
| 73 | - padding-top:20rpx; | ||
| 74 | - margin:0 auto; | ||
| 75 | -} | ||
| 76 | -.book-info-single{ | ||
| 77 | - width:100%; | ||
| 78 | - height:120rpx; | ||
| 79 | - padding-top:80rpx; | ||
| 80 | - border-bottom:1px solid #efeef3; | ||
| 81 | -} | ||
| 82 | -.book-info-single>input{ | ||
| 83 | - width:100%; | ||
| 84 | - height:100rpx; | ||
| 85 | -} | ||
| 86 | -.book-info-grand{ | ||
| 87 | - height:50rpx; | ||
| 88 | - border:1px solid #199095; | ||
| 89 | - margin-top:20rpx; | ||
| 90 | -} | ||
| 91 | -.book-grand{ | ||
| 92 | - width:90rpx; | ||
| 93 | - height:100%; | ||
| 94 | - box-sizing:border-box; | ||
| 95 | -} | ||
| 96 | -.book-grand-active{ | ||
| 97 | - background:rgba(25,153,149,.8); | ||
| 98 | -} | ||
| 99 | -.book-grand-border{ | ||
| 100 | - border-right:1px solid #199095; | ||
| 101 | -} | ||
| 102 | -.phone-reminder{ | ||
| 103 | - width:32rpx; | ||
| 104 | - height:32rpx; | ||
| 105 | - margin-left:20rpx; | ||
| 106 | -} | ||
| 107 | - | ||
| 108 | -.zhanwei{ | ||
| 109 | - width:100%; | ||
| 110 | - height:170rpx; | ||
| 111 | - background:#efeef3; | ||
| 112 | - position:fixed; | ||
| 113 | - left:0; | ||
| 114 | - right:0; | ||
| 115 | - bottom:0; | ||
| 116 | - z-index: 99; | ||
| 117 | -} | ||
| 118 | - | ||
| 119 | - | ||
| 120 | -.confirm-button{ | ||
| 121 | - width:680rpx; | ||
| 122 | - height:85rpx; | ||
| 123 | - background:#199095; | ||
| 124 | - margin:42rpx auto 0; | ||
| 125 | - border-radius:10rpx; | ||
| 126 | - opacity:.6; | ||
| 127 | -} | ||
| 128 | -.confirm-button-active{ | ||
| 129 | - opacity:1; | ||
| 130 | -} |
pages/book/b_invitation.js
deleted
100644 → 0
| 1 | -// pages/manager-invitation/review.js | ||
| 2 | -import util from '../../utils/util'; | ||
| 3 | -import App from '../../utils/api'; | ||
| 4 | -import TP from '../../utils/tpls'; | ||
| 5 | -const {regeneratorRuntime} = global | ||
| 6 | -Page({ | ||
| 7 | - | ||
| 8 | - /** | ||
| 9 | - * 页面的初始数据 | ||
| 10 | - */ | ||
| 11 | - data: { | ||
| 12 | - height: 667, | ||
| 13 | - current: 0, | ||
| 14 | - tpls: TP.tpls(), | ||
| 15 | - seller:{ | ||
| 16 | - name:'', | ||
| 17 | - room:'', | ||
| 18 | - date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'), | ||
| 19 | - addr:'', | ||
| 20 | - hasOwner:true, | ||
| 21 | - }, | ||
| 22 | - options:{}, | ||
| 23 | - }, | ||
| 24 | - detail:{}, | ||
| 25 | - | ||
| 26 | - /** | ||
| 27 | - * 生命周期函数--监听页面加载 | ||
| 28 | - */ | ||
| 29 | - onLoad: function (options) { | ||
| 30 | - options.tplid=options.tplid||1; | ||
| 31 | - let param={ | ||
| 32 | - options:options, | ||
| 33 | - } | ||
| 34 | - if(true){ | ||
| 35 | - param.tpls=[TP.tpls(options.tplid)] | ||
| 36 | - } | ||
| 37 | - this.setData(param) | ||
| 38 | - this.initData(options); | ||
| 39 | - }, | ||
| 40 | - initData(options){ | ||
| 41 | - App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{ | ||
| 42 | - this.detail=res.data; | ||
| 43 | - let tables=[]; | ||
| 44 | - res.data.tables.forEach(t=>{ | ||
| 45 | - tables.push(t.name); | ||
| 46 | - }) | ||
| 47 | - this.setData({ | ||
| 48 | - seller:{ | ||
| 49 | - name:res.data.seller.sellername, | ||
| 50 | - room:tables.join('、'), | ||
| 51 | - date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr), | ||
| 52 | - addr:res.data.seller.real_address||res.data.seller.map_address, | ||
| 53 | - image:res.data.image_url, | ||
| 54 | - hasOwner:true, | ||
| 55 | - } | ||
| 56 | - }) | ||
| 57 | - }) | ||
| 58 | - }, | ||
| 59 | - /** | ||
| 60 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 61 | - */ | ||
| 62 | - onReady: function () { | ||
| 63 | - | ||
| 64 | - }, | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * 生命周期函数--监听页面显示 | ||
| 68 | - */ | ||
| 69 | - onShow: function () { | ||
| 70 | - //导航栏自适应 | ||
| 71 | - let systemInfo = wx.getSystemInfoSync(); | ||
| 72 | - let reg = /ios/i; | ||
| 73 | - let pt = 20;//导航状态栏上内边距 | ||
| 74 | - let h = 44;//导航状态栏高度 | ||
| 75 | - if (reg.test(systemInfo.system)) { | ||
| 76 | - pt = systemInfo.statusBarHeight; | ||
| 77 | - h = 44; | ||
| 78 | - } else { | ||
| 79 | - pt = systemInfo.statusBarHeight; | ||
| 80 | - h = 48; | ||
| 81 | - } | ||
| 82 | - this.setData({ | ||
| 83 | - statusBarHeight: pt, | ||
| 84 | - titleBarHeight: h, | ||
| 85 | - height: systemInfo.windowHeight | ||
| 86 | - }) | ||
| 87 | - }, | ||
| 88 | - | ||
| 89 | - /** | ||
| 90 | - * 生命周期函数--监听页面隐藏 | ||
| 91 | - */ | ||
| 92 | - onHide: function () { | ||
| 93 | - | ||
| 94 | - }, | ||
| 95 | - | ||
| 96 | - /** | ||
| 97 | - * 生命周期函数--监听页面卸载 | ||
| 98 | - */ | ||
| 99 | - onUnload: function () { | ||
| 100 | - | ||
| 101 | - }, | ||
| 102 | - | ||
| 103 | - /** | ||
| 104 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 105 | - */ | ||
| 106 | - onPullDownRefresh: function () { | ||
| 107 | - | ||
| 108 | - }, | ||
| 109 | - | ||
| 110 | - /** | ||
| 111 | - * 页面上拉触底事件的处理函数 | ||
| 112 | - */ | ||
| 113 | - onReachBottom: function () { | ||
| 114 | - | ||
| 115 | - }, | ||
| 116 | - | ||
| 117 | - /** | ||
| 118 | - * 用户点击右上角分享 | ||
| 119 | - */ | ||
| 120 | - onShareAppMessage: function () { | ||
| 121 | - let path=util.http_build_query({ | ||
| 122 | - ...this.data.options, | ||
| 123 | - fromid:getApp().openid, | ||
| 124 | - hasSellerShare:1, | ||
| 125 | - hasInvitation:1, | ||
| 126 | - },'/pages/customer/index') | ||
| 127 | - return { | ||
| 128 | - title: this.data.tpls[this.data.current].shareFirstTitle, | ||
| 129 | - path: path, | ||
| 130 | - imageUrl:this.data.tpls[this.data.current].shareFirstImage, | ||
| 131 | - } | ||
| 132 | - }, | ||
| 133 | - swiperChange(e){ | ||
| 134 | - let current=e.detail.current | ||
| 135 | - this.setData({ | ||
| 136 | - current:current, | ||
| 137 | - [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr) | ||
| 138 | - }) | ||
| 139 | - }, | ||
| 140 | - switchTabs(e){ | ||
| 141 | - let current=util.attr(e,'current') | ||
| 142 | - this.setData({ | ||
| 143 | - current:current, | ||
| 144 | - [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr) | ||
| 145 | - }) | ||
| 146 | - }, | ||
| 147 | - sendmsg(){ | ||
| 148 | - if (!this.detail.phone) { | ||
| 149 | - util.toast('未填写手机号码', 'none') | ||
| 150 | - return; | ||
| 151 | - } else if (!/^1\d{10}$/.test(this.detail.phone)) { | ||
| 152 | - util.toast('手机号码错误', 'none') | ||
| 153 | - return; | ||
| 154 | - } | ||
| 155 | - wx.navigateTo({ | ||
| 156 | - url: '/pages/book/b_sms?id=' + this.detail.id | ||
| 157 | - }); | ||
| 158 | - }, | ||
| 159 | - gotoDetail(){ | ||
| 160 | - wx.redirectTo({ | ||
| 161 | - url: '/pages/book/b_detail?id=' + this.detail.id | ||
| 162 | - }); | ||
| 163 | - } | ||
| 164 | -}) |
pages/book/b_invitation.json
deleted
100644 → 0
pages/book/b_invitation.wxml
deleted
100644 → 0
| 1 | -<import src="../tpl/invitation"></import> | ||
| 2 | -<swiper | ||
| 3 | - indicator-dots="{{false}}" | ||
| 4 | - autoplay="{{false}}" | ||
| 5 | - duration="{{500}}" | ||
| 6 | - bindchange="swiperChange" | ||
| 7 | - current="{{current}}" | ||
| 8 | - style="height:{{height}}px;" | ||
| 9 | -> | ||
| 10 | - <block wx:for="{{tpls}}" wx:key="tpls.key"> | ||
| 11 | - <swiper-item> | ||
| 12 | - <view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;width:100%;"> | ||
| 13 | - <template is="tpl-{{item.id}}" data="{{seller,options}}"></template> | ||
| 14 | - </view> | ||
| 15 | - </swiper-item> | ||
| 16 | - </block> | ||
| 17 | -</swiper> | ||
| 18 | -<view class="flex-vc" | ||
| 19 | - style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;"> | ||
| 20 | - <view class="tabs flex-ll"> | ||
| 21 | - <formids class="back" bindclick="gotoDetail" > | ||
| 22 | - <view style="min-width: 100rpx;" class="flex-ll"> | ||
| 23 | - <image class="back-image" | ||
| 24 | - src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image> | ||
| 25 | - </view> | ||
| 26 | - </formids> | ||
| 27 | - <block wx:if="{{false}}" wx:for="{{tpls}}" wx:key="tpls.key"> | ||
| 28 | - <view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view> | ||
| 29 | - </block> | ||
| 30 | - </view> | ||
| 31 | -</view> | ||
| 32 | -<view class="bottom flex-lr"> | ||
| 33 | - <formids bindclick="sendmsg" class="sendmsg"> | ||
| 34 | - 发短信 | ||
| 35 | - </formids> | ||
| 36 | - <userinfo-share binduserinfo="share" class="share Semibold"> | ||
| 37 | - 通知客户 | ||
| 38 | - </userinfo-share> | ||
| 39 | -</view> | ||
| 40 | -<!--//商务--> | ||
| 41 | -<template name="tpl-1"> | ||
| 42 | - <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}"> | ||
| 43 | - <template is="tpl-shangwu" data="{{...seller,options}}"></template> | ||
| 44 | - </view> | ||
| 45 | -</template> | ||
| 46 | - | ||
| 47 | -<!--//温馨--> | ||
| 48 | -<template name="tpl-2"> | ||
| 49 | - <template is="tpl-wenxin" data="{{...seller,options}}"></template> | ||
| 50 | -</template> |
pages/book/b_invitation.wxss
deleted
100644 → 0
| 1 | -@import "../manager-invitation/tpls.wxss"; | ||
| 2 | -.pages{ | ||
| 3 | - background-size: 100%; | ||
| 4 | - font-size: 34rpx; | ||
| 5 | -} | ||
| 6 | -.tabs{ | ||
| 7 | -} | ||
| 8 | -.tabs .item{ | ||
| 9 | - font-size: 32rpx; | ||
| 10 | - color:#999999; | ||
| 11 | - margin-left: 20rpx; | ||
| 12 | - padding: 0 10rpx; | ||
| 13 | - height: 66rpx; | ||
| 14 | - line-height: 66rpx; | ||
| 15 | -} | ||
| 16 | -.tabs .item.active{ | ||
| 17 | - font-size: 36rpx; | ||
| 18 | - font-weight: bold; | ||
| 19 | - color: #E9D9B7; | ||
| 20 | - border-bottom: 2rpx solid #E9D9B7; | ||
| 21 | -} | ||
| 22 | -image{ | ||
| 23 | - width: 100%; | ||
| 24 | - height: 100%; | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | -.buts-share{ | ||
| 28 | - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png"); | ||
| 29 | -} | ||
| 30 | -.buts-share.customer{ | ||
| 31 | - background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png"); | ||
| 32 | -} | ||
| 33 | - | ||
| 34 | -.shangwu{ | ||
| 35 | - margin-top: 52rpx; | ||
| 36 | -} | ||
| 37 | -.shangwu .seller{ | ||
| 38 | - margin-bottom: 42rpx; | ||
| 39 | -} | ||
| 40 | -.shangwu .invit-logo.owner{ | ||
| 41 | - width: 380rpx; | ||
| 42 | - height: 200rpx; | ||
| 43 | - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"); | ||
| 44 | -} | ||
| 45 | -.shangwu .invit-logo.customer{ | ||
| 46 | - width: 352rpx; | ||
| 47 | - height: 164rpx; | ||
| 48 | - background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png"); | ||
| 49 | -} | ||
| 50 | - | ||
| 51 | - | ||
| 52 | -.wenxin-mask{ | ||
| 53 | - margin-top: 20rpx; | ||
| 54 | -} | ||
| 55 | -.wenxin-baitou{ | ||
| 56 | - margin-top: 20rpx; | ||
| 57 | -} | ||
| 58 | -.wenxin .seller{ | ||
| 59 | - margin-bottom: 22rpx; | ||
| 60 | -} | ||
| 61 | -.wenxin .invit-logo.owner{ | ||
| 62 | - width: 340rpx; | ||
| 63 | - height: 184rpx; | ||
| 64 | - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png"); | ||
| 65 | -} | ||
| 66 | -.wenxin .invit-logo.customer{ | ||
| 67 | - width: 344rpx; | ||
| 68 | - height: 198rpx; | ||
| 69 | - background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png"); | ||
| 70 | -} | ||
| 71 | - | ||
| 72 | -.back{ | ||
| 73 | - margin-left: 40rpx; | ||
| 74 | -} | ||
| 75 | -.back-image{ | ||
| 76 | - height: 32rpx; | ||
| 77 | - width: 18rpx; | ||
| 78 | -} | ||
| 79 | -.bottom{ | ||
| 80 | - position: fixed; | ||
| 81 | - bottom: 0; | ||
| 82 | - height: 98rpx; | ||
| 83 | - line-height: 98rpx; | ||
| 84 | - border-top: 2rpx solid #ECD9B7; | ||
| 85 | - background-color: #ECD9B7; | ||
| 86 | - width: 100%; | ||
| 87 | -} | ||
| 88 | -.bottom .sendmsg{ | ||
| 89 | - background-color: #262628; | ||
| 90 | - width: 30%; | ||
| 91 | - min-width: 30%; | ||
| 92 | - color: #ECD9B7; | ||
| 93 | - font-size: 30rpx; | ||
| 94 | -} | ||
| 95 | -.bottom .share{ | ||
| 96 | - text-align: center; | ||
| 97 | - width: 70%; | ||
| 98 | - font-size: 36rpx; | ||
| 99 | - color: #794F28; | ||
| 100 | -} |
pages/book/b_setting.js
deleted
100644 → 0
| 1 | -// pages/book/b_setting.js | ||
| 2 | -var util = require('../../utils/util.js') | ||
| 3 | -var bookOrder=require('../../utils/bookCommon.js') | ||
| 4 | -import App from '../../utils/api'; | ||
| 5 | -const {regeneratorRuntime} = global | ||
| 6 | - | ||
| 7 | -Page({ | ||
| 8 | - | ||
| 9 | - /** | ||
| 10 | - * 页面的初始数据 | ||
| 11 | - */ | ||
| 12 | - data: { | ||
| 13 | - dateStr:'', | ||
| 14 | - calendarMaskLoad:false, | ||
| 15 | - calendarMask:false, | ||
| 16 | - dayStyle:[ | ||
| 17 | - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }, | ||
| 18 | - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' } | ||
| 19 | - ], | ||
| 20 | - regions:[], | ||
| 21 | - regions_active:'', | ||
| 22 | - time:-1, | ||
| 23 | - speciallist:[], | ||
| 24 | - calendar:{ | ||
| 25 | - nextNum:0, | ||
| 26 | - }, | ||
| 27 | - rdate:'', | ||
| 28 | - }, | ||
| 29 | - regions:[], | ||
| 30 | - sellerid:0, | ||
| 31 | - timePickerArray:[ | ||
| 32 | - [], | ||
| 33 | - [], | ||
| 34 | - [], | ||
| 35 | - ], | ||
| 36 | - /** | ||
| 37 | - * 生命周期函数--监听页面加载 | ||
| 38 | - */ | ||
| 39 | - onLoad: async function (options) { | ||
| 40 | - let d=new Date()/1000; | ||
| 41 | - let dateStr=util.unixtoTime(d,'MM-DD DAY'); | ||
| 42 | - let timePickerArray= await bookOrder.getDayTimeSpace(); | ||
| 43 | - let speciallist=[ | ||
| 44 | - { date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' }, | ||
| 45 | - { date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' }, | ||
| 46 | - { date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' }, | ||
| 47 | - ]; | ||
| 48 | - this.setData({ | ||
| 49 | - dateStr:dateStr, | ||
| 50 | - timePickerArray:timePickerArray, | ||
| 51 | - speciallist:speciallist, | ||
| 52 | - }) | ||
| 53 | - }, | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 57 | - */ | ||
| 58 | - onReady: function () { | ||
| 59 | - | ||
| 60 | - }, | ||
| 61 | - | ||
| 62 | - /** | ||
| 63 | - * 生命周期函数--监听页面显示 | ||
| 64 | - */ | ||
| 65 | - onShow: async function () { | ||
| 66 | - this.setData({ | ||
| 67 | - height:getApp().system.windowHeight-170, | ||
| 68 | - }) | ||
| 69 | - setTimeout(()=>{ | ||
| 70 | - this.setData({ | ||
| 71 | - calendarMaskLoad:true, | ||
| 72 | - }) | ||
| 73 | - },1000); | ||
| 74 | - this.selectComponent('#nav').init(); | ||
| 75 | - this.sellerid=util.cache('sellerid'); | ||
| 76 | - App.Tables.GetTableListsBySellerId({ | ||
| 77 | - sellerid:this.sellerid | ||
| 78 | - }).then((res)=>{ | ||
| 79 | - this.regions=res.data[0]; | ||
| 80 | - this.getbooklist(); | ||
| 81 | - }) | ||
| 82 | - }, | ||
| 83 | - | ||
| 84 | - /** | ||
| 85 | - * 生命周期函数--监听页面隐藏 | ||
| 86 | - */ | ||
| 87 | - onHide: function () { | ||
| 88 | - | ||
| 89 | - }, | ||
| 90 | - | ||
| 91 | - /** | ||
| 92 | - * 生命周期函数--监听页面卸载 | ||
| 93 | - */ | ||
| 94 | - onUnload: function () { | ||
| 95 | - | ||
| 96 | - }, | ||
| 97 | - calendarShow(){ | ||
| 98 | - console.log('xxxxx') | ||
| 99 | - this.setData({ | ||
| 100 | - calendarMask:true | ||
| 101 | - }) | ||
| 102 | - console.log(this.data.calendarMask) | ||
| 103 | - }, | ||
| 104 | - dateChange(event){ | ||
| 105 | - let cktime=util.timetouUnix(event.detail.date) | ||
| 106 | - let day0=parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000); | ||
| 107 | - // if(cktime<day0){ | ||
| 108 | - // util.toast('请选择今天之后的日期','none'); | ||
| 109 | - // return; | ||
| 110 | - // } | ||
| 111 | - let clickDay = event.detail.date.substr(8,2); | ||
| 112 | - let changeDay = `dayStyle[1].day`; | ||
| 113 | - let changeBg = `dayStyle[1].background`; | ||
| 114 | - this.setData({ | ||
| 115 | - dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'), | ||
| 116 | - [changeDay]: clickDay, | ||
| 117 | - [changeBg]: "#84e7d0", | ||
| 118 | - }) | ||
| 119 | - | ||
| 120 | - this.getbooklist(); | ||
| 121 | - this.calendarClose(); | ||
| 122 | - }, | ||
| 123 | - calendarClose(){ | ||
| 124 | - this.setData({ | ||
| 125 | - calendarMask:false | ||
| 126 | - }) | ||
| 127 | - }, | ||
| 128 | - async getbooklist(){ | ||
| 129 | - let obj={}; | ||
| 130 | - | ||
| 131 | - let formdata={}; | ||
| 132 | - formdata.sid=this.sellerid; | ||
| 133 | - formdata.x=1; | ||
| 134 | - formdata.y=200; | ||
| 135 | - let time=0; | ||
| 136 | - if(this.data.time<0){ | ||
| 137 | - let sid=await bookOrder.getTimeSpaceIndexData(); | ||
| 138 | - time=sid.timeIndex | ||
| 139 | - obj.time=time; | ||
| 140 | - }else{ | ||
| 141 | - time=this.data.time; | ||
| 142 | - } | ||
| 143 | - let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time); | ||
| 144 | - formdata.rdate=rdate; | ||
| 145 | - formdata.status='1,2'; | ||
| 146 | - obj.rdate=rdate; | ||
| 147 | - let tids={}; | ||
| 148 | - let reserves=await App.Reserve.GetReserveList(formdata); | ||
| 149 | - if(reserves.data.length>0){ | ||
| 150 | - reserves.data.forEach(r=>{ | ||
| 151 | - let ts=r.tid.split(','); | ||
| 152 | - ts.forEach(tid=>{ | ||
| 153 | - let rname=''; | ||
| 154 | - if(r.sex==3){ | ||
| 155 | - rname=r.rname.substr(0,10) | ||
| 156 | - }else{ | ||
| 157 | - rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士') | ||
| 158 | - } | ||
| 159 | - tids[tid]={ | ||
| 160 | - rdate:r.rdate, | ||
| 161 | - id:r.id, | ||
| 162 | - status:r.status, | ||
| 163 | - rname:rname, | ||
| 164 | - } | ||
| 165 | - }) | ||
| 166 | - }) | ||
| 167 | - } | ||
| 168 | - console.log('tids',tids); | ||
| 169 | - let regions=[]; | ||
| 170 | - this.regions.forEach(region=>{ | ||
| 171 | - if(region.list.length>0){ | ||
| 172 | - let list_num=0; | ||
| 173 | - region.list.forEach(tb=>{ | ||
| 174 | - tb.status_str=''; | ||
| 175 | - tb.status_classname='enabled' | ||
| 176 | - tb.reserve_name='' | ||
| 177 | - tb.reserve_id='' | ||
| 178 | - if(tb.status!=0 && tb.status!=""){ | ||
| 179 | - tb.status_str='用餐中'; | ||
| 180 | - tb.status_classname='highlight'; | ||
| 181 | - tb.reserve_name=tb.spell==1?'拼桌':'堂食'; | ||
| 182 | - }else if(tids[tb.id]){ | ||
| 183 | - console.log('tids',region.name,tb.name); | ||
| 184 | - tb.status_str=tids[tb.id].status==2?'用餐中':'已预订'; | ||
| 185 | - tb.status_classname='highlight'; | ||
| 186 | - tb.reserve_id=tids[tb.id].id; | ||
| 187 | - tb.reserve_name=tids[tb.id].rname; | ||
| 188 | - } | ||
| 189 | - if(tb.enable!=1){ | ||
| 190 | - if(tb.status_str){ | ||
| 191 | - tb.status_classname='disabled-highlight'; | ||
| 192 | - }else{ | ||
| 193 | - tb.status_str='已停用'; | ||
| 194 | - tb.status_classname='disabled'; | ||
| 195 | - } | ||
| 196 | - } | ||
| 197 | - if(!tb.status_str){ | ||
| 198 | - list_num++; | ||
| 199 | - } | ||
| 200 | - region.list_num=list_num; | ||
| 201 | - }) | ||
| 202 | - regions.push(region); | ||
| 203 | - } | ||
| 204 | - }) | ||
| 205 | - obj.regions=regions | ||
| 206 | - if(!this.data.regions_active){ | ||
| 207 | - obj.regions_active=this.regions[0].name | ||
| 208 | - } | ||
| 209 | - this.setData(obj) | ||
| 210 | - }, | ||
| 211 | - chooseRegion(e){ | ||
| 212 | - this.setData({ | ||
| 213 | - regions_active:util.attr(e,'name') | ||
| 214 | - }) | ||
| 215 | - }, | ||
| 216 | - selectedValue(e){ | ||
| 217 | - this.setData({ | ||
| 218 | - time:util.attr(e,'value') | ||
| 219 | - }) | ||
| 220 | - this.getbooklist(); | ||
| 221 | - }, | ||
| 222 | - boardEvent(e){ | ||
| 223 | - console.log(e); | ||
| 224 | - App.Tables.GetTableListsBySellerId({ | ||
| 225 | - sellerid:this.sellerid | ||
| 226 | - },true).then((res)=>{ | ||
| 227 | - this.regions=res.data[0]; | ||
| 228 | - this.getbooklist(); | ||
| 229 | - }) | ||
| 230 | - }, | ||
| 231 | - gotoday(e){ | ||
| 232 | - this.setData({ | ||
| 233 | - [`calendar.nextNum`]:0 | ||
| 234 | - }) | ||
| 235 | - }, | ||
| 236 | - nextMonth(e){ | ||
| 237 | - this.setData({ | ||
| 238 | - [`calendar.nextNum`]:this.data.calendar.nextNum+1 | ||
| 239 | - }) | ||
| 240 | - }, | ||
| 241 | - prevMonth(e){ | ||
| 242 | - this.setData({ | ||
| 243 | - [`calendar.nextNum`]:this.data.calendar.nextNum-1 | ||
| 244 | - }) | ||
| 245 | - }, | ||
| 246 | -}) |
-
Please register or login to post a comment