|
...
|
...
|
@@ -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 |
|
|
|
},
|
|
|
|
}) |
...
|
...
|
|