Commit 6a1cad7df325eb44b097a7cb8494d4a48e857e2f

Authored by wangfan
2 parents 310d80b7 a7434664

Merge remote-tracking branch 'remotes/origin/master' into online-reserve

... ... @@ -54,7 +54,7 @@
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#199095",
"navigationBarTitleText": "点餐商户端",
"navigationBarTextStyle": "light"
"navigationBarTextStyle": "white"
},
"networkTimeout": {
"request": 5000,
... ... @@ -64,7 +64,7 @@
"color": "#999999",
"selectedColor": "#353535",
"backgroundColor": "#FEFEFE",
"borderStyle": "",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/reserve/index",
... ...
... ... @@ -137,6 +137,7 @@
text-overflow:ellipsis;
white-space: nowrap;
color:#999999;
width:90%;
}
.hasListModel .label{
height: 22rpx;
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
... ...
// cookbook/index.js
var mta=require('mta-wechat-analysis')
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
... ... @@ -34,6 +35,14 @@ Page({
})
this.getCookList();
this.initOrder();
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":options, //渠道分析
});
},
initOrder(){
App.Advance.CreateOrder({
... ... @@ -112,7 +121,7 @@ Page({
onShareAppMessage: function () {
return {
title:'一起来点菜啦!',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-go.jpg',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-go2.jpg',
}
},
formatCookList(list){
... ...
... ... @@ -74,7 +74,7 @@ Page({
return {
title:'菜品已点好,快来看看都点了什么~',
path:util.http_build_query(options,'/pack-cookbook/pages/success'),
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-show.jpg',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-show2.jpg',
}
},
... ...
... ... @@ -61,11 +61,10 @@
line-height: 140rpx;
border-top: 2rpx solid #F5F5F5;
border-radius: 0 0 10rpx 10rpx;
margin:0 10rpx 20rpx;
margin:0 0 20rpx;
text-align: right;
font-weight: bold;
font-size: 36rpx;
padding-right: 34rpx;
}
.hr{
height: 20rpx;
... ...
... ... @@ -161,9 +161,9 @@ Page({
*/
onShow: function () {
//if(!this.reserve_id || util.cache('tableid').length>0){
if (util.cache('tableid').length > 0) {
//if (util.cache('tableid').length > 0) {
this.getTables();
}
//}
setTimeout(() => {
this.setData({
calendarMaskLoad: true,
... ... @@ -272,9 +272,11 @@ Page({
console.log('ts', sobj.tables,this.checkedTables);
//console.log(e.type,key,val,form);
sobj.form = form;
sobj.buttonhide = true;
sobj.buttonhide = this.data.buttonhide;
if (form.tid.length > 0 && form.rname.length > 0) {
sobj.buttonhide = false;
}else{
sobj.buttonhide = true;
}
let displayTimes = false;
if (key == 'time') {
... ... @@ -286,7 +288,7 @@ Page({
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
if (!displayTimes) {
//sobj.form.tid = []; //切换日期时间清空桌位
sobj.buttonhide = true;
//sobj.buttonhide = true;
this.getTables();
}
if (key == 'date') {
... ... @@ -330,7 +332,9 @@ Page({
let tablesLength = 0;
if (tableid.length > 0) {
let toastTables={...this.checkedTables}
res.data.forEach(p => {
let resData=res.data.slice(1,res.data.length);
console.log('resData',resData)
resData.forEach(p => {
//if(tables.length>=3) return true;
p.list.forEach(t => {
delete toastTables[t.id]
... ... @@ -361,6 +365,7 @@ Page({
}
wx.removeStorage({key: 'tableid'})
}
console.log('tables',tables);
if(tables.length<1){
tablesLength=0;
tables_tmp = [];
... ... @@ -417,19 +422,24 @@ Page({
if (!form.tid) {
return util.toast('请选择桌子', 'none');
}
if (!form.rname) {
return util.toast('请填写预订人', 'none');
}
form.sid = this.sellerid;
form.rdate = rdate
if (!form.rid) {
try {
let enter_params = util.cache('enter_params');
let sc = (await App.Reserve.SellerInfo(enter_params)).data
let note_openid = enter_params.seller_openid;
let note_name = sc.seller_user.nickname;
form.note_openid = note_openid || '';
form.note_name = note_name || '';
} catch (e) {
try {
let enter_params = util.cache('enter_params');
let sc = (await App.Reserve.SellerInfo(enter_params)).data
let note_openid = enter_params.seller_openid;
let note_name = sc.seller_user.nick_name || sc.seller_user.nickname;
form.note_openid = note_openid || '';
if (form.rid) {//修改时传递uid
form.note_openid = enter_params.manager_id || '';
}
}
form.note_name = note_name || '';
} catch (e) {}
form.ddate = d_rdate.substr(0, 10);
if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间
let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");
... ... @@ -489,7 +499,7 @@ Page({
[changeDay]: clickDay,
[changeBg]: "#84e7d0",
//[`form.tid`]: [], //切换日期时间清空桌位
buttonhide: true,
//buttonhide: true,
})
this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime)
this.getTables();
... ...
... ... @@ -47,7 +47,7 @@ Page({
//title: (nickname||'')+'给你发送了一个订座信息,点击查看详情',
title: '点击查看详情,发邀请函',
path: path+'&hasInvitation=1&hasSellerShare=1',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai.jpg',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
success: function (res) {
console.log(res,666666)
},
... ... @@ -168,10 +168,21 @@ Page({
actionSheetHidden:true
})
},
startDinner(e){
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),
}).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
});
... ...
... ... @@ -13,7 +13,7 @@
<image src="http://qn.colorcun.com/custom/lite-yd/image/reserve-status-{{bookInfo.status}}.png"></image>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">预定座位</view>
<view class="gray-deep-font font30r">预订座位</view>
<view class="black-font font34r">{{tables.length}}个</view>
</view>
<view class="flex-lr order-desk">
... ... @@ -78,19 +78,27 @@
<!--通知预订人-->
<view class="notice-opt" wx:if="{{bookInfo.status==1}}">
<view class="notice-button-border font34r flex-lr">
<view bindtap="noticeCall">通知预订人</view>
<view>
<formids bindclick="noticeCall">通知预订人</formids>
</view>
<view wx:if="{{bookInfo.order && bookInfo.order.cookbooklist.length>0}}">
<formids bindclick="showOrder">查看菜品</formids>
</view>
</view>
<view class="notice-button-border font34r flex-lr">
<view bindtap="gotoModify">变更预定</view>
<view bindtap="cancelReserve">取消预定</view>
<view bindtap="startDinner" data-status="2">确认到店</view>
<view>
<formids bindclick="gotoModify">变更预订</formids>
</view>
<view >
<formids bindclick="cancelReserve">取消预订</formids>
</view>
<view>
<formids bindclick="startDinner" data-status="2">确认到店</formids>
</view>
</view>
</view>
<view class="notice-opt" wx:if="{{bookInfo.status==2}}">
<view class="notice-button white-font font34r flex-cc" bindtap="startDinner" data-status="3">顾客就餐完毕</view>
<formids class="notice-button white-font font34r flex-cc" bindclick="startDinner" data-status="3">顾客就餐完毕</formids>
</view>
<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">
... ...
... ... @@ -28,6 +28,9 @@ Page({
[],
],
speciallist:[],
ReservesCountMonth:[],
ReservesTotal:0,
timeStrLabel:bookOrder.timeStrLabel
},
sellerid:0,
indexOpt:null,
... ... @@ -70,6 +73,8 @@ Page({
})
//util.setBarTitle('预定本');
this.indexOpt=opt;
this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD'));
this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM'));
},
onShow:function(){
this.setData({
... ... @@ -169,13 +174,14 @@ Page({
let clickDay = event.detail.date.substr(8,2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.getbooklist();
this.calendarClose();
this.setData({
dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.getbooklist();
this.calendarClose();
this.ReservesCountDay(event.detail.date);
},
calendarClose(){
this.setData({
... ... @@ -221,4 +227,48 @@ Page({
exportFile(){
this.getbooklist(true);
},
ReservesCountDay(day){
App.Reserve.ReservesCountDay({
sid:this.sellerid,
day:day
}).then(res=>{
let ReservesTotal=0;
let ReservesCountDay={};
if(res.ret==200){
ReservesCountDay=res.data;
Object.keys(res.data).forEach(k=>{
if(res.data[k]!=-1){
ReservesTotal+=parseInt(res.data[k])
}
})
}
this.setData({
ReservesTotal:ReservesTotal,
ReservesCountDay:ReservesCountDay,
})
})
},
ReservesCountMonth(month){
App.Reserve.ReservesCountMonth({
sid:this.sellerid,
month:month
}).then(res=>{
let ReservesCountMonth=[];
if(res.ret==200){
res.data.forEach(v=>{
ReservesCountMonth.push(v>=1?1:0)
})
}
this.setData({
ReservesCountMonth:ReservesCountMonth,
})
})
},
clickMonth(e){
this.ReservesCountMonth(e.detail.currentYear+'-'+e.detail.currentMonth);
},
gotoday(e){
this.ReservesCountMonth(e.detail.date.substr(0,7));
}
})
\ No newline at end of file
... ...
... ... @@ -33,18 +33,20 @@
</view>
</view>
</view>
<view class="book-list-cut flex-ll font26r black-font">
<text>已订 {{ReservesTotal}}</text>
<text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDay.key">{{timeStrLabel[index]}} {{item}}</text>
</view>
<block wx:if="{{!bookList}}">
<nothingBook height="{{listHeight}}"></nothingBook>
<nothingBook height="{{listHeight}}"></nothingBook>
</block>
<block wx:else>
<view class="book-list-cut flex-lr font26r black-font">
<text>已订 {{bookList.length}}</text>
</view>
<view bindcsroll="onPullDownRefresh" class="bg_white">
<view class="book-list-thead flex-lr font34r black-font">
<view>桌号</view>
<view class="flex-cc">预定人</view>
<view class="flex-cc">预订人</view>
<view class="flex-cc" bindtap="timeorder">时间<image src="http://qn.colorcun.com/custom/lite-yd/image/direction.png" class="icon22-26" background-size="cover"></image></view>
<view class="flex-rr">操作</view>
</view>
... ... @@ -81,13 +83,17 @@
datefont-style="datefont-style"
todaybtn-style="todaybtn-style"
bindnextMonth="nextMonth"
bindprevMonth="prevMonth"
bindnextMonth="clickMonth"
bindprevMonth="clickMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
colored="#199095"
circle_show="{{false}}"
circle_show="{{true}}"
mystatus="{{ReservesCountMonth}}"
dotcolor-o="dotcolor-o"
dotcolor-t="dotcolor-t"
allshow="{{true}}"
></calendar>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -62,6 +62,9 @@ page{
font-size: 26rpx;
line-height: 66rpx;
}
.book-list-cut text{
margin-right: 50rpx;
}
.border-line{
width:670rpx;
height:1px;
... ...
... ... @@ -50,3 +50,15 @@
position: absolute;
bottom: 10rpx; right: 60rpx;
}
/* 出勤 */
.dotcolor-o{
background-color: #ff3333!important;
top: 20rpx!important;
left: 70%!important;
width: 10rpx!important;
height: 10rpx!important;
}
/* 未出勤 */
.dotcolor-t{
background-color: #fefefe!important;
}
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
... ...
... ... @@ -2,7 +2,7 @@
<nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav>
<view class="header">
<view class="info">
<view class="nick">{{user.nickname}}</view>
<view class="nick">{{user.nick_name || user.nickname}}</view>
<view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view>
</view>
</view>
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
... ...
// pages/customer/detail_owner.js
var mta=require('mta-wechat-analysis')
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
... ... @@ -24,6 +25,14 @@ Page({
invite_name:invite_name
})
}
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":options, //渠道分析
});
},
/**
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "light",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
... ...
// pages/customer/detail_owner.js
var mta=require('mta-wechat-analysis')
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
... ... @@ -24,6 +25,14 @@ Page({
invite_name:invite_name
})
}
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":options, //渠道分析
});
},
/**
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "light",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
... ...
... ... @@ -3,7 +3,7 @@
<view class="pages">
<view class="flex-vc" style="position: relative;">
<view class="invit-logo">
<image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1.png"></image>
<image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image>
</view>
<view class="seller flex-vc">
<view class="title">餐厅</view>
... ...
... ... @@ -4,7 +4,7 @@
<view class="tip">在这里维护你的常用预订信息</view>
<view class="card">
<view class="item flex-lr">
<view class="item-label">预 定 人</view>
<view class="item-label">预 订 人</view>
<view class="Medium flex-rr">
<input class="name input" placeholder="请输入姓名"
bindinput="changeInput"
... ...
... ... @@ -60,7 +60,15 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
if(formids){
wx.removeStorage({key:'formids'});
}
let enter_params = wx.getStorageSync('enter_params');
let operator=''
if(enter_params){
operator=JSON.stringify({
uid:enter_params.manager_id,
openid: enter_params.seller_openid,
sid:enter_params.seller_id,
})
}
wx.request({
url: host+act,
method: 'POST',
... ... @@ -69,6 +77,7 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
...header,
openid:openid,
formids:formids.toString(),
operator:operator,
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
... ...
... ... @@ -116,6 +116,12 @@ export default {
alias:'App.SendSMS.SmsBatchSend',
silence: false,
},
//统计某个商家某天预定总数
'App.Reserve.ReservesCountDay':null,
//统计某个商家某月预定总数
'App.Reserve.ReservesCountMonth':{
cachetime: 300,
},
/**提前点餐**/
'App.Advance.CreateOrder':{
... ...
... ... @@ -59,8 +59,10 @@ module.exports ={
}
if (sc.daily){
let ti=['morning','noon','night'];
console.log('getTimeSpace',sc.daily,sc.daily[ti[timeIndex]],timeIndex);
let ts=sc.daily[ti[timeIndex]].split('-');
let scDaily=sc.daily[ti[timeIndex]]||'00:00-23:59';
console.log('getTimeSpace',sc.daily,scDaily,timeIndex);
let ts=scDaily.split('-');
let stime
if(stimestr){
... ... @@ -175,6 +177,6 @@ module.exports ={
}
//console.log('times',obj);
return obj;
}
},
timeStrLabel:{'morning':'早市','noon':'午市','night':'晚市'},
}
... ...
//正式
var uri={
HOST__LINE:'https://xt04.colorcun.com/?s=',
HOST__LINE:'https://xt05.colorcun.com/?s=',
//获取商家信息
CGI__USER_GETSELLERBYID: 'App.Seller.GetSellerById',
... ...