Commit fc3f924d9c8616740cf56b4abcb3abbe420d367d

Authored by pengye
1 parent 379e90f4

订单列表、邀请函、商家详情判断是否开启在线预订,未开启不显示再次预订按钮

@@ -51,8 +51,10 @@ @@ -51,8 +51,10 @@
51 <view style="height: 30rpx;"></view> 51 <view style="height: 30rpx;"></view>
52 </view> 52 </view>
53 <view class="view button-cover flex-rr"> 53 <view class="view button-cover flex-rr">
54 - <navigator url="/pages/reserve/reserve?id={{reserve.seller.id}}&activeTab=reserve" class="second-book-button flex-cc item-button">再次预订</navigator>  
55 - <view class="remark-button flex-cc item-button" wx:if="{{tabType==6 && hasComment}}" catchtap="remark">评价</view> 54 + <block wx:if="{{reserve.seller.is_online_reserve == '1'}}">
  55 + <navigator url="/pages/reserve/reserve?id={{reserve.seller.id}}&activeTab=reserve" class="second-book-button flex-cc item-button">再次预订</navigator>
  56 + </block>
  57 + <view class="remark-button flex-cc item-button" wx:if="{{tabType==6 && hasComment}}" catchtap="remark">评价</view>
56 <block wx:if="{{tabType==5}}"> 58 <block wx:if="{{tabType==5}}">
57 <userinfo 59 <userinfo
58 binduserinfo="checkout" 60 binduserinfo="checkout"
@@ -28,11 +28,13 @@ @@ -28,11 +28,13 @@
28 <service id="service" class="split view"> 28 <service id="service" class="split view">
29 <view class="min-but flex align-center justify-center txt-30-h solid">联系客服</view> 29 <view class="min-but flex align-center justify-center txt-30-h solid">联系客服</view>
30 </service> 30 </service>
31 - <navigator url="/pages/reserve/reserve?id={{detail.sid}}&activeTab=reserve"  
32 - wx:if="{{detail.hasCancel || detail.status==6}}"  
33 - class="split">  
34 - <view class="min-but flex align-center justify-center txt-30-h solid">再次预订</view>  
35 - </navigator> 31 + <block wx:if="{{detail.seller.is_online_reserve == '1'}}">
  32 + <navigator url="/pages/reserve/reserve?id={{detail.sid}}&activeTab=reserve"
  33 + wx:if="{{detail.hasCancel || detail.status==6}}"
  34 + class="split">
  35 + <view class="min-but flex align-center justify-center txt-30-h solid">再次预订</view>
  36 + </navigator>
  37 + </block>
36 <block wx:if="{{customerCancel && customerCancel == '1'}}"> 38 <block wx:if="{{customerCancel && customerCancel == '1'}}">
37 <navigator url="./cancel?id={{detail.id}}" 39 <navigator url="./cancel?id={{detail.id}}"
38 wx:if="{{(detail.hasRunning || detail.status==0) && checkout.status!=3}}" 40 wx:if="{{(detail.hasRunning || detail.status==0) && checkout.status!=3}}"
@@ -235,8 +235,8 @@ @@ -235,8 +235,8 @@
235 {{toastText}} 235 {{toastText}}
236 </view> 236 </view>
237 </scroll-view> 237 </scroll-view>
238 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">  
239 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 238 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">
  239 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
240 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 240 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
241 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 241 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
242 </view> 242 </view>
@@ -237,8 +237,8 @@ @@ -237,8 +237,8 @@
237 {{toastText}} 237 {{toastText}}
238 </view> 238 </view>
239 </scroll-view> 239 </scroll-view>
240 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">  
241 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 240 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">
  241 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
242 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 242 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
243 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 243 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
244 </view> 244 </view>
@@ -220,8 +220,8 @@ @@ -220,8 +220,8 @@
220 {{toastText}} 220 {{toastText}}
221 </view> 221 </view>
222 </scroll-view> 222 </scroll-view>
223 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">  
224 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 223 +<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' && options.onlineReserve == '1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">
  224 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
225 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 225 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
226 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 226 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
227 </view> 227 </view>
@@ -218,8 +218,8 @@ @@ -218,8 +218,8 @@
218 {{toastText}} 218 {{toastText}}
219 </view> 219 </view>
220 </scroll-view> 220 </scroll-view>
221 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">  
222 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 221 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">
  222 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
223 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 223 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
224 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 224 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
225 </view> 225 </view>
@@ -279,8 +279,8 @@ @@ -279,8 +279,8 @@
279 {{toastText}} 279 {{toastText}}
280 </view> 280 </view>
281 </scroll-view> 281 </scroll-view>
282 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="all-button flex-lr sharewidth">  
283 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 282 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="all-button flex-lr sharewidth">
  283 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
284 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 284 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
285 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 285 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
286 </view> 286 </view>
@@ -233,8 +233,8 @@ @@ -233,8 +233,8 @@
233 {{toastText}} 233 {{toastText}}
234 </view> 234 </view>
235 </scroll-view> 235 </scroll-view>
236 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">  
237 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 236 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">
  237 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
238 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 238 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
239 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 239 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
240 </view> 240 </view>
@@ -230,8 +230,8 @@ @@ -230,8 +230,8 @@
230 {{toastText}} 230 {{toastText}}
231 </view> 231 </view>
232 </scroll-view> 232 </scroll-view>
233 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">  
234 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 233 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth {{themeColor}}">
  234 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
235 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 235 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
236 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 236 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
237 </view> 237 </view>
@@ -236,8 +236,8 @@ @@ -236,8 +236,8 @@
236 {{toastText}} 236 {{toastText}}
237 </view> 237 </view>
238 </scroll-view> 238 </scroll-view>
239 -<view wx:if="{{marketing.is_transpond=='1' || marketing.is_online_book=='1' || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth">  
240 - <view wx:if="{{marketing.is_online_book=='1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view> 239 +<view wx:if="{{marketing.is_transpond=='1' || (marketing.is_online_book=='1' && options.onlineReserve == '1') || (paymentId && paymentStatus == '0')}}" class="flex-lr sharewidth">
  240 + <view wx:if="{{marketing.is_online_book=='1' && options.onlineReserve == '1'}}" class="flex-cc font30r moreBtn" bindtap="secondbook" style="position: relative;">再次预订</view>
241 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view> 241 <view wx:if="{{detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0'}}" class="flex-cc font30r paymenBtn" bindtap="paymentFun">支付定金</view>
242 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button> 242 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r shareItem" open-type="share">转发给客人</button>
243 </view> 243 </view>
@@ -92,11 +92,23 @@ Page({ @@ -92,11 +92,23 @@ Page({
92 const month = date.getMonth() + 1; 92 const month = date.getMonth() + 1;
93 const day = date.getDate(); 93 const day = date.getDate();
94 let isOrder = this.isCurrentTimeGreaterThan(year, month, day, timeHour * 1, timeMinute * 1) 94 let isOrder = this.isCurrentTimeGreaterThan(year, month, day, timeHour * 1, timeMinute * 1)
95 - this.getSellerTemplateConfFun(RS.reserve(res.data).sid, isOrder, reserev.status); 95 + this.getSellerDetail(RS.reserve(res.data).sid, isOrder, reserev.status)
96 }).catch(res => { 96 }).catch(res => {
97 console.log(res, '详情请求失败'); 97 console.log(res, '详情请求失败');
98 }) 98 })
99 }, 99 },
  100 + // 获取店铺详情
  101 + getSellerDetail(sid, isOrder, status) {
  102 + App.Customer.GetSellerDetail({
  103 + openid: getApp().openid,
  104 + sid
  105 + }).then(res => {
  106 + let is_online_reserve = res.data.is_online_reserve;
  107 + this.getSellerTemplateConfFun(RS.reserve(res.data).sid, isOrder, status,is_online_reserve);
  108 + }).catch(res => {
  109 + console.log(res, '商家详情请求失败');
  110 + })
  111 + },
100 // 判断是否超过该预订的餐段截止时间 为1 代表超过了 112 // 判断是否超过该预订的餐段截止时间 为1 代表超过了
101 isCurrentTimeGreaterThan(year, month, day, hour, minute) { 113 isCurrentTimeGreaterThan(year, month, day, hour, minute) {
102 const currentTime = new Date(); 114 const currentTime = new Date();
@@ -105,7 +117,7 @@ Page({ @@ -105,7 +117,7 @@ Page({
105 return isorder; 117 return isorder;
106 }, 118 },
107 // 获取商家设置营销信息 119 // 获取商家设置营销信息
108 - getSellerTemplateConfFun(sid, isOrder, status) { 120 + getSellerTemplateConfFun(sid, isOrder, status, is_online_reserve) {
109 App.Seller.GetSellerTemplateConf({ 121 App.Seller.GetSellerTemplateConf({
110 sid 122 sid
111 }).then(res => { 123 }).then(res => {
@@ -118,7 +130,7 @@ Page({ @@ -118,7 +130,7 @@ Page({
118 } else { 130 } else {
119 url = '/pages/customer/detail_owner_invitation9'; 131 url = '/pages/customer/detail_owner_invitation9';
120 } 132 }
121 - url += '?id=' + this.data.options.id + '&tplid=' + this.data.options.tplid; 133 + url += '?id=' + this.data.options.id + '&tplid=' + this.data.options.tplid + '&onlineReserve=' + is_online_reserve;
122 // (过了当前餐段结束时间 || 预订是用餐完成状态) 邀请函显示已结束 134 // (过了当前餐段结束时间 || 预订是用餐完成状态) 邀请函显示已结束
123 url += (isOrder == '1' || status == '3') ? '&isOrder=1' : ''; 135 url += (isOrder == '1' || status == '3') ? '&isOrder=1' : '';
124 url+= this.data.options.paymentId?'&paymentId='+this.data.options.paymentId:'&paymentId=' ; 136 url+= this.data.options.paymentId?'&paymentId='+this.data.options.paymentId:'&paymentId=' ;
@@ -76,6 +76,7 @@ Page({ @@ -76,6 +76,7 @@ Page({
76 address: reserev.map_address, 76 address: reserev.map_address,
77 lat: reserev.lat, 77 lat: reserev.lat,
78 long: reserev.long, 78 long: reserev.long,
  79 + is_online_reserve: reserev.is_online_reserve,
79 } 80 }
80 }) 81 })
81 console.log('sellerseller', { 82 console.log('sellerseller', {
@@ -129,7 +129,9 @@ @@ -129,7 +129,9 @@
129 </text> 129 </text>
130 </view> 130 </view>
131 <view class="all-button flex-lr between"> 131 <view class="all-button flex-lr between">
132 - <navigator url="/pages/reserve/reserve?id={{sid}}&activeTab=reserve" class="book-item-font second-book-button flex-cc font30r" style="position: relative;">预订包间</navigator> 132 + <block wx:if="{{seller.is_online_reserve == '1'}}">
  133 + <navigator url="/pages/reserve/reserve?id={{sid}}&activeTab=reserve" class="book-item-font second-book-button flex-cc font30r" style="position: relative;">预订包间</navigator>
  134 + </block>
133 <button class="book-item-font flex-cc font30r shareItem" open-type="share">转发给朋友 135 <button class="book-item-font flex-cc font30r shareItem" open-type="share">转发给朋友
134 </button> 136 </button>
135 </view> 137 </view>