Commit 58465719f38e1248b15a41434dc4a3041e5b9748

Authored by vking
1 parent 387faca1

客户经理小程序接单

1 import App from '../utils/api' 1 import App from '../utils/api'
2 import util from '../utils/util' 2 import util from '../utils/util'
3 -  
4 -const {regeneratorRuntime} = global  
5 module.exports = { 3 module.exports = {
6 getHasEditorFlag() { 4 getHasEditorFlag() {
7 return new Promise(async function (success, fail) { 5 return new Promise(async function (success, fail) {
@@ -3,8 +3,6 @@ var uri = require('../../../utils/uri.js') @@ -3,8 +3,6 @@ var uri = require('../../../utils/uri.js')
3 import App from '../../../utils/api'; 3 import App from '../../../utils/api';
4 import RS from '../../../utils/reserveStatus' 4 import RS from '../../../utils/reserveStatus'
5 import PubSub from '../../../utils/PubSub' 5 import PubSub from '../../../utils/PubSub'
6 -  
7 -const {regeneratorRuntime} = global  
8 import TP from '../../../utils/tpls'; 6 import TP from '../../../utils/tpls';
9 import gl from '../../global'; 7 import gl from '../../global';
10 8
@@ -21,7 +19,7 @@ Page({ @@ -21,7 +19,7 @@ Page({
21 onLoad: async function (opt) { 19 onLoad: async function (opt) {
22 util.setBarTitle('预订详情'); 20 util.setBarTitle('预订详情');
23 console.log(opt) 21 console.log(opt)
24 - this.getDetail(opt.id); 22 + //this.getDetail(opt.id);
25 wx.showShareMenu({ 23 wx.showShareMenu({
26 withShareTicket: true, 24 withShareTicket: true,
27 success: function (res) { 25 success: function (res) {
@@ -30,10 +28,14 @@ Page({ @@ -30,10 +28,14 @@ Page({
30 }) 28 })
31 this.enter_params = util.cache('enter_params'); 29 this.enter_params = util.cache('enter_params');
32 this.sc = (await App.Reserve.SellerInfo(this.enter_params)).data; 30 this.sc = (await App.Reserve.SellerInfo(this.enter_params)).data;
33 - console.log('this.sc', this.sc); 31 + try{
  32 + await gl.VerificationIsAdmin();
  33 + }catch(e){}
  34 + console.log('this.sc', this.sc,getApp().isAdmin);
34 if(getApp().isAdmin || this.sc.seller.is_call_tel==1){ 35 if(getApp().isAdmin || this.sc.seller.is_call_tel==1){
35 this.hasCallPhone=true; 36 this.hasCallPhone=true;
36 } 37 }
  38 + this.getDetail(opt.id);
37 this.chooseManagerInit(); 39 this.chooseManagerInit();
38 PubSub.on('arrangeDesk',(desk)=>{ 40 PubSub.on('arrangeDesk',(desk)=>{
39 this.arrangeDesk(desk) 41 this.arrangeDesk(desk)
@@ -88,9 +90,22 @@ Page({ @@ -88,9 +90,22 @@ Page({
88 } 90 }
89 }else{ 91 }else{
90 //getApp().isAdmin 92 //getApp().isAdmin
91 - if(!this.hasCallPhone){//在线预订  
92 - if((bi.status==0 || bi.status==6)){  
93 - return; 93 + console.log('this.hasCallPhone',this.hasCallPhone,bi.status)
  94 + if(!this.hasCallPhone){//不能直接打电话
  95 + if(bi.status==6) return;
  96 + if(bi.status==0){
  97 + return wx.showModal({
  98 + title: '   客户要求不能满足时  \n请先安排包间后再联系客户调整',
  99 + content: '',
  100 + confirmColor: '#199095',
  101 + confirmText:'去安排',
  102 + showCancel: false,
  103 + success: (res)=> {
  104 + if (res.confirm) {
  105 + this.arrangeOrder();
  106 + }
  107 + }
  108 + });
94 } 109 }
95 } 110 }
96 } 111 }
@@ -246,7 +261,7 @@ Page({ @@ -246,7 +261,7 @@ Page({
246 }, 261 },
247 refuseOrder(){ 262 refuseOrder(){
248 wx.showModal({ 263 wx.showModal({
249 - title: '确认拒绝订单吗?', 264 + title: '   确定拒绝订单吗?   \n拒绝后无法联系客户',
250 content: '如果包间类型已订满,请及时停用', 265 content: '如果包间类型已订满,请及时停用',
251 showCancel:true, 266 showCancel:true,
252 cancelText:'拒绝订单', 267 cancelText:'拒绝订单',
@@ -301,15 +316,28 @@ Page({ @@ -301,15 +316,28 @@ Page({
301 }) 316 })
302 }, 317 },
303 easyCall(e){ 318 easyCall(e){
  319 + let key=util.attr(e,'key')
304 let bi=this.data.bookInfo 320 let bi=this.data.bookInfo
305 //getApp().isAdmin 321 //getApp().isAdmin
306 - if(bi.type==1 && !this.hasCallPhone){//在线预订  
307 - if((bi.status==0 || bi.status==6)){  
308 - return; 322 + if(bi.type==1 && !this.hasCallPhone && key!='seller'){//在线预订
  323 + if(bi.status==6) return;
  324 + if(bi.status==0){
  325 + return wx.showModal({
  326 + title: '   客户要求不能满足时  \n请先安排包间后再联系客户调整',
  327 + content: '',
  328 + confirmColor: '#199095',
  329 + confirmText:'去安排',
  330 + showCancel: false,
  331 + success: (res)=> {
  332 + if (res.confirm) {
  333 + this.arrangeOrder();
  334 + }
  335 + }
  336 + });
309 } 337 }
310 } 338 }
311 let phone=bi.phone 339 let phone=bi.phone
312 - if(util.attr(e,'key')=='seller'){ 340 + if(key=='seller'){
313 phone=bi.seller.phone 341 phone=bi.seller.phone
314 if(bi.seller.seller_tel){ 342 if(bi.seller.seller_tel){
315 let seller_tel=bi.seller.seller_tel.split(','); 343 let seller_tel=bi.seller.seller_tel.split(',');
@@ -120,7 +120,7 @@ @@ -120,7 +120,7 @@
120 <formids bindclick="showOrder">查看菜品</formids> 120 <formids bindclick="showOrder">查看菜品</formids>
121 </view> 121 </view>
122 </view> 122 </view>
123 - <view class="notice-button-border font34r flex-lr" wx:if="{{hasEditorFlag}}"> 123 + <view class="notice-button-border font34r flex-lr" wx:if="{{hasEditorFlag || bookInfo.type==1}}">
124 <view> 124 <view>
125 <formids bindclick="gotoModify">变更预订</formids> 125 <formids bindclick="gotoModify">变更预订</formids>
126 </view> 126 </view>
@@ -128,7 +128,7 @@ view{ @@ -128,7 +128,7 @@ view{
128 right:240rpx; 128 right:240rpx;
129 width: 82rpx; 129 width: 82rpx;
130 height: 52rpx; 130 height: 52rpx;
131 - z-index: 99; 131 + z-index: 2;
132 } 132 }
133 .reserve-status-tip .text{ 133 .reserve-status-tip .text{
134 font-weight: bold; 134 font-weight: bold;
@@ -504,7 +504,7 @@ @@ -504,7 +504,7 @@
504 "id": 60, 504 "id": 60,
505 "name": "pack-book/pages/book/b_detail", 505 "name": "pack-book/pages/book/b_detail",
506 "pathName": "pack-book/pages/book/b_detail", 506 "pathName": "pack-book/pages/book/b_detail",
507 - "query": "id=33284", 507 + "query": "id=55330",
508 "scene": null 508 "scene": null
509 }, 509 },
510 { 510 {