Commit be17e6fabc2e635b914bfba6af03fa072b162731

Authored by zhangyan
1 parent 3e85babb

更多桌位

... ... @@ -4,7 +4,6 @@ import comm from '../../utils/bookCommon';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
... ... @@ -39,22 +38,36 @@ Page({
}
],
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' }
],
},
tablesAll:[],
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let d=new Date()/1000;
this.setDateStr();
this.sellerid=util.cache('sellerid');
this.getTables()
},
/**
*
* @param d
*
*/
setDateStr(d=new Date()/1000){
let dateStr=[
util.unixtoTime(d,'MM-DD'),
util.unixtoTime(d+86400,'MM-DD'),
util.unixtoTime(d,'MM-DD `DAY/周WW`'),
util.unixtoTime(parseInt(d)+86400,'MM-DD `DAY/周WW`'),
];
this.setData({
dateStr:dateStr,
})
this.sellerid=util.cache('sellerid');
this.getTables()
},
/**
... ... @@ -68,6 +81,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
})
},1000);
},
... ... @@ -166,7 +184,7 @@ Page({
let form=this.data.form;
try{
let rdate=await comm.getTimeSpace(this.data.dateStr[this.data.form.date],this.data.form.time);
console.log('rdate',rdate);
console.log('rdate',this.data.dateStr[this.data.form.date],rdate);
App.Reserve.GetTableList({
sid:this.sellerid,
pnum_str:form.pnum_str,
... ... @@ -225,11 +243,33 @@ selectphone:function(e){
searchlist:null
})
},
calendarShow(){
this.setData({
calendarMask:true
})
},
dateChange(event){
console.log(event);
let clickDay = event.detail.day;
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.setDateStr(util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day))
this.getTables()
},
calendarClose(){
this.setData({
calendarMask: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
})
}
})
\ No newline at end of file
},
})
... ...
... ... @@ -10,7 +10,7 @@
"compileType": "miniprogram",
"libVersion": "2.3.0",
"appid": "wxd3dc4206c76f14fc",
"projectname": "xcx-book",
"projectname": "book",
"isGameTourist": false,
"condition": {
"search": {
... ... @@ -30,7 +30,7 @@
"list": []
},
"miniprogram": {
"current": 16,
"current": 14,
"list": [
{
"id": 0,
... ... @@ -145,7 +145,7 @@
}
},
{
"id": -1,
"id": 14,
"name": "预定本-添加预定",
"pathName": "pages/book/b_addnew",
"query": "seller_id=1&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE&manager_id=500",
... ...
... ... @@ -74,6 +74,11 @@ function unixtoTime(ns,format) {
}
}
}
if(format.indexOf('`')>0){
result=result.replace(/`(.*)\/(.*)`/ig,function($0,$1,$2){
return $1||$2;
});
}
return result;
}
... ...