Commit 46fc2da490f1b6b0740490001a8ce06f507da46c

Authored by vking
1 parent e88772b3

推荐商家

@@ -2,7 +2,14 @@ @@ -2,7 +2,14 @@
2 <nav hasHome>订座详情</nav> 2 <nav hasHome>订座详情</nav>
3 <view class="page"> 3 <view class="page">
4 <view class="flex-vc success"> 4 <view class="flex-vc success">
5 - <block wx:if="{{detail.hasCancel}}"> 5 + <block wx:if="{{detail.hasRunning}}">
  6 + <view class="icon">
  7 + <icon type="success" size="47" color="#C8B16D"/>
  8 + </view>
  9 + <view class="title Medium">订座成功</view>
  10 + <view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
  11 + </block>
  12 + <block wx:elif="{{detail.hasCancel}}">
6 <view class="icon"> 13 <view class="icon">
7 <icon type="info" size="47" color="#C9C9C9"/> 14 <icon type="info" size="47" color="#C9C9C9"/>
8 </view> 15 </view>
@@ -29,16 +36,8 @@ @@ -29,16 +36,8 @@
29 <view class="title Medium" style="font-size: 36rpx;">抱歉!</view> 36 <view class="title Medium" style="font-size: 36rpx;">抱歉!</view>
30 <view class="info Medium" style="font-size: 36rpx;color: #353535;">您相中的餐厅包间已经订满</view> 37 <view class="info Medium" style="font-size: 36rpx;color: #353535;">您相中的餐厅包间已经订满</view>
31 </block> 38 </block>
32 - <block wx:else="">  
33 - <view class="icon">  
34 - <icon type="success" size="47" color="#C8B16D"/>  
35 - </view>  
36 - <view class="title Medium">订座成功</view>  
37 - <view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>  
38 - </block>  
39 </block> 39 </block>
40 </view> 40 </view>
41 -  
42 <block wx:if="{{detail.hasRunning}}"> 41 <block wx:if="{{detail.hasRunning}}">
43 <view class="flex-lr share-view" wx:if="{{detail.type==1}}"> 42 <view class="flex-lr share-view" wx:if="{{detail.type==1}}">
44 <formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1" 43 <formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1"
@@ -10,6 +10,7 @@ const status=[ @@ -10,6 +10,7 @@ const status=[
10 ]; 10 ];
11 export default { 11 export default {
12 reserve(detail){ 12 reserve(detail){
  13 + /*
13 let ns = new Date() / 1000 14 let ns = new Date() / 1000
14 //取消 15 //取消
15 detail.hasCancel=detail.status==4; 16 detail.hasCancel=detail.status==4;
@@ -21,10 +22,23 @@ export default { @@ -21,10 +22,23 @@ export default {
21 }else{//C端 22 }else{//C端
22 detail.hasRunning = !detail.hasOvered && !detail.hasCancel && detail.status==5 23 detail.hasRunning = !detail.hasOvered && !detail.hasCancel && detail.status==5
23 } 24 }
  25 + */
  26 + detail.hasRunning=this.hasRunningFlag(detail)
  27 + if(!detail.hasRunning){
  28 + detail.hasCancel=detail.status==4;
  29 + detail.hasOvered=detail.status!=0 && detail.status!=6;
  30 + }
24 detail.getStatusStr=''; 31 detail.getStatusStr='';
25 if(detail.status>=0){ 32 if(detail.status>=0){
26 detail.getStatusStr=status[detail.status]; 33 detail.getStatusStr=status[detail.status];
27 } 34 }
28 return detail; 35 return detail;
29 }, 36 },
  37 + hasRunningFlag(detail){//判断订单正在运行
  38 + let ns = new Date() / 1000
  39 + let flag=true;
  40 + if(detail.status==0 || detail.status==6 || detail.status==4) return false//未进行状态
  41 + if(ns > detail.edate) return false//超时
  42 + return flag
  43 + }
30 } 44 }