Showing
9 changed files
with
90 additions
and
25 deletions
| 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"> |
| 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"> |
| 5 | <view class="flex-lr order-detail"> | 6 | <view class="flex-lr order-detail"> |
| 6 | - <view class="gray-deep-font font30r">到店时间</view> | ||
| 7 | - <view class="black-font font34r">{{bookInfo.rdateStr}}</view> | 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> | ||
| 13 | + <view class="flex-lr order-detail"> | ||
| 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> |
| @@ -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:150rpx; |
| 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; |
| @@ -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"> |
| @@ -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) + '个' |
| @@ -109,27 +109,40 @@ Page({ | @@ -109,27 +109,40 @@ 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, | ||
| 123 | } | 136 | } |
| 124 | }) | 137 | }) |
| 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) | 138 | + App.Reserve.SellerInfo({seller_id:reserev.seller.id}).then(async sc=>{ |
| 139 | + this.msgTpl=await ST.getTplMsg(reserev,sc.data.setting.template_code,sc.data) | ||
| 127 | console.log('this.msgTpl',this.msgTpl); | 140 | console.log('this.msgTpl',this.msgTpl); |
| 128 | }) | 141 | }) |
| 129 | }) | 142 | }) |
| 130 | }, | 143 | }, |
| 131 | - formatDatail(detail){ | ||
| 132 | - detail.rdateStr = util.unixtoTime(detail.ddate, 'YYYY/MM/DD 星期WW HH:II'); | 144 | + formatDatail(detail,dateSmart){ |
| 145 | + detail.rdateStr = dateSmart; | ||
| 133 | detail.tableFirst = detail.tables[0].name; | 146 | detail.tableFirst = detail.tables[0].name; |
| 134 | if (detail.tables.length > 1) { | 147 | if (detail.tables.length > 1) { |
| 135 | detail.tableSubInfo = '等' + (detail.tables.length) + '个' | 148 | detail.tableSubInfo = '等' + (detail.tables.length) + '个' |
| @@ -153,7 +166,7 @@ Page({ | @@ -153,7 +166,7 @@ Page({ | ||
| 153 | // detail.cusman_phone='15877556369'; | 166 | // detail.cusman_phone='15877556369'; |
| 154 | // detail.cusman_account='wx:vking'; | 167 | // detail.cusman_account='wx:vking'; |
| 155 | // } | 168 | // } |
| 156 | - detail=RS.reserve(detail); | 169 | + //detail=RS.reserve(detail); |
| 157 | return detail; | 170 | return detail; |
| 158 | }, | 171 | }, |
| 159 | showManager(){ | 172 | 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 | }) |
| @@ -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/,txb[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:'用餐已为您安排,点击查看详情', |
-
Please register or login to post a comment