Commit df74cd6338f2faffd1f36f907ba6960cee736512

Authored by liuxuqinfhp1220
2 parents 693df5f8 ca14d5e8

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:
  online
... ... @@ -74,7 +74,7 @@ Component({
if (this.data.detail.tableFirst) {
tableSubInfo = (this.data.detail.tableFirst || '') + ' ' + (this.data.detail.tableSubInfo || '');
tableFirst = this.data.detail.tableFirst
} else if(this.data.detail.tables) {
} else if(this.data.detail.tables.length>0) {
tableFirst = this.data.detail.tables[0].name
tableSubInfo = this.data.detail.tables[0].name;
if (this.data.detail.tables.length > 1) {
... ...
// pages/customer/detail_owner.js
import util from '../../utils/util';
import App from '../../utils/api';
import RS from './reserveStatus';
const {regeneratorRuntime} = global
import TP from '../../utils/tpls';
... ... @@ -13,6 +14,7 @@ Page({
data: {
detail: null,
hasOnlineReserve: false,
hasFirstShow:0,
},
id: null,
tpls: TP.tpls(),
... ... @@ -21,6 +23,9 @@ Page({
*/
onLoad: function (options) {
this.id = options.id;
this.setData({
hasFirstShow:options.hasFirstShow||0,
})
},
/**
... ... @@ -38,9 +43,10 @@ Page({
openid: getApp().openid,
rid: this.id
}).then(res => {
console.log('res.data.type',res.data.type)
this.setData({
detail: this.formatDatail(res.data),
hasOnlineReserve:res.data.type==0,
hasOnlineReserve:res.data.type==1,
})
})
},
... ... @@ -68,22 +74,19 @@ Page({
},
formatDatail(detail) {
detail.rdateStr = util.unixtoTime(detail.ddate, 'MM月DD日 WW HH:II');
detail.tableFirst = detail.tables[0].name;
if (detail.tables.length > 1) {
detail.tableSubInfo = '等' + (detail.tables.length) + '个'
+ (detail.tables[0].tid == 2 ? '包间' : '');
if(detail.tables.length>0){
detail.tableFirst = detail.tables[0].name;
if (detail.tables.length > 1) {
detail.tableSubInfo = '等' + (detail.tables.length) + '个'
+ (detail.tables[0].tid == 2 ? '包间' : '');
}
}
// if(!detail.cusman){
// detail.cusman='vking';
// detail.cusman_phone='15877556369';
// detail.cusman_account='wx:vking';
// }
let ns = new Date() / 1000
detail.hasCancel = detail.status == 4
detail.hasOvered = false
if (!detail.hasCancel) {
detail.hasOvered = ns > detail.ddate || detail.status >= 2
}
detail=RS.reserve(detail);
detail.seller.seller_tel=detail.seller.seller_tel.split(',');
return detail;
},
... ...
... ... @@ -15,15 +15,30 @@
<view class="title Medium">订座已完成</view>
</block>
<block wx:else="">
<view class="icon">
<icon type="success" size="47" color="#C8B16D"/>
</view>
<view class="title Medium">订座成功</view>
<view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
<block wx:if="{{detail.status==0}}">
<view class="icon">
<icon type="waiting" size="47" color="#C8B16D"/>
</view>
<view class="title Medium">餐厅处理中</view>
<view class="info" wx:if="{{hasFirstShow}}">预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)</view>
</block>
<block wx:elif="{{detail.status==6}}">
<view class="icon">
<icon type="warn" size="47" color="#999999"/>
</view>
<view class="title Medium">{{detail.msg||'包间已订满'}}</view>
</block>
<block wx:else="">
<view class="icon">
<icon type="success" size="47" color="#C8B16D"/>
</view>
<view class="title Medium">订座成功</view>
<view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
</block>
</block>
</view>
<block wx:if="{{!detail.hasOvered && !detail.hasCancel}}">
<block wx:if="{{detail.hasRunning}}">
<view class="flex-lr share-view" >
<userinfo-share
binduserinfo="userinfo"
... ...
//0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单
const status=[
'待确认',//0
'已定座',//1
'确认到店(到店)',//2
'用餐完成(离店)',//3
'取消预定',//4
'C端在线预定(分配包间)',//5
'拒单'//6
];
export default {
reserve(detail){
let ns = new Date() / 1000
//取消
detail.hasCancel=detail.status==4;
//结束
detail.hasOvered= ns > detail.ddate || (detail.status >= 2 && detail.status <= 3)
//正常运行已接单
if(detail.type==0){//B端
detail.hasRunning = !detail.hasOvered && !detail.hasCancel
}else{//C端
detail.hasRunning = !detail.hasOvered && !detail.hasCancel && detail.status==5
}
return detail;
},
}
\ No newline at end of file
... ...
... ... @@ -113,11 +113,40 @@ Page({
if(!this.user.phone){
return util.toast('请填写手机','none')
}
App.Customer.SetCustomerInfo({
...this.user
App.Customer.SetReserveInfo({
sid:this.options.sid,
pnum:this.options.pnum,
ddate:this.options.ddate,
rdate:this.getRdate(),
rname:this.user.name,
sex:this.user.sex,
phone:this.user.phone,
cusdem:this.user.remark||'',
}).then(res=>{
App.Customer.GetCustomerInfo({},'clear')
wx.navigateBack()
if(res.ret!=200){
return util.toast(res.msg,'none');
}
if(res.data.hasSetUserInfo){
App.Customer.GetCustomerInfo({},'clear')
}
wx.redirectTo({
url:util.http_build_query({
id:res.data.rid,
hasFirstShow:1,
},'/pages/customer/detail_owner')
})
})
},
getRdate(){
let daily=this.data.seller.daily;
let ddate=util.unixtoTime(this.options.ddate,'YYYY-MM-DD,HH:II').split(',');
let rd=['00:00','00:00'];
Object.keys(daily).forEach((k)=>{
let t=daily[k].split('-')
if(t[0]<=ddate[1] && ddate[1]<=t[1]){
rd=t;
}
})
return util.timetouUnix(ddate[0]+' '+rd[0]+':00')+'-'+util.timetouUnix(ddate[0]+' '+rd[1]+':00')
},
})
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@
"minified": true,
"newFeature": true,
"nodeModules": true,
"autoAudits": false,
"autoAudits": true,
"uglifyFileName": false,
"checkInvalidKey": true,
"enhance": true,
... ... @@ -463,16 +463,18 @@
"query": "sid=1&ddate=1234567890&pnum=10",
"scene": null
},
{
"id": 56,
"name": "测试组件",
"pathName": "pages/reserve/detail",
"query": "id=154",
"scene": null
},
{
<<<<<<< HEAD
"id": 56,
"name": "测试组件",
"pathName": "pages/reserve/detail",
"query": "id=154",
"id": -1,
"id": 57,
"name": "pages/customer/detail_owner",
"pathName": "pages/customer/detail_owner",
"query": "id=18599",
"query": "id=24838&hasFirstShow=1",
"scene": null
}
]
... ...
... ... @@ -268,6 +268,11 @@ export default {
cachetime: -1,
},
//C端录入预定
'App.Customer.SetReserveInfo':{
openid:'openid',
silence:false,
},
//获得小程序码
'App.Other.generate_qrcode':{
... ...