|
...
|
...
|
@@ -2,6 +2,7 @@ var util = require('../../../utils/util.js') |
|
|
|
var uri = require('../../../utils/uri.js')
|
|
|
|
import App from '../../../utils/api';
|
|
|
|
import RS from '../../../utils/reserveStatus'
|
|
|
|
import PubSub from '../../../utils/PubSub'
|
|
|
|
|
|
|
|
const {regeneratorRuntime} = global
|
|
|
|
import TP from '../../../utils/tpls';
|
|
...
|
...
|
@@ -30,6 +31,12 @@ Page({ |
|
|
|
this.sc = (await App.Reserve.SellerInfo(this.enter_params)).data;
|
|
|
|
console.log('this.sc', this.sc);
|
|
|
|
this.chooseManagerInit();
|
|
|
|
PubSub.on('arrangeDesk',(desk)=>{
|
|
|
|
this.arrangeDesk(desk)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onUnload(){
|
|
|
|
PubSub.off('arrangeDesk')
|
|
|
|
},
|
|
|
|
onShow: function () {
|
|
|
|
this.notice = this.selectComponent('#notice');
|
|
...
|
...
|
@@ -178,20 +185,10 @@ Page({ |
|
|
|
})
|
|
|
|
},
|
|
|
|
async startDinner(e) {
|
|
|
|
let cause = {};
|
|
|
|
let enter_params = util.cache('enter_params');
|
|
|
|
let sc = (await App.Reserve.SellerInfo(enter_params)).data
|
|
|
|
cause = {desc: ""}
|
|
|
|
if (enter_params) {
|
|
|
|
cause.uid = enter_params.manager_id;
|
|
|
|
}
|
|
|
|
if (sc.seller_user) {
|
|
|
|
cause.uname = (sc.seller_user.nick_name || sc.seller_user.nickname)
|
|
|
|
}
|
|
|
|
App.Reserve.SetReserveStatus({
|
|
|
|
rid: this.data.bookInfo.id,
|
|
|
|
status: util.attr(e, 'status'),
|
|
|
|
cause: JSON.stringify(cause),
|
|
|
|
cause: await this.getCause(),
|
|
|
|
}).then(() => {
|
|
|
|
this.getDetail(this.data.bookInfo.id, true);
|
|
|
|
});
|
|
...
|
...
|
@@ -205,4 +202,93 @@ Page({ |
|
|
|
}, '/pack-cookbook/pages/success')
|
|
|
|
});
|
|
|
|
},
|
|
|
|
refuseOrder(){
|
|
|
|
wx.showModal({
|
|
|
|
title: '确认拒绝订单吗?',
|
|
|
|
content: '如果包间类型已订满,请及时停用',
|
|
|
|
showCancel:true,
|
|
|
|
cancelText:'拒绝订单',
|
|
|
|
cancelColor:'',
|
|
|
|
confirmText:'去安排',
|
|
|
|
confirmColor:'',
|
|
|
|
success:(async (res)=>{
|
|
|
|
console.info(res)
|
|
|
|
if(res.cancel){
|
|
|
|
let params={
|
|
|
|
rid:this.data.bookInfo.id,
|
|
|
|
status:6,
|
|
|
|
cause:await this.getCause('拒绝订单'),
|
|
|
|
}
|
|
|
|
App.Reserve.SetReserveStatus(params).then(()=>{
|
|
|
|
this.getDetail(this.data.bookInfo.id,true);
|
|
|
|
PubSub.emit('fulshReseveList')
|
|
|
|
})
|
|
|
|
}else{//分配
|
|
|
|
this.arrangeOrder()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
arrangeOrder(){
|
|
|
|
let bi=this.data.bookInfo
|
|
|
|
let checked_tids=''
|
|
|
|
//rdate=1568023200-1568041200&tid=0&pnum=6&checked_tids=&rid=&hasPubsub=1
|
|
|
|
wx.navigateTo({
|
|
|
|
url:util.http_build_query({
|
|
|
|
rdate:bi.rdate+'-'+bi.edate,
|
|
|
|
tid:0,
|
|
|
|
pnum:6,
|
|
|
|
checked_tids:checked_tids,
|
|
|
|
rid:'',
|
|
|
|
hasPubSub:1,
|
|
|
|
},'./b_desk')
|
|
|
|
})
|
|
|
|
},
|
|
|
|
async arrangeDesk(res){
|
|
|
|
console.log('arrangeDesk',res.tableid)
|
|
|
|
let params={
|
|
|
|
rid:this.data.bookInfo.id,
|
|
|
|
status:5,
|
|
|
|
cause:await this.getCause('安排包间'),
|
|
|
|
tid:res.tableid.toString()
|
|
|
|
}
|
|
|
|
App.Reserve.SetReserveStatus(params).then(()=>{
|
|
|
|
this.getDetail(this.data.bookInfo.id,true);
|
|
|
|
PubSub.emit('fulshReseveList')
|
|
|
|
})
|
|
|
|
},
|
|
|
|
easyCall(e){
|
|
|
|
let bi=this.data.bookInfo
|
|
|
|
let phone=bi.phone
|
|
|
|
if(util.attr(e,'key')=='seller'){
|
|
|
|
phone=bi.seller.phone
|
|
|
|
if(bi.seller.seller_tel){
|
|
|
|
let seller_tel=bi.seller.seller_tel.split(',');
|
|
|
|
if(seller_tel.length>0){
|
|
|
|
phone=seller_tel[parseInt(Math.random()*seller_tel.length)]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
phone=phone.replace(/[^\d]/g,'')
|
|
|
|
if(phone){
|
|
|
|
wx.makePhoneCall({
|
|
|
|
phoneNumber: phone
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
util.toast('号码为空','none')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async getCause(desc=""){
|
|
|
|
let cause = {};
|
|
|
|
let enter_params = util.cache('enter_params');
|
|
|
|
let sc = (await App.Reserve.SellerInfo(enter_params)).data
|
|
|
|
cause = {desc: desc}
|
|
|
|
if (enter_params) {
|
|
|
|
cause.uid = enter_params.manager_id;
|
|
|
|
}
|
|
|
|
if (sc.seller_user) {
|
|
|
|
cause.uname = (sc.seller_user.nick_name || sc.seller_user.nickname)
|
|
|
|
}
|
|
|
|
return JSON.stringify(cause)
|
|
|
|
}
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|