Commit 5fad9c8a1079800d5dfb894cdb813f06706267d0

Authored by wangfan
1 parent 4870598b

fenbao

Showing 100 changed files with 49 additions and 3960 deletions

Too many changes to show.

To preserve performance only 100 of 100+ files are displayed.

{
"component": true,
"usingComponents": {
"as":"/components/actionSheet/index"
}
"component": true,
"usingComponents": {
"as":"/components/actionSheet/index"
}
}
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"as":"../../actionSheet/index"
"board":"../board/board"
}
}
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"formids":"/components/formids/formids"
}
"component": true,
"usingComponents": {
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"service":"/components/book/smsbatch/service",
"service":"./service",
"formids":"/components/formids/formids",
"sendsms":"/components/book/smsbatch/sendsms"
"sendsms":"./sendsms"
}
}
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"board":"/components/book/board/board"
}
"component": true,
"usingComponents": {
"as":"/components/actionSheet/index"
}
}
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"formids":"../../formids/formids"
}
"component": true,
"usingComponents": {
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"timeDuration":"/components/book/time/time",
"timeDuration":"../../components/book/time/time",
"nav":"/components/nav/nav"
}
... ...
... ... @@ -3,13 +3,13 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nothingBook":"/components/book/nothing/nothing",
"bookList":"/components/book/list/list",
"nothingBook":"../../components/book/nothing/nothing",
"bookList":"../components/book/list/list",
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"tabBar":"../../components/book/tabBar/tabBar",
"searchList":"/components/searchlist/searchlist",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"board":"../../components/book/board/board",
"formids":"/components/formids/formids",
"a2l":"/components/tips/add-to-lite"
}
... ...
... ... @@ -3,8 +3,8 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"selectPeople":"/components/book/people/people",
"orderDesk":"/components/book/desk/desk",
"selectPeople":"../../components/book/people/people",
"orderDesk":"../../components/book/desk/desk",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
... ... @@ -3,10 +3,10 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"noticeCall":"/components/book/notice/notice",
"step":"/components/book/step/step",
"board":"/components/book/board/board",
"cancel":"/components/book/reserveCancel/cancel",
"noticeCall":"../../components/book/notice/notice",
"step":"../../components/book/step/step",
"board":"../../components/book/board/board",
"cancel":"../../components/book/reserveCancel/cancel",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
... ...
... ... @@ -3,10 +3,10 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nothingBook":"/components/book/nothing/nothing",
"bookList":"/components/book/list/list",
"nothingBook":"../../components/book/nothing/nothing",
"bookList":"../../components/book/list/list",
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"tabBar":"../../components/book/tabBar/tabBar",
"calendar": "plugin://bmCalendar/calendar",
"formids":"/components/formids/formids"
}
... ...
... ... @@ -3,8 +3,8 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"selectPeople":"/components/book/people/people",
"step":"/components/book/step/step",
"selectPeople":"../../components/book/people/people",
"step":"../../components/book/step/step",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
... ... @@ -4,9 +4,9 @@
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"tabBar":"../../components/book/tabBar/tabBar",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"board":"../../components/book/board/board",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
// pages/book/b_sms.js
var util = require('../../utils/util.js')
import App from '../../utils/api';
import bcm from '../../utils/bookCommon';
var util = require('/utils/util.js')
import App from '/utils/api';
import bcm from '/utils/bookCommon';
const {regeneratorRuntime} = global
import ST from './b_sms_tpls';
import ST from '/utils/sms_tpls';
const tpls = {
SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!',
SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!',
... ...
... ... @@ -4,7 +4,7 @@
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"tabBar":"../../../components/book/tabBar/tabBar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"tabBar":"../../../components/book/tabBar/tabBar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"tabBar":"../../../components/book/tabBar/tabBar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
... ... @@ -6,8 +6,8 @@
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"service":"/components/book/smsbatch/service",
"sendsms":"/components/book/smsbatch/sendsms"
"service":"../../../components/book/smsbatch/service",
"sendsms":"../../../components/book/smsbatch/sendsms"
}
}
\ No newline at end of file
... ...
... ... @@ -6,8 +6,8 @@
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"rows":"/components/book/smsbatch/rows",
"service":"/components/book/smsbatch/service"
"rows":"../../../components/book/smsbatch/rows",
"service":"../../../components/book/smsbatch/service"
}
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,7 @@
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"rows":"/components/book/smsbatch/rows"
"rows":"../../../components/book/smsbatch/rows"
}
}
\ No newline at end of file
... ...
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
var bookOrder=require('../../utils/bookCommon.js')
Page({
data:{
},
onLoad:function(){
util.setBarTitle('选择用餐时间');
this.getdatelist()
this.getimelist();
wx.removeStorage({
key:'order_pnum',
})
wx.removeStorage({
key:'tabletype',
})
},
onShow:function(){
},
changelist:function(e){
console.log('xxxx',e)
var timelist=this.data.timeList;
timelist.forEach(function(v,i){
v.list.forEach(function(r,n){
r.isselect=false
})
})
this.setData({
timeList:timelist,
time_dur:e.detail
})
},
//日期选择
selectdate:function(e){
var title=e.currentTarget.dataset.title;
var datelist=this.data.dateList;
var selectdate=''
datelist.forEach(function(v,i){
v.isActive=false
if(v.title==title){
v.isActive=true;
selectdate=v.date
}
})
this.setData({
dateList:datelist,
selectdate:selectdate,
time_dur:null
})
this.getimelist();
},
selectOther:function(){
var currentTime=Date.parse(new Date());
var timeobj=bookOrder.changedate(currentTime)
console.log(this.data.selectdate,this.data.time_dur)
wx.navigateTo({
url:'b_info?year='+timeobj.year+'&date='+this.data.selectdate+'&time='+this.data.time_dur
})
},
//获取日期列表
getdatelist:function(){
var currentTime=Date.parse(new Date());
var dur=24*60*60*1000;
var list=[currentTime,currentTime+dur,currentTime+2*dur];
var desklist=[];
for(var i=0;i<list.length;i++){
var dd=bookOrder.changedate(list[i]);
if(i==0){
var title='今天';
var isselect=true
}
if(i==1){
var title='明天';
var isselect=false
}
if(i==2){
var myDate = new Date(list[2]);
var title=bookOrder.getweek(myDate.getDay());
var isselect=false
}
desklist.push({
title:title,
date:'0'+dd.month+(dd.day<10 ? '-0'+dd.day : '-'+dd.day),
isActive:isselect,
year:dd.year
})
}
this.setData({
dateList:desklist,
selectdate:desklist[0].date
})
console.log(this.data.selectdate)
},
//获取时间列表
getimelist:function(){
var currentTime=Date.parse(new Date());
var timeobj=bookOrder.changedate(currentTime)
var timelist=[
{
title:'早市',
time_dur:'6:00-10:00',
list:[
{
time_dur:'6:00',
isselect:false,
time_mask:6
}
],
starttime:6,
endtime:10
},
{
title:'午市',
time_dur:'11:00-15:00',
list:[
{
time_dur:'11:00',
isselect:false,
time_mask:11
}
],
starttime:11,
endtime:15
},
{
title:'晚市',
time_dur:'17:00-22:00',
list:[
{
time_dur:'17:00',
isselect:false,
time_mask:17
}
],
starttime:17,
endtime:22
},
];
var that=this;
timelist.forEach(function(v,i){
var len=(v.endtime-v.starttime)/0.5;
var time=v.starttime;
console.log(len)
for(var j=0;j<len;j++){
time+=0.5;
if(bookOrder.isInteger(time)==true){
v.list.push(
{
time_dur:time+':00',
isselect:false,
time_mask:time
}
)
}else{
v.list.push(
{
time_dur:Math.floor(time)+':30',
isselect:false,
time_mask:time
}
)
}
}
})
var thisdate=0;
if(that.data.selectdate.split('-')[1].length>1){
thisdate=parseInt(that.data.selectdate.split('-')[1][0]=='0' ? that.data.selectdate.split('-')[1].slice(1,2) : that.data.selectdate.split('-')[1])
}else{
thisdate=parseInt(that.data.selectdate.split('-')[1])
}
if(thisdate==timeobj.day){
var thistime=timeobj.hour+timeobj.minute/60;
var dd=[]
timelist.forEach(function(v,i){
if(thistime<v.endtime){
dd.push(v)
}
})
timelist=dd;
timelist.forEach(function(v,i){
if(thistime>=v.starttime && thistime<=v.endtime){
var list=[]
v.list.forEach(function(r,n){
if(thistime<r.time_mask){
list.push(r)
}
})
v.list=list
}
})
}
this.setData({
timeList:timelist
})
},
})
\ No newline at end of file
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"timeDuration":"/components/book/time/time",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
<nav>点餐商户端</nav>
<!--日期-->
<view style="padding-bottom:160rpx;">
<view class="select-date flex-lr smooth">
<block wx:for="{{dateList}}">
<view class="single-date gray-deep-font flex-vc" bindtap="selectdate" data-title="{{item.title}}">
<view class="font30r {{item.isActive==true ? 'black-font' : ''}}">{{item.title}}</view>
<view class="font34r date-num flex-cc {{item.isActive==true ? 'select-date-active black-font' : ''}}">{{item.date}}</view>
</view>
</block>
<view class="single-date gray-deep-font flex-vc">
<view class="font30r">更多</view>
<view class="date-num flex-vc">
<image src="http://qn.colorcun.com/custom/lite-yd/image/more-dot.png" class="more-dot"></image>
</view>
</view>
</view>
<block wx:for="{{timeList}}">
<timeDuration item="{{item}}" bind:changelist="changelist"></timeDuration>
</block>
</view>
<view class="confirm-button white-font flex-vc font34r {{time_dur ? 'confirm-button-active' : ''}}" bindtap="{{time_dur ? 'selectOther' : ''}}">确定</view>
<date-picker
startTime="{{startTime}}"
endTime="{{endTime}}"
unit="{{unit}}"
reserveUnit="{{reserveUnit}}"
unreserveTime="{{unreserveTime}}"
activedConst="{{activedConst}}"
disabledConst="{{disabledConst}}"
themeColor="#1f78d1"
bind:selectTime="onSelectTime"
/>
\ No newline at end of file
.select-date{
width:680rpx;
height:180rpx;
margin:0 auto;
}
.more-dot{
width:50rpx;
height:10rpx;
}
.date-num{
padding:0 10rpx;
height:70rpx;
}
.select-date-active{
border-bottom:2px solid #199095;
box-sizing:border-box;
}
.confirm-button{
width:680rpx;
height:85rpx;
background:#74BBBE;
position:fixed;
left:0;
right:0;
bottom:60rpx;
margin:0 auto;
border-radius:10rpx;
}
.confirm-button-active{
background:#199095;
}
\ No newline at end of file
// pages/book/b_addnew.js
import util from '../../utils/util';
import comm from '../../utils/bookCommon';
import App from '../../utils/api';
const {regeneratorRuntime} = global
const formTpl = {
rid: '',
date: 0,
time: 0,
//pnum_str:'1-4',
pnum: 6,
tabid: 0,
rname: '',
phone: '',
sex: 1,
cusdem: '',
tid: [],
}
Page({
/**
* 页面的初始数据
*/
data: {
dateStr: [],
form: JSON.parse(JSON.stringify(formTpl)),
tables: [],
grand: [
{
sex: 1,
grand_title: '先生',
isselect: true
},
{
sex: 2,
grand_title: '女士',
isselect: false
},
{
sex: 3,
grand_title: '公司',
isselect: false
}
],
buttonhide: true,
calendarMaskLoad: false,
calendarMask: false,
dayStyle: [
{month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'},
{month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'}
],
timePickerArray: [
[],
[],
[],
],
timePickerIndex: [0, 0, 0],
tablesLength: 0,
timePickerMask: false,
pnumInputFocus: false,
pageMarginBottom: 0,
speciallist: [],
calendar: {
nextNum: 0,
},
defDtime: ['', '12:00', '18:30'],
hasUseDefDtime: true,
CustomRemark:[],
CustomRemarkMoreMask:false,
},
/**
* 生命周期函数--监听页面加载
*/
reserve_id: '',
checkedTables:{},//已选中的桌子集合
onLoad: async function (options) {
this.initLoad(options)
this.getCustomRemark();
},
async initLoad(options = {}){
let nt = new Date() / 1000;
let speciallist = [
{date: util.unixtoTime(nt, 'YYYY-MM-DD'), background: '', text: '今 天'},
{date: util.unixtoTime(nt + 86400, 'YYYY-MM-DD'), background: '', text: '明 天'},
{date: util.unixtoTime(nt + 86400 * 2, 'YYYY-MM-DD'), background: '', text: '后 天'},
];
this.reserve_id = options.id || '';
await this.setDateStr();
this.sellerid = util.cache('enter_params')['seller_id'];
let timePickerArray = await comm.getDayTimeSpace();
//判断hasUseDefDtime
let hasUseDefDtime = true;
let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
if (mmii > this.data.defDtime[this.data.form.time]) {
hasUseDefDtime = false;
}
this.setData({
timePickerArray: timePickerArray,
speciallist: speciallist,
hasUseDefDtime: hasUseDefDtime,
})
if (this.reserve_id > 0) {
this.initModify(this.reserve_id);
} else if(options.hasQuick==1){
this.initQuick(options);
} else {
this.getTables();
}
},
/**
*
* @param d
*
*/
async setDateStr(d = new Date() / 1000){
let ns = new Date() / 1000;
let dateStr = [
util.unixtoTime(ns, 'MM-DD `DAY/周WW`'),
util.unixtoTime(parseInt(ns) + 86400, 'MM-DD `DAY/周WW`'),
];
//let dateStr=this.data.dateStr;
let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`')
let form = this.data.form;
let timeObj = await comm.getTimeSpaceIndexData(d);
//form.time=await comm.getTimeSpaceIndex(d);
form.time = timeObj.timeIndex;
let ind = dateStr._indexOf(nowStr);
if (ind > -1) {
form.date = ind
} else {
dateStr.push(nowStr.substr(0, 5));
form.date = 2;
}
let timePickerIndex = this.data.timePickerIndex;
timePickerIndex[timeObj.timeIndex] = timeObj.timeMatchIndex;
let obj = {
dateStr: dateStr,
form: form,
timePickerIndex: timePickerIndex,
timeOpt: timeObj.timeOpt,
};
this.setData(obj)
return obj;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//if(!this.reserve_id || util.cache('tableid').length>0){
//if (util.cache('tableid').length > 0) {
this.getTables();
//}
setTimeout(() => {
this.setData({
calendarMaskLoad: true,
})
}, 1000);
this.conditionInfo()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
selectedValue(e){
console.log(e);
let key = util.attr(e, 'key');
let val;
let sobj = {};
if (e.type == 'input' || e.type == 'confirm') {
val = util.val(e);
if (key == 'phone') {
var that = this;
if (e.detail.value != '' && e.detail.value.length >= 3) {
App.Reserve.GetReserveUser(
{
keywords: e.detail.value,
sid: this.sellerid
}
).then(function (json) {
if (json.ret == 200 && json.data.length > 0) {
that.setData({
searchlist: json.data
})
} else {
that.setData({
searchlist: null
})
}
})
} else {
this.setData({
searchlist: null
})
}
}
if (key == 'pnum') {
sobj.pnumInputFocus = true;
}
} else {
val = util.attr(e, 'value');
}
if (key == 'time') {
if (this.data.timeOpt[val]) return;
}
if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) {
if (util.attr(e, 'display') != 'block') {
return;
}
}
let form = this.data.form;
if (key == 'tid') {
let ts = this.data.tables;
if (ts[val].isselect) {
ts[val].isselect = false;
form.tid.remove(ts[val].id);
delete this.checkedTables[ts[val].id]
} else {
ts[val].isselect = true;
form.tid.push(ts[val].id);
this.checkedTables[ts[val].id]=ts[val].name
}
sobj.tables = ts;
} else {
form[key] = val;
}
console.log('ts', sobj.tables,this.checkedTables);
//console.log(e.type,key,val,form);
sobj.form = form;
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') {
if (util.attr(e, 'display') == 'block') {
displayTimes = true;
sobj.timePickerMask = true;
}
}
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
if (!displayTimes) {
//sobj.form.tid = []; //切换日期时间清空桌位
//sobj.buttonhide = true;
this.getTables();
}
if (key == 'date') {
let xtime = util.unixtoTime(new Date() / 1000, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
this.setDateStr(util.timetouUnix(xtime));
}
}
//判断hasUseDefDtime
if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
sobj.hasUseDefDtime = true
}
if (this.data.form.date == 0) {//
let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
sobj.hasUseDefDtime = false;
}
}
this.setData(sobj)
},
async getTables(){
let form = this.data.form;
let tableid = util.cache('tableid');
console.log('getTables-tableid', tableid.length, this.reserve_id);
//if (tableid.length < 1 && this.reserve_id) {
if (tableid.length < 1) {
tableid = this.data.form.tid;
}
console.log('getTables-tableid', tableid, tableid.length);
try {
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time);
console.log('rdate', this.data.dateStr[this.data.form.date], rdate);
App.Reserve.GetTableList({
sid: util.cache('enter_params')['seller_id'],
//pnum_str:form.pnum_str,
pnum: form.pnum,
rdate: rdate,
tid: form.tabid,
rid: this.reserve_id,
}).then(res => {
let tables = [];
let tablesLength = 0;
if (tableid.length > 0) {
let toastTables={...this.checkedTables}
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]
tablesLength++;
if (tables.length >= 3) return true;
if (tableid._indexOf(t.id) > -1) {
t.isselect = true;
tables.push(t);
}
})
})
console.log('toastTables',toastTables,this.data.form.tid,this.checkedTables);
//清理已选中的桌位
let toastTablesInfo=[];
let tid=this.data.form.tid
Object.keys(this.checkedTables).forEach(ckid=>{
if(toastTables[ckid]){
delete this.checkedTables[ckid]
tid.remove(ckid);
toastTablesInfo.push(toastTables[ckid]);
}
})
if(toastTablesInfo.length>0){
this.setData({
[`form.tid`]:tid,
})
util.toast(toastTablesInfo.toString()+'已被占用啦','none');
}
wx.removeStorage({key: 'tableid'})
}
console.log('tables-first',tables);
if(tables.length<1){
tablesLength=0;
let fortids=[];
res.data.forEach((p,ri) => {
p.list.forEach(t => {
if(fortids._indexOf(t.id)<0) {
tablesLength++;
tables.push(t);
fortids.push(t.id);
}
})
})
if (tables.length >= 3) {
tables = tables.slice(0, 3);
}
}
this.tablesLength = tablesLength;
this.setData({
tables: tables,
tablesLength: tablesLength
})
})
} catch (e) {
this.setData({
tables: []
})
}
},
async formsubmit(){
if (this.data.buttonhide) return;
try {
let d_stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
this.data.form.time, d_stimestr);
let stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]];
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
this.data.form.time, stimestr);
console.log('stimestr', stimestr, this.data.form.time, this.data.timePickerIndex);
console.log('rdate', rdate);
this.setData({
buttonhide: true,
})
let form = JSON.parse(JSON.stringify(this.data.form));
console.log('typeof form.tid', typeof form.tid);
if (typeof form.tid == 'object') {
let tid = new Set(form.tid);//tid 去重
form.tid = [...tid].toString();
}
if (!form.tid) {
return util.toast('请选择桌子', 'none');
}
if (!form.rname) {
return util.toast('请填写预订人', 'none');
}
form.sid = this.sellerid;
form.rdate = rdate
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");
form.ddate = util.timetouUnix(ddateStr);
}
App.Reserve.SetReserveInfo(form).then(res => {
if (res.ret == 200) {
this.getCustomRemark()
let _id = (res.data.id || res.data)
this.setData({
form: JSON.parse(JSON.stringify(formTpl)),
tables: [],
timePickerIndex: [0, 0, 0],
})
this.initLoad();
this.checkedTables={};
App.Reserve.Detail({rid: _id, openid: ''}, 'clear')
wx.navigateTo({
url: util.http_build_query({id:_id,tplid:1},'b_invitation'),
});
} else {
util.toast(res.msg, 'none')
}
})
} catch (e) {
}
},
selectphone: function (e) {
this.data.form.phone = e.detail.phone;
this.data.form.rname = e.detail.rname;
this.data.form.cusdem = e.detail.cusdem;
var form = this.data.form
this.data.form.sex = e.detail.sex;
this.setData({
form: this.data.form,
searchlist: null
})
this.conditionInfo();
},
calendarShow(){
this.setData({
calendarMask: true
})
},
dateChange(event){
console.log(event);
//let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day)
let cktime = util.timetouUnix(event.detail.date)
let day0 = parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);
// if (cktime < day0) {
// util.toast('请选择有效日期', 'none');
// return;
// }
let clickDay = event.detail.date.substr(8, 2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
[changeDay]: clickDay,
[changeBg]: "#84e7d0",
//[`form.tid`]: [], //切换日期时间清空桌位
//buttonhide: true,
})
console.log('cktime',cktime,util.unixtoTime(cktime,'YYYY-MM-DD'))
this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime)
this.calendarClose();
setTimeout(res=>{
this.getTables();
},10)
},
calendarClose(){
this.setData({
calendarMask: false,
timePickerMask: false,
})
},
async selectdesk(){
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time);
console.log(this.data.form)
wx.navigateTo({
url: 'b_desk?rdate=' + rdate + '&tid=' + this.data.form.tabid
//+'&pnum_str='+this.data.form.pnum_str
+ '&pnum=' + this.data.form.pnum
+ '&checked_tids=' + this.data.form.tid
+ '&rid=' + this.reserve_id
})
},
conditionInfo: function () {
var form = this.data.form
if (form.tid.length > 0 && form.rname.length > 0) {
this.data.buttonhide = false;
}
this.setData({
buttonhide: this.data.buttonhide
})
},
/**
* 选中时间区域
*/
bindTimePickerChange(e){
let timeIndex = util.attr(e, 'timeIndex');
if (timeIndex < 0) return;
let timePickerIndex = this.data.timePickerIndex;
//timePickerIndex[timeIndex]=util.val(e);
timePickerIndex[timeIndex] = util.attr(e, 'val');
console.log(e, timeIndex, util.attr(e, 'val'));
this.setData({
timePickerIndex: timePickerIndex,
hasUseDefDtime: false,
})
},
/**
* 修改初始化
*/
async initModify(id){
try {
let res = await App.Reserve.Detail({rid: id, openid: ''});
console.log('initModify', res);
//设置日期
let obj = await this.setDateStr(res.data.ddate);
//设置时间
let nd = util.unixtoTime(res.data.ddate, 'HH:II');
let timePickerIndex = this.data.timePickerIndex
console.log('initModify-', this.data.timePickerArray, obj.form.time, nd)
this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {
console.log('initModify-', nd, dd)
if (nd == dd) {
timePickerIndex[obj.form.time] = ii;
return true;
}
})
console.log('initModify-timePickerIndex', timePickerIndex);
//obj.form.pnum_str=res.data.pnum_str;
obj.form.pnum = res.data.pnum || 6;
obj.form.rname = res.data.rname;
obj.form.phone = res.data.phone || "";
obj.form.sex = res.data.sex;
obj.form.cusdem = res.data.cusdem;
obj.form.rid = id;
obj.form.tid = [];
let tablesed = [];
res.data.tables.forEach((t, ti) => {
obj.form.tid.push(t.id)
if (ti >= 3) return;
t.isselect = true
t["isselected"] = 1
tablesed.push(t);
this.checkedTables[t.id]=t.name;
})
this.setData({
timePickerIndex: timePickerIndex,
form: obj.form,
//tablesed:tablesed,
hasUseDefDtime: false,
})
setTimeout(() => {
this.getTables();
}, 300)
} catch (e) {
console.log('initModify', e)
}
},
pnumInputFocusEvent(e){
console.log(e);
this.setData({
pnumInputFocus: 'focus' == e.type
})
},
inputFocusTime: 0,
blurTime: 0,
inputFocus(e){
console.log(e, this.inputFocusTime);
return;
if (e.timeStamp > this.inputFocusTime) {
this.inputFocusTime = e.timeStamp;
if (e.type == 'focus' && this.data.pageMarginBottom == 0) {
this.setData({
pageMarginBottom: 300
})
setTimeout(res => {
this.pageScrollToBottom();
}, 100)
} else {
if (this.blurTime > 5) {
this.blurTime = 0;
this.setData({
pageMarginBottom: 0
})
} else {
setTimeout(res => {
this.blurTime += 1;
this.inputFocus(e);
}, 300)
}
}
}
},
pageScrollToBottom: function () {
wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) {
// 使页面滚动到底部
wx.pageScrollTo({
scrollTop: rect.bottom
})
}).exec()
},
gotoday(e){
this.setData({
[`calendar.nextNum`]: 0
})
},
nextMonth(e){
this.setData({
[`calendar.nextNum`]: this.data.calendar.nextNum + 1
})
},
prevMonth(e){
this.setData({
[`calendar.nextNum`]: this.data.calendar.nextNum - 1
})
},
/**
* 快速预定初始化
* tid
* tname
* ddate
* pnum
*/
async initQuick(options){
try {
console.log('initQuick', options);
this.checkedTables[options.tid]=options.tname
options.ddate=options.ddate.substr(0,10);
//设置日期
let obj = await this.setDateStr(options.ddate);
//设置时间
let nd = util.unixtoTime(options.ddate, 'HH:II');
let timePickerIndex = this.data.timePickerIndex
console.log('initQuick-', this.data.timePickerArray, obj.form.time, nd)
this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {
console.log('initQuick-', nd, dd)
if (nd == dd) {
timePickerIndex[obj.form.time] = ii;
return true;
}
})
console.log('initQuick-timePickerIndex', timePickerIndex);
obj.form.pnum = options.pnum || 6;
obj.form.rname = "";
obj.form.phone = "";
obj.form.sex = 1;
obj.form.cusdem = "";
obj.form.rid = "";
obj.form.tid = [options.tid];
this.setData({
timePickerIndex: timePickerIndex,
form: obj.form,
hasUseDefDtime: false,
})
setTimeout(() => {
this.getTables();
}, 300)
} catch (e) {
console.log('initQuick', e)
}
},
getCustomRemark(){
App.User.GetCustomRemark({
uid:util.cache('enter_params')['manager_id'],
}).then(res=>{
let CustomRemark=[];
res.data.forEach(r=>{
if(r.often_use){
CustomRemark.push(r);
}
})
this.setData({
CustomRemark:CustomRemark,
})
})
},
oftenUse(e){
let id=util.attr(e,'id');
let val=util.attr(e,'value');
let CustomRemark=this.data.CustomRemark;
let form=this.data.form;
CustomRemark.forEach(r=>{
if(id==r.id){
if(r.active){
form.cusdem=form.cusdem.replace(val+'、','')
}
r.active=!r.active
if(r.active){
form.cusdem+=val+'、'
}
}
})
this.setData({
CustomRemark:CustomRemark,
form:form,
})
this.conditionInfo()
},
CustomRemarkMore(){
this.setData({
CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask
})
}
})
\ No newline at end of file
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nothingBook":"/components/book/nothing/nothing",
"bookList":"/components/book/list/list",
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"searchList":"/components/searchlist/searchlist",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"formids":"/components/formids/formids",
"a2l":"/components/tips/add-to-lite"
}
}
\ No newline at end of file
<!--pages/book/b_addnew.wxml-->
<nav>录入订座信息</nav>
<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page">
<view class="base-info">
<!--
<view class="section flex-lr date">
<view class="flex-rr" style="width:100%;">
<item class="date-item {{form.date==0?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="0">
<view class="date-item-text">{{dateStr[0]}}</view>
</item>
<item class="date-item {{form.date==1?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="1">
<view class="date-item-text">{{dateStr[1]}}</view>
</item>
</view>
<view class="more flex-ll" bindtap="calendarShow">
<view></view>
<view></view>
<view></view>
</view>
</view>
-->
<view class="section">
<view class="tab flex-ll">
<formids class="item {{form.date==0?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="0">
{{dateStr[0]}}
</formids>
<formids class="item {{form.date==1?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="1">
{{dateStr[1]}}
</formids>
<view class="item {{form.date==2?'checked':''}} flex-lr"
bindtap="selectedValue" data-key="date" data-value="2" bindtap="calendarShow">
<view style="width: 80%" class="item-text">{{dateStr[2]||'其他'}}</view>
<image
src="http://qn.colorcun.com/custom/lite-yd/image/date{{dateStr[2]?'.selected':''}}.png"
style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image>
</view>
</view>
</view>
<view class="section ">
<view class="tab flex-ll">
<formids class="item {{form.time==0?'checked':''}} {{timeOpt[0]}}"
wx:if="{{timePickerArray[0].length>0}}"
bindtap="selectedValue" data-key="time" data-value="0">
<view class="picker">早市</view>
</formids>
<formids class="item {{form.time==1?'checked':''}} {{timeOpt[1]}}"
wx:if="{{timePickerArray[1].length>0}}"
bindtap="selectedValue" data-key="time" data-value="1">
<view class="picker">午市</view>
</formids>
<formids class="item {{form.time==2?'checked':''}} {{timeOpt[2]}}"
wx:if="{{timePickerArray[2].length>0}}"
bindtap="selectedValue" data-key="time" data-value="2">
<view class="picker">晚市</view>
</formids>
</view>
</view>
<view class="section" style="height: 90rpx;">
<view class="tab flex-lr">
<view class="tab flex-ll">
<formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key"
bindtap="selectedValue" data-key="pnum" data-value="{{item}}">
<view class="pnum">{{item}}</view>
</formids>
</view>
<view class="tab" style="margin-left: 20rpx;">
<view class="item {{form.pnum<6 || form.pnum>10?'checked':''}} flex-lr"
data-key="pnum" data-value="{{form.pnum}}">
<view style="width: 80%" class="pnum">
<input
bindinput="selectedValue" bindconfirm="selectedValue"
bindblur="pnumInputFocusEvent"
data-key="pnum" value="{{(form.pnum<6 || form.pnum>10) || pnumInputFocus?form.pnum:''}}"
placeholder-class="placeholder-class-pnum"
maxlength="3" type="number"
placeholder="{{form.pnum<6 || form.pnum>10?form.pnum:''}} 更多"/>
</view>
<image
src="http://qn.colorcun.com/custom/lite-yd/image/pnum{{form.pnum<6 || form.pnum>10?'.selected':''}}.png"
style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image>
</view>
</view>
</view>
</view>
<!--
<view class="section ">
<view class="tab flex-ll">
<view class="item {{form.pnum_str=='1-4'?'checked':''}}"
bindtap="selectedValue" data-key="pnum_str" data-value="1-4">
4人以下
</view>
<view class="item {{form.pnum_str=='5-9'?'checked':''}}"
bindtap="selectedValue" data-key="pnum_str" data-value="5-9">
5~9人
</view>
<view class="item {{form.pnum_str=='10-99'?'checked':''}}"
bindtap="selectedValue" data-key="pnum_str" data-value="10-99">
10人以上
</view>
</view>
</view>
<view class="section ">
<view class="tab flex-ll">
<view class="item {{form.tabid=='2'?'checked':''}}"
bindtap="selectedValue" data-key="tabid" data-value="2">
包间
</view>
<view class="item {{form.tabid=='1'?'checked':''}}"
bindtap="selectedValue" data-key="tabid" data-value="1">
散座
</view>
</view>
</view>
-->
</view>
<view class="page-full tables">
<view class="page" style="margin-top: 0">
<view class="title flex-lr">
<view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view>
<view class="flex-rr advice-more" bindtap="selectdesk" wx:if="{{tablesLength>1}}">
<view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>
</view>
</view>
<view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}">
<block wx:for="{{tablesed||tables}}" wx:key="tables.key">
<board width="160" height="180" board="{{item}}"
style="margin: 20rpx 0 0 20rpx"
event="boardChoose" className="noBottom"
data-value="{{index}}"
bindtap="selectedValue"
data-key="tid"></board>
</block>
</view>
<view class="advice-desk-detail flex-cc" wx:else="">
没有符合条件的桌位!
</view>
</view>
</view>
<view class="book-info">
<view class="book-info-single flex-lr" style="align-items:flex-start;position:relative;z-index:10;">
<input placeholder="客户电话" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11"
bindinput="selectedValue"
bindconfirm="selectedValue"
data-key="phone"
value="{{form.phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;" cursor-spacing="260"/>
<view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095">
<view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:if="{{hasUseDefDtime && form.time>0}}">{{defDtime[form.time]}}</view>
<view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:else="">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view>
</view>
<block wx:if="{{searchlist}}">
<searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList>
</block>
</view>
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="客户姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r"
maxlength="12" style="width:450rpx;" value="{{form.rname}}"
bindinput="selectedValue"
bindconfirm="selectedValue"
bindfocus="inputFocus"
bindblur="inputFocus"
data-key="rname"/>
<view class="book-info-grand flex-rr font28r gray-deep-font">
<block wx:for="{{grand}}" wx:key="grand.key">
<view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}"
bindtap="selectedValue"
data-value="{{item.sex}}"
data-key="sex">{{item.grand_title}}</view>
</block>
</view>
</view>
<view class="book-info-single flex-lr">
<input placeholder="客户要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"
bindinput="selectedValue"
bindconfirm="selectedValue"
bindfocus="inputFocus"
bindblur="inputFocus"
data-key="cusdem"/>
<view class="CustomRemarkMore flex-rr">
<view bindtap="CustomRemarkMore">快速备注</view>
</view>
</view>
<view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;">
<view class="flex-lr CustomRemark">
<view class="CustomRemarks">
<view class="CustomRemarksView">
<view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
bindtap="oftenUse"
data-id="{{item.id}}"
data-value="{{item.often_use}}">{{item.often_use}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="page-full submit">
<view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">完成预订</view>
</view>
</view>
<tabBar></tabBar>
<view class="calendar-mask" bindtap="calendarClose"
style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">
<view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">
<calendar catchtap="catchtap"
isTodaybtn="{{true}}" todaybtn_txt="回到今天"
custom="{{false}}"
switchover="{{['上一月','下个月']}}"
active-coloro="active-coloro"
active-colort="active-colort"
speciallist="{{speciallist}}"
txt_style="txt-style"
calendar-style="calendar"
header-style="calendar-header"
weektitle-style="weektitle-style"
restcolor-style="restcolor-style"
txt_type="cn-d"
datefont-style="datefont-style"
todaybtn-style="todaybtn-style"
bindnextMonth="nextMonth"
bindprevMonth="prevMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
prev="{{true||calendar.nextNum>0}}"
circle_show="{{false}}"
closelaststyle="{{true}}"
></calendar>
</view>
</view>
<view class="calendar-mask" bindtap="calendarClose"
style="height:100%;" wx:if="{{timePickerMask}}">
<view class="timePicker">
<view class="flex-rr">
<image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="calendarClose"></image>
</view>
<view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">
<view bindtap="calendarClose">{{form.time==1?'午市':form.time==2?'晚市':'早市'}}</view>
</view>
<view class="flex-ll" style="flex-wrap:wrap">
<view class="time-item {{timePickerIndex[form.time]==index?'checked':''}}"
style="{{(index+1)%3==0?'margin-right:0;':''}}"
wx:for="{{timePickerArray[form.time]}}" wx:key=""
bindtap="bindTimePickerChange"
data-time-index="{{form.time}}"
data-val="{{index}}"
>{{item}}</view>
</view>
</view>
</view>
<view class="calendar-mask" bindtap="CustomRemarkMore"
style="height:100%;" wx:if="{{CustomRemarkMoreMask}}">
<view class="timePicker" catchtap="catchtap">
<view class="flex-rr">
<image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image>
</view>
<view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">
<view bindtap="calendarClose">更多标签</view>
</view>
<view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;">
<view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
wx:if="{{item.often_use}}" bindtap="oftenUse"
data-id="{{item.id}}"
data-value="{{item.often_use}}">{{item.often_use}}</view>
</view>
</view>
</view>
<a2l bgColor="#199095"></a2l>
\ No newline at end of file
/* pages/book/b_addnew.wxss */
.page{
width: 90%;
margin: 20rpx 4% 0;
}
.base-info{
}
.section{
height: 110rpx;
}
.section .label{
width: 60rpx;
font-size: 30rpx;
margin-right: 38rpx;
}
.date{
color:#199095;
width: 100%;
font-size: 38rpx;
font-weight: bold;
}
.date-item{
width: 50%;
}
.date-item-text{
height: 60rpx;
line-height: 60rpx;
border-bottom: 4rpx solid rgba(0,0,0,0);
width: 200rpx;
text-align: center;
color: #666666;
}
.checked .date-item-text{
border-bottom: 4rpx solid #199095;
color: #199095;
}
.date .more{
width: 65rpx;
min-width: 65rpx;
height: 60rpx;
}
.date .more view{
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-right: 12rpx;
background-color: #999;
}
.section .tab{
font-size: 34rpx;
color: #199095;
}
.section .tab .item{
height: 50rpx;
line-height: 49rpx;
width: 210rpx !important;
min-width: 210rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 20rpx;
text-align: center;
}
.section .tab .item .item-text,.section .tab .item .picker{
height: 46rpx;
line-height: 46rpx;
}
.section .tab .item .picker{
width:210rpx;
text-align: center;
}
.section .tab .item-pnum{
height: 50rpx;
line-height: 50rpx;
width: 60rpx !important;
min-width: 60rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 32rpx;
text-align: center;
}
.section .tab .item-pnum .pnum,.section .tab .item .pnum input{
height: 46rpx;
line-height: 46rpx;
font-size: 34rpx;
}
.section .tab .item:last-child{
margin-right: 0;
}
.section .tab .item-pnum:last-child{
margin-right: 0;
}
.section .tab .checked{
background-color:#199095;
color: #FEFEFE;
border: 2rpx solid #199095;
}
.section .tab .disabled{
background-color:#999999;
color: #efefef;
border: 2rpx solid #999999;
}
/**
可定桌位
*/
.page-full{
width: 112%;
margin-left: -6%;
background-color: #F5F5F5;
}
.tables{
height: 314rpx;
font-size: 30rpx;
}
.tables .title{
padding-top: 36rpx;
height: 42rpx;
line-height: 42rpx;
}
.advice-desk-detail{
height: 220rpx;
width:100%;
}
.order-desk-info{
width:160rpx;
min-width: 160rpx;
height:160rpx;
background:#A9E3E6;
border:1px solid #A9E3E6;
border-radius:10rpx;
position:relative;
overflow:hidden;
margin-left:22rpx;
}
.desk-checked{
border:1px solid #199095;
}
.advice-desk-detail .order-desk-info:first-child{
margin-left:0;
}
.desk-active{
position: absolute;
top: -2rpx;
right: -2rpx;
}
.order-desk-type{
height:30rpx;
line-height: 30rpx;
background:#61A5D1;
position:absolute;
left:0;
top:0;
font-size: 26rpx;
padding: 0 12rpx 4rpx 8rpx;
border-radius: 0 16rpx 16rpx 0;
}
.advice-more{
padding:20rpx 0;
padding-left:30rpx;
}
.cut{
width:100%;
height:4px;
background:#efeef3;
}
/**
预定人信息
*/
.book-info{
width:100%;
padding-top:20rpx;
margin:0 auto;
padding-bottom: 300rpx;
}
.book-info-single{
width:100%;
height:120rpx;
padding-top:40rpx;
border-bottom:1px solid #efeef3;
}
.book-info-single>input{
width:100%;
height:100rpx;
}
.book-info-grand{
height:50rpx;
border:1px solid #199095;
margin-top:20rpx;
}
.book-grand{
width:90rpx;
height:100%;
box-sizing:border-box;
}
.book-grand-active{
background:rgba(25,153,149,.8);
}
.book-grand-border{
border-right:1px solid #199095;
}
.book-grand-border:last-child{
border-width: 0;
}
.phone-reminder{
width:32rpx;
height:32rpx;
margin-left:20rpx;
}
/**
提交按钮
*/
.submit{
position: fixed;
bottom: 120rpx;
left: 0;
right: 0;
height: 150rpx;
background-color: #fefefe;
z-index: 9;
}
.confirm-button{
width:680rpx;
height:85rpx;
background:#199095;
margin:42rpx auto 0;
border-radius:10rpx;
opacity:.6;
}
.confirm-button-active{
opacity:1;
}
@import "common/calendar.wxss";
.placeholder-class-pnum{
color:#199095;
font-size: 34rpx;
}
.timePicker{
width: 80%;
overflow: hidden;
position: absolute;
bottom: 0;
border-top: 2rpx solid #ccc;
background-color: #FEFEFE;
padding: 20rpx 10% 80rpx;
}
.timePicker .time-item{
width: 150rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 40rpx;
font-weight: bold;
color:#199095;
border: 2rpx solid #199095;
border-radius: 10rpx;
text-align: center;
margin-right: 66rpx;
margin-bottom: 60rpx;
}
.timePicker .time-item.checked{
background-color: #199095;
color:#fefefe;
}
.timePicker .close{
width: 50rpx;
height: 50rpx;
transform:rotate(45deg);
margin-top: -10rpx;
margin-right: -10%;
}
.CustomRemark{
line-height: 60rpx;
overflow: hidden;
}
.CustomRemarks{
width: 100%;
}
.CustomRemarksView{
height: 60rpx;
overflow: hidden;
}
.CustomRemarkMore{
width: 200rpx;
min-width: 200rpx;
color:#199095;
font-size: 30rpx;
}
.CustomRemarkItem{
height: 48rpx;
line-height: 48rpx;
padding: 4rpx 14rpx;
background-color: #F5F5F5;
font-size: 30rpx;
color: #999999;
border-radius: 10rpx;
margin-right: 20rpx;
float: left;
margin-bottom: 40rpx;
}
.CustomRemarkItem:last-child{
margin-right: 0;
}
.CustomRemarkMore .CustomRemarkItem{
padding: 4rpx 24rpx;
}
.book-info-single.last{
border-width: 0;
}
.CustomRemarkItem.active{
background-color: #6AB6B9;
color: #FFFFFF;
}
\ No newline at end of file
import util from '../../utils/util';
import comm from '../../utils/bookCommon';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
data:{
menu_active_id:''
},
checked_tids:[],
desks:[],
onLoad:function(opt){
console.log('onLoad',opt)
util.setBarTitle('选择桌位');
var radio=750/util.getsystem().windowWidth;
var contentHeight=util.getsystem().windowHeight-Math.ceil(350/radio);
if(opt.tid==0){
delete opt.tid
}
if(opt.checked_tids){
this.checked_tids=opt.checked_tids.split(',')
util.cache('tableid',this.checked_tids)
}
this.setData({
sellerid:util.cache('sellerid'),
opt:opt,
hasCheckedTable:this.checked_tids.length>0
})
this.getdesklist();
},
onShow:function(){
this.setData({
height:getApp().system.windowHeight-55
})
},
changedesk:function(e){
let tableid=util.cache('tableid');
this.checked_tids= tableid && tableid.length>0?tableid:[];
this.setData({
hasCheckedTable:this.checked_tids.length>0
})
},
back:function(){
this.setData({
buttonClick:true
})
//wx.removeStorage({key:'tableid'})
wx.navigateBack();
},
getdesklist:function(){
var formdata=this.data.opt;
formdata.sid=this.data.sellerid;
var that=this;
App.Reserve.GetTableList(formdata).then(function (json) {
if(json.ret==200){
console.log('this.checked_tids',that.checked_tids);
that.desks=json.data
that.formatDesklist(true)
}
})
},
formatDesklist(hasFirst=true){
let desks=this.desks;
if(desks.length>0){
desks.forEach((v,i)=>{
v.list.forEach((r,n)=>{
r.isselect=false
if(this.checked_tids._indexOf(r.id)>-1){
r.isselect=true;
}
})
})
let param={
desklist:desks,
}
if(hasFirst){
param.menu_active_id=desks[0].name
}
this.setData(param)
}
return desks;
},
switchMenu(e){
this.formatDesklist(false)
this.setData({
menu_active_id:util.attr(e,'id')
})
},
})
\ No newline at end of file
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"selectPeople":"/components/book/people/people",
"orderDesk":"/components/book/desk/desk",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
<nav>选择桌位</nav>
<!--桌位状态-->
<view class="flex-lr" style="border-top:1rpx solid #E0E0E0">
<view class="menus" style="height: {{height}}px; overflow-y: auto;overflow-x: hidden;align-self:flex-start ">
<view class="menus-item flex-cc {{item.name==menu_active_id?'active':''}}"
wx:for="{{desklist}}" wx:key="desklist.key"
bindtap="switchMenu" data-id="{{item.name}}">
<view class="name">{{item.name}}</view>
<view class="hip" wx:if="{{item.chenkNum>0}}">{{item.chenkNum}}</view>
</view>
</view>
<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}}" bind:changedesk="changedesk" wx:if="{{item.name==menu_active_id}}"></orderDesk>
</block>
</view>
</view>
<view class="confirm-button white-font flex-vc font34r {{hasCheckedTable ? 'confirm-button-active' : ''}}" bindtap="back">确定</view>
view{
line-height:1.2;
}
.other-info{
width:100%;
height:220rpx;
padding:20rpx 0;
box-sizing:border-box;
}
.selected-time{
width:375rpx;
height:100%;
border-right:1px solid #efeef3;
box-sizing:border-box;
}
.actual-time{
margin-top:10rpx;
}
.cut{
width:100%;
height:4px;
background:#efeef3;
}
.desk-type{
width:680rpx;
padding:40rpx 0 20rpx;
margin:0 auto;
}
.desk-type-single{
width:160rpx;
height:60rpx;
border:1px solid #199095;
border-radius:30rpx;
background:#EBF8F8;
}
.desk-type-single-active{
background:#199095;
}
.desk-list{
width:100%;
}
.desk-region{
width:680rpx;
padding-top:40rpx;
margin:0 auto;
}
.confirm-button{
width:460rpx;
height:85rpx;
background:#74BBBE;
position:fixed;
left:250rpx;
bottom:40rpx;
margin:0 auto;
border-radius:10rpx;
}
.confirm-button-active{
background:#199095;
}
.menus{
width: 168rpx;
min-width: 168rpx;
background-color: #F5F5F5;
}
.menus-item{
width: 168rpx;
height: 158rpx;
line-height: 158rpx;
font-size: 34rpx;
border: 1rpx solid #E0E0E0;
border-top-width: 0;
border-left-width: 0;
position: relative;
}
.menus-item.active{
background-color: #FEFEFE;
}
.menus-item .name{
width: 140rpx;
max-height: 96rpx;
line-height: 48rpx;
overflow: hidden;
text-align: center;
}
.menus-item .hip{
background-color: #f00;
width: 40rpx;
height: 40rpx;
position: absolute;
border-radius: 50%;
color: #fefefe;
text-align: center;
line-height: 40rpx;
font-size: 22rpx;
top:10rpx;
right: 10rpx;
}
\ No newline at end of file
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
import App from '../../utils/api';
const {regeneratorRuntime} = global
import TP from '../../utils/tpls';
Page({
data:{
actionSheetHidden:true,
actionSheetItems:['客户取消','客户行程改变']
},
sc:{},
tpls:TP.tpls(),
enter_params:{},
onLoad:async function (opt) {
util.setBarTitle('预定详情');
console.log(opt)
this.getDetail(opt.id);
wx.showShareMenu({
withShareTicket: true,
success:function(res){
console.log(res)
}
})
this.enter_params=util.cache('enter_params');
this.sc=(await App.Reserve.SellerInfo(this.enter_params)).data;
console.log('this.sc',this.sc);
this.chooseManagerInit();
},
onShow:function(){
this.notice=this.selectComponent('#notice');
},
noticeCall:function(){
this.selectComponent('#notice').show();
},
onShareAppMessage: function () {
this.selectComponent('#notice').close();
var obj=this.data.bookInfo;
let path=util.http_build_query({
id:this.data.bookInfo.id,
fromid:getApp().openid,
hasSellerShare:1,
hasInvitation:1,
tplid:1
},'/pages/customer/index')
return {
//title: (nickname||'')+'给你发送了一个订座信息,点击查看详情',
title: this.tpls[0].shareFirstTitle,
path: path,
imageUrl:this.tpls[0].shareFirstImage,
success: function (res) {
console.log(res,666666)
},
fail:function(){
console.log('ccccc')
},
complete:function(){
console.log('ccccc')
}
};
},
getcall:function(){
if(!this.detailData.hasOwner){
return util.toast('只有记录人可以拨打','none');
}
if(this.data.bookInfo.phone.length<3){
return util.toast('号码错误','none');
}
wx.makePhoneCall({
phoneNumber: this.data.bookInfo.phone, //仅为示例,并非真实的电话号码
complete:()=>{
this.selectComponent('#notice').close();
}
})
},
chooseManagerInit(){
try{
let managers=this.sc.manager;
let mans=[];
let mans_role=[];
// let space='';
// for(let i=0;i<50;i++){
// space+=' ';
// }
if(managers.length>0){
managers.forEach(man=>{
let nickname=man.nick_name||man.user_name;
mans.push(nickname);
//mans_role.push('     ['+man.role_name+'] -- '+man.user_name+space);
mans_role.push('['+man.role_name+'] -- '+nickname);
})
}
this.setData({mans:mans,mans_role:mans_role})
}catch(e){
wx.showToast({
title:'无客户经理',
icon:'none'
});
}
},
chooseManager(e){
let mansIndex=util.val(e);
this.setData({mansIndex:mansIndex});
try{
let managers=this.sc.manager;
let man=managers[mansIndex];
if(man){
App.Reserve.SetReserveCusman({
rid:this.data.bookInfo.id,
cusman_id:man.id,
cusman:man.nick_name||man.user_name,
cusman_phone:man.user_phone?man.user_phone:'',
cusman_account:man.user_wechat?man.user_wechat:'',
cusman_openid:man.seat_openid?man.seat_openid:''
}).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
});
}
}catch(e){
console.log(e);
}
},
flushSellerInfo(){
App.Reserve.SellerInfo(util.cache('enter_params'),true);
},
detailData:null,
async getDetail(id,force=false){
let res=await App.Reserve.Detail({rid:id,openid:''},force);
res.data.rdateStr=util.unixtoTime(res.data.ddate,"MM月DD日 HH:II")
res.data.phoneStr=res.data.phone||'';
let enter_params=util.cache('enter_params');
let sc=(await App.Reserve.SellerInfo(enter_params)).data
let note_openid=enter_params.seller_openid;
res.data.hasOwner=false;
if(note_openid==res.data.note_openid || sc.seller_user.role_name=='管理员'){
res.data.hasOwner=true;
}
if(!res.data.hasOwner){
res.data.phoneStr=res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){
return $1+'**'+$3;
})
}
if(res.data.status==4 && res.data.cancel){
res.data.cancel.cdateStr=util.unixtoTime(res.data.cancel.cdate,"YYYY.MM.DD HH:II")
}
this.detailData=res.data;
this.setData({
tables:res.data.tables,
bookInfo:res.data,
})
},
gotoModify(){
wx.redirectTo({
url:'./b_addnew?id='+this.data.bookInfo.id
})
},
cancelReserve(){
this.selectComponent('#cancel').show();
},
reserveCancel(e){
console.log('reserveCancel',e.detail);
this.getDetail(this.data.bookInfo.id,true);
},
actionSheetChange(e){
this.setData({
actionSheetHidden:true
})
},
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);
});
},
showOrder(){
wx.navigateTo({
url:util.http_build_query({rid:this.data.bookInfo.id,oid:this.data.bookInfo.orderid,identity:2},'/pack-cookbook/pages/success')
});
},
})
\ No newline at end of file
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"noticeCall":"/components/book/notice/notice",
"step":"/components/book/step/step",
"board":"/components/book/board/board",
"cancel":"/components/book/reserveCancel/cancel",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
<nav hasHome>订座详情</nav>
<!--订单信息-->
<view class="order-info">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">到店时间</view>
<view class="black-font font34r">{{bookInfo.rdateStr}}</view>
</view>
<view class="flex-lr order-detail">
<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>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">预订座位</view>
<view class="black-font font34r">{{tables.length}}个</view>
</view>
<view class="flex-lr order-desk">
<view class="gray-deep-font font30r"></view>
<view class="flex-re" style="width:100%;flex-wrap:wrap;">
<block wx:for="{{tables}}" wx:key="tables.key">
<board width="160" height="180" board="{{item}}" className="noBottom"
style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board>
</block>
</view>
</view>
<view class="flex-lr order-detail">
<text class="gray-deep-font font30r" space="true" decode="true">客户姓名</text>
<view class="black-font font34r">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">客户电话</view>
<view class="black-font font34r" bindtap="getcall">{{bookInfo.phoneStr||''}}</view>
</view>
<block wx:if="{{bookInfo.cusdem!='' && bookInfo.cusdem!='null'}}">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">备注信息</view>
<view class="black-font font34r">{{bookInfo.cusdem}}</view>
</view>
</block>
</view>
<view class="order-info">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">客户经理</view>
<view class="flex-lr black-font font34r" style=" border-bottom: 2rpx solid #999;">
<picker bindchange="chooseManager" catchtap="flushSellerInfo" value="{{mansIndex}}" range="{{mans_role}}">
<view class="picker">
{{mans[mansIndex]?mans[mansIndex]:bookInfo.cusman?bookInfo.cusman:'请选择'}}
</view>
</picker>
</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">记录人</view>
<view class="black-font font34r">{{bookInfo.note_name}}</view>
</view>
</view>
<view class="order-info" wx:if="{{bookInfo.status==4 && bookInfo.cancel}}">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">取消原因</view>
<view class="flex-lr black-font font34r">
{{bookInfo.cancel.desc}}
</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">取消时间</view>
<view class="black-font font34r">{{bookInfo.cancel.cdateStr}}</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">操作人</view>
<view class="black-font font34r">{{bookInfo.cancel.uname}}</view>
</view>
</view>
<view style="height: 250rpx;"></view>
<!--通知预订人-->
<view class="notice-opt" wx:if="{{bookInfo.status==1}}">
<view class="notice-button-border font34r flex-lr">
<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>
<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}}">
<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">
<block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">
<action-sheet-item>{{item}}</action-sheet-item>
</block>
<action-sheet-item>
<input placeholder="请输入" style="width:100%"/>
</action-sheet-item>
<action-sheet-cancel >取消</action-sheet-cancel>
</action-sheet>
<cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel>
\ No newline at end of file
view{
line-height:1.2;
}
/*商家信息*/
.seller-info{
width:680rpx;
height:auto;
padding:40rpx 0;
margin:0 auto;
border-bottom:1px solid #efeef3;
}
.seller-image{
width:60rpx;
height:60rpx;
border-radius:50%;
margin-right:20rpx;
}
.seller-address{
margin-top:10rpx;
}
.seller-location{
width:32rpx;
height:34rpx;
}
/*订单信息*/
.order-info{
width:680rpx;
height:auto;
padding:0 20rpx;
margin:0 auto;
border-bottom:1px solid #efeef3;
box-sizing:border-box;
}
.order-detail{
width:100%;
padding:40rpx 0;
}
.order-desk{
width:100%;
height:auto;
position:relative;
}
.order-status{
width:172rpx;
height:100rpx;
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
z-index:2;
}
.order-desk-info{
width:120rpx;
height:120rpx;
background:#A9E3E6;
border:1px solid #199095;
border-radius:10rpx;
position:relative;
overflow:hidden;
margin-left:20rpx;
margin-top:20rpx;
}
.order-desk-detail{
width:100%;
height:90rpx;
}
.order-desk-type{
width:100%;
height:30rpx;
background:#199095;
position:absolute;
left:0;
bottom:0;
}
.seller-staff{
width:680rpx;
padding:40rpx 20rpx;
box-sizing:border-box;
margin:0 auto;
}
.notice-opt{
position:fixed;
left:0;
right:0;
bottom: 0;
padding-bottom: 50rpx;
background-color: #fefefe;
}
.notice-button{
height:85rpx;
width:90%;
background:#199095;
border-radius:0;
margin:20rpx auto 0;
}
.notice-button-border{
height:85rpx;
width:90%;
border:solid 2rpx #199095;
border-radius:0;
margin:20rpx auto 0;
color: #199095;
}
.notice-button-border view{
width: 100%;
border-right: 2rpx solid #199095;
text-align: center;
height: 50rpx;
line-height: 50rpx;
}
.notice-button-border view:last-child{
border-right-width: 0;
}
.reserve-status-tip{
position: absolute;
top:300rpx;
right:200rpx;
width: 82rpx;
height: 52rpx;
}
.reserve-status-tip image{
width: 100%;
height: 100%;
}
\ No newline at end of file
var mta=require('mta-wechat-analysis')
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
var bookOrder=require('../../utils/bookCommon.js')
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
data:{
isloading:false,
pagex:1,
pagey:10,
sort:null,
dateStr:'',
calendarMaskLoad:false,
calendarMask:false,
dayStyle:[
{ month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' },
{ month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }
],
keywords:'',
sort:'',
form:{
time:-1,
},
timePickerArray:[
[],
[],
[],
],
speciallist:[],
ReservesCountMonth:[],
ReservesTotal:0,
timeStrLabel:bookOrder.timeStrLabel
},
sellerid:0,
indexOpt:null,
YYYY:'YYYY',
onLoad:async function(opt){
this.indexOpt=opt;
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":opt, //渠道分析
});
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
var radio=750/util.getsystem().windowWidth;
var contentHeight=util.getsystem().windowHeight-Math.ceil(120/radio)
if(opt.seller_id){
this.sellerid=opt.seller_id;
util.cache('sellerid',opt.seller_id)
util.cache('enter_params',opt)
App.Reserve.SellerInfo(opt)
}else{
this.sellerid=util.cache('sellerid');
}
//this.sellerid=opt.seller_id ? opt.seller_id : util.cache('sellerid');
let timePickerArray= await bookOrder.getDayTimeSpace();
let speciallist=[
{ date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
];
this.setData({
sellerid:this.sellerid,
listHeight:contentHeight-Math.ceil(210/radio),
dateStr:dateStr,
timePickerArray: timePickerArray,
speciallist:speciallist,
})
//util.setBarTitle('预定本');
this.indexOpt=opt;
this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD'));
this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM'));
},
onShow:function(){
this.setData({
isloading:false,
})
this.getbooklist();
this.selectComponent('#nav').init();
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
})
let openid=getApp().openid;
if(openid && this.indexOpt.seller_id){
App.Reserve.SellerForOpenid({openid:openid,sedata:JSON.stringify(this.indexOpt)})
//客户经理=>人人都是客户经理
//if(this.indexOpt.manager_id){
App.Reserve.UpdateSellerUser({seat_openid:openid,kid:this.indexOpt.manager_id});
//}
}else{
console.log('index-opt',openid,this.indexOpt);
}
},1000);
},
async getbooklist(isExport=false){
let time=0;
if(this.data.form.time<0){
let sid=await bookOrder.getTimeSpaceIndexData();
time=sid.timeIndex
}else{
time=this.data.form.time;
}
var formdata={};
if(this.data.sort!=''){
formdata.sort=this.data.sort
}
if(this.data.keywords!=''){
formdata.keywords=this.data.keywords
}
formdata.sid=this.sellerid;
formdata.x=1;
formdata.y=200;
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);
formdata.rdate=rdate;
if(isExport){
this.__exportFile(formdata);
}else{
var that=this;
App.Reserve.GetReserveList(formdata).then(function(json){
console.log(json)
if(json.ret==200){
that.setData({
isloading:true,
bookList:json.data.length==0 ? null : json.data,
form:{time:time},
})
that.boolists=that.selectAllComponents('.orderbook');
that.boolists.forEach(function(v,i){
v.changeitem();
})
}
}).catch(e=>{})
}
},
timeorder:function(){
if(this.data.sort==''){
this.data.sort=1;
}else{
this.data.sort='';
}
this.setData({
sort:this.data.sort
})
this.getbooklist();
},
searchinput:function(e){
this.data.keywords=e.detail.value;
this.setData({
keywords:this.data.keywords
})
if(e.detail.value==''){
this.getbooklist();
}
},
calendarShow(){
console.log('xxxxx')
this.setData({
calendarMask:true
})
console.log(this.data.calendarMask)
},
dateChange(event){
this.YYYY=event.detail.date.substr(0,4);
let cktime=util.timetouUnix(event.detail.date)
console.log('cktime',cktime,this.YYYY)
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.ReservesCountDay(event.detail.date);
},
calendarClose(){
this.setData({
calendarMask:false
})
},
selectedValue:function (e) {
this.setData({
form:{time:e.currentTarget.dataset.value}
})
this.getbooklist();
},
searchbook:function(e){
console.log(this.data.form)
this.getbooklist();
},
__exportFile(formdata){
App.Reserve.ExportReserve(formdata).then(res=>{
let url=res.data;
if(!url){
return util.toast('没有预订数据','none')
}
wx.downloadFile({
url: url,
success: function(res) {
const filePath = res.tempFilePath;
console.log('filePath',filePath);
wx.previewImage({
current: filePath,
urls: [filePath]
})
wx.saveImageToPhotosAlbum({
filePath:filePath,
fail (res) {
util.toast('保存失败','none')
}
})
}
})
});
},
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
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nothingBook":"/components/book/nothing/nothing",
"bookList":"/components/book/list/list",
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"calendar": "plugin://bmCalendar/calendar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
<nav id="nav">订座</nav>
<view class="page">
<block wx:if="{{isloading==true}}">
<view class="book-page bg_white">
<view class="book-search flex-lr">
<view class="flex-ll book-search-left">
<image src="http://qn.colorcun.com/custom/lite-yd/image/search.png" class="search-icon"></image>
<input placeholder="桌位/客户姓名/手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/>
</view>
<view bindtap="exportFile" class="exportFile flex-vc">
<image src="http://qn.colorcun.com/custom/lite-yd/image/export.png" class="search-icon"></image>
<view>导出</view>
</view>
</view>
<view class="search-easy flex-lr">
<formids class="block flex-vc" bindtap="calendarShow">
<view class="flex-vc" >
<view class="green-font font34r font-bold flex-cc">{{dateStr}}</view>
</view>
</formids>
<view class="block section flex-vc">
<view class="tab flex-cc">
<formids class="item flex-vc {{form.time==0?'checked':''}}"
wx:if="{{timePickerArray[0].length>0}}"
bindtap="selectedValue" data-key="time" data-value="0">早市</formids>
<formids class="item flex-cc {{form.time==1?'checked':''}}"
wx:if="{{timePickerArray[1].length>0}}"
bindtap="selectedValue" data-key="time" data-value="1">午市</formids>
<formids class="item flex-cc {{form.time==2?'checked':''}}"
wx:if="{{timePickerArray[2].length>0}}"
bindtap="selectedValue" data-key="time" data-value="2">晚市</formids>
</view>
</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>
</block>
<block wx:else>
<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" 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>
<view class="book-list" style="padding-bottom:118rpx;">
<view class="book-list-body">
<block wx:for="{{bookList}}" wx:key="bookList.key">
<bookList item="{{item}}" class="orderbook"></bookList>
</block>
</view>
</view>
</view>
</block>
</block>
</view>
<tabBar></tabBar>
<view class="calendar-mask" bindtap="calendarClose"
style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">
<view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">
<calendar catchtap="catchtap"
isTodaybtn="{{true}}" todaybtn_txt="回到今天"
custom="{{false}}"
switchover="{{['上一月','下个月']}}"
active-coloro="active-coloro"
active-colort="active-colort"
speciallist="{{speciallist}}"
txt_style="txt-style"
calendar-style="calendar"
header-style="calendar-header"
weektitle-style="weektitle-style"
restcolor-style="restcolor-style"
txt_type="cn-d"
datefont-style="datefont-style"
todaybtn-style="todaybtn-style"
bindnextMonth="clickMonth"
bindprevMonth="clickMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
colored="#199095"
circle_show="{{true}}"
mystatus="{{ReservesCountMonth}}"
dotcolor-o="dotcolor-o"
dotcolor-t="dotcolor-t"
allshow="{{true}}"
></calendar>
</view>
</view>
\ No newline at end of file
page{
background:#efeef3;
}
.page{
width: 100%;
margin: 0;
overflow: hidden;
}
.book-page{
width:100%;
padding-top:20rpx;
}
.book-search{
width:675rpx;
height:80rpx;
margin:0 auto;
}
.book-search-left{
width:590rpx;
height:80rpx;
border-radius:40rpx;
box-shadow: 0 0 8px #ccc;
margin:0 auto;
margin-bottom:10rpx;
}
.search-icon{
width:40rpx;
height:40rpx;
margin-left:30rpx;
}
.search-input{
width:520rpx;
height:100%;
padding:10rpx;
box-sizing:border-box;
}
.book-list-thead{
width:100%;
height:120rpx;
padding:0 40rpx;
box-sizing:border-box;
font-weight:400;
border-bottom: 2rpx solid #F1F0F4;
}
.book-list-thead>view{
width:25%;
}
.icon22-26{
width:22rpx;
height:26rpx;
margin-left:8rpx;
}
.book-list-body{
width:100%;
height:auto;
box-sizing:border-box;
}
.book-list-cut{
height:66rpx;
background:#F5F5F5;
padding-left:44rpx;
font-size: 26rpx;
line-height: 66rpx;
}
.book-list-cut text{
margin-right: 50rpx;
}
.border-line{
width:670rpx;
height:1px;
background:#efeef3;
margin:0 auto;
}
.search-easy{
height:80rpx;
padding:20rpx 0;
}
.search-easy .block{
width: 50%;
min-width: 50%;
height: 100%;
}
.search-easy .block:first-child{
border-right: 1px solid #E0E0E0;
}
.section .tab{
font-size: 34rpx;
color: #199095;
height: 50rpx;
}
.section .tab .item{
height: 50rpx;
line-height: 49rpx;
width: 94rpx !important;
min-width: 94rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 16rpx;
text-align: center;
display: block;
}
.section .tab .item:after{
padding-right: 5rpx;
}
.section .tab .checked{
background-color:#199095;
color: #FEFEFE;
}
.exportFile{
font-size: 26rpx;
color:#353535;
}
.exportFile image{
width: 32rpx;
height: 32rpx;
margin: 0 auto 8rpx;
}
@import "common/calendar.wxss";
\ No newline at end of file
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
var bookOrder=require('../../utils/bookCommon.js')
const {regeneratorRuntime} = global
Page({
data:{
grand:[
{
sex:1,
grand_title:'先生',
isselect:true
},
{
sex:2,
grand_title:'女士',
isselect:false
}
],
name:'',
sex:1,
phone:'',
remark:'',
buttonhide:true,
pnum:'6'
},
onLoad:function(opt){
wx.removeStorage({
key:'tableid',
})
wx.removeStorage({
key:'tabletype',
})
util.setBarTitle('录入订座信息');
var selectmonth=opt.date.split('-')[0][0]=='0' ? opt.date.split('-')[0][1] : opt.date.split('-')[0];
var selectday=opt.date.split('-')[1][0]=='0' ? opt.date.split('-')[1][1] : opt.date.split('-')[1];
console.log(opt)
var stringTime =opt.year+'-'+opt.date+' ' +opt.time+':00';
console.log(stringTime)
var time=bookOrder.gettimestamp(stringTime);
console.log(time)
this.setData({
thisyear:opt.year,
selectdate:selectmonth+'月'+selectday+'日',
time_dur:opt.time,
sellerid:util.cache('sellerid'),
time:time,
pnum:util.cache('order_pnum') ? util.cache('order_pnum') : this.data.pnum,
})
this.getdesklist();
},
onShow:function(){
var that=this;
if(util.cache('tableid')){
var tables=util.cache('tableid');
var templist=this.data.templist;
var showdesk=[];
for(var i=0;i<tables.length;i++){
templist.forEach(function(r,n){
if(tables[i]==r.id){
r.isselect=true;
if(r.tid==2){
r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name;
showdesk.unshift(r);
}else {
r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name;
showdesk.push(r);
}
}
})
}
this.setData({
showdesk:showdesk.slice(0,2)
})
}
if(util.cache('tableid') && util.cache('tableid').length>0){
if(this.data.name!='' && this.data.phone!='' && !this.data.reminder){
this.setData({
buttonhide:false
})
}
}
util.postSuccessFun=function(json,uri_code){
switch (uri_code) {
case uri.CGI_USER_SETRESERVEINFO__CODE:
wx.hideLoading()
if(json.ret==200){
wx.reLaunch({
url:util.http_build_query(json.data,'b_detail')
})
}
break;
case uri.CGI_USER_GETTABLELIST__CODE:
console.log('xxxx',json.data);
var list=json.data;
var templist=[];
for(var key in list){
if(key!='typex' && key!='typey'){
list[key].list.forEach(function(v,i){
templist.push(v)
})
}
}
var tempsan=[];
var tempbao=[];
var showdesk=[];
var temp={};
templist.forEach(function(v,i){
v.name=v.name.length>4 ? v.name.slice(0,3)+'...' : v.name;
if(!v.r_status){
if(v.tid==2){
tempbao.push(v);
v.isselect=false;
showdesk.unshift(v);
}else{
tempsan.push(v);
v.isselect=false;
showdesk.push(v);
}
}
if(v.tid==2){
if(!temp.hasOwnProperty("tabletype_2")){
temp['tabletype_2']=true
}
}else{
if(!temp.hasOwnProperty("tabletype_1")){
temp['tabletype_1']=true
}
}
})
util.cache('tabletype',temp);
console.log(showdesk)
that.setData({
sancount:list.typex, //typex散座
baocount:list.typey, //typey包间
showdesk:showdesk.slice(0,2),
templist:templist
})
break;
}
}
},
changetime:function(){
wx.navigateBack()
},
selectgrand:function(e){
var sex=e.currentTarget.dataset.sex;
console.log(sex)
var grandlist=this.data.grand;
grandlist.forEach(function(v,i){
v.isselect=false;
if(v.sex==sex){
v.isselect=true;
}
})
this.setData({
grand:grandlist,
sex:sex
})
},
condition:function(e){
var name=this.data.name;
var phone=e.detail.value;
var regExp = /^(86)?((13\d{9})|(15[0,1,2,3,5,6,7,8,9]\d{8})|(18[0,5,6,7,8,9]\d{8}))$/
if(!(regExp.test(phone))){
this.setData({
reminder:'手机格式不正确'
})
}else{
this.setData({
reminder:null
})
}
if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){
this.setData({
buttonhide:false
})
}
},
changename:function(e){
this.setData({
name:e.detail.value
})
},
changephone:function(e){
this.setData({
phone:e.detail.value
})
},
changeremark:function(e){
this.setData({
remark:e.detail.value
})
},
ifAll:function(){
var name=this.data.name;
var phone=this.data.phone;
if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){
this.setData({
buttonhide:false
})
}
},
formsubmit:async function(){
wx.showLoading({
title:'正在预定',
mask:true
});
console.log(this.data.time)
var formData={
sid:this.data.sellerid,
tid:util.cache('tableid').toString(),
rname:this.data.name, //姓名
phone:this.data.phone, //手机号
sex:this.data.sex, //性别
pnum:this.data.pnum, //人数
rdate:this.data.time, //时间
cusdem:this.data.remark //备注
}
try{
let enter_params=util.cache('enter_params');
let manager_id=enter_params.manager_id;
if(manager_id){
let sc=(await App.Reserve.SellerInfo(enter_params)).data
let managers=sc.manager;
managers.forEach(man=>{
if(manager_id==man.id){
formData.cusman_id=man.id;
formData.cusman=man.user_name;
formData.cusman_phone=man.user_phone?man.user_phone:'';
formData.cusman_account=man.user_wechat?man.user_wechat:'';
}
})
}
let man=managers[mansIndex];
if(man){
App.Reserve.SetReserveCusman({
rid:this.data.bookInfo.id,
cusman_id:man.id,
cusman:man.user_name,
cusman_phone:man.user_phone?man.user_phone:'158777556369',
cusman_account:man.user_wechat?man.user_wechat:'',
});
}
}catch (e){}
console.log(formData)
util.post(uri.CGI_USER_SETRESERVEINFO,formData,uri.CGI_USER_SETRESERVEINFO__CODE)
},
changepnum:function(e){
console.log(e)
this.setData({
pnum:e.detail
})
this.getdesklist();
},
selectdesk:function(){
wx.navigateTo({
url:'b_desk?pnum='+this.data.pnum+'&year='+this.data.thisyear+'&date='+this.data.selectdate+'&time_dur='+this.data.time_dur
})
},
getdesklist:function(){
util.post(uri.CGI_USER_GETTABLELIST,{sid:this.data.sellerid,pnum:parseInt(this.data.pnum),rdate:this.data.time},uri.CGI_USER_GETTABLELIST__CODE)
},
binddesk:function(e){
var id=e.currentTarget.dataset.id;
var tables=util.cache('tableid') ? util.cache('tableid') : [];
var showdesk=this.data.showdesk;
showdesk.forEach(function(v,i){
if(v.id==id){
if(v.isselect==true){
var thisindex=tables.indexOf(id);
tables.splice(thisindex,1)
}else{
tables.push(id)
}
v.isselect=!v.isselect
}
})
util.cache('tableid',tables);
this.setData({
showdesk:showdesk
})
var name=this.data.name;
var phone=this.data.phone;
if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){
this.setData({
buttonhide:false
})
}
}
})
\ No newline at end of file
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"selectPeople":"/components/book/people/people",
"step":"/components/book/step/step",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
<nav>点餐商户端</nav>
<step step="1"></step>
<view class="other-info flex-lr">
<view class="selected-time flex-vc" bindtap="changetime">
<view class="font30r black-font">时间</view>
<view class="actual-time green-font font34r">{{selectdate}} {{time_dur}}</view>
</view>
<selectPeople bind:changepnum="changepnum" pnum="{{pnum}}"></selectPeople>
</view>
<view class="border-line"></view>
<view class="advice-desk flex-lr">
<view class="black-font font30r">桌位</view>
<view>
<view class="font26r gray-deep-font flex-rr">(包间余{{baocount}}个,散座余{{sancount}}个)</view>
<view class="advice-desk-detail flex-rr">
<block wx:for="{{showdesk}}">
<block wx:if="{{item.tid==2}}">
<view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}">
<view class="flex-vc order-desk-detail">
<view class="font28r black-font smooth">{{item.name}}</view>
<view class="font26r black-font" style="margin-top:6rpx;">{{item.table_pnum}}人</view>
</view>
<view class="order-desk-type flex-cc white-font font20r">包间</view>
</view>
</block>
<block wx:else>
<view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}">
<view class="flex-vc order-desk-detail" style="height:100%;">
<view class="font28r black-font smooth">{{item.name}}</view>
<view class="font26r black-font" style="margin-top:6rpx;">6人</view>
</view>
</view>
</block>
</block>
<view class="flex-rr advice-more" bindtap="selectdesk">
<view style="padding-right:30rpx;" class="gray-deep-font font26r">更多</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>
</view>
</view>
</view>
</view>
<view class="cut"></view>
<view class="book-info" style="margin-bottom: 205rpx;">
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="请输入预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{name}}" bindinput="changename" bindblur="ifAll"/>
<view class="book-info-grand flex-rr font28r gray-deep-font">
<block wx:for="{{grand}}">
<view class="book-grand flex-cc {{index==0 ? 'book-grand-border' : ''}} {{item.isselect==true ? 'book-grand-active white-font' : ''}}" bindtap="selectgrand" data-sex="{{item.sex}}">{{item.grand_title}}</view>
</block>
</view>
</view>
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="请输入预订人手机号码(必填)" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11" bindblur="condition" bindinput="changephone" value="{{phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;"/>
<block wx:if="{{reminder}}">
<view class="flex-rr" style="height:100rpx;">
<view style="color:#E14553;" class="font28r">{{reminder}}</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/name-have.png" class="phone-reminder"></image>
</view>
</block>
</view>
<view class="book-info-single">
<input placeholder="请输入顾客要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{remark}}" bindinput="changeremark"/>
</view>
</view>
<view class="zhanwei">
<view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view>
</view>
\ No newline at end of file
view{
line-height:1.2;
}
.other-info{
width:100%;
height:220rpx;
padding:20rpx 0;
box-sizing:border-box;
}
.selected-time{
width:375rpx;
height:100%;
border-right:1px solid #efeef3;
box-sizing:border-box;
}
.actual-time{
margin-top:30rpx;
}
.border-line{
width:680rpx;
height:1px;
background:#efeef3;
margin:0 auto;
}
.advice-desk{
width:680rpx;
height:auto;
padding:40rpx 0;
margin:0 auto;
}
.advice-desk-detail{
margin-top:30rpx;
}
.order-desk-info{
width:120rpx;
height:120rpx;
background:#EBF8F8;
border:1px solid #199095;
border-radius:10rpx;
position:relative;
overflow:hidden;
margin-right:40rpx;
}
.desk-active{
background:#A9E3E6;
}
.order-desk-detail{
width:100%;
height:90rpx;
}
.order-desk-type{
width:100%;
height:30rpx;
background:#199095;
position:absolute;
left:0;
bottom:0;
}
.advice-more{
padding:20rpx 0;
padding-left:30rpx;
}
.cut{
width:100%;
height:4px;
background:#efeef3;
}
.book-info{
width:680rpx;
padding-top:20rpx;
margin:0 auto;
}
.book-info-single{
width:100%;
height:120rpx;
padding-top:80rpx;
border-bottom:1px solid #efeef3;
}
.book-info-single>input{
width:100%;
height:100rpx;
}
.book-info-grand{
height:50rpx;
border:1px solid #199095;
margin-top:20rpx;
}
.book-grand{
width:90rpx;
height:100%;
box-sizing:border-box;
}
.book-grand-active{
background:rgba(25,153,149,.8);
}
.book-grand-border{
border-right:1px solid #199095;
}
.phone-reminder{
width:32rpx;
height:32rpx;
margin-left:20rpx;
}
.zhanwei{
width:100%;
height:170rpx;
background:#efeef3;
position:fixed;
left:0;
right:0;
bottom:0;
z-index: 99;
}
.confirm-button{
width:680rpx;
height:85rpx;
background:#199095;
margin:42rpx auto 0;
border-radius:10rpx;
opacity:.6;
}
.confirm-button-active{
opacity:1;
}
\ No newline at end of file
// pages/manager-invitation/review.js
import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
height: 667,
current: 0,
tpls: TP.tpls(),
seller:{
name:'',
room:'',
date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
addr:'',
hasOwner:true,
},
options:{},
},
detail:{},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
options.tplid=options.tplid||1;
let param={
options:options,
}
if(true){
param.tpls=[TP.tpls(options.tplid)]
}
this.setData(param)
this.initData(options);
},
initData(options){
App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{
this.detail=res.data;
let tables=[];
res.data.tables.forEach(t=>{
tables.push(t.name);
})
this.setData({
seller:{
name:res.data.seller.sellername,
room:tables.join('、'),
date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller.real_address||res.data.seller.map_address,
image:res.data.image_url,
hasOwner:true,
}
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//导航栏自适应
let systemInfo = wx.getSystemInfoSync();
let reg = /ios/i;
let pt = 20;//导航状态栏上内边距
let h = 44;//导航状态栏高度
if (reg.test(systemInfo.system)) {
pt = systemInfo.statusBarHeight;
h = 44;
} else {
pt = systemInfo.statusBarHeight;
h = 48;
}
this.setData({
statusBarHeight: pt,
titleBarHeight: h,
height: systemInfo.windowHeight
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let path=util.http_build_query({
...this.data.options,
fromid:getApp().openid,
hasSellerShare:1,
hasInvitation:1,
},'/pages/customer/index')
return {
title: this.data.tpls[this.data.current].shareFirstTitle,
path: path,
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
}
},
swiperChange(e){
let current=e.detail.current
this.setData({
current:current,
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
switchTabs(e){
let current=util.attr(e,'current')
this.setData({
current:current,
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
sendmsg(){
if (!this.detail.phone) {
util.toast('未填写手机号码', 'none')
return;
} else if (!/^1\d{10}$/.test(this.detail.phone)) {
util.toast('手机号码错误', 'none')
return;
}
wx.navigateTo({
url: '/pages/book/b_sms?id=' + this.detail.id
});
},
gotoDetail(){
wx.redirectTo({
url: '/pages/book/b_detail?id=' + this.detail.id
});
}
})
\ No newline at end of file
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share"
}
}
\ No newline at end of file
<import src="../tpl/invitation"></import>
<swiper
indicator-dots="{{false}}"
autoplay="{{false}}"
duration="{{500}}"
bindchange="swiperChange"
current="{{current}}"
style="height:{{height}}px;"
>
<block wx:for="{{tpls}}" wx:key="tpls.key">
<swiper-item>
<view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;width:100%;">
<template is="tpl-{{item.id}}" data="{{seller,options}}"></template>
</view>
</swiper-item>
</block>
</swiper>
<view class="flex-vc"
style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">
<view class="tabs flex-ll">
<formids class="back" bindclick="gotoDetail" >
<view style="min-width: 100rpx;" class="flex-ll">
<image class="back-image"
src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image>
</view>
</formids>
<block wx:if="{{false}}" wx:for="{{tpls}}" wx:key="tpls.key">
<view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="bottom flex-lr">
<formids bindclick="sendmsg" class="sendmsg">
发短信
</formids>
<userinfo-share binduserinfo="share" class="share Semibold">
通知客户
</userinfo-share>
</view>
<!--//商务-->
<template name="tpl-1">
<view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">
<template is="tpl-shangwu" data="{{...seller,options}}"></template>
</view>
</template>
<!--//温馨-->
<template name="tpl-2">
<template is="tpl-wenxin" data="{{...seller,options}}"></template>
</template>
\ No newline at end of file
@import "../manager-invitation/tpls.wxss";
.pages{
background-size: 100%;
font-size: 34rpx;
}
.tabs{
}
.tabs .item{
font-size: 32rpx;
color:#999999;
margin-left: 20rpx;
padding: 0 10rpx;
height: 66rpx;
line-height: 66rpx;
}
.tabs .item.active{
font-size: 36rpx;
font-weight: bold;
color: #E9D9B7;
border-bottom: 2rpx solid #E9D9B7;
}
image{
width: 100%;
height: 100%;
}
.buts-share{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
.buts-share.customer{
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");
}
.shangwu{
margin-top: 52rpx;
}
.shangwu .seller{
margin-bottom: 42rpx;
}
.shangwu .invit-logo.owner{
width: 380rpx;
height: 200rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png");
}
.shangwu .invit-logo.customer{
width: 352rpx;
height: 164rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");
}
.wenxin-mask{
margin-top: 20rpx;
}
.wenxin-baitou{
margin-top: 20rpx;
}
.wenxin .seller{
margin-bottom: 22rpx;
}
.wenxin .invit-logo.owner{
width: 340rpx;
height: 184rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png");
}
.wenxin .invit-logo.customer{
width: 344rpx;
height: 198rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
.back{
margin-left: 40rpx;
}
.back-image{
height: 32rpx;
width: 18rpx;
}
.bottom{
position: fixed;
bottom: 0;
height: 98rpx;
line-height: 98rpx;
border-top: 2rpx solid #ECD9B7;
background-color: #ECD9B7;
width: 100%;
}
.bottom .sendmsg{
background-color: #262628;
width: 30%;
min-width: 30%;
color: #ECD9B7;
font-size: 30rpx;
}
.bottom .share{
text-align: center;
width: 70%;
font-size: 36rpx;
color: #794F28;
}
\ No newline at end of file
// pages/book/b_setting.js
var util = require('../../utils/util.js')
var bookOrder=require('../../utils/bookCommon.js')
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
dateStr:'',
calendarMaskLoad:false,
calendarMask:false,
dayStyle:[
{ month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' },
{ month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }
],
regions:[],
regions_active:'',
time:-1,
speciallist:[],
calendar:{
nextNum:0,
},
rdate:'',
},
regions:[],
sellerid:0,
timePickerArray:[
[],
[],
[],
],
/**
* 生命周期函数--监听页面加载
*/
onLoad: async function (options) {
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
let timePickerArray= await bookOrder.getDayTimeSpace();
let speciallist=[
{ date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
];
this.setData({
dateStr:dateStr,
timePickerArray:timePickerArray,
speciallist:speciallist,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: async function () {
this.setData({
height:getApp().system.windowHeight-170,
})
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
})
},1000);
this.selectComponent('#nav').init();
this.sellerid=util.cache('sellerid');
App.Tables.GetTableListsBySellerId({
sellerid:this.sellerid
}).then((res)=>{
this.regions=res.data[0];
this.getbooklist();
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
calendarShow(){
console.log('xxxxx')
this.setData({
calendarMask:true
})
console.log(this.data.calendarMask)
},
dateChange(event){
let cktime=util.timetouUnix(event.detail.date)
let day0=parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);
// if(cktime<day0){
// util.toast('请选择今天之后的日期','none');
// return;
// }
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();
},
calendarClose(){
this.setData({
calendarMask:false
})
},
async getbooklist(){
let obj={};
let formdata={};
formdata.sid=this.sellerid;
formdata.x=1;
formdata.y=200;
let time=0;
if(this.data.time<0){
let sid=await bookOrder.getTimeSpaceIndexData();
time=sid.timeIndex
obj.time=time;
}else{
time=this.data.time;
}
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);
formdata.rdate=rdate;
formdata.status='1,2';
obj.rdate=rdate;
let tids={};
let reserves=await App.Reserve.GetReserveList(formdata);
if(reserves.data.length>0){
reserves.data.forEach(r=>{
let ts=r.tid.split(',');
ts.forEach(tid=>{
let rname='';
if(r.sex==3){
rname=r.rname.substr(0,10)
}else{
rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
}
tids[tid]={
rdate:r.rdate,
id:r.id,
status:r.status,
rname:rname,
}
})
})
}
console.log('tids',tids);
let regions=[];
this.regions.forEach(region=>{
if(region.list.length>0){
let list_num=0;
region.list.forEach(tb=>{
tb.status_str='';
tb.status_classname='enabled'
tb.reserve_name=''
tb.reserve_id=''
if(tb.status!=0 && tb.status!=""){
tb.status_str='用餐中';
tb.status_classname='highlight';
tb.reserve_name=tb.spell==1?'拼桌':'堂食';
}else if(tids[tb.id]){
console.log('tids',region.name,tb.name);
tb.status_str=tids[tb.id].status==2?'用餐中':'已预订';
tb.status_classname='highlight';
tb.reserve_id=tids[tb.id].id;
tb.reserve_name=tids[tb.id].rname;
}
if(tb.enable!=1){
if(tb.status_str){
tb.status_classname='disabled-highlight';
}else{
tb.status_str='已停用';
tb.status_classname='disabled';
}
}
if(!tb.status_str){
list_num++;
}
region.list_num=list_num;
})
regions.push(region);
}
})
obj.regions=regions
if(!this.data.regions_active){
obj.regions_active=this.regions[0].name
}
this.setData(obj)
},
chooseRegion(e){
this.setData({
regions_active:util.attr(e,'name')
})
},
selectedValue(e){
this.setData({
time:util.attr(e,'value')
})
this.getbooklist();
},
boardEvent(e){
console.log(e);
App.Tables.GetTableListsBySellerId({
sellerid:this.sellerid
},true).then((res)=>{
this.regions=res.data[0];
this.getbooklist();
})
},
gotoday(e){
this.setData({
[`calendar.nextNum`]:0
})
},
nextMonth(e){
this.setData({
[`calendar.nextNum`]:this.data.calendar.nextNum+1
})
},
prevMonth(e){
this.setData({
[`calendar.nextNum`]:this.data.calendar.nextNum-1
})
},
})
\ No newline at end of file