Commit 660fdc2681566777ab1120fcaa3a62b871eda4ec

Authored by vking
1 parent cacaa466

online

@@ -14,7 +14,7 @@ Page({ @@ -14,7 +14,7 @@ Page({
14 data: { 14 data: {
15 detail: null, 15 detail: null,
16 hasOnlineReserve: false, 16 hasOnlineReserve: false,
17 - hasFirstShow:0, 17 + firstShowMsg:'',
18 }, 18 },
19 id: null, 19 id: null,
20 tpls: TP.tpls(), 20 tpls: TP.tpls(),
@@ -24,7 +24,7 @@ Page({ @@ -24,7 +24,7 @@ Page({
24 onLoad: function (options) { 24 onLoad: function (options) {
25 this.id = options.id; 25 this.id = options.id;
26 this.setData({ 26 this.setData({
27 - hasFirstShow:options.hasFirstShow||0, 27 + firstShowMsg:options.firstShowMsg,
28 }) 28 })
29 }, 29 },
30 30
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <icon type="waiting" size="47" color="#C8B16D"/> 20 <icon type="waiting" size="47" color="#C8B16D"/>
21 </view> 21 </view>
22 <view class="title Medium">餐厅处理中</view> 22 <view class="title Medium">餐厅处理中</view>
23 - <view class="info" wx:if="{{hasFirstShow}}">预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)</view> 23 + <view class="info" wx:if="{{firstShowMsg}}">{{firstShowMsg}}</view>
24 </block> 24 </block>
25 <block wx:elif="{{detail.status==6}}"> 25 <block wx:elif="{{detail.status==6}}">
26 <view class="icon"> 26 <view class="icon">
@@ -131,10 +131,14 @@ Page({ @@ -131,10 +131,14 @@ Page({
131 if(res.data.hasSetUserInfo){ 131 if(res.data.hasSetUserInfo){
132 App.Customer.GetCustomerInfo({},'clear') 132 App.Customer.GetCustomerInfo({},'clear')
133 } 133 }
  134 + let firstShowMsg='预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)'
  135 + if(!this.hasInWorkTime()){//非营业时间预订
  136 + firstShowMsg='商家未营业,营业后将第一时间告知您预订结果'
  137 + }
134 wx.redirectTo({ 138 wx.redirectTo({
135 url:util.http_build_query({ 139 url:util.http_build_query({
136 id:res.data.rid, 140 id:res.data.rid,
137 - hasFirstShow:1, 141 + firstShowMsg:firstShowMsg,
138 },'/pages/customer/detail_owner') 142 },'/pages/customer/detail_owner')
139 }) 143 })
140 }) 144 })
@@ -164,4 +168,22 @@ Page({ @@ -164,4 +168,22 @@ Page({
164 user: this.user 168 user: this.user
165 }) 169 })
166 }, 170 },
  171 + hasInWorkTime(){
  172 + let daily=this.data.seller.daily;
  173 + let wt=['morning','noon','night'];
  174 + let stime='',etime='',time=parseInt(new Date()/1000)
  175 + let today=util.unixtoTime(time,"YYYY-MM-DD")
  176 + wt.forEach(k=>{
  177 + if(!daily[k])return;
  178 + let xt=daily[k].split('-');
  179 + if(!stime){
  180 + stime=util.timetouUnix(today+' '+xt[0]+':00')
  181 + }
  182 + etime=util.timetouUnix(today+' '+xt[1]+':00')
  183 + })
  184 + if(time>=stime && time<=etime){
  185 + return true;
  186 + }
  187 + return false;
  188 + },
167 }) 189 })
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 font-weight: bold; 34 font-weight: bold;
35 } 35 }
36 .item view:last-child{ 36 .item view:last-child{
37 - font-size: 34rpx; 37 + font-size: 28rpx;
38 } 38 }
39 .switch{ 39 .switch{
40 width: 252rpx; 40 width: 252rpx;