Commit d066617629a1f489533b75ecf3ad23a842763a6f

Authored by liuxuqinfhp1220
2 parents cc280531 6c2eab56

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: (38 commits)
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  周到安排
  ...
Showing 51 changed files with 674 additions and 138 deletions
... ... @@ -16,30 +16,7 @@ Array.prototype.remove = function(val) {
this.splice(index, 1);
}
};
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
let consoleLog=console.log
function wlog(){
let argumentsX=[...arguments]
return new Promise(function (success,fail) {
let params=[]
let len=0
argumentsX.forEach((val,i)=>{
if(len>=4500) return
let str=JSON.stringify(val);
if(!str) return;
params[i]=str.substr(0,4500-len)
len+=params[i].length
})
logger.info(...params);
success()
})
}
console.log=function () {
consoleLog(...arguments)
wlog(...arguments);
}
}
import log from 'utils/realTimeLog'
App({
openid:"",
system:{},
... ... @@ -187,7 +164,7 @@ App({
wx.getClipboardData({
success:(res)=>{
let match=res.data.match(/#(.*)#/);
if(match && res.data.indexOf('一键订')>0){
if(match && res.data.indexOf('周到安排')>0){
success(match[1])
}else{
fail()
... ...
... ... @@ -11,7 +11,7 @@
"pages/customer/remind",
"pages/reserve/index",
"pages/me/index",
"pages/me/concat",
"pages/me/concat",
"pages/me/setting",
"pages/me/list",
"pages/reserve/search",
... ... @@ -64,7 +64,8 @@
"pages/book/smsbatch/detail",
"pages/book/smsbatch/list",
"pages/book/smsbatch/result",
"pages/book/roomtype/roomtype"
"pages/book/roomtype/roomtype",
"pages/book/b_reserve"
]
}
],
... ... @@ -124,7 +125,7 @@
"version": "1.2.1",
"provider": "wx23a9cef3522e4f7c"
},
"haowu":{
"haowu": {
"version": "3.2.0",
"provider": "wx56c8f077de74b07c"
}
... ... @@ -134,9 +135,9 @@
"desc": "你的位置信息用于获得离你最近的餐厅"
}
},
"usingComponents":{
"layout":"/components/layout",
"fb":"/components/common/feedback"
"usingComponents": {
"layout": "/components/layout",
"fb": "/components/common/feedback"
},
"debug": true,
"sitemapLocation": "sitemap.json"
... ...
... ... @@ -5,7 +5,7 @@
优惠信息
<view class="close"></view>
</view>
<view class="slogan">致电商家时,请说明是一键订平台的客户</view>
<view class="slogan">致电商家时,请说明是周到安排平台的客户</view>
<scroll-view
scroll-y
class="list"
... ...
... ... @@ -65,7 +65,7 @@ Component({
item_code:seller.id+"",
title:seller.sellername,
desc:seller.slogan,
category_list:(seller.cate && seller.cate.length>0)?seller.cate:['餐厅','饭店','餐饮','订包间','一键订'],
category_list:(seller.cate && seller.cate.length>0)?seller.cate:['餐厅','饭店','餐饮','订包间','周到安排'],
image_list:seller.envi_image,
src_mini_program_path:'/pages/reserve/detail?id='+seller.id+'&from=haowu',
brand_info:{
... ...
... ... @@ -5,7 +5,7 @@
<cover-view style="position: relative;" wx:if="{{!hidden}}">
<cover-image src="http://qn.colorcun.com/reserve/images/%E4%BC%98%E6%83%A0%E6%B4%BB%E5%8A%A83.png"></cover-image>
<cover-view class="discount-view">
<cover-view class="text">精选折扣,一键订用户专享</cover-view>
<cover-view class="text">精选折扣,周到安排用户专享</cover-view>
<cover-view class="close" catchtap="hide"></cover-view>
</cover-view>
</cover-view>
... ...
... ... @@ -7,6 +7,10 @@ Component({
type:String,
value:"",
},
hasPubSub:{
type:Boolean,
value:false
},
},
data: {},
methods: {
... ... @@ -14,29 +18,46 @@ Component({
var tebleid = e.currentTarget.dataset.id;
var tables = util.cache('tableid') ? util.cache('tableid') : [];
var list = this.data.list;
var pages = getCurrentPages();
var addnewPage=pages[pages.length - 2];
let checkedTids=this.data.checkedTids.split(',');
list.forEach(function (v, i) {
if (v.id == tebleid) {
console.log('click.board',v);
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
if (v.isselect == true) {
var thisindex = tables.indexOf(tebleid);
tables.splice(thisindex, 1)
delete addnewPage.checkedTables[tebleid]
} else {
tables.push(tebleid)
addnewPage.checkedTables[tebleid]=v.name;
if(this.data.hasPubSub){
let checkedTids=this.data.checkedTids.split(',');
list.forEach(function (v, i) {
if (v.id == tebleid) {
console.log('click.board',v);
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
if (v.isselect == true) {
var thisindex = tables.indexOf(tebleid);
tables.splice(thisindex, 1)
} else {
tables.push(tebleid)
}
v.isselect = !v.isselect
}
v.isselect = !v.isselect
}
})
addnewPage.data.form.tid = tables;
addnewPage.setData({
form: addnewPage.data.form
})
console.log('checkedTables',addnewPage.checkedTables);
})
}else{
var pages = getCurrentPages();
var addnewPage=pages[pages.length - 2];
let checkedTids=this.data.checkedTids.split(',');
list.forEach(function (v, i) {
if (v.id == tebleid) {
console.log('click.board',v);
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
if (v.isselect == true) {
var thisindex = tables.indexOf(tebleid);
tables.splice(thisindex, 1)
delete addnewPage.checkedTables[tebleid]
} else {
tables.push(tebleid)
addnewPage.checkedTables[tebleid]=v.name;
}
v.isselect = !v.isselect
}
})
addnewPage.data.form.tid = tables;
addnewPage.setData({
form: addnewPage.data.form
})
console.log('checkedTables',addnewPage.checkedTables);
}
util.cache('tableid', tables);
this.triggerEvent("changedesk");
this.setData({
... ...
... ... @@ -39,7 +39,7 @@ Component({
})
},
async sendMsg(e){
let sign_name = '一键订';
let sign_name = '周到安排';
let item = this.data.item;
let ss = await App.Reserve.SmsInfo({seller_id: item.sid}, true);
let id = item.id;
... ...
... ... @@ -15,24 +15,20 @@ Component({
data: {
pi: 0,
dot:0,
hasEditorFlag:false,
hasEditorFlag:false,//添加预订
hasReserveOrder:false,//运营处理在线预订
tabsHidden:true,
},
attached(){
let pages = getCurrentPages();
let p = pages[pages.length - 1];
let pi = ['/pack-book/pages/book/b_addnew', '/pack-book/pages/book/b_index', '/pack-book/pages/book/b_setting', '/pack-book/pages/book/setting/index'];
for (let x in pi) {
console.log('tabBar', pi[x], p);
if (pi[x].indexOf(p.route) > -1) {
this.setData({
pi: x
})
break;
}
}
let pr=p.route.split('/')
this.setData({
pi: pr[pr.length-1]
})
},
ready(){
this.VerificationIsAdmin()
this.hasDot()
this.hasEditor();
},
... ... @@ -71,5 +67,16 @@ Component({
})
})
},
VerificationIsAdmin(){
gl.VerificationIsAdmin().then(()=>{
this.setData({
hasReserveOrder:true,
})
}).catch(()=>{
this.setData({
hasReserveOrder:false,
})
})
},
}
})
... ...
... ... @@ -2,25 +2,31 @@
<view class="tabBar flex-cc" >
<block wx:if="{{!tabsHidden}}">
<formids wx:if="{{hasEditorFlag}}" class="item flex-vc" bindtap="redirectTo" data-url="/pack-book/pages/book/b_addnew">
<view class="flex-vc {{pi==0?'checked':''}}" >
<view class="flex-vc {{pi=='b_addnew'?'checked':''}}" >
<view class="icon reserve"></view>
<view class="text">订座</view>
</view>
</formids>
<formids wx:if="{{hasReserveOrder}}" class="item flex-vc" bindtap="redirectTo" data-url="/pack-book/pages/book/b_reserve">
<view class="flex-vc {{pi=='b_reserve'?'checked':''}}">
<view class="icon order"></view>
<view class="text">在线预订</view>
</view>
</formids>
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pack-book/pages/book/b_index">
<view class="flex-vc {{pi==1?'checked':''}}">
<view class="flex-vc {{pi=='b_index'?'checked':''}}">
<view class="icon book"></view>
<view class="text">已预订</view>
</view>
</formids>
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pack-book/pages/book/b_setting">
<view class="flex-vc {{pi==2?'checked':''}}">
<view class="flex-vc {{pi=='b_setting'?'checked':''}}">
<view class="icon board"></view>
<view class="text">桌位</view>
</view>
</formids>
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pack-book/pages/book/setting/index">
<view class="flex-vc {{pi==3?'checked':''}}">
<view class="flex-vc {{pi=='index'?'checked':''}}">
<view class="icon setting">
<view class="dot" wx:if="{{dot>0}}"></view>
</view>
... ...
... ... @@ -16,7 +16,7 @@
}
.tabBar .item{
width: 33%;
min-width: 25%;
min-width: 20%;
}
.dot{
position: absolute;
... ... @@ -62,3 +62,9 @@
.tabBar .checked .board {
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-boards-checked.png");
}
.tabBar .order{
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E6%97%B6%E9%97%B4%E6%8A%A5%E5%91%8A%20%281%29.png");
}
.tabBar .checked .order {
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E6%97%B6%E9%97%B4%E6%8A%A5%E5%91%8A.png");
}
... ...
import App from '../utils/api'
import util from '../utils/util'
const {regeneratorRuntime} = global
module.exports ={
getHasEditorFlag(){
return new Promise(async function(success,fail){
let enter_params=util.cache('enter_params');
let res=await App.Reserve.SellerInfo(enter_params)
if(res.data.config.is_auth==1){
success()
}else{
fail()
}
})
},
module.exports = {
getHasEditorFlag() {
return new Promise(async function (success, fail) {
let enter_params = util.cache('enter_params');
let res = await App.Reserve.SellerInfo(enter_params)
if (res.data.config.is_auth == 1) {
success()
} else {
fail()
}
})
},
VerificationIsAdmin() {
//App.Seller.VerificationIsAdmin
return new Promise(async function (success, fail) {
let enter_params = util.cache('enter_params');
let res = await App.Seller.VerificationIsAdmin({openid:enter_params.seller_openid})
if (res.data && res.data.status==1) {
success()
} else {
fail()
}
})
}
}
\ No newline at end of file
... ...
import util from '../../../utils/util';
import comm from '../../../utils/bookCommon';
import App from '../../../utils/api';
import PubSub from '../../../utils/PubSub'
const {regeneratorRuntime} = global
Page({
data: {
... ... @@ -12,6 +13,7 @@ Page({
options:null,
onLoad: function (opt) {
console.log('onLoad', opt)
wx.removeStorageSync({key: 'tableid'})
this.options=opt;
var radio = 750 / util.getsystem().windowWidth;
var contentHeight = util.getsystem().windowHeight - Math.ceil(350 / radio);
... ... @@ -26,7 +28,8 @@ Page({
this.setData({
sellerid: this.sellerid,
opt: opt,
hasCheckedTable: this.checked_tids.length > 0
hasCheckedTable: this.checked_tids.length > 0,
hasPubSub:opt.hasPubSub
})
//this.getdesklist();
this.getDeskList();
... ... @@ -48,6 +51,15 @@ Page({
buttonClick: true
})
//wx.removeStorage({key:'tableid'})
if(this.data.hasPubSub){
if(this.checked_tids.length<1) return
wx.removeStorage({
key:'tableid'
})
PubSub.emit('arrangeDesk',{
tableid:this.checked_tids
})
}
wx.navigateBack();
},
getdesklist: function () {
... ...
... ... @@ -12,7 +12,7 @@
<view style="height: {{height-80}}px;overflow-y: auto;padding-bottom: 160rpx;overflow-x: hidden;width: 100%;">
<block wx:for="{{desklist}}" wx:key="desklist.key">
<orderDesk list="{{item.list}}" checkedTids="{{opt.checked_tids}}"
bind:changedesk="changedesk"
bind:changedesk="changedesk" hasPubSub="{{hasPubSub}}"
wx:if="{{item.name==menu_active_id}}"></orderDesk>
</block>
... ...
... ... @@ -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
... ...
... ... @@ -13,8 +13,11 @@
<view class="gray-deep-font font30r">用餐人数</view>
<view class="black-font font34r">{{bookInfo.pnum_str||bookInfo.pnum}}人</view>
</view>
<view class="reserve-status-tip" wx:if="{{bookInfo.status!=null}}">
<image src="http://qn.colorcun.com/custom/lite-yd/image/reserve-status-{{bookInfo.status}}.png"></image>
<view class="reserve-status-tip" wx:if="{{bookInfo.status==0 || bookInfo.status==6}}">
<view class="text">{{bookInfo.status==0?'待处理':'已拒绝'}}</view>
</view>
<view class="reserve-status-tip" wx:elif="{{bookInfo.status}}">
<image src="http://qn.colorcun.com/custom/lite-yd/image/reserve-status-{{bookInfo.status==5?1:bookInfo.status}}.png"></image>
</view>
<view class="flex-lr order-desk" wx:if="{{bookInfo.type==1}}">
<view class="flex-re" style="width:100%;flex-wrap:wrap;">
... ... @@ -118,6 +121,25 @@
<view class="notice-opt" wx:if="{{bookInfo.status==2}}">
<formids class="notice-button white-font font34r flex-cc" bindclick="startDinner" data-status="3">客户就餐完毕</formids>
</view>
<!--操作在线预订-->
<view class="notice-opt" wx:if="{{bookInfo.status==0}}">
<view class="notice-button-border font34r flex-lr">
<view>
<formids bindclick="easyCall" data-key="seller">联系商家</formids>
</view>
<view>
<formids bindclick="easyCall" data-key="customer">联系顾客</formids>
</view>
</view>
<view class="notice-button-border font34r flex-lr">
<view>
<formids bindclick="refuseOrder">拒绝订单</formids>
</view>
<view>
<formids bindclick="arrangeOrder">安排包间</formids>
</view>
</view>
</view>
<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">
<block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">
... ...
... ... @@ -128,6 +128,16 @@ view{
width: 82rpx;
height: 52rpx;
}
.reserve-status-tip .text{
font-weight: bold;
font-size: 32rpx;
color: #C51B41;
white-space : nowrap;
transform: rotate(-15deg);
border: solid 2rpx #C51B41;
padding: 5rpx;
width: 100rpx;
}
.reserve-status-tip image{
width: 100%;
height: 100%;
... ...
... ... @@ -36,6 +36,10 @@ Page({
indexOpt:null,
YYYY:'YYYY',
onLoad:async function(opt){
if(opt.rid){
this.reserveId=opt.rid
delete opt.rid
}
this.indexOpt=opt;
mta.Page.init({
"appID":"500667280",
... ... @@ -97,6 +101,13 @@ Page({
}
},1000);
if(this.reserveId){
let url='./b_detail?id='+this.reserveId
this.reserveId=''
return wx.navigateTo({
url:url
})
}
},
async getbooklist(isExport=false){
let time=0;
... ...
// pack-book/pages/book/b_reserve.js
// pages/book/setting/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
import PubSub from '../../../utils/PubSub'
import RS from '../../../utils/reserveStatus'
Page({
offset: 1,
limit: 10,
hasMore: true,
list:[],
/**
* 页面的初始数据
*/
data: {
list:[],
hasMore:true,
activeType:1,
},
/**
* 生命周期函数--监听页面加载
*/
enter_params: {},
onLoad: function (options) {
this.enter_params = util.cache('enter_params');
this.seller_id=options.seller_id||this.enter_params.seller_id;
this.getMembers();
PubSub.on('fulshReseveList',()=>{
this.switchTab({
currentTarget:{
dataset:{
type:this.data.activeType
}
}
});
})
},
onUnload(){
PubSub.off('fulshReseveList')
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
onUnload(){
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.getMembers(true);
}
},
getMembers(hasReachBottom=false){
let params={
sid:this.seller_id,
x:this.offset,
y:this.limit,
rdate:'1234567890-9999999999',
sort:1,
type:1,
}
if(this.data.activeType==1){
params.status='0,0'
}else{
params.status='1,2,3,4,5,6'
}
App.Reserve.GetReserveList(params).then((res)=>{
let list = res.data
if(list.length>0){
list.forEach((r,i)=>{
list[i]=RS.reserve(r)
})
}
this.list=this.list.concat(list)
let obj={list:this.list};
if(list.length<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}else{
this.offset++;
}
this.setData(obj)
}).catch(e=>{})
},
gotoDetail(e){
let url='./b_detail?id='+util.attr(e,'id')
return wx.navigateTo({
url:url
})
},
switchTab(e){
let activeType=util.attr(e,'type')
this.setData({
activeType:activeType,
hasMore:true,
})
this.list=[]
this.offset= 1
this.limit= 10
this.hasMore=true
this.pageScrollToTop()
setTimeout(()=>{
this.getMembers()
},300)
},
pageScrollToTop: function () {
wx.createSelectorQuery().select('.pages').boundingClientRect(function (rect) {
// 使页面滚动到底部
if(rect && rect.top){
wx.pageScrollTo({
scrollTop: rect.top
})
}
}).exec()
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"../../components/book/tabBar/tabBar"
}
}
\ No newline at end of file
... ...
<!--pack-book/pages/book/b_reserve.wxml-->
<wxs src="../../../utils/util.wxs" module="util" />
<nav id="nav" backgroundColor="#199095" color="#fefefe">在线预订</nav>
<view class="tabs flex-lr">
<view class="item {{activeType==1?'active':''}}" bindtap="switchTab" data-type="1">待处理</view>
<view class="item {{activeType==2?'active':''}}" bindtap="switchTab" data-type="2">已处理</view>
</view>
<view class="pages">
<block wx:if="{{list.length>0}}">
<view class="row" wx:for="{{list}}" wx:key="list.key" data-id="{{item.id}}" bindtap="gotoDetail">
<view class="flex-lr">
<view class="flex-ll">
<view class="label">包间需求:</view>
<view class="content">{{item.room_demand_str||''}}</view>
</view>
<view class="buttonStatus" wx:if="{{item.status>0}}">{{item.getStatusStr}}</view>
</view>
<view class="flex-ll">
<view class="label">就餐时间:</view>
<view class="content">{{util.unixtoTime(item.ddate,'YYYY-MM-DD HH:II')}}</view>
</view>
<view class="flex-lr">
<view class="flex-ll">
<view class="label">预订客户:</view>
<view class="content">{{item.rname}} {{['','先生','女士',''][item.sex]}}</view>
</view>
<view class="button" wx:if="{{item.status==0}}">立即处理</view>
</view>
</view>
</block>
<view wx:else="" class="history-is-empty flex-vc Medium">
<image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>
<view>暂时还没订单</view>
</view>
<view wx:if="{{!hasMore}}" class="flex-vc hasMore">已经到底了</view>
</view>
<tabBar></tabBar>
... ...
/* pack-book/pages/book/b_reserve.wxss */
.pages{
width: 90%;
margin: 80rpx auto 0;
color: #353535;
overflow-y: auto;
padding-bottom: 150rpx;
min-height: 900rpx;
}
.row{
font-size: 34rpx;
border-bottom: 2rpx solid #F1F0F4;
padding-top: 34rpx;
padding-bottom: 34rpx;
}
.hasMore{
padding-top: 34rpx;
padding-bottom: 34rpx;
font-size: 24rpx;
color: #cccccc;
}
.history-is-empty{
margin: 200rpx auto;
font-size: 34rpx;
}
.history-is-empty image{
width: 376rpx;
height: 310rpx;
margin-bottom: 122rpx;
}
.button{
background-color: #199095;
color: #fefefe;
border-radius: 10rpx;
padding: 2rpx 10rpx;
white-space:nowrap;
}
.buttonStatus{
border: solid 2rpx #199095;
color: #199095;
border-radius: 10rpx;
padding: 2rpx 10rpx;
white-space:nowrap;
transform: rotate(-15deg);
}
.tabs{
background-color: #199095;
margin-top: -2rpx;
position: fixed;
width: 100%;
z-index: 9;
}
.tabs .item{
height: 80rpx;
line-height: 80rpx;
text-align: center;
width: 50%;
box-sizing: border-box;
font-weight: bold;
font-size: 34rpx;
color: #fefefe;
}
.tabs .item:first-child{
border-radius: 0 8rpx 0 0 ;
}
.tabs .item:last-child{
border-radius: 8rpx 0 0 0 ;
}
.tabs .item.active{
background-color: #fefefe;
color: #199095;
width: 75%;
}
\ No newline at end of file
... ...
... ... @@ -65,16 +65,20 @@ Page({
async getDetail(id){
let res=await App.Reserve.Detail({rid: id, openid: ''});
this.bookInfo=res.data
let tplMsg=await ST.getTplMsg(res.data,this.sc.setting.template_code,this.sc)
if(res.data.operator_openid==2){//运营处理订单,强制使用运营短信
this.tplsIndex='SMS_173950289'
}
let tplMsg=await ST.getTplMsg(res.data,this.tplsIndex,this.sc)
this.setData({
bookInfo: res.data,
tplMsg: tplMsg
})
},
sendsms(){
App.SendSMS.Message({
phone: this.bookInfo.phone,
sign_name: '一键订',
sign_name: '周到安排',
template_code: this.tplsIndex,
template_param: JSON.stringify(ST.smsData),
rid: this.bookInfo.id,
... ...
... ... @@ -32,7 +32,9 @@ Page({
}
)
},
onUnload(){
PubSub.off('flushNewCustomer')
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -75,7 +77,7 @@ Page({
hasSellerShare:true,
},'/pages/reserve/detail')
return {
title:'请客订包间,就上一键订',
title:'请客订包间,就上周到安排',
imageUrl:'https://xt04.colorcun.com/sellerShare/Share_'+this.data.seller.id+'.png?'+Math.random(),
path: path,
}
... ...
... ... @@ -150,6 +150,12 @@ Page({
util.toast('本区域暂无配送人员', 'none');
},
callSeller(){
if(this.data.detail.seller.is_online_reserve==1 && this.data.detail.seller.is_tele==0){
//在线预定没有话机
return wx.makePhoneCall({
phoneNumber:'400-000-9690'
})
}
let seller_tel=this.data.detail.seller.seller_tel
if(seller_tel.length<1) return util.toast('商家电话错误','none')
if(seller_tel.length==1){//只有一个电话
... ...
... ... @@ -30,6 +30,10 @@ Page({
})
this.selectComponent("#network").debug(opt, 'scene');
}
if(opt.act=='tobook'){//消息跳入运营处理预订
delete opt.act
return this.redirectTo({url: util.http_build_query(opt,'/pack-book/pages/book/b_index')});
}
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"backgroundTextStyle": "light",
"usingComponents": {
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"userinfo-share": "/components/userinfo/share",
... ...
<!--pages/customer/list.wxml-->
<nav hasHome>一键订</nav>
<nav hasHome>周到安排</nav>
<view class="page">
<!--
<view class="tabs flex-cc">
... ...
... ... @@ -154,7 +154,7 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
PubSub.off('quick')
},
/**
... ...
<!--pages/manager-invitation/index.wxml-->
<view class="pages flex-vc">
<view class="title">欢迎使用一键订</view>
<view class="title">欢迎使用周到安排</view>
<view class="steps flex-cc">
<view class="icon home"></view>
<view class="dot" wx:for="{{[4,5,6,7,8,9,10]}}" wx:key="key" style="opacity:{{item/10}};" ></view>
<view class="icon user"></view>
</view>
<view class="info">一键订,客户经理专用的拓客工具</view>
<view class="info">周到安排,客户经理专用的拓客工具</view>
<view class="dot-max" wx:for="{{dots}}" style="bottom: {{item.bottom}}rpx;left: {{item.left}}rpx;zoom: {{item.zoom}};" wx:key="key"></view>
<userinfo binduserinfo="userinfo" style="width: 100%;">
<view class="userinfo">立即使用</view>
... ...
... ... @@ -13,7 +13,7 @@ Page({
current: 0,
tpls: TP.tpls(),
seller:{
name:'一键订示例餐厅',
name:'周到安排示例餐厅',
room:'天香阁',
date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
addr:'粤江西路啤酒文化创意艺术区B09'
... ... @@ -141,7 +141,7 @@ Page({
},'/pages/manager-invitation/display')
if(!this.data.options.rid){
return {
title: '一键订,客户经理专用的拓客工具',
title: '周到安排,客户经理专用的拓客工具',
path: '/pages/manager-invitation/index',
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
}
... ...
... ... @@ -33,7 +33,9 @@ Page({
}
)
},
onUnload(){
PubSub.off('flushNewCustomer')
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"getpos":"/components/userinfo/getpos",
... ...
<!--pages/me/follow.wxml-->
<nav>订好座,就用一键订</nav>
<nav>订好座,就用周到安排</nav>
<view class="pages">
<view class="flex-vc empty" wx:if="{{sellers.length<1}}">
<block wx:if="{{!hasFirstShow}}">
... ...
<!--pages/me/index.wxml-->
<nav>一键订</nav>
<nav>周到安排</nav>
<view class="page">
<view class="header flex-ll">
<view class="avatar">
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"formids":"/components/formids/formids",
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav"
... ...
... ... @@ -143,7 +143,7 @@ Page({
onShareAppMessage: function () {
let path=util.http_build_query({id:this.data.seller.id,fromid:getApp().openid},'/pages/reserve/detail')
return {
title:'请客订包间,就上一键订',
title:'请客订包间,就上周到安排',
imageUrl:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png?'+Math.random(),
path:path,
}
... ... @@ -154,15 +154,21 @@ Page({
activeTab:'reserve'
})
}
let seller_tel=this.data.seller.seller_tel
if(seller_tel.length<1) return util.toast('商家电话错误','none')
if(seller_tel.length==1){//只有一个电话
let phone=seller_tel[0].replace(/[^\d]/,'')
if(this.data.hasOnlineReserve && this.data.seller.is_tele==0){
wx.makePhoneCall({
phoneNumber:phone
phoneNumber:'400-000-9690'
})
}else{
this.selectComponent('#as').show();
let seller_tel=this.data.seller.seller_tel
if(seller_tel.length<1) return util.toast('商家电话错误','none')
if(seller_tel.length==1){//只有一个电话
let phone=seller_tel[0].replace(/[^\d]/,'')
wx.makePhoneCall({
phoneNumber:phone
})
}else{
this.selectComponent('#as').show();
}
}
},
reservePhone(e){
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"userinfo":"/components/userinfo/userinfo",
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
... ...
... ... @@ -198,6 +198,8 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
PubSub.off('searchParam')
PubSub.off('appHide')
},
/**
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
... ...
<!--pages/reserve/indexList.wxml-->
<nav>一键订</nav>
<nav>周到安排</nav>
<view class="header">
<view class="transverse-search flex-ll">
<view
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav"
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"一键订",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"nav":"/components/nav/nav",
"painter":"/components/painter/painter",
... ...
... ... @@ -220,8 +220,8 @@
"id": 21,
"name": "预订本-80商家",
"pathName": "pack-book/pages/book/b_index",
"query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=762",
"scene": "1001"
"query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354",
"scene": 1001
},
{
"id": -1,
... ... @@ -478,7 +478,7 @@
"id": 57,
"name": "pages/customer/detail_owner",
"pathName": "pages/customer/detail_owner",
"query": "id= 32456&hasFirstShow=1",
"query": "id=33347&hasFirstShow=1",
"scene": null
},
{
... ... @@ -499,7 +499,21 @@
"id": 60,
"name": "pack-book/pages/book/b_detail",
"pathName": "pack-book/pages/book/b_detail",
"query": "id=30711",
"query": "id=33284",
"scene": null
},
{
"id": -1,
"name": "pack-book/pages/book/b_reserve",
"pathName": "pack-book/pages/book/b_reserve",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/customer/index?act=tobook",
"pathName": "pages/customer/index",
"query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354&act=tobook",
"scene": null
}
]
... ...
... ... @@ -317,6 +317,11 @@ export default {
'App.Seller.SetTableClassFull':null,
//获取包间置满日期
'App.Customer.GetTableFillUpDate':null
'App.Customer.GetTableFillUpDate':null,
//提供openid获取身份信息
'App.Seller.VerificationIsAdmin':{
cachetime: 1800,
},
}
\ No newline at end of file
... ...
//app.js
// import log from 'utils/realTimeLog'
function str2ab(str) {
let strLen = str.length*2
var buf =new ArrayBuffer(strLen>5000?5000:strLen);
var bufView =new Uint16Array(buf);
for (var i = 0; i < buf.byteLength;i++) {
let asc=str.charCodeAt(i)
bufView[i] = asc;
}
return buf;
}
function ab2str(buf) {
return String.fromCharCode.apply(null,new Uint16Array(buf));
}
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
let consoleLog=console.log
function wlog(){
let argumentsX=[...arguments]
return new Promise(function (success,fail) {
let params=""
argumentsX.forEach((val,i)=>{
let str=JSON.stringify(val);
if(!str) return;
params+=str
})
let bs=str2ab(params)
logger.info(ab2str(bs).toString());
success()
})
}
console.log=function () {
consoleLog(...arguments)
wlog(...arguments);
}
}
\ No newline at end of file
... ...
... ... @@ -35,6 +35,9 @@ export default {
detail.getStatusStr='';
if(detail.status>=0){
detail.getStatusStr=status[detail.status];
if(!detail.hasRunning && (detail.status==1 || detail.status==5)){
detail.getStatusStr=status[3];
}
}
//mask
if(detail.phone){
... ... @@ -42,6 +45,15 @@ export default {
return $1+'**'+$3
})
}
//room_demand
if(detail.room_demand && typeof detail.room_demand=='string'){
detail.room_demand=JSON.parse(detail.room_demand)
detail.room_demand_str=detail.room_demand[0].name
let how=detail.room_demand.length
if(how>1){
detail.room_demand_str+=' 等'+how+'间'
}
}
return detail;
},
hasRunningFlag(detail){//判断订单正在运行
... ... @@ -50,6 +62,7 @@ export default {
if(detail.status==0 || detail.status==6 || detail.status==4) return false//未进行状态
if(detail.status==3) return false //用餐完成(离店)
//if(ns > detail.edate) return false//超时
//console.log('ns > this.getNextTime(detail)',ns , this.getNextTime(detail))
if(ns > this.getNextTime(detail)) return false//超时
return flag
},
... ... @@ -82,6 +95,6 @@ export default {
if(!last_time) return detail.edate;
let ns=util.timetouUnix(util.unixtoTime(detail.edate,"YYYY-MM-DD "+last_time.substr(0,5)+':00'))
if(hasToday) return ns
return ns+86400
return parseInt(ns)+86400
},
}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@ const tpls = {
SMS_163050401: '尊敬的贵宾,您好!\n ${seller_name}已为您安排${date}的用餐,房间:${region_room_name}; \n地址:${seller_addr}; \n电话:${seller_phone} \n预祝用餐愉快,${cusman}期待您的光临!',
SMS_164277855:'贵宾您好!${seller_name}为您预留${date}的${region_room_name};\n电话:${seller_phone},预祝用餐愉快!',
SMS_164268239:'贵宾您好!${seller_name}为您预留${date}的${region_room_name};\n地址:${seller_addr},电话:${seller_phone},预祝用餐愉快!',
SMS_173950289:'已为您预订${seller_name}的${rooms}包房,用餐时间为${shiduan},祝您用餐愉快!订包间享优惠,微信搜索“周到安排”。'
};
module.exports ={
... ... @@ -71,6 +72,7 @@ module.exports ={
async getTplMsg(bookInfo,tplcode='SMS_163050401',sc=null){
let smsData = {}
let txa=['早上','中午','晚上']
let txb=['早餐','午餐','晚餐']
let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate,sc);
if(!bookInfo.rdateStr){
bookInfo.rdateStr=util.unixtoTime(bookInfo.ddate, "MM月DD日 HH:II")
... ... @@ -114,6 +116,14 @@ module.exports ={
seller_phone: bookInfo.seller.phone.substr(0, 20),
}
break;
//【周到安排】已为您预订陕西风味面馆的春满大地、福寿同乐包房,用餐时间为9月12日晚餐,祝您用餐愉快!订包间享优惠,微信搜索“周到安排”。
case 'SMS_173950289'://运营安排包间
smsData = {
seller_name: bookInfo.seller.sellername.substr(0, 20),
shiduan: bookInfo.rdateStr.replace(/日.*/,'日'+txb[tx.timeIndex]),
rooms: this.getTableNameOne(bookInfo.tables).substr(0, 20),
}
break;
default:
let guest = '';
if (bookInfo.sex == 3) {
... ...