Commit 4c70d029359c1207520e7300fb2766aa62fb11d5

Authored by liuxuqinfhp1220
2 parents ffa1f323 d5fff0b7

Merge branch 'master' of http://123.56.79.57/xt/xcx-book

# By vking
# Via vking
* 'master' of http://123.56.79.57/xt/xcx-book: (52 commits)
  fix unionid
  fixbug 回退早市
  fixbug 早市不能选中
  fixbug 早市不能选中
  history
  history
  history
  history
  history
  history
  history
  对接商户端跳入
  网络优化并发bug
  网络优化并发bug
  隐藏号码
  隐藏号码
  隐藏号码
  隐藏号码
  fix fenli bug
  更换短信逻辑
  ...
Showing 54 changed files with 2439 additions and 182 deletions
@@ -16,11 +16,12 @@ Array.prototype.remove = function(val) { @@ -16,11 +16,12 @@ Array.prototype.remove = function(val) {
16 this.splice(index, 1); 16 this.splice(index, 1);
17 } 17 }
18 }; 18 };
19 -import log from 'utils/realTimeLog' 19 +//import log from 'utils/realTimeLog'
20 App({ 20 App({
21 openid:"", 21 openid:"",
22 system:{}, 22 system:{},
23 shareTicket:"", 23 shareTicket:"",
  24 + isAdmin:false,//是否运营人员
24 onLaunch: async function (opt) { 25 onLaunch: async function (opt) {
25 console.log('onLaunch',opt,wx.env); 26 console.log('onLaunch',opt,wx.env);
26 wx.removeStorage({key: 'formids'});//清理历史formids 27 wx.removeStorage({key: 'formids'});//清理历史formids
@@ -30,7 +30,8 @@ @@ -30,7 +30,8 @@
30 "pages/reserve/discount", 30 "pages/reserve/discount",
31 "pages/reserve/indexList", 31 "pages/reserve/indexList",
32 "pages/reserve/share", 32 "pages/reserve/share",
33 - "pages/reserve/submit" 33 + "pages/reserve/submit",
  34 + "pages/me/history"
34 ], 35 ],
35 "subpackages": [ 36 "subpackages": [
36 { 37 {
@@ -52,6 +53,7 @@ @@ -52,6 +53,7 @@
52 "pages/book/b_invitation", 53 "pages/book/b_invitation",
53 "pages/book/b_desk", 54 "pages/book/b_desk",
54 "pages/book/b_addnew", 55 "pages/book/b_addnew",
  56 + "pages/book/online_update",
55 "pages/book/b_sms", 57 "pages/book/b_sms",
56 "pages/book/b_setting", 58 "pages/book/b_setting",
57 "pages/book/setting/index", 59 "pages/book/setting/index",
1 <!--components/actionSheet/index.wxml--> 1 <!--components/actionSheet/index.wxml-->
2 <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="action-sheet"> 2 <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="action-sheet">
3 <view class="tip" wx:if="{{hasTip}}"><slot></slot></view> 3 <view class="tip" wx:if="{{hasTip}}"><slot></slot></view>
4 - <block wx:for="{{items}}" wx:key="items.key"> 4 + <block wx:for="{{items}}" wx:key="itemskey">
5 <action-sheet-item bindtap="bindItemTap" data-value="{{item}}" data-index="{{index}}">{{item}}</action-sheet-item> 5 <action-sheet-item bindtap="bindItemTap" data-value="{{item}}" data-index="{{index}}">{{item}}</action-sheet-item>
6 </block> 6 </block>
7 <action-sheet-cancel bindtap="bindItemTap">取消</action-sheet-cancel> 7 <action-sheet-cancel bindtap="bindItemTap">取消</action-sheet-cancel>
@@ -43,7 +43,7 @@ Component({ @@ -43,7 +43,7 @@ Component({
43 if (e.type = "getuserinfo") { 43 if (e.type = "getuserinfo") {
44 if (e.detail.errMsg == 'getUserInfo:ok') { 44 if (e.detail.errMsg == 'getUserInfo:ok') {
45 var userInfo = e.detail.userInfo //avatarUrl nickName gender; 45 var userInfo = e.detail.userInfo //avatarUrl nickName gender;
46 - console.log('xxxxx', userInfo) 46 + console.log('getUserInfo:ok', e.detail)
47 util.cache('userInfo', userInfo); 47 util.cache('userInfo', userInfo);
48 App.Reserve.AddUser({ 48 App.Reserve.AddUser({
49 openid: getApp().openid, 49 openid: getApp().openid,
@@ -51,6 +51,7 @@ Component({ @@ -51,6 +51,7 @@ Component({
51 nickname: userInfo.nickName, 51 nickname: userInfo.nickName,
52 gender: userInfo.gender 52 gender: userInfo.gender
53 }) 53 })
  54 + getApp()._getOpenid();
54 this.triggerEvent("userinfo", userInfo); 55 this.triggerEvent("userinfo", userInfo);
55 } else if (e.detail.errMsg == 'getUserInfo:fail auth deny') { 56 } else if (e.detail.errMsg == 'getUserInfo:fail auth deny') {
56 wx.showModal({ 57 wx.showModal({
@@ -73,7 +73,7 @@ Component({ @@ -73,7 +73,7 @@ Component({
73 this.boardEnable(0) 73 this.boardEnable(0)
74 break; 74 break;
75 case '订座': 75 case '订座':
76 - wx.navigateTo({ 76 + wx.redirectTo({
77 url:'b_addnew?hasQuick=1&tid='+board.id 77 url:'b_addnew?hasQuick=1&tid='+board.id
78 +'&tname='+board.name 78 +'&tname='+board.name
79 +'&pnum='+(board.most_pnum>board.table_pnum?board.most_pnum:board.table_pnum) 79 +'&pnum='+(board.most_pnum>board.table_pnum?board.most_pnum:board.table_pnum)
@@ -7,6 +7,10 @@ Component({ @@ -7,6 +7,10 @@ Component({
7 type:String, 7 type:String,
8 value:"", 8 value:"",
9 }, 9 },
  10 + reserveId:{
  11 + type:String,
  12 + value:"",
  13 + },
10 hasPubSub:{ 14 hasPubSub:{
11 type:Boolean, 15 type:Boolean,
12 value:false 16 value:false
@@ -20,10 +24,16 @@ Component({ @@ -20,10 +24,16 @@ Component({
20 var list = this.data.list; 24 var list = this.data.list;
21 if(this.data.hasPubSub){ 25 if(this.data.hasPubSub){
22 let checkedTids=this.data.checkedTids.split(','); 26 let checkedTids=this.data.checkedTids.split(',');
23 - list.forEach(function (v, i) { 27 + list.forEach( (v, i)=>{
24 if (v.id == tebleid) { 28 if (v.id == tebleid) {
25 console.log('click.board',v); 29 console.log('click.board',v);
26 - if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none'); 30 + if(this.data.reserveId){
  31 + if(v.reserve_id!=this.data.reserveId){
  32 + if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
  33 + }
  34 + }else{
  35 + if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
  36 + }
27 if (v.isselect == true) { 37 if (v.isselect == true) {
28 var thisindex = tables.indexOf(tebleid); 38 var thisindex = tables.indexOf(tebleid);
29 tables.splice(thisindex, 1) 39 tables.splice(thisindex, 1)
@@ -37,10 +47,16 @@ Component({ @@ -37,10 +47,16 @@ Component({
37 var pages = getCurrentPages(); 47 var pages = getCurrentPages();
38 var addnewPage=pages[pages.length - 2]; 48 var addnewPage=pages[pages.length - 2];
39 let checkedTids=this.data.checkedTids.split(','); 49 let checkedTids=this.data.checkedTids.split(',');
40 - list.forEach(function (v, i) { 50 + list.forEach( (v, i) =>{
41 if (v.id == tebleid) { 51 if (v.id == tebleid) {
42 console.log('click.board',v); 52 console.log('click.board',v);
43 - if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none'); 53 + if(this.data.reserveId){
  54 + if(v.reserve_id!=this.data.reserveId) {
  55 + if (v.status_str && checkedTids._indexOf(v.id) < 0) return util.toast('不能预订该桌位', 'none');
  56 + }
  57 + }else{
  58 + if (v.status_str && checkedTids._indexOf(v.id) < 0) return util.toast('不能预订该桌位', 'none');
  59 + }
44 if (v.isselect == true) { 60 if (v.isselect == true) {
45 var thisindex = tables.indexOf(tebleid); 61 var thisindex = tables.indexOf(tebleid);
46 tables.splice(thisindex, 1) 62 tables.splice(thisindex, 1)
@@ -41,11 +41,16 @@ Component({ @@ -41,11 +41,16 @@ Component({
41 }) 41 })
42 42
43 } 43 }
44 - if(item.sex==3){  
45 - item.rname_mask=item.rname.substr(0,10) 44 + if(item.rname){
  45 + if(item.sex==3){
  46 + item.rname_mask=item.rname.substr(0,10)
  47 + }else{
  48 + item.rname_mask=item.rname.substr(0,3)+(item.sex==1?'先生':'女士')
  49 + }
46 }else{ 50 }else{
47 - item.rname_mask=item.rname.substr(0,3)+(item.sex==1?'先生':'女士') 51 + item.rname_mask=''
48 } 52 }
  53 +
49 item.order_time=util.unixtoTime(item.ddate,'HH:II') 54 item.order_time=util.unixtoTime(item.ddate,'HH:II')
50 item.status_str=reserveStatus[item.status]||''; 55 item.status_str=reserveStatus[item.status]||'';
51 this.setData({vitem:item}) 56 this.setData({vitem:item})
  1 +<wxs src="../../../../utils/util.wxs" module="util" />
1 <view class="book-list-tds flex-lr font30r black-font reserve-status-{{vitem.status}}"> 2 <view class="book-list-tds flex-lr font30r black-font reserve-status-{{vitem.status}}">
2 <formids bindtap="detail" class="book-list-td flex-vc"> 3 <formids bindtap="detail" class="book-list-td flex-vc">
3 <view class="flex-vc"> 4 <view class="flex-vc">
@@ -12,7 +13,14 @@ @@ -12,7 +13,14 @@
12 </view> 13 </view>
13 </formids> 14 </formids>
14 <formids bindtap="detail" class="book-list-td flex-vc"> 15 <formids bindtap="detail" class="book-list-td flex-vc">
15 - <view class="flex-vc">{{vitem.order_time}}</view> 16 + <view class="flex-vc">
  17 + <block wx:if="{{vitem.type==1}}">
  18 + {{vitem.is_set_ddate==1?vitem.order_time:util.reserveTimeSpace(vitem.ddate_solt)}}
  19 + </block>
  20 + <block wx:else="">
  21 + {{vitem.order_time}}
  22 + </block>
  23 + </view>
16 </formids> 24 </formids>
17 <formids bindtap="{{(vitem.status==1 || vitem.status==5)?'invitation':'detail'}}" class="book-list-td flex-vc"> 25 <formids bindtap="{{(vitem.status==1 || vitem.status==5)?'invitation':'detail'}}" class="book-list-td flex-vc">
18 <view class="flex-rr green-font"> 26 <view class="flex-rr green-font">
@@ -14,9 +14,9 @@ @@ -14,9 +14,9 @@
14 width:100%; 14 width:100%;
15 line-height:1.2; 15 line-height:1.2;
16 } 16 }
17 -.reserve-status-4,.reserve-status-3{ 17 +.reserve-status-4,.reserve-status-3,.reserve-status-6{
18 color:#999999; 18 color:#999999;
19 } 19 }
20 -.reserve-status-4 .green-font,.reserve-status-3 .green-font{ 20 +.reserve-status-4 .green-font,.reserve-status-3 .green-font,.reserve-status-6 .green-font{
21 color:#999999; 21 color:#999999;
22 } 22 }
@@ -61,7 +61,7 @@ Component({ @@ -61,7 +61,7 @@ Component({
61 }); 61 });
62 break; 62 break;
63 case 2: 63 case 2:
64 - if (!this.data.bookInfo.hasOwner) { 64 + if (!this.data.bookInfo.hasOwner && this.data.bookInfo.type==0) {
65 return util.toast('只有记录人可以拨打', 'none'); 65 return util.toast('只有记录人可以拨打', 'none');
66 } 66 }
67 console.log('this.data.bookInfo', this.data.bookInfo); 67 console.log('this.data.bookInfo', this.data.bookInfo);
@@ -81,15 +81,28 @@ Component({ @@ -81,15 +81,28 @@ Component({
81 if(sc.seller_user){ 81 if(sc.seller_user){
82 cause.uname=(sc.seller_user.nick_name||sc.seller_user.nickname) 82 cause.uname=(sc.seller_user.nick_name||sc.seller_user.nickname)
83 } 83 }
84 - App.Reserve.SetReserveStatus({  
85 - rid:this.data.bookInfo.id,  
86 - status:4,  
87 - cause:JSON.stringify(cause),  
88 - }).then(()=>{  
89 - this.hide()  
90 - this.triggerEvent('reserveCancel',{hasCancel:true});  
91 - //this.getDetail(this.data.bookInfo.id,true);  
92 - }) 84 + if(1==this.data.bookInfo.type){
  85 + App.Customer.SetReserveStatus({
  86 + rid:this.data.bookInfo.id,
  87 + status:4,
  88 + cause:JSON.stringify(cause),
  89 + }).then(()=>{
  90 + this.hide()
  91 + this.triggerEvent('reserveCancel',{hasCancel:true});
  92 + //this.getDetail(this.data.bookInfo.id,true);
  93 + })
  94 + }else{
  95 + App.Reserve.SetReserveStatus({
  96 + rid:this.data.bookInfo.id,
  97 + status:4,
  98 + cause:JSON.stringify(cause),
  99 + }).then(()=>{
  100 + this.hide()
  101 + this.triggerEvent('reserveCancel',{hasCancel:true});
  102 + //this.getDetail(this.data.bookInfo.id,true);
  103 + })
  104 + }
  105 +
93 } 106 }
94 } 107 }
95 }) 108 })
@@ -41,7 +41,7 @@ Component({ @@ -41,7 +41,7 @@ Component({
41 let pages = getCurrentPages(); 41 let pages = getCurrentPages();
42 let p = pages[pages.length - 1]; 42 let p = pages[pages.length - 1];
43 if (url.indexOf(p.route) < 0) { 43 if (url.indexOf(p.route) < 0) {
44 - wx.redirectTo({ 44 + wx.reLaunch({
45 url: url, 45 url: url,
46 }) 46 })
47 } 47 }
@@ -20,6 +20,7 @@ module.exports = { @@ -20,6 +20,7 @@ module.exports = {
20 let enter_params = util.cache('enter_params'); 20 let enter_params = util.cache('enter_params');
21 let res = await App.Seller.VerificationIsAdmin({openid:enter_params.seller_openid}) 21 let res = await App.Seller.VerificationIsAdmin({openid:enter_params.seller_openid})
22 if (res.data && res.data.status==1) { 22 if (res.data && res.data.status==1) {
  23 + getApp().isAdmin=true
23 success() 24 success()
24 } else { 25 } else {
25 fail() 26 fail()
@@ -93,28 +93,20 @@ Page({ @@ -93,28 +93,20 @@ Page({
93 ]; 93 ];
94 this.reserve_id = options.id || ''; 94 this.reserve_id = options.id || '';
95 let rev_time=parseInt(nt) 95 let rev_time=parseInt(nt)
96 - if(options.hasQuick==1){  
97 - let rdate=options.ddate.split('-')  
98 - if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){  
99 - rev_time=rdate[0]  
100 - }  
101 - await this.setDateStr(rev_time);  
102 - }  
103 - //判断hasUseDefDtime  
104 - let hasUseDefDtime = true;  
105 - let mmii = util.unixtoTime(rev_time, 'HH:II');  
106 - if (mmii > this.data.defDtime[this.data.form.time]) {  
107 - hasUseDefDtime = false;  
108 - }  
109 - console.log('initLoad::setDateStr',util.unixtoTime(rev_time,'YYYY-MM-DD HH:II'),this.data.defDtime[this.data.form.time])  
110 - await this.setDateStr(rev_time,hasUseDefDtime);  
111 this.sellerid = util.cache('enter_params')['seller_id']; 96 this.sellerid = util.cache('enter_params')['seller_id'];
112 let timePickerArray = await comm.getDayTimeSpace(); 97 let timePickerArray = await comm.getDayTimeSpace();
113 this.setData({ 98 this.setData({
114 timePickerArray: timePickerArray, 99 timePickerArray: timePickerArray,
115 speciallist: speciallist, 100 speciallist: speciallist,
116 - hasUseDefDtime: hasUseDefDtime, 101 + //hasUseDefDtime: hasUseDefDtime,
117 }) 102 })
  103 + if(options.hasQuick==1){
  104 + let rdate=options.ddate.split('-')
  105 + if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){
  106 + rev_time=rdate[0]
  107 + }
  108 + }
  109 + await this.setDateStr(rev_time);
118 if (this.reserve_id > 0) { 110 if (this.reserve_id > 0) {
119 this.initModify(this.reserve_id); 111 this.initModify(this.reserve_id);
120 } else if(options.hasQuick==1){ 112 } else if(options.hasQuick==1){
@@ -123,17 +115,25 @@ Page({ @@ -123,17 +115,25 @@ Page({
123 this.getTables(); 115 this.getTables();
124 } 116 }
125 }, 117 },
126 - /**  
127 - *  
128 - * @param d  
129 - *  
130 - */  
131 - async setDateStr(d = new Date() / 1000,hasUseDefDtime=false){ 118 +
  119 + hasInTimeSpace(hhii,timeIndex){
  120 + console.log('hasInTimeSpace',this.data.timePickerArray)
  121 + if(this.data.timePickerArray.length<1)return false
  122 + let timePickerArray=this.data.timePickerArray[timeIndex];
  123 + let tl=timePickerArray.length
  124 + if(tl<1) return false
  125 + console.log('hasInTimeSpace',hhii,timePickerArray[0],timePickerArray[tl-1],hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1])
  126 + if(hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1]) return true
  127 + return false
  128 + },
  129 + async setDateStr(d = new Date() / 1000,hasUseDefDtime=false,fouceTime=-1){
  130 + fouceTime=fouceTime>-1?fouceTime:this.data.form.time
  131 + hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[fouceTime],fouceTime)
132 if(hasUseDefDtime){// 132 if(hasUseDefDtime){//
133 - let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[this.data.form.time]) 133 + let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[fouceTime])
134 d=util.timetouUnix(timestr) 134 d=util.timetouUnix(timestr)
135 } 135 }
136 - console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime) 136 + console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime,fouceTime)
137 this.year=util.unixtoTime(d,'YYYY'); 137 this.year=util.unixtoTime(d,'YYYY');
138 let ns = new Date() / 1000; 138 let ns = new Date() / 1000;
139 let dateStr = [ 139 let dateStr = [
@@ -144,13 +144,20 @@ Page({ @@ -144,13 +144,20 @@ Page({
144 let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`') 144 let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`')
145 let form = this.data.form; 145 let form = this.data.form;
146 146
147 - let timeObj = await comm.getTimeSpaceIndexData(d); 147 + let timeObj = await comm.getTimeSpaceIndexData(d,null,fouceTime);
  148 + if(fouceTime!=timeObj.timeIndex && fouceTime>0){
  149 + timeObj.timeIndex=fouceTime
  150 + }
148 //form.time=await comm.getTimeSpaceIndex(d); 151 //form.time=await comm.getTimeSpaceIndex(d);
149 //如果小于默认时间,使用默认时间 152 //如果小于默认时间,使用默认时间
150 let mmii = util.unixtoTime(d,'HH:II') 153 let mmii = util.unixtoTime(d,'HH:II')
  154 + console.log('setDateStr-timeObj',timeObj,mmii,this.data.defDtime[timeObj.timeIndex])
151 if (mmii < this.data.defDtime[timeObj.timeIndex]) { 155 if (mmii < this.data.defDtime[timeObj.timeIndex]) {
152 - let str=util.unixtoTime(d, 'YYYY-MM-DD '+this.data.defDtime[timeObj.timeIndex]+':00')  
153 - timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str)); 156 + hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[timeObj.timeIndex],timeObj.timeIndex)
  157 + if(hasUseDefDtime){
  158 + let str=util.unixtoTime(d, 'YYYY-MM-DD '+this.data.defDtime[timeObj.timeIndex]+':00')
  159 + timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str));
  160 + }
154 } 161 }
155 162
156 form.time = timeObj.timeIndex; 163 form.time = timeObj.timeIndex;
@@ -168,6 +175,7 @@ Page({ @@ -168,6 +175,7 @@ Page({
168 form: form, 175 form: form,
169 timePickerIndex: timePickerIndex, 176 timePickerIndex: timePickerIndex,
170 timeOpt: timeObj.timeOpt, 177 timeOpt: timeObj.timeOpt,
  178 + hasUseDefDtime:hasUseDefDtime
171 }; 179 };
172 180
173 this.setData(obj) 181 this.setData(obj)
@@ -330,8 +338,9 @@ Page({ @@ -330,8 +338,9 @@ Page({
330 sobj.hasUseDefDtime=false 338 sobj.hasUseDefDtime=false
331 } 339 }
332 } 340 }
333 - this.setDateStr(xtime,sobj.hasUseDefDtime); 341 + this.setDateStr(xtime,sobj.hasUseDefDtime,sobj.form.time);
334 } 342 }
  343 +
335 if (this.data.form.date == 0) {// 344 if (this.data.form.date == 0) {//
336 let mmii = util.unixtoTime(new Date() / 1000, 'HH:II'); 345 let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
337 if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) { 346 if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
@@ -349,7 +358,6 @@ Page({ @@ -349,7 +358,6 @@ Page({
349 this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime); 358 this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
350 } 359 }
351 } 360 }
352 -  
353 this.setData(sobj) 361 this.setData(sobj)
354 }, 362 },
355 selectedValue(e){ 363 selectedValue(e){
@@ -422,7 +430,7 @@ Page({ @@ -422,7 +430,7 @@ Page({
422 //console.log(e.type,key,val,form); 430 //console.log(e.type,key,val,form);
423 sobj.form = form; 431 sobj.form = form;
424 sobj.buttonhide = this.data.buttonhide; 432 sobj.buttonhide = this.data.buttonhide;
425 - if (form.tid.length > 0 && form.rname.length > 0) { 433 + if (form.tid.length > 0 && form.rname.length > 0 && this.data.timePickerArray[form.time].length>0){
426 sobj.buttonhide = false; 434 sobj.buttonhide = false;
427 }else{ 435 }else{
428 sobj.buttonhide = true; 436 sobj.buttonhide = true;
@@ -481,9 +489,10 @@ Page({ @@ -481,9 +489,10 @@ Page({
481 sid: util.cache('enter_params')['seller_id'], 489 sid: util.cache('enter_params')['seller_id'],
482 //pnum_str:form.pnum_str, 490 //pnum_str:form.pnum_str,
483 pnum: form.pnum, 491 pnum: form.pnum,
484 - rdate: rdate, 492 + rdate: util.unixtoTime(rdate.substr(0,10),'YYYYMMDD'),
485 tid: form.tabid, 493 tid: form.tabid,
486 rid: this.reserve_id, 494 rid: this.reserve_id,
  495 + ddate_solt:parseInt(form.time)+1
487 }).then(res => { 496 }).then(res => {
488 let tables = []; 497 let tables = [];
489 let tablesLength = 0; 498 let tablesLength = 0;
@@ -572,6 +581,9 @@ Page({ @@ -572,6 +581,9 @@ Page({
572 let tid = new Set(form.tid);//tid 去重 581 let tid = new Set(form.tid);//tid 去重
573 form.tid = [...tid].toString(); 582 form.tid = [...tid].toString();
574 } 583 }
  584 + if(this.data.timePickerArray[form.time].length<1){
  585 + return util.toast('请选择时段', 'none');
  586 + }
575 if (!form.tid) { 587 if (!form.tid) {
576 return util.toast('请选择桌子', 'none'); 588 return util.toast('请选择桌子', 'none');
577 } 589 }
@@ -598,6 +610,8 @@ Page({ @@ -598,6 +610,8 @@ Page({
598 let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00"); 610 let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");
599 form.ddate = util.timetouUnix(ddateStr); 611 form.ddate = util.timetouUnix(ddateStr);
600 } 612 }
  613 + form.ddate_solt=parseInt(form.time)+1
  614 + form.is_set_ddate=1
601 App.Reserve.SetReserveInfo(form).then(res => { 615 App.Reserve.SetReserveInfo(form).then(res => {
602 if (res.ret == 200) { 616 if (res.ret == 200) {
603 this.getCustomRemark() 617 this.getCustomRemark()
@@ -687,6 +701,7 @@ Page({ @@ -687,6 +701,7 @@ Page({
687 + '&pnum=' + this.data.form.pnum 701 + '&pnum=' + this.data.form.pnum
688 + '&checked_tids=' + this.data.form.tid 702 + '&checked_tids=' + this.data.form.tid
689 + '&rid=' + this.reserve_id 703 + '&rid=' + this.reserve_id
  704 + + '&ddate_solt='+(parseInt(this.data.form.time)+1)
690 }) 705 })
691 }, 706 },
692 conditionInfo: function () { 707 conditionInfo: function () {
@@ -723,7 +738,7 @@ Page({ @@ -723,7 +738,7 @@ Page({
723 738
724 console.log('initModify', res); 739 console.log('initModify', res);
725 //设置日期 740 //设置日期
726 - let obj = await this.setDateStr(res.data.ddate); 741 + let obj = await this.setDateStr(res.data.ddate,null,res.data.ddate_solt-1);
727 //设置时间 742 //设置时间
728 let nd = util.unixtoTime(res.data.ddate, 'HH:II'); 743 let nd = util.unixtoTime(res.data.ddate, 'HH:II');
729 let timePickerIndex = this.data.timePickerIndex 744 let timePickerIndex = this.data.timePickerIndex
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 <view class="section" style="height: 90rpx;"> 62 <view class="section" style="height: 90rpx;">
63 <view class="tab flex-lr"> 63 <view class="tab flex-lr">
64 <view class="tab flex-ll"> 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" 65 + <formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnumkey"
66 bindtap="selectedValue" data-key="pnum" data-value="{{item}}"> 66 bindtap="selectedValue" data-key="pnum" data-value="{{item}}">
67 <view class="pnum">{{item}}</view> 67 <view class="pnum">{{item}}</view>
68 </formids> 68 </formids>
@@ -129,7 +129,7 @@ @@ -129,7 +129,7 @@
129 </view> 129 </view>
130 </view> 130 </view>
131 <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}"> 131 <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}">
132 - <block wx:for="{{tablesed||tables}}" wx:key="tables.key"> 132 + <block wx:for="{{tablesed||tables}}" wx:key="tableskey">
133 <board width="160" height="180" board="{{item}}" 133 <board width="160" height="180" board="{{item}}"
134 style="margin: 20rpx 0 0 20rpx" 134 style="margin: 20rpx 0 0 20rpx"
135 event="boardChoose" className="noBottom" 135 event="boardChoose" className="noBottom"
@@ -167,7 +167,7 @@ @@ -167,7 +167,7 @@
167 bindblur="inputFocus" 167 bindblur="inputFocus"
168 data-key="rname"/> 168 data-key="rname"/>
169 <view class="book-info-grand flex-rr font28r gray-deep-font"> 169 <view class="book-info-grand flex-rr font28r gray-deep-font">
170 - <block wx:for="{{grand}}" wx:key="grand.key"> 170 + <block wx:for="{{grand}}" wx:key="grandkey">
171 <view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}" 171 <view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}"
172 bindtap="selectedValue" 172 bindtap="selectedValue"
173 data-value="{{item.sex}}" 173 data-value="{{item.sex}}"
@@ -12,8 +12,9 @@ Page({ @@ -12,8 +12,9 @@ Page({
12 sellerid:'', 12 sellerid:'',
13 options:null, 13 options:null,
14 onLoad: function (opt) { 14 onLoad: function (opt) {
  15 + //rdate=1574910000-1574924400&tid=0&pnum=6&checked_tids=&rid=44038&ddate_solt=2
15 console.log('onLoad', opt) 16 console.log('onLoad', opt)
16 - wx.removeStorageSync({key: 'tableid'}) 17 + wx.removeStorageSync('tableid')
17 this.options=opt; 18 this.options=opt;
18 var radio = 750 / util.getsystem().windowWidth; 19 var radio = 750 / util.getsystem().windowWidth;
19 var contentHeight = util.getsystem().windowHeight - Math.ceil(350 / radio); 20 var contentHeight = util.getsystem().windowHeight - Math.ceil(350 / radio);
@@ -112,13 +113,13 @@ Page({ @@ -112,13 +113,13 @@ Page({
112 }, 113 },
113 async getbooklist(){ 114 async getbooklist(){
114 let obj={}; 115 let obj={};
115 -  
116 let formdata={}; 116 let formdata={};
117 formdata.sid=this.sellerid; 117 formdata.sid=this.sellerid;
118 formdata.x=1; 118 formdata.x=1;
119 formdata.y=200; 119 formdata.y=200;
120 - formdata.rdate=this.options.rdate;  
121 formdata.status='1,2,5'; 120 formdata.status='1,2,5';
  121 + formdata.rdate=util.unixtoTime(this.options.rdate.substr(0,10),"YYYYMMDD");
  122 + formdata.ddate_solt=this.options.ddate_solt
122 let tids={}; 123 let tids={};
123 let reserves=await App.Reserve.GetReserveList(formdata); 124 let reserves=await App.Reserve.GetReserveList(formdata);
124 if(reserves.data.length>0){ 125 if(reserves.data.length>0){
@@ -126,10 +127,14 @@ Page({ @@ -126,10 +127,14 @@ Page({
126 let ts=r.tid.split(','); 127 let ts=r.tid.split(',');
127 ts.forEach(tid=>{ 128 ts.forEach(tid=>{
128 let rname=''; 129 let rname='';
129 - if(r.sex==3){  
130 - rname=r.rname.substr(0,10) 130 + if(r.rname){
  131 + if(r.sex==3){
  132 + rname=r.rname.substr(0,10)
  133 + }else{
  134 + rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
  135 + }
131 }else{ 136 }else{
132 - rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士') 137 + rname=" "
133 } 138 }
134 tids[tid]={ 139 tids[tid]={
135 rdate:r.rdate, 140 rdate:r.rdate,
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <view style="height: {{height-80}}px;overflow-y: auto;padding-bottom: 160rpx;overflow-x: hidden;width: 100%;"> 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"> 13 <block wx:for="{{desklist}}" wx:key="desklist.key">
14 <orderDesk list="{{item.list}}" checkedTids="{{opt.checked_tids}}" 14 <orderDesk list="{{item.list}}" checkedTids="{{opt.checked_tids}}"
  15 + reserveId="{{opt.rid}}"
15 bind:changedesk="changedesk" hasPubSub="{{hasPubSub}}" 16 bind:changedesk="changedesk" hasPubSub="{{hasPubSub}}"
16 wx:if="{{item.name==menu_active_id}}"></orderDesk> 17 wx:if="{{item.name==menu_active_id}}"></orderDesk>
17 </block> 18 </block>
@@ -17,6 +17,7 @@ Page({ @@ -17,6 +17,7 @@ Page({
17 sc: {}, 17 sc: {},
18 tpls: TP.tpls(), 18 tpls: TP.tpls(),
19 enter_params: {}, 19 enter_params: {},
  20 + hasCallPhone:false,
20 onLoad: async function (opt) { 21 onLoad: async function (opt) {
21 util.setBarTitle('预订详情'); 22 util.setBarTitle('预订详情');
22 console.log(opt) 23 console.log(opt)
@@ -30,6 +31,9 @@ Page({ @@ -30,6 +31,9 @@ Page({
30 this.enter_params = util.cache('enter_params'); 31 this.enter_params = util.cache('enter_params');
31 this.sc = (await App.Reserve.SellerInfo(this.enter_params)).data; 32 this.sc = (await App.Reserve.SellerInfo(this.enter_params)).data;
32 console.log('this.sc', this.sc); 33 console.log('this.sc', this.sc);
  34 + if(getApp().isAdmin || this.sc.seller.is_call_tel==1){
  35 + this.hasCallPhone=true;
  36 + }
33 this.chooseManagerInit(); 37 this.chooseManagerInit();
34 PubSub.on('arrangeDesk',(desk)=>{ 38 PubSub.on('arrangeDesk',(desk)=>{
35 this.arrangeDesk(desk) 39 this.arrangeDesk(desk)
@@ -76,9 +80,21 @@ Page({ @@ -76,9 +80,21 @@ Page({
76 }; 80 };
77 }, 81 },
78 getcall: function () { 82 getcall: function () {
79 - if (!this.detailData.hasOwner) {  
80 - return util.toast('只有记录人可以拨打', 'none'); 83 + let bi=this.data.bookInfo
  84 +
  85 + if(bi.type==0){
  86 + if (!this.detailData.hasOwner && !this.hasCallPhone) {
  87 + return util.toast('只有记录人可以拨打', 'none');
  88 + }
  89 + }else{
  90 + //getApp().isAdmin
  91 + if(!this.hasCallPhone){//在线预订
  92 + if((bi.status==0 || bi.status==6)){
  93 + return;
  94 + }
  95 + }
81 } 96 }
  97 +
82 if (this.data.bookInfo.phone.length < 3) { 98 if (this.data.bookInfo.phone.length < 3) {
83 return util.toast('号码错误', 'none'); 99 return util.toast('号码错误', 'none');
84 } 100 }
@@ -149,9 +165,11 @@ Page({ @@ -149,9 +165,11 @@ Page({
149 let note_openid = enter_params.seller_openid; 165 let note_openid = enter_params.seller_openid;
150 res.data.hasOwner = false; 166 res.data.hasOwner = false;
151 if (note_openid == res.data.note_openid || sc.seller_user.role_name == '管理员') { 167 if (note_openid == res.data.note_openid || sc.seller_user.role_name == '管理员') {
152 - res.data.hasOwner = true; 168 + if(res.data.type==0){
  169 + res.data.hasOwner = true;
  170 + }
153 } 171 }
154 - if (!res.data.hasOwner) { 172 + if(!res.data.hasOwner && !this.hasCallPhone){
155 res.data.phoneStr = res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/, function ($0, $1, $2, $3) { 173 res.data.phoneStr = res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/, function ($0, $1, $2, $3) {
156 return $1 + '**' + $3; 174 return $1 + '**' + $3;
157 }) 175 })
@@ -178,8 +196,12 @@ Page({ @@ -178,8 +196,12 @@ Page({
178 }) 196 })
179 }, 197 },
180 gotoModify() { 198 gotoModify() {
  199 + let url='./b_addnew'
  200 + if(this.detailData.type==1){
  201 + url='./online_update'
  202 + }
181 wx.redirectTo({ 203 wx.redirectTo({
182 - url: './b_addnew?id=' + this.data.bookInfo.id 204 + url: url+'?id=' + this.data.bookInfo.id
183 }) 205 })
184 }, 206 },
185 cancelReserve() { 207 cancelReserve() {
@@ -195,13 +217,23 @@ Page({ @@ -195,13 +217,23 @@ Page({
195 }) 217 })
196 }, 218 },
197 async startDinner(e) { 219 async startDinner(e) {
198 - App.Reserve.SetReserveStatus({  
199 - rid: this.data.bookInfo.id,  
200 - status: util.attr(e, 'status'),  
201 - cause: await this.getCause(),  
202 - }).then(() => {  
203 - this.getDetail(this.data.bookInfo.id, true);  
204 - }); 220 + if(this.detailData.type==1){
  221 + App.Customer.SetReserveStatus({
  222 + rid: this.data.bookInfo.id,
  223 + status: util.attr(e, 'status'),
  224 + cause: await this.getCause(),
  225 + }).then(() => {
  226 + this.getDetail(this.data.bookInfo.id, true);
  227 + });
  228 + }else{
  229 + App.Reserve.SetReserveStatus({
  230 + rid: this.data.bookInfo.id,
  231 + status: util.attr(e, 'status'),
  232 + cause: await this.getCause(),
  233 + }).then(() => {
  234 + this.getDetail(this.data.bookInfo.id, true);
  235 + });
  236 + }
205 }, 237 },
206 showOrder() { 238 showOrder() {
207 wx.navigateTo({ 239 wx.navigateTo({
@@ -229,7 +261,7 @@ Page({ @@ -229,7 +261,7 @@ Page({
229 status:6, 261 status:6,
230 cause:await this.getCause('拒绝订单'), 262 cause:await this.getCause('拒绝订单'),
231 } 263 }
232 - App.Reserve.SetReserveStatus(params).then(()=>{ 264 + App.Customer.SetReserveStatus(params).then(()=>{
233 this.getDetail(this.data.bookInfo.id,true); 265 this.getDetail(this.data.bookInfo.id,true);
234 PubSub.emit('fulshReseveList') 266 PubSub.emit('fulshReseveList')
235 }) 267 })
@@ -242,7 +274,7 @@ Page({ @@ -242,7 +274,7 @@ Page({
242 arrangeOrder(){ 274 arrangeOrder(){
243 let bi=this.data.bookInfo 275 let bi=this.data.bookInfo
244 let checked_tids='' 276 let checked_tids=''
245 - //rdate=1568023200-1568041200&tid=0&pnum=6&checked_tids=&rid=&hasPubsub=1 277 + //rdate=1574848800-1574866800&tid=0&pnum=6&checked_tids=&rid=&hasPubSub=1&ddate_solt=3
246 wx.navigateTo({ 278 wx.navigateTo({
247 url:util.http_build_query({ 279 url:util.http_build_query({
248 rdate:bi.rdate+'-'+bi.edate, 280 rdate:bi.rdate+'-'+bi.edate,
@@ -251,6 +283,7 @@ Page({ @@ -251,6 +283,7 @@ Page({
251 checked_tids:checked_tids, 283 checked_tids:checked_tids,
252 rid:'', 284 rid:'',
253 hasPubSub:1, 285 hasPubSub:1,
  286 + ddate_solt:bi.ddate_solt
254 },'./b_desk') 287 },'./b_desk')
255 }) 288 })
256 }, 289 },
@@ -262,13 +295,19 @@ Page({ @@ -262,13 +295,19 @@ Page({
262 cause:await this.getCause('安排包间'), 295 cause:await this.getCause('安排包间'),
263 tid:res.tableid.toString() 296 tid:res.tableid.toString()
264 } 297 }
265 - App.Reserve.SetReserveStatus(params).then(()=>{ 298 + App.Customer.SetReserveStatus(params).then(()=>{
266 this.getDetail(this.data.bookInfo.id,true); 299 this.getDetail(this.data.bookInfo.id,true);
267 PubSub.emit('fulshReseveList') 300 PubSub.emit('fulshReseveList')
268 }) 301 })
269 }, 302 },
270 easyCall(e){ 303 easyCall(e){
271 let bi=this.data.bookInfo 304 let bi=this.data.bookInfo
  305 + //getApp().isAdmin
  306 + if(bi.type==1 && !this.hasCallPhone){//在线预订
  307 + if((bi.status==0 || bi.status==6)){
  308 + return;
  309 + }
  310 + }
272 let phone=bi.phone 311 let phone=bi.phone
273 if(util.attr(e,'key')=='seller'){ 312 if(util.attr(e,'key')=='seller'){
274 phone=bi.seller.phone 313 phone=bi.seller.phone
  1 +<wxs src="../../../utils/util.wxs" module="util" />
1 <nav hasHome>订座详情</nav> 2 <nav hasHome>订座详情</nav>
2 <a2l bindshow="a2lshow" bindhide="a2lshow" key="BOOK-DETAIL" type="black" hitStr="通知客户"></a2l> 3 <a2l bindshow="a2lshow" bindhide="a2lshow" key="BOOK-DETAIL" type="black" hitStr="通知客户"></a2l>
3 <!--订单信息--> 4 <!--订单信息-->
4 -<view class="order-info"> 5 +<view class="order-info" wx:if="{{bookInfo}}" >
  6 + <view class="flex-lr order-detail">
  7 + <view class="gray-deep-font font30r">用餐时段</view>
  8 + <view class="black-font font34r">
  9 + {{util.unixtoTime(bookInfo.ddate,'YYYY年MM月DD日 ')}}
  10 + {{util.reserveTimeSpace(bookInfo.ddate_solt)}}
  11 + </view>
  12 + </view>
5 <view class="flex-lr order-detail"> 13 <view class="flex-lr order-detail">
6 - <view class="gray-deep-font font30r">到店时间</view>  
7 - <view class="black-font font34r">{{bookInfo.rdateStr}}</view> 14 + <view class="gray-deep-font font30r">用餐时间</view>
  15 + <view class="black-font font34r" wx:if="{{bookInfo.type==1}}">
  16 + {{bookInfo.is_set_ddate==1?util.unixtoTime(bookInfo.ddate,'HH:II'):''}}
  17 + </view>
  18 + <view class="black-font font34r" wx:else="">
  19 + {{util.unixtoTime(bookInfo.ddate,'HH:II')}}
  20 + </view>
8 </view> 21 </view>
9 <view class="flex-lr order-detail" wx:if="{{bookInfo.type==1}}"> 22 <view class="flex-lr order-detail" wx:if="{{bookInfo.type==1}}">
10 <view class="gray-deep-font font30r">包间需求</view> 23 <view class="gray-deep-font font30r">包间需求</view>
@@ -44,7 +57,7 @@ @@ -44,7 +57,7 @@
44 </view> 57 </view>
45 <view class="flex-lr order-detail"> 58 <view class="flex-lr order-detail">
46 <text class="gray-deep-font font30r" space="true" decode="true">客户姓名</text> 59 <text class="gray-deep-font font30r" space="true" decode="true">客户姓名</text>
47 - <view class="black-font font34r">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view> 60 + <view class="black-font font34r" wx:if="{{bookInfo.rname}}">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view>
48 </view> 61 </view>
49 <view class="flex-lr order-detail"> 62 <view class="flex-lr order-detail">
50 <view class="gray-deep-font font30r">客户电话</view> 63 <view class="gray-deep-font font30r">客户电话</view>
@@ -124,15 +124,12 @@ view{ @@ -124,15 +124,12 @@ view{
124 } 124 }
125 .reserve-status-tip{ 125 .reserve-status-tip{
126 position: absolute; 126 position: absolute;
127 - top:200rpx;  
128 - right:140rpx; 127 + top:220rpx;
  128 + right:240rpx;
129 width: 82rpx; 129 width: 82rpx;
130 height: 52rpx; 130 height: 52rpx;
131 z-index: 99; 131 z-index: 99;
132 } 132 }
133 -.reserve-status-tip.online{  
134 - top:150rpx;  
135 -}  
136 .reserve-status-tip .text{ 133 .reserve-status-tip .text{
137 font-weight: bold; 134 font-weight: bold;
138 font-size: 32rpx; 135 font-size: 32rpx;
@@ -40,6 +40,10 @@ Page({ @@ -40,6 +40,10 @@ Page({
40 this.reserveId=opt.rid 40 this.reserveId=opt.rid
41 delete opt.rid 41 delete opt.rid
42 } 42 }
  43 + if(opt.goPath){//商户端跳入带入的参数
  44 + this.goPath=opt.goPath
  45 + delete opt.goPath
  46 + }
43 this.indexOpt=opt; 47 this.indexOpt=opt;
44 mta.Page.init({ 48 mta.Page.init({
45 "appID":"500667280", 49 "appID":"500667280",
@@ -108,6 +112,11 @@ Page({ @@ -108,6 +112,11 @@ Page({
108 url:url 112 url:url
109 }) 113 })
110 } 114 }
  115 + if(this.goPath){
  116 + return wx.reLaunch({
  117 + url:'./'+this.goPath
  118 + })
  119 + }
111 }, 120 },
112 async getbooklist(isExport=false){ 121 async getbooklist(isExport=false){
113 let time=0; 122 let time=0;
@@ -128,7 +137,8 @@ Page({ @@ -128,7 +137,8 @@ Page({
128 formdata.x=1; 137 formdata.x=1;
129 formdata.y=200; 138 formdata.y=200;
130 let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY); 139 let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);
131 - formdata.rdate=rdate; 140 + formdata.rdate=util.unixtoTime(rdate.substr(0,10),"YYYYMMDD");
  141 + formdata.ddate_solt=parseInt(time)+1
132 if(isExport){ 142 if(isExport){
133 this.__exportFile(formdata); 143 this.__exportFile(formdata);
134 }else{ 144 }else{
@@ -240,7 +250,7 @@ Page({ @@ -240,7 +250,7 @@ Page({
240 ReservesCountDay(day){ 250 ReservesCountDay(day){
241 App.Reserve.ReservesCountDay({ 251 App.Reserve.ReservesCountDay({
242 sid:this.sellerid, 252 sid:this.sellerid,
243 - day:day 253 + day:day.replace(/\-/g,'')
244 }).then(res=>{ 254 }).then(res=>{
245 255
246 let ReservesTotal=0; 256 let ReservesTotal=0;
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </view> 36 </view>
37 <view class="book-list-cut flex-ll font26r black-font"> 37 <view class="book-list-cut flex-ll font26r black-font">
38 <text>已订 {{ReservesTotal}}</text> 38 <text>已订 {{ReservesTotal}}</text>
39 - <text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDay.key">{{timeStrLabel[index]}} {{item}}</text> 39 + <text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDaykey">{{timeStrLabel[index]}} {{item}}</text>
40 </view> 40 </view>
41 <block wx:if="{{!bookList}}"> 41 <block wx:if="{{!bookList}}">
42 <nothingBook height="{{listHeight}}"></nothingBook> 42 <nothingBook height="{{listHeight}}"></nothingBook>
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 </view> 53 </view>
54 <view class="book-list" style="padding-bottom:118rpx;"> 54 <view class="book-list" style="padding-bottom:118rpx;">
55 <view class="book-list-body"> 55 <view class="book-list-body">
56 - <block wx:for="{{bookList}}" wx:key="bookList.key"> 56 + <block wx:for="{{bookList}}" wx:key="bookListkey">
57 <bookList item="{{item}}" class="orderbook"></bookList> 57 <bookList item="{{item}}" class="orderbook"></bookList>
58 </block> 58 </block>
59 </view> 59 </view>
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 import util from '../../../utils/util'; 2 import util from '../../../utils/util';
3 import App from '../../../utils/api'; 3 import App from '../../../utils/api';
4 import TP from '../../../utils/tpls'; 4 import TP from '../../../utils/tpls';
  5 +import RS from '../../../utils/reserveStatus'
5 const {regeneratorRuntime} = global 6 const {regeneratorRuntime} = global
6 Page({ 7 Page({
7 8
@@ -44,11 +45,24 @@ Page({ @@ -44,11 +45,24 @@ Page({
44 res.data.tables.forEach(t=>{ 45 res.data.tables.forEach(t=>{
45 tables.push(t.name); 46 tables.push(t.name);
46 }) 47 })
  48 + let reserev=RS.reserve(res.data)
  49 + console.log('reserev',reserev)
  50 + let dateSmart
  51 + if(res.data.type==1){
  52 + dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[0])
  53 + if(res.data.is_set_ddate==1){
  54 + dateSmart+=' '+util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[1])
  55 + }else{
  56 + dateSmart+=' '+reserev.soltName
  57 + }
  58 + }else{
  59 + dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStr)
  60 + }
47 this.setData({ 61 this.setData({
48 seller:{ 62 seller:{
49 name:res.data.seller.sellername, 63 name:res.data.seller.sellername,
50 room:tables.join('、'), 64 room:tables.join('、'),
51 - date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr), 65 + date:dateSmart,
52 addr:res.data.seller.real_address||res.data.seller.map_address, 66 addr:res.data.seller.real_address||res.data.seller.map_address,
53 image:res.data.image_url, 67 image:res.data.image_url,
54 hasOwner:true, 68 hasOwner:true,
@@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
17 </swiper> 17 </swiper>
18 <view class="flex-vc" 18 <view class="flex-vc"
19 style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;"> 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" > 20 + <view class="tabs flex-ll" bindtap="gotoDetail" >
  21 + <formids class="back" >
22 <view style="min-width: 100rpx;" class="flex-ll"> 22 <view style="min-width: 100rpx;" class="flex-ll">
23 <image class="back-image" 23 <image class="back-image"
24 src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image> 24 src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image>
@@ -74,18 +74,15 @@ Page({ @@ -74,18 +74,15 @@ Page({
74 getMembers(hasReachBottom=false){ 74 getMembers(hasReachBottom=false){
75 let params={ 75 let params={
76 sid:this.seller_id, 76 sid:this.seller_id,
77 - x:this.offset,  
78 - y:this.limit,  
79 - rdate:'1234567890-9999999999',  
80 - sort:1,  
81 - type:1, 77 + page:this.offset,
  78 + size:this.limit,
82 } 79 }
83 if(this.data.activeType==1){ 80 if(this.data.activeType==1){
84 - params.status='0,0' 81 + params.flag='0'
85 }else{ 82 }else{
86 - params.status='1,2,3,4,5,6' 83 + params.flag='1'
87 } 84 }
88 - App.Reserve.GetReserveList(params).then((res)=>{ 85 + App.Reserve.GetOnlineReserveList(params).then((res)=>{
89 let list = res.data 86 let list = res.data
90 if(list.length>0){ 87 if(list.length>0){
91 list.forEach((r,i)=>{ 88 list.forEach((r,i)=>{
@@ -17,7 +17,13 @@ @@ -17,7 +17,13 @@
17 </view> 17 </view>
18 <view class="flex-ll"> 18 <view class="flex-ll">
19 <view class="label">就餐时间:</view> 19 <view class="label">就餐时间:</view>
20 - <view class="content">{{util.unixtoTime(item.ddate,'YYYY-MM-DD HH:II')}}</view> 20 + <view class="content" wx:if="{{item.is_set_ddate==1}}">
  21 + {{util.unixtoTime(item.ddate,'YYYY-MM-DD '+util.reserveTimeSpace(item.ddate_solt)+' HH:II')}}
  22 + </view>
  23 + <view class="content" wx:else="">
  24 + {{util.unixtoTime(item.ddate,'YYYY-MM-DD')}}
  25 + {{util.reserveTimeSpace(item.ddate_solt)}}
  26 + </view>
21 </view> 27 </view>
22 <view class="flex-lr"> 28 <view class="flex-lr">
23 <view class="flex-ll"> 29 <view class="flex-ll">
@@ -143,8 +143,10 @@ Page({ @@ -143,8 +143,10 @@ Page({
143 time=this.data.time; 143 time=this.data.time;
144 } 144 }
145 let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.year); 145 let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.year);
146 - formdata.rdate=rdate; 146 + //formdata.rdate=rdate;
147 formdata.status='1,2,5'; 147 formdata.status='1,2,5';
  148 + formdata.rdate=util.unixtoTime(rdate.substr(0,10),"YYYYMMDD");
  149 + formdata.ddate_solt=parseInt(time)+1
148 obj.rdate=rdate; 150 obj.rdate=rdate;
149 let tids={}; 151 let tids={};
150 let reserves=await App.Reserve.GetReserveList(formdata); 152 let reserves=await App.Reserve.GetReserveList(formdata);
@@ -153,10 +155,14 @@ Page({ @@ -153,10 +155,14 @@ Page({
153 let ts=r.tid.split(','); 155 let ts=r.tid.split(',');
154 ts.forEach(tid=>{ 156 ts.forEach(tid=>{
155 let rname=''; 157 let rname='';
156 - if(r.sex==3){  
157 - rname=r.rname.substr(0,10) 158 + if(r.rname){
  159 + if(r.sex==3){
  160 + rname=r.rname.substr(0,10)
  161 + }else{
  162 + rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
  163 + }
158 }else{ 164 }else{
159 - rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士') 165 + rname=" "
160 } 166 }
161 tids[tid]={ 167 tids[tid]={
162 rdate:r.rdate, 168 rdate:r.rdate,
1 // pages/book/b_sms.js 1 // pages/book/b_sms.js
2 var util = require('../../../utils/util.js') 2 var util = require('../../../utils/util.js')
3 import App from '../../../utils/api'; 3 import App from '../../../utils/api';
4 -import bcm from '../../../utils/bookCommon';  
5 -const {regeneratorRuntime} = global  
6 -import ST from '../../../utils/sms_tpls';  
7 -const tpls = {  
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}期待您的光临,预祝就餐愉快!',  
10 - SMS_163050401: '尊敬的贵宾,您好!\n ${seller_name}已为您安排${date}的用餐,房间:${region_room_name}; \n地址:${seller_addr}; \n电话:${seller_phone} \n预祝用餐愉快,${cusman}期待您的光临!',  
11 -};  
12 Page({ 4 Page({
13 5
14 /** 6 /**
@@ -24,16 +16,10 @@ Page({ @@ -24,16 +16,10 @@ Page({
24 * 生命周期函数--监听页面加载 16 * 生命周期函数--监听页面加载
25 */ 17 */
26 onLoad: function (options) { 18 onLoad: function (options) {
  19 + this.options=options;
27 this.enter_params=util.cache('enter_params'); 20 this.enter_params=util.cache('enter_params');
28 - App.Reserve.SellerInfo(this.enter_params).then(res=>{  
29 - this.sc=res.data;  
30 - try{  
31 - this.tplsIndex=res.data.setting.template_code  
32 - }catch(e){}  
33 - this.getDetail(options.id);  
34 - }); 21 + this.getDetail();
35 }, 22 },
36 -  
37 /** 23 /**
38 * 生命周期函数--监听页面初次渲染完成 24 * 生命周期函数--监听页面初次渲染完成
39 */ 25 */
@@ -62,28 +48,18 @@ Page({ @@ -62,28 +48,18 @@ Page({
62 48
63 }, 49 },
64 bookInfo: null, 50 bookInfo: null,
65 - async getDetail(id){  
66 - let res=await App.Reserve.Detail({rid: id, openid: ''});  
67 - this.bookInfo=res.data  
68 - if(res.data.operator_openid==2){//运营处理订单,强制使用运营短信  
69 - this.tplsIndex='SMS_173950289'  
70 - }  
71 - let tplMsg=await ST.getTplMsg(res.data,this.tplsIndex,this.sc) 51 + async getDetail(){
  52 + let msg=await App.SendSMS.GetSmsContent({rid: this.options.id});
  53 + console.log('tplMsg',msg.data.content)
72 this.setData({ 54 this.setData({
73 - bookInfo: res.data,  
74 - tplMsg: tplMsg 55 + tplMsg: msg.data.content
75 }) 56 })
76 -  
77 }, 57 },
78 sendsms(){ 58 sendsms(){
79 - App.SendSMS.Message({  
80 - phone: this.bookInfo.phone,  
81 - sign_name: '周到安排',  
82 - template_code: this.tplsIndex,  
83 - template_param: JSON.stringify(ST.smsData),  
84 - rid: this.bookInfo.id,  
85 - len:this.data.tplMsg.length  
86 - }).then((res) => { 59 + App.SendSMS.NewMessage({
  60 + rid: this.options.id,
  61 + sid:this.enter_params.seller_id,
  62 + }).then(res=>{
87 if (res.ret != 200) { 63 if (res.ret != 200) {
88 return util.toast(res.msg, 'none'); 64 return util.toast(res.msg, 'none');
89 } 65 }
@@ -91,7 +67,7 @@ Page({ @@ -91,7 +67,7 @@ Page({
91 this.setData({ 67 this.setData({
92 hideSendsms: true, 68 hideSendsms: true,
93 }) 69 })
94 - App.Reserve.SmsInfo({seller_id: this.bookInfo.seller.id}, 'clear') 70 + App.Reserve.SmsInfo({seller_id: this.enter_params.seller_id}, 'clear')
95 }) 71 })
96 }, 72 },
97 copysms(){ 73 copysms(){
  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 + is_set_ddate:0,
  21 +
  22 +}
  23 +Page({
  24 +
  25 + /**
  26 + * 页面的初始数据
  27 + */
  28 + data: {
  29 + dateStr: [],
  30 + form: JSON.parse(JSON.stringify(formTpl)),
  31 + tables: [],
  32 + grand: [
  33 + {
  34 + sex: 1,
  35 + grand_title: '先生',
  36 + isselect: true
  37 + },
  38 + {
  39 + sex: 2,
  40 + grand_title: '女士',
  41 + isselect: false
  42 + },
  43 + {
  44 + sex: 3,
  45 + grand_title: '公司',
  46 + isselect: false
  47 + }
  48 + ],
  49 + buttonhide: true,
  50 +
  51 + calendarMaskLoad: false,
  52 + calendarMask: false,
  53 + dayStyle: [
  54 + {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'},
  55 + {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'}
  56 + ],
  57 + timePickerArray: [
  58 + [],
  59 + [],
  60 + [],
  61 + ],
  62 + timePickerIndex: [0, 0, 0],
  63 + tablesLength: 0,
  64 +
  65 + timePickerMask: false,
  66 + pnumInputFocus: false,
  67 + pageMarginBottom: 0,
  68 + speciallist: [],
  69 + calendar: {
  70 + nextNum: 0,
  71 + },
  72 + defDtime: ['', '12:00', '18:30'],
  73 + hasUseDefDtime: true,
  74 + CustomRemark:[],
  75 + CustomRemarkMoreMask:false,
  76 + },
  77 + /**
  78 + * 生命周期函数--监听页面加载
  79 + */
  80 + reserve_id: '',
  81 + checkedTables:{},//已选中的桌子集合
  82 + year:util.unixtoTime(new Date() / 1000,'YYYY'),
  83 + onLoad: async function (options) {
  84 + this.options=options
  85 + this.initLoad(options)
  86 + this.getCustomRemark();
  87 + },
  88 + async initLoad(options = {}){
  89 + let nt = new Date() / 1000;
  90 + let speciallist = [
  91 + {date: util.unixtoTime(nt, 'YYYY-MM-DD'), background: '', text: '今 天'},
  92 + {date: util.unixtoTime(nt + 86400, 'YYYY-MM-DD'), background: '', text: '明 天'},
  93 + {date: util.unixtoTime(nt + 86400 * 2, 'YYYY-MM-DD'), background: '', text: '后 天'},
  94 + ];
  95 + this.reserve_id = options.id || '';
  96 + let rev_time=parseInt(nt)
  97 + if(options.hasQuick==1){
  98 + let rdate=options.ddate.split('-')
  99 + if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){
  100 + rev_time=rdate[0]
  101 + }
  102 + await this.setDateStr(rev_time);
  103 + }
  104 + //判断hasUseDefDtime
  105 + let hasUseDefDtime = true;
  106 + let mmii = util.unixtoTime(rev_time, 'HH:II');
  107 + if (mmii > this.data.defDtime[this.data.form.time]) {
  108 + hasUseDefDtime = false;
  109 + }
  110 + console.log('initLoad::setDateStr',util.unixtoTime(rev_time,'YYYY-MM-DD HH:II'),this.data.defDtime[this.data.form.time])
  111 + await this.setDateStr(rev_time,hasUseDefDtime);
  112 + this.sellerid = util.cache('enter_params')['seller_id'];
  113 + let timePickerArray = await comm.getDayTimeSpace();
  114 + this.setData({
  115 + timePickerArray: timePickerArray,
  116 + speciallist: speciallist,
  117 + hasUseDefDtime: hasUseDefDtime,
  118 + })
  119 + if (this.reserve_id > 0) {
  120 + this.initModify(this.reserve_id);
  121 + } else if(options.hasQuick==1){
  122 + this.initQuick(options);
  123 + } else {
  124 + this.getTables();
  125 + }
  126 + },
  127 +
  128 + hasInTimeSpace(hhii,timeIndex){
  129 + if(this.data.timePickerArray.length)return false
  130 + let timePickerArray=this.data.timePickerArray[timeIndex];
  131 + let tl=timePickerArray.length
  132 + if(tl<1) return false
  133 + console.log('hasInTimeSpace',hhii,timePickerArray[0],timePickerArray[tl-1],hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1])
  134 + if(hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1]) return true
  135 + return false
  136 + },
  137 + async setDateStr(d = new Date() / 1000,hasUseDefDtime=false,fouceTime=-1){
  138 + fouceTime=fouceTime>-1?fouceTime:this.data.form.time
  139 + hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[fouceTime],fouceTime)
  140 + if(hasUseDefDtime){//
  141 + let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[this.data.form.time])
  142 + d=util.timetouUnix(timestr)
  143 + }
  144 + console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime)
  145 + this.year=util.unixtoTime(d,'YYYY');
  146 + let ns = new Date() / 1000;
  147 + let dateStr = [
  148 + util.unixtoTime(ns, 'MM-DD `DAY/周WW`'),
  149 + util.unixtoTime(parseInt(ns) + 86400, 'MM-DD `DAY/周WW`'),
  150 + ];
  151 + //let dateStr=this.data.dateStr;
  152 + let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`')
  153 + let form = this.data.form;
  154 +
  155 + let timeObj = await comm.getTimeSpaceIndexData(d);
  156 + if(fouceTime!=timeObj.timeIndex && fouceTime>0){
  157 + timeObj.timeIndex=fouceTime
  158 + }
  159 + //form.time=await comm.getTimeSpaceIndex(d);
  160 + //如果小于默认时间,使用默认时间
  161 + let mmii = util.unixtoTime(d,'HH:II')
  162 + if (mmii < this.data.defDtime[timeObj.timeIndex]) {
  163 + hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[timeObj.timeIndex],timeObj.timeIndex)
  164 + if(hasUseDefDtime) {
  165 + let str = util.unixtoTime(d, 'YYYY-MM-DD ' + this.data.defDtime[timeObj.timeIndex] + ':00')
  166 + timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str));
  167 + }
  168 + }
  169 +
  170 + form.time = timeObj.timeIndex;
  171 + let ind = dateStr._indexOf(nowStr);
  172 + if (ind > -1) {
  173 + form.date = ind
  174 + } else {
  175 + dateStr.push(nowStr.substr(0, 5));
  176 + form.date = 2;
  177 + }
  178 + let timePickerIndex = this.data.timePickerIndex;
  179 + timePickerIndex[timeObj.timeIndex] = timeObj.timeMatchIndex;
  180 + form.is_set_ddate = this.is_set_ddate
  181 + let obj = {
  182 + dateStr: dateStr,
  183 + form: form,
  184 + timePickerIndex: timePickerIndex,
  185 + timeOpt: timeObj.timeOpt,
  186 + hasUseDefDtime:hasUseDefDtime
  187 + };
  188 +
  189 + this.setData(obj)
  190 + return obj;
  191 +
  192 + },
  193 +
  194 + /**
  195 + * 生命周期函数--监听页面初次渲染完成
  196 + */
  197 + onReady: function () {
  198 +
  199 + },
  200 +
  201 + /**
  202 + * 生命周期函数--监听页面显示
  203 + */
  204 + onShow: function () {
  205 + //if(!this.reserve_id || util.cache('tableid').length>0){
  206 + //if (util.cache('tableid').length > 0) {
  207 + this.getTables();
  208 + //}
  209 + setTimeout(() => {
  210 + this.setData({
  211 + calendarMaskLoad: true,
  212 + })
  213 + }, 1000);
  214 + this.conditionInfo()
  215 + },
  216 +
  217 + /**
  218 + * 生命周期函数--监听页面隐藏
  219 + */
  220 + onHide: function () {
  221 +
  222 + },
  223 +
  224 + /**
  225 + * 生命周期函数--监听页面卸载
  226 + */
  227 + onUnload: function () {
  228 +
  229 + },
  230 +
  231 + /**
  232 + * 页面相关事件处理函数--监听用户下拉动作
  233 + */
  234 + onPullDownRefresh: function () {
  235 +
  236 + },
  237 +
  238 + /**
  239 + * 页面上拉触底事件的处理函数
  240 + */
  241 + onReachBottom: function () {
  242 +
  243 + },
  244 +
  245 + /**
  246 + * 用户点击右上角分享
  247 + */
  248 + onShareAppMessage: function () {
  249 +
  250 + },
  251 + async selectedValueAsync(e){
  252 + console.log(e);
  253 + let key = util.attr(e, 'key');
  254 + let val;
  255 + let sobj = {};
  256 + if (key == 'date') {
  257 + this.year=util.unixtoTime(new Date() / 1000,'YYYY');
  258 + }
  259 + if (e.type == 'input' || e.type == 'confirm') {
  260 + val = util.val(e);
  261 + if (key == 'phone') {
  262 + var that = this;
  263 + if (e.detail.value != '' && e.detail.value.length >= 3) {
  264 + App.Reserve.GetReserveUser(
  265 + {
  266 + keywords: e.detail.value,
  267 + sid: this.sellerid
  268 + }
  269 + ).then(function (json) {
  270 + if (json.ret == 200 && json.data.length > 0) {
  271 + that.setData({
  272 + searchlist: json.data
  273 + })
  274 + } else {
  275 + that.setData({
  276 + searchlist: null
  277 + })
  278 + }
  279 + })
  280 + } else {
  281 + this.setData({
  282 + searchlist: null
  283 + })
  284 + }
  285 + }
  286 + if (key == 'pnum') {
  287 + sobj.pnumInputFocus = true;
  288 + }
  289 + } else {
  290 + val = util.attr(e, 'value');
  291 + }
  292 + if (key == 'time') {
  293 + if (this.data.timeOpt[val]) return;
  294 + }
  295 + if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) {
  296 + if (util.attr(e, 'display') != 'block') {
  297 + return;
  298 + }
  299 + }
  300 + let form = this.data.form;
  301 +
  302 + if (key == 'tid') {
  303 + let ts = this.data.tables;
  304 + if (ts[val].isselect) {
  305 + ts[val].isselect = false;
  306 + form.tid.remove(ts[val].id);
  307 + delete this.checkedTables[ts[val].id]
  308 + } else {
  309 + ts[val].isselect = true;
  310 + form.tid.push(ts[val].id);
  311 + this.checkedTables[ts[val].id]=ts[val].name
  312 + }
  313 + sobj.tables = ts;
  314 + } else {
  315 + form[key] = val;
  316 + }
  317 + console.log('ts', sobj.tables,this.checkedTables);
  318 + //console.log(e.type,key,val,form);
  319 + sobj.form = form;
  320 + sobj.buttonhide = this.data.buttonhide;
  321 + if (form.tid.length > 0 && form.rname.length > 0) {
  322 + sobj.buttonhide = false;
  323 + }else{
  324 + sobj.buttonhide = true;
  325 + }
  326 + let displayTimes = false;
  327 + if (key == 'time') {
  328 + if (util.attr(e, 'display') == 'block') {
  329 + displayTimes = true;
  330 + sobj.timePickerMask = true;
  331 + }
  332 + }
  333 + //判断hasUseDefDtime
  334 + if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
  335 + sobj.hasUseDefDtime = true
  336 + let ntime = parseInt(new Date() / 1000)
  337 + let xtime =ntime
  338 + if(key == 'time'){
  339 + xtime=util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[this.data.form.date].substr(0, 5)) + ' HH:II:SS');
  340 + xtime=util.timetouUnix(xtime)
  341 + //if 当前时间在区间内 hasUseDefDtime 为 false
  342 + let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
  343 + this.data.form.time, null,null,this.year);
  344 + d_rdate=d_rdate.split('-');
  345 + if(d_rdate[0] <= ntime && ntime<=d_rdate[1]){
  346 + sobj.hasUseDefDtime=false
  347 + }
  348 + }
  349 + this.setDateStr(xtime,sobj.hasUseDefDtime,sobj.form.time);
  350 + }
  351 + if (this.data.form.date == 0) {//
  352 + let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
  353 + if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
  354 + sobj.hasUseDefDtime = false;
  355 + }
  356 + }
  357 + if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
  358 + if (!displayTimes) {
  359 + //sobj.form.tid = []; //切换日期时间清空桌位
  360 + //sobj.buttonhide = true;
  361 + this.getTables();
  362 + }
  363 + if (key == 'date') {
  364 + let xtime = util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
  365 + this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
  366 + }
  367 + }
  368 +
  369 + this.setData(sobj)
  370 + },
  371 + selectedValue(e){
  372 + console.log(e);
  373 + let key = util.attr(e, 'key');
  374 + let val;
  375 + let sobj = {};
  376 + if (key == 'date') {
  377 + this.year=util.unixtoTime(new Date() / 1000,'YYYY');
  378 + }
  379 + if (e.type == 'input' || e.type == 'confirm') {
  380 + val = util.val(e);
  381 + if (key == 'phone') {
  382 + var that = this;
  383 + if (e.detail.value != '' && e.detail.value.length >= 3) {
  384 + App.Reserve.GetReserveUser(
  385 + {
  386 + keywords: e.detail.value,
  387 + sid: this.sellerid
  388 + }
  389 + ).then(function (json) {
  390 + if (json.ret == 200 && json.data.length > 0) {
  391 + that.setData({
  392 + searchlist: json.data
  393 + })
  394 + } else {
  395 + that.setData({
  396 + searchlist: null
  397 + })
  398 + }
  399 + })
  400 + } else {
  401 + this.setData({
  402 + searchlist: null
  403 + })
  404 + }
  405 + }
  406 + if (key == 'pnum') {
  407 + sobj.pnumInputFocus = true;
  408 + }
  409 + } else {
  410 + val = util.attr(e, 'value');
  411 + }
  412 + if (key == 'time') {
  413 + if (this.data.timeOpt[val]) return;
  414 + }
  415 + if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) {
  416 + if (util.attr(e, 'display') != 'block') {
  417 + return;
  418 + }
  419 + }
  420 + let form = this.data.form;
  421 +
  422 + if (key == 'tid') {
  423 + let ts = this.data.tables;
  424 + if (ts[val].isselect) {
  425 + ts[val].isselect = false;
  426 + form.tid.remove(ts[val].id);
  427 + delete this.checkedTables[ts[val].id]
  428 + } else {
  429 + ts[val].isselect = true;
  430 + form.tid.push(ts[val].id);
  431 + this.checkedTables[ts[val].id]=ts[val].name
  432 + }
  433 + sobj.tables = ts;
  434 + } else {
  435 + form[key] = val;
  436 + }
  437 + console.log('ts', sobj.tables,this.checkedTables);
  438 + //console.log(e.type,key,val,form);
  439 + sobj.form = form;
  440 + sobj.buttonhide = this.data.buttonhide;
  441 + if (form.tid.length > 0 && form.rname.length > 0) {
  442 + sobj.buttonhide = false;
  443 + }else{
  444 + sobj.buttonhide = true;
  445 + }
  446 + let displayTimes = false;
  447 + if (key == 'time') {
  448 + if (util.attr(e, 'display') == 'block') {
  449 + displayTimes = true;
  450 + sobj.timePickerMask = true;
  451 + }
  452 + }
  453 + //判断hasUseDefDtime
  454 + if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
  455 + sobj.hasUseDefDtime = true
  456 + let ntime = parseInt(new Date() / 1000)
  457 + let xtime =ntime
  458 + if(key == 'time'){
  459 + xtime=util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[this.data.form.date].substr(0, 5)) + ' HH:II:SS');
  460 + xtime=util.timetouUnix(xtime)
  461 + }
  462 + this.setDateStr(xtime,sobj.hasUseDefDtime);
  463 + }
  464 + if (this.data.form.date == 0) {//
  465 + let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
  466 + if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
  467 + sobj.hasUseDefDtime = false;
  468 + }
  469 + }
  470 + if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
  471 + if (!displayTimes) {
  472 + //sobj.form.tid = []; //切换日期时间清空桌位
  473 + //sobj.buttonhide = true;
  474 + this.getTables();
  475 + }
  476 + if (key == 'date') {
  477 + let xtime = util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
  478 + this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
  479 + }
  480 + }
  481 +
  482 + this.setData(sobj)
  483 + },
  484 + async getTables(){
  485 + let form = this.data.form;
  486 + let tableid = util.cache('tableid');
  487 + console.log('getTables-tableid', tableid.length, this.reserve_id);
  488 + //if (tableid.length < 1 && this.reserve_id) {
  489 + if (tableid.length < 1) {
  490 + tableid = this.data.form.tid;
  491 + }
  492 + console.log('getTables-tableid', tableid, tableid.length);
  493 + try {
  494 + let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time,null,null,this.year);
  495 + console.log('rdate', this.data.dateStr[this.data.form.date], rdate);
  496 + App.Reserve.GetTableList({
  497 + sid: util.cache('enter_params')['seller_id'],
  498 + //pnum_str:form.pnum_str,
  499 + pnum: form.pnum,
  500 + rdate: util.unixtoTime(rdate.substr(0,10),'YYYYMMDD'),
  501 + tid: form.tabid,
  502 + rid: this.reserve_id,
  503 + ddate_solt:parseInt(form.time)+1
  504 + }).then(res => {
  505 + let tables = [];
  506 + let tablesLength = 0;
  507 + if (tableid.length > 0) {
  508 + let toastTables={...this.checkedTables}
  509 + let resData=res.data.slice(1,res.data.length);
  510 + console.log('resData',resData)
  511 + resData.forEach(p => {
  512 + //if(tables.length>=3) return true;
  513 + p.list.forEach(t => {
  514 + delete toastTables[t.id]
  515 + tablesLength++;
  516 + if (tables.length >= 3) return true;
  517 + if (tableid._indexOf(t.id) > -1) {
  518 + t.isselect = true;
  519 + tables.push(t);
  520 + }
  521 + })
  522 + })
  523 + console.log('toastTables',toastTables,this.data.form.tid,this.checkedTables);
  524 + //清理已选中的桌位
  525 + let toastTablesInfo=[];
  526 + let tid=this.data.form.tid
  527 + Object.keys(this.checkedTables).forEach(ckid=>{
  528 + if(toastTables[ckid]){
  529 + delete this.checkedTables[ckid]
  530 + tid.remove(ckid);
  531 + toastTablesInfo.push(toastTables[ckid]);
  532 + }
  533 + })
  534 + if(toastTablesInfo.length>0){
  535 + this.setData({
  536 + [`form.tid`]:tid,
  537 + })
  538 + util.toast(toastTablesInfo.toString()+'已被占用啦','none');
  539 + }
  540 + wx.removeStorage({key: 'tableid'})
  541 + }
  542 + console.log('tables-first',tables);
  543 + if(tables.length<1){
  544 + tablesLength=0;
  545 + let fortids=[];
  546 + res.data.forEach((p,ri) => {
  547 + p.list.forEach(t => {
  548 + if(fortids._indexOf(t.id)<0) {
  549 + tablesLength++;
  550 + tables.push(t);
  551 + fortids.push(t.id);
  552 + }
  553 + })
  554 + })
  555 + if (tables.length >= 3) {
  556 + tables = tables.slice(0, 3);
  557 + }
  558 + }
  559 + this.tablesLength = tablesLength;
  560 + this.setData({
  561 + tables: tables,
  562 + tablesLength: tablesLength
  563 + })
  564 + this.conditionInfo();
  565 + })
  566 + } catch (e) {
  567 + this.setData({
  568 + tables: []
  569 + })
  570 + }
  571 + },
  572 + async formsubmit(){
  573 + if (this.data.buttonhide) return;
  574 + try {
  575 + let d_stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
  576 + let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
  577 + this.data.form.time, d_stimestr,null,this.year);
  578 + let stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]];
  579 + let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
  580 + this.data.form.time, stimestr,null,this.year);
  581 + console.log('stimestr', stimestr, this.data.form.time, this.data.timePickerIndex);
  582 + console.log('rdate', rdate);
  583 + this.setData({
  584 + buttonhide: true,
  585 + })
  586 + let form = JSON.parse(JSON.stringify(this.data.form));
  587 + console.log('typeof form.tid', typeof form.tid);
  588 + if (typeof form.tid == 'object') {
  589 + let tid = new Set(form.tid);//tid 去重
  590 + form.tid = [...tid].toString();
  591 + }
  592 + if (!form.tid) {
  593 + return util.toast('请选择桌子', 'none');
  594 + }
  595 + if (!form.rname) {
  596 + return util.toast('请填写预订人', 'none');
  597 + }
  598 + form.sid = this.sellerid;
  599 + form.rdate = rdate
  600 +
  601 + try {
  602 + let enter_params = util.cache('enter_params');
  603 + let sc = (await App.Reserve.SellerInfo(enter_params)).data
  604 + let note_openid = enter_params.seller_openid;
  605 + let note_name = sc.seller_user.nick_name || sc.seller_user.nickname;
  606 + form.note_openid = note_openid || '';
  607 + if (form.rid) {//修改时传递uid
  608 + form.note_openid = enter_params.manager_id || '';
  609 + }
  610 + form.note_name = note_name || '';
  611 + } catch (e) {}
  612 +
  613 + form.ddate = d_rdate.substr(0, 10);
  614 + if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间
  615 + let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");
  616 + form.ddate = util.timetouUnix(ddateStr);
  617 + }
  618 + //App.Customer.SetReserveInfoById
  619 + form.ddate_solt=parseInt(form.time)+1
  620 + App.Customer.SetReserveInfoById(form).then(res => {
  621 + if (res.ret == 200) {
  622 + this.getCustomRemark()
  623 + let _id = (res.data.id || res.data)
  624 + this.setData({
  625 + form: JSON.parse(JSON.stringify(formTpl)),
  626 + tables: [],
  627 + timePickerIndex: [0, 0, 0],
  628 + })
  629 + this.initLoad();
  630 + this.checkedTables={};
  631 + App.Reserve.Detail({rid: _id, openid: ''}, 'clear')
  632 + wx.redirectTo({
  633 + url: util.http_build_query({id:_id,tplid:1},'b_invitation'),
  634 + });
  635 + } else {
  636 + util.toast(res.msg, 'none')
  637 + }
  638 + })
  639 + } catch (e) {
  640 + }
  641 + },
  642 + selectphone: function (e) {
  643 + this.data.form.phone = e.detail.phone;
  644 + this.data.form.rname = e.detail.rname;
  645 + this.data.form.cusdem = e.detail.cusdem;
  646 + var form = this.data.form
  647 + this.data.form.sex = e.detail.sex;
  648 + this.setData({
  649 + form: this.data.form,
  650 + searchlist: null
  651 + })
  652 + this.conditionInfo();
  653 + },
  654 + calendarShow(){
  655 + this.setData({
  656 + calendarMask: true
  657 + })
  658 + },
  659 + dateChange(event){
  660 + console.log(event);
  661 + //let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day)
  662 + let cktime = util.timetouUnix(event.detail.date)
  663 + this.year=event.detail.date.substr(0, 4);
  664 + console.log('this.year',this.year);
  665 + let day0 = parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);
  666 + // if (cktime < day0) {
  667 + // util.toast('请选择有效日期', 'none');
  668 + // return;
  669 + // }
  670 + let clickDay = event.detail.date.substr(8, 2);
  671 + let changeDay = `dayStyle[1].day`;
  672 + let changeBg = `dayStyle[1].background`;
  673 + this.setData({
  674 + [changeDay]: clickDay,
  675 + [changeBg]: "#84e7d0",
  676 + //[`form.tid`]: [], //切换日期时间清空桌位
  677 + //buttonhide: true,
  678 + })
  679 + console.log('cktime',cktime,util.unixtoTime(cktime,'YYYY-MM-DD'))
  680 + if(cktime == day0){//今天
  681 + this.setDateStr( new Date() / 1000 )
  682 + }else{
  683 + let xtime=util.unixtoTime(new Date() / 1000, event.detail.date + ' HH:II:SS');
  684 + xtime=util.timetouUnix(xtime)
  685 + this.setDateStr(xtime,true)
  686 + }
  687 +
  688 + this.calendarClose();
  689 + setTimeout(res=>{
  690 + this.getTables();
  691 + },10)
  692 +
  693 + },
  694 + calendarClose(){
  695 + this.setData({
  696 + calendarMask: false,
  697 + timePickerMask: false,
  698 + })
  699 + },
  700 + async selectdesk(){
  701 + let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time,null,null,this.year);
  702 + console.log(this.data.form)
  703 + wx.navigateTo({
  704 + url: 'b_desk?rdate=' + rdate + '&tid=' + this.data.form.tabid
  705 + //+'&pnum_str='+this.data.form.pnum_str
  706 + + '&pnum=' + this.data.form.pnum
  707 + + '&checked_tids=' + this.data.form.tid
  708 + + '&rid=' + this.reserve_id
  709 + + '&ddate_solt='+(this.data.form.time+1)
  710 + })
  711 + },
  712 + conditionInfo: function () {
  713 + var form = this.data.form
  714 + if (form.tid.length > 0 && form.rname.length > 0) {
  715 + this.data.buttonhide = false;
  716 + }
  717 + this.setData({
  718 + buttonhide: this.data.buttonhide
  719 + })
  720 + },
  721 + /**
  722 + * 选中时间区域
  723 + */
  724 + bindTimePickerChange(e){
  725 + let timeIndex = util.attr(e, 'timeIndex');
  726 + if (timeIndex < 0) return;
  727 + let timePickerIndex = this.data.timePickerIndex;
  728 + //timePickerIndex[timeIndex]=util.val(e);
  729 + timePickerIndex[timeIndex] = util.attr(e, 'val');
  730 +
  731 + console.log(e, timeIndex, util.attr(e, 'val'));
  732 + this.setData({
  733 + timePickerIndex: timePickerIndex,
  734 + hasUseDefDtime: false,
  735 + [`form.is_set_ddate`]:1,
  736 + })
  737 + },
  738 + /**
  739 + * 修改初始化
  740 + */
  741 + is_set_ddate:0,
  742 + async initModify(id){
  743 + try {
  744 + let res = await App.Reserve.Detail({rid: id, openid: ''});
  745 + this.is_set_ddate=res.data.is_set_ddate
  746 + console.log('initModify', res);
  747 + //设置日期
  748 + let obj = await this.setDateStr(res.data.ddate,null,res.data.ddate_solt-1);
  749 + //设置时间
  750 + let nd = util.unixtoTime(res.data.ddate, 'HH:II');
  751 + let timePickerIndex = this.data.timePickerIndex
  752 + console.log('initModify-', this.data.timePickerArray, obj.form.time, nd)
  753 + this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {
  754 + console.log('initModify-', nd, dd)
  755 + if (nd == dd) {
  756 + timePickerIndex[obj.form.time] = ii;
  757 + return true;
  758 + }
  759 + })
  760 +
  761 + console.log('initModify-timePickerIndex', timePickerIndex);
  762 + //obj.form.pnum_str=res.data.pnum_str;
  763 + obj.form.pnum = res.data.pnum || 6;
  764 + obj.form.rname = res.data.rname;
  765 + obj.form.phone = res.data.phone || "";
  766 + obj.form.sex = res.data.sex;
  767 + obj.form.cusdem = res.data.cusdem;
  768 + obj.form.is_set_ddate=res.data.is_set_ddate
  769 + obj.form.rid = id;
  770 + obj.form.tid = [];
  771 + let tablesed = [];
  772 + res.data.tables.forEach((t, ti) => {
  773 + obj.form.tid.push(t.id)
  774 + if (ti >= 3) return;
  775 + t.isselect = true
  776 + t["isselected"] = 1
  777 + tablesed.push(t);
  778 + this.checkedTables[t.id]=t.name;
  779 + })
  780 + this.setData({
  781 + timePickerIndex: timePickerIndex,
  782 + form: obj.form,
  783 + //tablesed:tablesed,
  784 + hasUseDefDtime: false,
  785 + })
  786 + setTimeout(() => {
  787 + this.getTables();
  788 + }, 300)
  789 +
  790 + } catch (e) {
  791 + console.log('initModify', e)
  792 + }
  793 + },
  794 + pnumInputFocusEvent(e){
  795 + console.log(e);
  796 + this.setData({
  797 + pnumInputFocus: 'focus' == e.type
  798 + })
  799 + },
  800 + inputFocusTime: 0,
  801 + blurTime: 0,
  802 + inputFocus(e){
  803 + console.log(e, this.inputFocusTime);
  804 + return;
  805 + if (e.timeStamp > this.inputFocusTime) {
  806 + this.inputFocusTime = e.timeStamp;
  807 + if (e.type == 'focus' && this.data.pageMarginBottom == 0) {
  808 + this.setData({
  809 + pageMarginBottom: 300
  810 + })
  811 + setTimeout(res => {
  812 + this.pageScrollToBottom();
  813 + }, 100)
  814 + } else {
  815 + if (this.blurTime > 5) {
  816 + this.blurTime = 0;
  817 + this.setData({
  818 + pageMarginBottom: 0
  819 + })
  820 + } else {
  821 + setTimeout(res => {
  822 + this.blurTime += 1;
  823 + this.inputFocus(e);
  824 + }, 300)
  825 + }
  826 +
  827 + }
  828 +
  829 + }
  830 + },
  831 + pageScrollToBottom: function () {
  832 + wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) {
  833 + // 使页面滚动到底部
  834 + wx.pageScrollTo({
  835 + scrollTop: rect.bottom
  836 + })
  837 + }).exec()
  838 + },
  839 + gotoday(e){
  840 + this.setData({
  841 + [`calendar.nextNum`]: 0
  842 + })
  843 + },
  844 + nextMonth(e){
  845 + this.setData({
  846 + [`calendar.nextNum`]: this.data.calendar.nextNum + 1
  847 + })
  848 + },
  849 + prevMonth(e){
  850 + this.setData({
  851 + [`calendar.nextNum`]: this.data.calendar.nextNum - 1
  852 + })
  853 + },
  854 + /**
  855 + * 快速预订初始化
  856 + * tid
  857 + * tname
  858 + * ddate
  859 + * pnum
  860 + */
  861 + async initQuick(options){
  862 + try {
  863 + console.log('initQuick', options);
  864 + this.checkedTables[options.tid]=options.tname
  865 + this.year=util.unixtoTime(options.ddate.substr(0,10),'YYYY');
  866 + let form=this.data.form
  867 + form.tid=[options.tid]
  868 +
  869 + this.setData({
  870 + form: form,
  871 + })
  872 + setTimeout(() => {
  873 + this.getTables();
  874 + }, 300)
  875 + } catch (e) {
  876 + console.log('initQuick', e)
  877 + }
  878 + },
  879 + getCustomRemark(){
  880 + App.User.GetCustomRemark({
  881 + uid:util.cache('enter_params')['manager_id'],
  882 + }).then(res=>{
  883 + let CustomRemark=[];
  884 + res.data.forEach(r=>{
  885 + if(r.often_use){
  886 + CustomRemark.push(r);
  887 + }
  888 + })
  889 + this.setData({
  890 + CustomRemark:CustomRemark,
  891 + })
  892 + })
  893 + },
  894 + oftenUse(e){
  895 + let id=util.attr(e,'id');
  896 + let val=util.attr(e,'value');
  897 + let CustomRemark=this.data.CustomRemark;
  898 + let form=this.data.form;
  899 + CustomRemark.forEach(r=>{
  900 + if(id==r.id){
  901 + if(r.active){
  902 + form.cusdem=form.cusdem.replace(val+'、','')
  903 + }
  904 + r.active=!r.active
  905 + if(r.active){
  906 + form.cusdem+=val+'、'
  907 + }
  908 + }
  909 + })
  910 + this.setData({
  911 + CustomRemark:CustomRemark,
  912 + form:form,
  913 + })
  914 + this.conditionInfo()
  915 + },
  916 + CustomRemarkMore(){
  917 + this.setData({
  918 + CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask
  919 + })
  920 + }
  921 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"black",
  5 + "usingComponents": {
  6 + "nothingBook":"../../components/book/nothing/nothing",
  7 + "nav":"/components/nav/nav",
  8 + "tabBar":"../../components/book/tabBar/tabBar",
  9 + "searchList":"/components/searchlist/searchlist",
  10 + "calendar": "plugin://bmCalendar/calendar",
  11 + "board":"../../components/book/board/board",
  12 + "formids":"/components/formids/formids"
  13 + }
  14 +}
  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="selectedValueAsync" 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="selectedValueAsync" 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="selectedValueAsync" 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">
  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:400rpx;" cursor-spacing="260"/>
  153 + <view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095">
  154 + <block wx:if="{{form.is_set_ddate==1}}">
  155 + <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:if="{{hasUseDefDtime && form.time>0}}">{{defDtime[form.time]}}</view>
  156 + <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:else="">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view>
  157 + </block>
  158 + <view wx:else="" style="height: 100rpx;line-height: 100rpx;color:rgba(53,53,53,1);">未设置到店时间</view>
  159 + </view>
  160 + <block wx:if="{{searchlist}}">
  161 + <searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList>
  162 + </block>
  163 + </view>
  164 + <view class="book-info-single flex-lr" style="align-items:flex-start;">
  165 + <input placeholder="客户姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r"
  166 + maxlength="12" style="width:450rpx;" value="{{form.rname}}"
  167 + bindinput="selectedValue"
  168 + bindconfirm="selectedValue"
  169 + bindfocus="inputFocus"
  170 + bindblur="inputFocus"
  171 + data-key="rname"/>
  172 + <view class="book-info-grand flex-rr font28r gray-deep-font">
  173 + <block wx:for="{{grand}}" wx:key="grand.key">
  174 + <view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}"
  175 + bindtap="selectedValue"
  176 + data-value="{{item.sex}}"
  177 + data-key="sex">{{item.grand_title}}</view>
  178 + </block>
  179 + </view>
  180 + </view>
  181 +
  182 + <view class="book-info-single flex-lr">
  183 + <input placeholder="客户要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"
  184 + bindinput="selectedValue"
  185 + bindconfirm="selectedValue"
  186 + bindfocus="inputFocus"
  187 + bindblur="inputFocus"
  188 + data-key="cusdem"/>
  189 + <view class="CustomRemarkMore flex-rr">
  190 + <view bindtap="CustomRemarkMore">快速备注</view>
  191 + </view>
  192 + </view>
  193 + <view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;">
  194 + <view class="flex-lr CustomRemark">
  195 + <view class="CustomRemarks">
  196 + <view class="CustomRemarksView">
  197 + <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
  198 + bindtap="oftenUse"
  199 + data-id="{{item.id}}"
  200 + data-value="{{item.often_use}}">{{item.often_use}}</view>
  201 + </view>
  202 + </view>
  203 + </view>
  204 + </view>
  205 + </view>
  206 + <view class="page-full submit">
  207 + <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">完成预订</view>
  208 + </view>
  209 +</view>
  210 +<tabBar></tabBar>
  211 +<view class="calendar-mask" bindtap="calendarClose"
  212 + style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">
  213 + <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">
  214 + <calendar catchtap="catchtap"
  215 + isTodaybtn="{{true}}" todaybtn_txt="回到今天"
  216 + custom="{{false}}"
  217 + switchover="{{['上一月','下个月']}}"
  218 + active-coloro="active-coloro"
  219 + active-colort="active-colort"
  220 + speciallist="{{speciallist}}"
  221 + txt_style="txt-style"
  222 + calendar-style="calendar"
  223 + header-style="calendar-header"
  224 + weektitle-style="weektitle-style"
  225 + restcolor-style="restcolor-style"
  226 + txt_type="cn-d"
  227 +
  228 + datefont-style="datefont-style"
  229 + todaybtn-style="todaybtn-style"
  230 +
  231 + bindnextMonth="nextMonth"
  232 + bindprevMonth="prevMonth"
  233 + bindselectDate="dateChange"
  234 + bindgotoday="gotoday"
  235 +
  236 + prev="{{true||calendar.nextNum>0}}"
  237 + circle_show="{{false}}"
  238 + closelaststyle="{{true}}"
  239 + ></calendar>
  240 + </view>
  241 +</view>
  242 +<view class="calendar-mask" bindtap="calendarClose"
  243 + style="height:100%;" wx:if="{{timePickerMask}}">
  244 + <view class="timePicker">
  245 + <view class="flex-rr">
  246 + <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="calendarClose"></image>
  247 + </view>
  248 + <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">
  249 + <view bindtap="calendarClose">{{form.time==1?'午市':form.time==2?'晚市':'早市'}}</view>
  250 + </view>
  251 + <view class="flex-ll" style="flex-wrap:wrap">
  252 + <view class="time-item {{timePickerIndex[form.time]==index?'checked':''}}"
  253 + style="{{(index+1)%3==0?'margin-right:0;':''}}"
  254 + wx:for="{{timePickerArray[form.time]}}" wx:key=""
  255 + bindtap="bindTimePickerChange"
  256 + data-time-index="{{form.time}}"
  257 + data-val="{{index}}"
  258 + >{{item}}</view>
  259 + </view>
  260 + </view>
  261 +</view>
  262 +
  263 +<view class="calendar-mask" bindtap="CustomRemarkMore"
  264 + style="height:100%;" wx:if="{{CustomRemarkMoreMask}}">
  265 + <view class="timePicker" catchtap="catchtap">
  266 + <view class="flex-rr">
  267 + <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image>
  268 + </view>
  269 + <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">
  270 + <view bindtap="calendarClose">更多标签</view>
  271 + </view>
  272 + <view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;">
  273 + <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
  274 + wx:if="{{item.often_use}}" bindtap="oftenUse"
  275 + data-id="{{item.id}}"
  276 + data-value="{{item.often_use}}">{{item.often_use}}</view>
  277 + </view>
  278 + </view>
  279 +</view>
  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 +}
@@ -121,7 +121,7 @@ Page({ @@ -121,7 +121,7 @@ Page({
121 } 121 }
122 if(key=='send_msg'){ 122 if(key=='send_msg'){
123 obj.totalChar=form[key].length; 123 obj.totalChar=form[key].length;
124 - obj.totalSms=Math.ceil((form[key].length+3)/67); 124 + obj.totalSms=Math.ceil((form[key].length+4)/67);
125 } 125 }
126 obj.buttonStatus=false; 126 obj.buttonStatus=false;
127 if(this.data.form.send_msg && this.data.form.name && this.data.form.phone){ 127 if(this.data.form.send_msg && this.data.form.name && this.data.form.phone){
1 // pages/customer/detail_owner.js 1 // pages/customer/detail_owner.js
2 import util from '../../utils/util'; 2 import util from '../../utils/util';
3 import App from '../../utils/api'; 3 import App from '../../utils/api';
  4 +import RS from '../../utils/reserveStatus'
4 const {regeneratorRuntime} = global 5 const {regeneratorRuntime} = global
5 import TP from '../../utils/tpls'; 6 import TP from '../../utils/tpls';
6 Page({ 7 Page({
@@ -67,8 +68,9 @@ Page({ @@ -67,8 +68,9 @@ Page({
67 openid: getApp().openid, 68 openid: getApp().openid,
68 rid: this.id 69 rid: this.id
69 },fouce).then(res => { 70 },fouce).then(res => {
  71 + let reserev=RS.reserve(res.data)
70 this.setData({ 72 this.setData({
71 - detail:this.formatDatail(res.data) 73 + detail:this.formatDatail(reserev)
72 }) 74 })
73 }) 75 })
74 }, 76 },
@@ -3,6 +3,7 @@ var mta = require('mta-wechat-analysis') @@ -3,6 +3,7 @@ var mta = require('mta-wechat-analysis')
3 import util from '../../utils/util'; 3 import util from '../../utils/util';
4 import App from '../../utils/api'; 4 import App from '../../utils/api';
5 import TP from '../../utils/tpls'; 5 import TP from '../../utils/tpls';
  6 +import RS from '../../utils/reserveStatus'
6 const {regeneratorRuntime} = global 7 const {regeneratorRuntime} = global
7 Page({ 8 Page({
8 9
@@ -106,20 +107,33 @@ Page({ @@ -106,20 +107,33 @@ Page({
106 res.data.tables.forEach(t=>{ 107 res.data.tables.forEach(t=>{
107 tables.push(t.name); 108 tables.push(t.name);
108 }) 109 })
  110 + let reserev=RS.reserve(res.data)
  111 + console.log('reserev',reserev)
  112 + let dateSmart
  113 + if(res.data.type==1){
  114 + dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[0])
  115 + if(res.data.is_set_ddate==1){
  116 + dateSmart+=' '+util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[1])
  117 + }else{
  118 + dateSmart+=' '+reserev.soltName
  119 + }
  120 + }else{
  121 + dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStr)
  122 + }
109 this.setData({ 123 this.setData({
110 - detail: this.formatDatail(res.data), 124 + detail: this.formatDatail(res.data,dateSmart),
111 seller:{ 125 seller:{
112 name:res.data.seller.sellername, 126 name:res.data.seller.sellername,
113 room:tables.join('、'), 127 room:tables.join('、'),
114 - date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr), 128 + date:dateSmart,
115 addr:res.data.seller.real_address||res.data.seller.map_address, 129 addr:res.data.seller.real_address||res.data.seller.map_address,
116 image:res.data.image_url, 130 image:res.data.image_url,
117 } 131 }
118 }) 132 })
119 }) 133 })
120 }, 134 },
121 - formatDatail(detail){  
122 - detail.rdateStr = util.unixtoTime(detail.ddate, 'YYYY/MM/DD 星期WW HH:II'); 135 + formatDatail(detail,dateSmart){
  136 + detail.rdateStr = dateSmart;
123 detail.tableFirst = detail.tables[0].name; 137 detail.tableFirst = detail.tables[0].name;
124 if (detail.tables.length > 1) { 138 if (detail.tables.length > 1) {
125 detail.tableSubInfo = '等' + (detail.tables.length) + '个' 139 detail.tableSubInfo = '等' + (detail.tables.length) + '个'
@@ -200,7 +214,13 @@ Page({ @@ -200,7 +214,13 @@ Page({
200 util.toast('赴约成功', 'none') 214 util.toast('赴约成功', 'none')
201 let url='/pages/customer/list' 215 let url='/pages/customer/list'
202 if(parseInt(this.data.detail.ddate)-(new Date()/1000)>3600){ 216 if(parseInt(this.data.detail.ddate)-(new Date()/1000)>3600){
203 - url='/pages/customer/list?hasRelaTip=1' 217 + if(this.data.detail.type==1){
  218 + if(this.data.detail.is_set_ddate==1){
  219 + url='/pages/customer/list?hasRelaTip=1'
  220 + }
  221 + }else{
  222 + url='/pages/customer/list?hasRelaTip=1'
  223 + }
204 } 224 }
205 wx.reLaunch({ 225 wx.reLaunch({
206 url: url 226 url: url
@@ -109,27 +109,47 @@ Page({ @@ -109,27 +109,47 @@ Page({
109 res.data.tables.forEach(t=>{ 109 res.data.tables.forEach(t=>{
110 tables.push(t.name); 110 tables.push(t.name);
111 }) 111 })
  112 + let reserev=RS.reserve(res.data)
  113 + console.log('reserev',reserev)
  114 + let dateSmart
  115 + if(res.data.type==1){
  116 + dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[0])
  117 + if(res.data.is_set_ddate==1){
  118 + dateSmart+=' '+util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[1])
  119 + }else{
  120 + dateSmart+=' '+reserev.soltName
  121 + }
  122 + }else{
  123 + dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStr)
  124 + }
112 this.setData({ 125 this.setData({
113 - detail: this.formatDatail(res.data), 126 + detail: this.formatDatail(reserev,dateSmart),
114 seller:{ 127 seller:{
115 - name:res.data.seller.sellername, 128 + name:reserev.seller.sellername,
116 room:tables.join('、'), 129 room:tables.join('、'),
117 - date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),  
118 - addr:res.data.seller.real_address||res.data.seller.map_address,  
119 - image:res.data.image_url, 130 + date:dateSmart,
  131 + addr:reserev.seller.real_address||reserev.seller.map_address,
  132 + image:reserev.image_url,
120 hasOwner:true, 133 hasOwner:true,
121 - type:res.data.type,  
122 - is_set_ddate:res.data.is_set_ddate 134 + type:reserev.type,
  135 + is_set_ddate:reserev.is_set_ddate,
  136 + hasUpTime:reserev.type==1 && reserev.hasRunning && reserev.status!=2,
123 } 137 }
124 }) 138 })
125 - App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{  
126 - this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code,sc.data) 139 + /*
  140 + App.Reserve.SellerInfo({seller_id:reserev.seller.id}).then(async sc=>{
  141 + this.msgTpl=await ST.getTplMsg(reserev,sc.data.setting.template_code,sc.data)
127 console.log('this.msgTpl',this.msgTpl); 142 console.log('this.msgTpl',this.msgTpl);
128 - }) 143 + })*/
  144 + })
  145 + App.SendSMS.GetSmsContent({
  146 + rid:this.data.options.id,
  147 + }).then(res=>{
  148 + this.msgTpl=res.data.content
129 }) 149 })
130 }, 150 },
131 - formatDatail(detail){  
132 - detail.rdateStr = util.unixtoTime(detail.ddate, 'YYYY/MM/DD 星期WW HH:II'); 151 + formatDatail(detail,dateSmart){
  152 + detail.rdateStr = dateSmart;
133 detail.tableFirst = detail.tables[0].name; 153 detail.tableFirst = detail.tables[0].name;
134 if (detail.tables.length > 1) { 154 if (detail.tables.length > 1) {
135 detail.tableSubInfo = '等' + (detail.tables.length) + '个' 155 detail.tableSubInfo = '等' + (detail.tables.length) + '个'
@@ -153,7 +173,7 @@ Page({ @@ -153,7 +173,7 @@ Page({
153 // detail.cusman_phone='15877556369'; 173 // detail.cusman_phone='15877556369';
154 // detail.cusman_account='wx:vking'; 174 // detail.cusman_account='wx:vking';
155 // } 175 // }
156 - detail=RS.reserve(detail); 176 + //detail=RS.reserve(detail);
157 return detail; 177 return detail;
158 }, 178 },
159 showManager(){ 179 showManager(){
1 // pages/customer/list.js 1 // pages/customer/list.js
2 import util from '../../utils/util'; 2 import util from '../../utils/util';
3 import App from '../../utils/api'; 3 import App from '../../utils/api';
  4 +import RS from '../../utils/reserveStatus'
4 5
5 const {regeneratorRuntime} = global 6 const {regeneratorRuntime} = global
6 import TP from '../../utils/tpls'; 7 import TP from '../../utils/tpls';
@@ -90,6 +91,7 @@ Page({ @@ -90,6 +91,7 @@ Page({
90 row.hasOwner = getApp().openid == row.openid 91 row.hasOwner = getApp().openid == row.openid
91 let d = util.unixtoTime(row.rdate, 'MM月DD日 DAY 星期WW'); 92 let d = util.unixtoTime(row.rdate, 'MM月DD日 DAY 星期WW');
92 typeof dlist[d] == 'undefined' ? dlist[d] = [] : ''; 93 typeof dlist[d] == 'undefined' ? dlist[d] = [] : '';
  94 + row=RS.reserve(row)
93 dlist[d].push(row); 95 dlist[d].push(row);
94 this.ids.push(row.id); 96 this.ids.push(row.id);
95 }) 97 })
  1 +// pages/me/history.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + sellers:{},
  11 + hasMore:false,
  12 + hasFirstShow:true,
  13 + sellersLength:0,
  14 + },
  15 + sellers:[],
  16 + /**
  17 + * 生命周期函数--监听页面加载
  18 + */
  19 + onLoad: function (options) {
  20 +
  21 + },
  22 + formatSellers(data){
  23 + let sellers=[];
  24 + let hasChange=false
  25 + this.sellers.forEach(seller=>{
  26 + if(seller.id==data.sid){
  27 + hasChange=true
  28 + seller.hasFollow=data.hasFollow
  29 + }
  30 + if(seller.hasFollow){
  31 + sellers.push(seller)
  32 + }
  33 + })
  34 + if(!hasChange){
  35 + sellers=[]
  36 + }
  37 + this.setData({
  38 + sellers:sellers
  39 + })
  40 + },
  41 + /**
  42 + * 生命周期函数--监听页面初次渲染完成
  43 + */
  44 + onReady: function () {
  45 +
  46 + },
  47 +
  48 + /**
  49 + * 生命周期函数--监听页面显示
  50 + */
  51 + hasOnShow:true,
  52 + onShow: function () {
  53 + if(this.data.sellers.length==0){
  54 + wx.showLoading({
  55 + title: '加载中',
  56 + })
  57 + this.setData({
  58 + hasFirstShow:true,
  59 + })
  60 + }
  61 + if(this.hasMore || this.data.sellers.length==0){
  62 + this.sellers=[]
  63 + this.offset=1
  64 + // this.setData({
  65 + // sellers:[]
  66 + // })
  67 + this.hasOnShow=true;
  68 + this.selectComponent('#getpos').getPos();
  69 + }
  70 + },
  71 +
  72 + /**
  73 + * 生命周期函数--监听页面隐藏
  74 + */
  75 + onHide: function () {
  76 +
  77 + },
  78 +
  79 + /**
  80 + * 生命周期函数--监听页面卸载
  81 + */
  82 + onUnload: function () {
  83 +
  84 + },
  85 +
  86 + /**
  87 + * 页面相关事件处理函数--监听用户下拉动作
  88 + */
  89 + onPullDownRefresh: function () {
  90 +
  91 + },
  92 +
  93 + /**
  94 + * 页面上拉触底事件的处理函数
  95 + */
  96 + onReachBottom: function (e) {
  97 + console.log(e)
  98 + if(this.hasMore){
  99 + this.GetCollectionSellerList();
  100 + }
  101 + },
  102 + offset:1,
  103 + size:200,
  104 + hasMore:true,
  105 + GetCollectionSellerList(){
  106 + App.Customer.GetHistoryList().then(res=>{
  107 + let sellers=res.data;
  108 + let sellersLength=sellers.length;
  109 + this.hasMore=sellersLength>=this.size
  110 + if(this.hasMore){
  111 + this.offset+=1
  112 + }
  113 + let group={}
  114 + sellers.forEach((seller,si) => {
  115 + let day=util.unixtoTime(seller.cdate,"`DAY/MM月DD日`")
  116 + if(!group[day]){
  117 + group[day]={
  118 + day:day,
  119 + sellers:[]
  120 + }
  121 + }
  122 + group[day].sellers.push(seller)
  123 + })
  124 + if(!this.hasOnShow){
  125 + sellers=[...this.data.sellers,...sellers]
  126 + }
  127 + this.hasOnShow=false;
  128 + this.setData({
  129 + sellers:group,
  130 + sellersLength:sellersLength,
  131 + hasFirstShow:false,
  132 + })
  133 + this.sellers=group
  134 + wx.hideLoading()
  135 + if(res.data.length==0 && this.offset==1){
  136 + this.GetRecommendSellerLists()
  137 + }
  138 + })
  139 + },
  140 + gotoDetail(e){
  141 + wx.navigateTo({
  142 + url:'/pages/reserve/detail?id='+util.attr(e,'sid')
  143 + })
  144 + },
  145 + onpos(e){
  146 + console.log(e);
  147 + this.location=e.detail
  148 + this.GetCollectionSellerList();
  149 + },
  150 +
  151 + hasRecommend:true,
  152 + GetRecommendSellerLists(){
  153 + if(!this.hasRecommend) return
  154 + let param={}
  155 + if(this.location){
  156 + param={
  157 + lat:this.location.latitude,
  158 + lng:this.location.longitude
  159 + }
  160 + }
  161 + App.Customer.GetRecommendSellerLists(param).then(res=>{
  162 + this.setData({
  163 + rsl:res.data
  164 + })
  165 + })
  166 + },
  167 + hasGoto:false,
  168 + bindtransition(e){
  169 + console.log(e)
  170 + if('change'==e.type){
  171 + this.hasGoto=false
  172 + }
  173 + if('animationfinish'==e.type){
  174 + if(this.hasGoto && (e.detail.current+1)==this.data.rsl.length){
  175 + wx.switchTab({
  176 + url: '/pages/reserve/index'
  177 + })
  178 + return;
  179 + }else{
  180 + this.hasGoto=true
  181 + }
  182 + }
  183 + },
  184 + goHome(){
  185 + wx.switchTab({
  186 + url: '/pages/reserve/index'
  187 + })
  188 + },
  189 + clean(){
  190 + wx.showModal({
  191 + title: '                  '+'确定清空浏览记录?',
  192 + cancelColor:'#999999',
  193 + confirmColor:'',
  194 + success: (res)=> {
  195 + if (res.confirm) {
  196 + App.Customer.ClearHistory();
  197 + this.setData({
  198 + sellers:[],
  199 + sellersLength:0,
  200 + })
  201 + this.GetRecommendSellerLists();
  202 + }
  203 + }
  204 + })
  205 + },
  206 +})
  1 +{
  2 + "usingComponents": {
  3 + "formids":"/components/formids/formids",
  4 + "getpos":"/components/userinfo/getpos",
  5 + "sb-tr":"/components/reserve/seller-box-transverse/seller-box",
  6 + "nav":"/components/nav/nav",
  7 + "hr":"/components/hr"
  8 + }
  9 +}
  1 +<!--pages/me/history.wxml-->
  2 +<nav>订好座,就用周到安排</nav>
  3 +<view class="pages">
  4 + <view class="flex-vc empty" wx:if="{{sellersLength<1}}">
  5 + <block wx:if="{{!hasFirstShow}}">
  6 + <image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
  7 + <view class="text">您还没有留下足迹哦~</view>
  8 + <view class="goHome" bindtap="goHome">去首页逛逛</view>
  9 + </block>
  10 + </view>
  11 + <block wx:else="">
  12 + <view class="clean flex-rr" bindtap="clean">
  13 + <view class="clean-img"></view>
  14 + <view class="clean-text">清空</view>
  15 + </view>
  16 + <view class="follow" >
  17 + <view class="seller-group" wx:for="{{sellers}}" wx:key="sellerskey" wx:for-item="group">
  18 + <view class="timeline">{{group.day}}</view>
  19 + <view class="seller-item flex-ll" wx:for="{{group.sellers}}" wx:key="groupSellerskey" wx:for-item="seller"
  20 + bindtap="gotoDetail" data-sid="{{seller.id}}">
  21 + <image mode="aspectFill" class="image"
  22 + src="{{seller.seller_image?seller.seller_image+'?imageView2/2/w/320/interlace/0/q/100':'http://qn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'}}"></image>
  23 + <view class="seller-item-info">
  24 + <view class="seller-item-name">{{seller.sellername}}</view>
  25 + <view class="seller-item-price" wx:if="{{seller.average>0}}">¥{{seller.average}}元/人</view>
  26 + </view>
  27 + <view class="seller-item-line"></view>
  28 + </view>
  29 + </view>
  30 + <hr class="seller flex-vc" bgColor="#f5f5f5" wx:if="{{!hasMore}}" style="margin-top: 20rpx;">我是有底线的</hr>
  31 + </view>
  32 + </block>
  33 +</view>
  34 +<block wx:if="{{!hasFirstShow && sellersLength<1}}">
  35 + <view class="rsl-block">
  36 + <view class="line-push">为你推荐</view>
  37 + <view class="transverse-list">
  38 + <swiper
  39 + indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
  40 + interval="2000" duration="500"
  41 + previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
  42 + current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
  43 + <block wx:for="{{rsl}}" wx:key="rsl.key">
  44 + <swiper-item bindtap="gotoDetail" data-sid="{{item.id}}" id="{{item.id}}">
  45 + <view class="seller" id="seller-{{item.id}}">
  46 + <sb-tr seller="{{item}}"
  47 + hasActivityTags="{{false}}"
  48 + hasActivityShort="{{true}}"
  49 + hasBrand="true" hasActivityTese="true"
  50 + hasSlogan="{{false}}"></sb-tr>
  51 + </view>
  52 + </swiper-item>
  53 + </block>
  54 + </swiper>
  55 + </view>
  56 + </view>
  57 +</block>
  58 +<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
  1 +/* pages/me/history.wxss */
  2 +page{
  3 + background-color: #F5F5F5;
  4 +}
  5 +.pages{
  6 + width: 100%;
  7 + margin: 0 auto;
  8 + font-size: 30rpx;
  9 +}
  10 +.seller-group{
  11 + background-color: #ffff;
  12 + margin-bottom: 10rpx;
  13 +}
  14 +.empty{margin-top: 160rpx;}
  15 +.empty image{
  16 + width: 191px;
  17 + height: 158px;
  18 +}
  19 +.empty .text{
  20 + font-size: 28rpx;
  21 + margin-top: 60rpx;
  22 +}
  23 +.follow {
  24 + padding-bottom: 50rpx;
  25 + padding-top: 50rpx;
  26 +}
  27 +.clean{
  28 + background-color: #fff;
  29 + height: 50rpx;
  30 + line-height: 50rpx;
  31 + padding-top: 10rpx;
  32 + position: fixed;
  33 + right: 0rpx;
  34 + width: 100%;
  35 + z-index: 10;
  36 +}
  37 +.clean-img{
  38 + background-image: url("http://qn.colorcun.com/reserve/images/20191224153853.png");
  39 + background-size: 100% 100%;
  40 + width: 24rpx;
  41 + height: 24rpx;
  42 +}
  43 +.clean-text{
  44 + margin:0 40rpx 0 10rpx;
  45 + font-size:24rpx;
  46 + color:rgba(53,53,53,1);
  47 +}
  48 +.rsl-block{
  49 + position: fixed;
  50 + bottom: 0rpx;
  51 + width: 100%;
  52 +}
  53 +.transverse-list{
  54 + background-color: #fefefe;
  55 + width: 100%;
  56 +}
  57 +.transverse-list .seller{
  58 + width: 98%;
  59 + margin: 0 auto;
  60 +}
  61 +.line-push{
  62 + background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
  63 + width: 328rpx;
  64 + height: 42rpx;
  65 + background-size: 100% 24rpx;
  66 + margin: 0 auto;
  67 + font-size:30rpx;
  68 + color: #C0A369;
  69 + line-height: 24rpx;
  70 + background-repeat: no-repeat;
  71 + text-align: center;
  72 + margin-bottom: 60rpx;
  73 +}
  74 +
  75 +.goHome{
  76 + width:200rpx;
  77 + height:60rpx;
  78 + border-radius:30rpx;
  79 + border:2rpx solid rgba(192,163,105,1);
  80 +
  81 + font-size:28rpx;
  82 + font-weight:500;
  83 + color:rgba(192,163,105,1);
  84 + line-height:60rpx;
  85 + text-align: center;
  86 + margin-top: 40rpx;
  87 +}
  88 +
  89 +.timeline{
  90 + height: 80rpx;
  91 + line-height: 80rpx;
  92 + box-sizing: border-box;
  93 +
  94 + font-size:36rpx;
  95 + font-weight:600;
  96 + color:rgba(53,53,53,1);
  97 + padding-left: 20rpx;
  98 + border-bottom: 2rpx solid #f5f5f5;
  99 +}
  100 +
  101 +.seller-item{
  102 + box-sizing: border-box;
  103 + width: 100%;
  104 + height: 280rpx;
  105 + padding: 20rpx;
  106 + position: relative;
  107 +}
  108 +.seller-item-line{
  109 + position: absolute;
  110 + width: calc(100% - 200rpx);
  111 + height: 2rpx;
  112 + right:0;
  113 + bottom: 0;
  114 + background-color: #f5f5f5;
  115 +}
  116 +.seller-item .image{
  117 + width: 160rpx;
  118 + height: 240rpx;
  119 + background-color: #4C4E4F;
  120 + min-width: 160rpx;
  121 + margin-right: 20rpx;
  122 +}
  123 +.seller-item-info{
  124 + flex-direction: row;
  125 + justify-content: space-around;
  126 + height:240rpx;
  127 + width: calc(100% - 200rpx);
  128 +}
  129 +.seller-item-name{
  130 + height:44rpx;
  131 + font-size:32rpx;
  132 + font-weight:600;
  133 + color:rgba(53,53,53,1);
  134 + line-height:44rpx;
  135 + margin-top: 28rpx;
  136 + overflow: hidden;
  137 + white-space:nowrap;
  138 + text-overflow: ellipsis;
  139 +}
  140 +.seller-item-price{
  141 + height:40rpx;
  142 + font-size:28rpx;
  143 + font-weight:600;
  144 + color:rgba(53,53,53,1);
  145 + line-height:40rpx;
  146 + margin-top: 60rpx;
  147 +}
@@ -46,6 +46,10 @@ @@ -46,6 +46,10 @@
46 <view class="icon picon p1"></view> 46 <view class="icon picon p1"></view>
47 <view class="text">常用联系人</view> 47 <view class="text">常用联系人</view>
48 </navigator> 48 </navigator>
  49 + <navigator class="flex-vc" url="/pages/me/history">
  50 + <view class="icon picon p4"></view>
  51 + <view class="text">浏览记录</view>
  52 + </navigator>
49 <view class="flex-vc" bindtap="gotoSellerBook" wx:if="{{hasSellerBook}}"> 53 <view class="flex-vc" bindtap="gotoSellerBook" wx:if="{{hasSellerBook}}">
50 <view class="icon picon p2"></view> 54 <view class="icon picon p2"></view>
51 <view class="text">商户模式</view> 55 <view class="text">商户模式</view>
@@ -96,6 +96,9 @@ image{ @@ -96,6 +96,9 @@ image{
96 .picon.p3{ 96 .picon.p3{
97 background-image: url("http://qn.colorcun.com/custom/me/image/p3.png"); 97 background-image: url("http://qn.colorcun.com/custom/me/image/p3.png");
98 } 98 }
  99 +.picon.p4{
  100 + background-image: url("http://qn.colorcun.com/reserve/images/201912241538531.png");
  101 +}
99 .block-rev .width3{ 102 .block-rev .width3{
100 width: 75%; 103 width: 75%;
101 } 104 }
@@ -42,6 +42,7 @@ Page({ @@ -42,6 +42,7 @@ Page({
42 }) 42 })
43 }) 43 })
44 this.SetRelaOpenid(); 44 this.SetRelaOpenid();
  45 + App.Customer.BindClicks({sid:options.id})
45 }, 46 },
46 GetSellerDetail(){ 47 GetSellerDetail(){
47 let options=this.options 48 let options=this.options
@@ -290,7 +290,7 @@ @@ -290,7 +290,7 @@
290 padding: 28rpx 0; 290 padding: 28rpx 0;
291 } 291 }
292 .activity-left{ 292 .activity-left{
293 - width: 100%; 293 + width: calc(100% - 120rpx);
294 } 294 }
295 .activity-right{ 295 .activity-right{
296 min-width: 120rpx; 296 min-width: 120rpx;
@@ -327,9 +327,12 @@ @@ -327,9 +327,12 @@
327 } 327 }
328 .discount{ 328 .discount{
329 margin-right: 20rpx; 329 margin-right: 20rpx;
  330 + white-space:nowrap;
330 } 331 }
331 .discount:last-child{ 332 .discount:last-child{
332 margin-right: 0; 333 margin-right: 0;
  334 + overflow: hidden;
  335 + text-overflow: ellipsis;
333 } 336 }
334 .discount .discount-left{ 337 .discount .discount-left{
335 background-image: url("http://qn.colorcun.com/reserve/images/%E5%B7%A6%E8%BE%B9.png"); 338 background-image: url("http://qn.colorcun.com/reserve/images/%E5%B7%A6%E8%BE%B9.png");
@@ -20,9 +20,9 @@ @@ -20,9 +20,9 @@
20 时间 20 时间
21 <view class="title-right"></view> 21 <view class="title-right"></view>
22 </view> 22 </view>
23 - <view class="content flex-cc"> 23 + <view class="content flex-cc date-time">
24 {{date}} 24 {{date}}
25 - <view class="upTime" bindtap="upTime" wx:if="{{is_set_ddate==0 && type==1}}">修改时间</view> 25 + <view class="upTime" bindtap="upTime" wx:if="{{hasUpTime}}">{{is_set_ddate==0?'添加时间':'修改时间'}}</view>
26 </view> 26 </view>
27 <view class="title title-addr-view flex-cc" bindtap="lookLocation"> 27 <view class="title title-addr-view flex-cc" bindtap="lookLocation">
28 <view class="title-addr"></view> 28 <view class="title-addr"></view>
@@ -255,6 +255,11 @@ @@ -255,6 +255,11 @@
255 height: 40rpx; 255 height: 40rpx;
256 line-height: 40rpx; 256 line-height: 40rpx;
257 } 257 }
  258 +.date-time{
  259 + position: relative;
  260 + height: 50rpx;
  261 + line-height: 50rpx;
  262 +}
258 .upTime{ 263 .upTime{
259 width: 92rpx; 264 width: 92rpx;
260 height: 34rpx; 265 height: 34rpx;
@@ -262,5 +267,7 @@ @@ -262,5 +267,7 @@
262 font-size: 20rpx; 267 font-size: 20rpx;
263 background-color: #ECD9B7; 268 background-color: #ECD9B7;
264 color: #794F28; 269 color: #794F28;
265 - margin-left: 20rpx; 270 + position: absolute;
  271 + right:0;
  272 + top:8rpx;
266 } 273 }
@@ -220,7 +220,7 @@ @@ -220,7 +220,7 @@
220 "id": 21, 220 "id": 21,
221 "name": "预订本-80商家", 221 "name": "预订本-80商家",
222 "pathName": "pack-book/pages/book/b_index", 222 "pathName": "pack-book/pages/book/b_index",
223 - "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354", 223 + "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&goPath=b_addnew",
224 "scene": 1001 224 "scene": 1001
225 }, 225 },
226 { 226 {
@@ -352,14 +352,14 @@ @@ -352,14 +352,14 @@
352 "id": 39, 352 "id": 39,
353 "name": "pages/reserve/detail 在线订座 ", 353 "name": "pages/reserve/detail 在线订座 ",
354 "pathName": "pages/reserve/detail", 354 "pathName": "pages/reserve/detail",
355 - "query": "id=1009&fromid=&activeTab=", 355 + "query": "id=1",
356 "scene": null 356 "scene": null
357 }, 357 },
358 { 358 {
359 "id": 40, 359 "id": 40,
360 "name": "邀请Ren pages/customer/index ", 360 "name": "邀请Ren pages/customer/index ",
361 "pathName": "pages/customer/detail_owner_invitation", 361 "pathName": "pages/customer/detail_owner_invitation",
362 - "query": "id=25569&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", 362 + "query": "id= 45539&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1",
363 "scene": null 363 "scene": null
364 }, 364 },
365 { 365 {
@@ -522,6 +522,48 @@ @@ -522,6 +522,48 @@
522 "pathName": "pages/customer/list", 522 "pathName": "pages/customer/list",
523 "query": "hasRelaTip=1", 523 "query": "hasRelaTip=1",
524 "scene": null 524 "scene": null
  525 + },
  526 + {
  527 + "id": 64,
  528 + "name": "pack-book/pages/book/b_addnew 桌位进入",
  529 + "pathName": "pack-book/pages/book/b_addnew",
  530 + "query": "id=43844",
  531 + "scene": null
  532 + },
  533 + {
  534 + "id": 65,
  535 + "name": "pack-book/pages/book/online_update",
  536 + "pathName": "pack-book/pages/book/online_update",
  537 + "query": "id=45016",
  538 + "scene": null
  539 + },
  540 + {
  541 + "id": -1,
  542 + "name": "pages/customer/detail_owner_invitation",
  543 + "pathName": "pages/customer/detail_owner_invitation",
  544 + "query": "id=43762&hasInvitation=1&hasSellerShare=1&tplid=1",
  545 + "scene": null
  546 + },
  547 + {
  548 + "id": -1,
  549 + "name": "pack-book/pages/book/b_sms",
  550 + "pathName": "pack-book/pages/book/b_sms",
  551 + "query": "id=44178",
  552 + "scene": null
  553 + },
  554 + {
  555 + "id": -1,
  556 + "name": "新建内部预订",
  557 + "pathName": "pack-book/pages/book/b_addnew",
  558 + "query": "",
  559 + "scene": null
  560 + },
  561 + {
  562 + "id": -1,
  563 + "name": "pages/me/history",
  564 + "pathName": "pages/me/history",
  565 + "query": "",
  566 + "scene": null
525 } 567 }
526 ] 568 ]
527 } 569 }
@@ -102,7 +102,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr @@ -102,7 +102,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
102 mask: true 102 mask: true
103 }) 103 })
104 } 104 }
105 - if (RMT.check(cache_key)) return RMT.get(cache_key) 105 + if (RMT.check(cache_key) && !api.hasDisabledRMT) return RMT.get(cache_key)
106 RMT.set(cache_key) 106 RMT.set(cache_key)
107 return new Promise(async(success, fail) => { 107 return new Promise(async(success, fail) => {
108 if(api.msgSecCheck){//数据安全检查 108 if(api.msgSecCheck){//数据安全检查
@@ -8,11 +8,13 @@ export default { @@ -8,11 +8,13 @@ export default {
8 //ximing http://www.dzapi.com/index.php?s= 8 //ximing http://www.dzapi.com/index.php?s=
9 alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空 9 alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空
10 msgSecCheck:true, //进行内容安全检查 10 msgSecCheck:true, //进行内容安全检查
  11 + hasDisabledRMT:true, //默认false进行网络并发管理, true不进行并发管理
11 }, 12 },
12 13
13 //预订信息详情 14 //预订信息详情
14 'App.Reserve.Detail': { 15 'App.Reserve.Detail': {
15 cachetime: 30, 16 cachetime: 30,
  17 + openid:'openid',
16 }, 18 },
17 19
18 //建立预订关系 20 //建立预订关系
@@ -56,6 +58,7 @@ export default { @@ -56,6 +58,7 @@ export default {
56 //预订列表 58 //预订列表
57 'App.Reserve.GetReserveList': { 59 'App.Reserve.GetReserveList': {
58 silence: false, 60 silence: false,
  61 + alias:'App.Reserve.NewGetReserveList'
59 }, 62 },
60 63
61 //地图页-商家 64 //地图页-商家
@@ -73,10 +76,24 @@ export default { @@ -73,10 +76,24 @@ export default {
73 cachetime: 60, 76 cachetime: 60,
74 }, 77 },
75 78
  79 + //获得推荐桌位
  80 + 'App.Reserve.GetTableList':{
  81 + alias:'App.Reserve.NewGetTableList'
  82 + },
  83 +
  84 + //录入预订
  85 + 'App.Reserve.SetReserveInfo':{
  86 + alias:'App.Reserve.NewSetReserveInfo'
  87 + },
  88 +
76 // 修改当前预订状态 0:待确认,1:已定座,2:确认到店,3:用餐完成 89 // 修改当前预订状态 0:待确认,1:已定座,2:确认到店,3:用餐完成
77 'App.Reserve.SetReserveStatus': { 90 'App.Reserve.SetReserveStatus': {
78 silence: false, 91 silence: false,
79 }, 92 },
  93 + //分离后的在线预订专用修改当前预订
  94 + 'App.Customer.SetReserveStatus': {
  95 + silence: false,
  96 + },
80 97
81 //修改当前桌子是否启用 0:未启用,1:启用 98 //修改当前桌子是否启用 0:未启用,1:启用
82 'App.Reserve.SetSwitchStatus': { 99 'App.Reserve.SetSwitchStatus': {
@@ -94,6 +111,7 @@ export default { @@ -94,6 +111,7 @@ export default {
94 //导出 111 //导出
95 'App.Reserve.ExportReserve': { 112 'App.Reserve.ExportReserve': {
96 silence: false, 113 silence: false,
  114 + alias:'App.Reserve.NewExportReserve'
97 }, 115 },
98 116
99 //查询短信剩余及套餐 117 //查询短信剩余及套餐
@@ -126,7 +144,9 @@ export default { @@ -126,7 +144,9 @@ export default {
126 silence: false, 144 silence: false,
127 }, 145 },
128 //统计某个商家某天预订总数 146 //统计某个商家某天预订总数
129 - 'App.Reserve.ReservesCountDay':null, 147 + 'App.Reserve.ReservesCountDay':{
  148 + alias:'App.Reserve.NewReservesCountDay',
  149 + },
130 //统计某个商家某月预订总数 150 //统计某个商家某月预订总数
131 'App.Reserve.ReservesCountMonth':{ 151 'App.Reserve.ReservesCountMonth':{
132 cachetime: 300, 152 cachetime: 300,
@@ -135,15 +155,20 @@ export default { @@ -135,15 +155,20 @@ export default {
135 /**提前点餐**/ 155 /**提前点餐**/
136 'App.Advance.CreateOrder':{ 156 'App.Advance.CreateOrder':{
137 //silence: false, 157 //silence: false,
  158 + hasDisabledRMT:true,//可并发
138 }, 159 },
139 //菜品列表 160 //菜品列表
140 'App.Advance.GetCookbookByClass': null, 161 'App.Advance.GetCookbookByClass': null,
141 //菜品规格 162 //菜品规格
142 'App.Advance.GetCookbookSelBySpecsId': null, 163 'App.Advance.GetCookbookSelBySpecsId': null,
143 //添加到购物车 164 //添加到购物车
144 - 'App.Advance.AddCart': null, 165 + 'App.Advance.AddCart': {
  166 + hasDisabledRMT:true,//可并发
  167 + },
145 //减菜 168 //减菜
146 - 'App.Advance.ReduceOrder': null, 169 + 'App.Advance.ReduceOrder': {
  170 + hasDisabledRMT:true,//可并发
  171 + },
147 //设置人数,设置备注 172 //设置人数,设置备注
148 'App.Advance.SetOrderById':null, 173 'App.Advance.SetOrderById':null,
149 //清空购物车 174 //清空购物车
@@ -347,7 +372,31 @@ export default { @@ -347,7 +372,31 @@ export default {
347 openid:'openid', 372 openid:'openid',
348 cachetime: -1, 373 cachetime: -1,
349 }, 374 },
  375 + //查看短信内容
  376 + 'App.SendSMS.GetSmsContent':null,
  377 + //发送短信
  378 + 'App.SendSMS.NewMessage':null,
  379 +
  380 + //商户修改在线预定
  381 + 'App.Customer.SetReserveInfoById':null,
350 //生成小程序码 382 //生成小程序码
351 'App.System.GetWxLiteCode':null, 383 'App.System.GetWxLiteCode':null,
  384 + //获取在线预定列表
  385 + 'App.Reserve.GetOnlineReserveList':null,
  386 +
  387 + //绑定关系(用户浏览记录)
  388 + 'App.Customer.BindClicks':{
  389 + openid:'openid',
  390 + },
  391 +
  392 + //清空浏览记录(用户浏览记录)
  393 + 'App.Customer.ClearHistory':{
  394 + openid:'openid',
  395 + },
  396 +
  397 + //获取用户浏览记录(用户浏览记录)
  398 + 'App.Customer.GetHistoryList':{
  399 + openid:'openid',
  400 + },
352 401
353 } 402 }
@@ -143,7 +143,13 @@ module.exports ={ @@ -143,7 +143,13 @@ module.exports ={
143 return 0; 143 return 0;
144 }, 144 },
145 //获得时间戳在早中晚的索引等 145 //获得时间戳在早中晚的索引等
146 - async getTimeSpaceIndexData(d=new Date()/1000,sc=null){ 146 + /**
  147 + * @param d
  148 + * @param sc
  149 + * @param fouceTime 强制使用timeIndex
  150 + * @returns {Promise.<{timeIndex: number, timeMatchIndex: number, timeOpt: [string,string,string]}>}
  151 + */
  152 + async getTimeSpaceIndexData(d=new Date()/1000,sc=null,fouceTime=0){
147 let day0 = new Date(new Date().setHours(0, 0, 0, 0)) / 1000 ; 153 let day0 = new Date(new Date().setHours(0, 0, 0, 0)) / 1000 ;
148 let day1 = day0 + 86400; 154 let day1 = day0 + 86400;
149 let isDay=false;//是否今天 155 let isDay=false;//是否今天
@@ -157,10 +163,10 @@ module.exports ={ @@ -157,10 +163,10 @@ module.exports ={
157 timeMatchIndex:0, 163 timeMatchIndex:0,
158 timeOpt:['','',''] 164 timeOpt:['','','']
159 }; 165 };
160 - for(let i=0;i<times.length;i++) { 166 + for(let i=fouceTime;i<times.length;i++) {
161 let flag = false; 167 let flag = false;
162 for (let j = 0; j < times[i].length; j++) { 168 for (let j = 0; j < times[i].length; j++) {
163 - //console.log('times', nd, times[i][j], i, j); 169 + console.log('times', nd, times[i][j], i, j);
164 if (nd <= times[i][j]) { 170 if (nd <= times[i][j]) {
165 obj.timeIndex = i; 171 obj.timeIndex = i;
166 obj.timeMatchIndex = j; 172 obj.timeMatchIndex = j;
@@ -176,7 +182,7 @@ module.exports ={ @@ -176,7 +182,7 @@ module.exports ={
176 obj.timeOpt[i] = 'disabled'; 182 obj.timeOpt[i] = 'disabled';
177 } 183 }
178 } 184 }
179 - //console.log('times',obj); 185 + console.log('times',obj);
180 return obj; 186 return obj;
181 }, 187 },
182 timeStrLabel:{'morning':'早市','noon':'午市','night':'晚市'}, 188 timeStrLabel:{'morning':'早市','noon':'午市','night':'晚市'},
@@ -146,6 +146,16 @@ module.exports ={ @@ -146,6 +146,16 @@ module.exports ={
146 break; 146 break;
147 } 147 }
148 let tpl = this.tpls[tplcode]; 148 let tpl = this.tpls[tplcode];
  149 + if(bookInfo.type==1 && smsData.date){
  150 + if(bookInfo.is_set_ddate!=1){
  151 + if(tplcode=='SMS_154587043'){
  152 + smsData.date=smsData.date.replace(/[\d]{2}:[\d]{2}/,txa[tx.timeIndex])
  153 + }else{
  154 + smsData.date=smsData.date.replace(/[\d]{2}:[\d]{2}/,'')
  155 + }
  156 +
  157 + }
  158 + }
149 this.smsData = smsData; 159 this.smsData = smsData;
150 tpl = tpl.replace(/\${([^}]+)}/ig, function ($0, $1) { 160 tpl = tpl.replace(/\${([^}]+)}/ig, function ($0, $1) {
151 //console.log($0, $1); 161 //console.log($0, $1);
@@ -6,6 +6,7 @@ let tpls=[ @@ -6,6 +6,7 @@ let tpls=[
6 name: '商务', 6 name: '商务',
7 hasImage:false, 7 hasImage:false,
8 timeStr:'YYYY/MM/DD 星期WW HH:II', 8 timeStr:'YYYY/MM/DD 星期WW HH:II',
  9 + timeStrSmart:['YYYY/MM/DD 星期WW','HH:II'],
9 shareFirstImage:'http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg', 10 shareFirstImage:'http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg',
10 shareImage:'http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148573.jpg', 11 shareImage:'http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148573.jpg',
11 shareFirstTitle:'用餐已为您安排,点击查看详情', 12 shareFirstTitle:'用餐已为您安排,点击查看详情',
@@ -17,6 +18,7 @@ let tpls=[ @@ -17,6 +18,7 @@ let tpls=[
17 name: '温馨', 18 name: '温馨',
18 hasImage:true, 19 hasImage:true,
19 timeStr:'YYYY年MM月DD日HH时II分', 20 timeStr:'YYYY年MM月DD日HH时II分',
  21 + timeStrSmart:['YYYY年MM月DD日','HH时II分'],
20 shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/wx1.jpg', 22 shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/wx1.jpg',
21 shareImage:'http://qn.colorcun.com/manager-invitation/wx3/wx2.jpg', 23 shareImage:'http://qn.colorcun.com/manager-invitation/wx3/wx2.jpg',
22 shareFirstTitle:'用餐已为您安排,点击查看详情', 24 shareFirstTitle:'用餐已为您安排,点击查看详情',
@@ -74,7 +74,7 @@ function unixtoTime(ns,format) { @@ -74,7 +74,7 @@ function unixtoTime(ns,format) {
74 } 74 }
75 } 75 }
76 } 76 }
77 - if(format.indexOf('`')>0){ 77 + if(format.indexOf('`')>-1){
78 result=result.replace(/`(.*)\/(.*)`/ig,function($0,$1,$2){ 78 result=result.replace(/`(.*)\/(.*)`/ig,function($0,$1,$2){
79 return $1||$2; 79 return $1||$2;
80 }); 80 });