|
|
|
// 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;
|
|
|
|
},
|
...
|
...
|
|