|
...
|
...
|
@@ -161,9 +161,9 @@ Page({ |
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
//if(!this.reserve_id || util.cache('tableid').length>0){
|
|
|
|
if (util.cache('tableid').length > 0) {
|
|
|
|
//if (util.cache('tableid').length > 0) {
|
|
|
|
this.getTables();
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
setTimeout(() => {
|
|
|
|
this.setData({
|
|
|
|
calendarMaskLoad: true,
|
|
...
|
...
|
@@ -272,9 +272,11 @@ Page({ |
|
|
|
console.log('ts', sobj.tables,this.checkedTables);
|
|
|
|
//console.log(e.type,key,val,form);
|
|
|
|
sobj.form = form;
|
|
|
|
sobj.buttonhide = true;
|
|
|
|
sobj.buttonhide = this.data.buttonhide;
|
|
|
|
if (form.tid.length > 0 && form.rname.length > 0) {
|
|
|
|
sobj.buttonhide = false;
|
|
|
|
}else{
|
|
|
|
sobj.buttonhide = true;
|
|
|
|
}
|
|
|
|
let displayTimes = false;
|
|
|
|
if (key == 'time') {
|
|
...
|
...
|
@@ -286,7 +288,7 @@ Page({ |
|
|
|
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
|
|
|
|
if (!displayTimes) {
|
|
|
|
//sobj.form.tid = []; //切换日期时间清空桌位
|
|
|
|
sobj.buttonhide = true;
|
|
|
|
//sobj.buttonhide = true;
|
|
|
|
this.getTables();
|
|
|
|
}
|
|
|
|
if (key == 'date') {
|
|
...
|
...
|
@@ -330,7 +332,9 @@ Page({ |
|
|
|
let tablesLength = 0;
|
|
|
|
if (tableid.length > 0) {
|
|
|
|
let toastTables={...this.checkedTables}
|
|
|
|
res.data.forEach(p => {
|
|
|
|
let resData=res.data.slice(1,res.data.length);
|
|
|
|
console.log('resData',resData)
|
|
|
|
resData.forEach(p => {
|
|
|
|
//if(tables.length>=3) return true;
|
|
|
|
p.list.forEach(t => {
|
|
|
|
delete toastTables[t.id]
|
|
...
|
...
|
@@ -361,6 +365,7 @@ Page({ |
|
|
|
}
|
|
|
|
wx.removeStorage({key: 'tableid'})
|
|
|
|
}
|
|
|
|
console.log('tables',tables);
|
|
|
|
if(tables.length<1){
|
|
|
|
tablesLength=0;
|
|
|
|
tables_tmp = [];
|
|
...
|
...
|
@@ -417,19 +422,24 @@ Page({ |
|
|
|
if (!form.tid) {
|
|
|
|
return util.toast('请选择桌子', 'none');
|
|
|
|
}
|
|
|
|
if (!form.rname) {
|
|
|
|
return util.toast('请填写预订人', 'none');
|
|
|
|
}
|
|
|
|
form.sid = this.sellerid;
|
|
|
|
form.rdate = rdate
|
|
|
|
if (!form.rid) {
|
|
|
|
try {
|
|
|
|
let enter_params = util.cache('enter_params');
|
|
|
|
let sc = (await App.Reserve.SellerInfo(enter_params)).data
|
|
|
|
let note_openid = enter_params.seller_openid;
|
|
|
|
let note_name = sc.seller_user.nickname;
|
|
|
|
form.note_openid = note_openid || '';
|
|
|
|
form.note_name = note_name || '';
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
let enter_params = util.cache('enter_params');
|
|
|
|
let sc = (await App.Reserve.SellerInfo(enter_params)).data
|
|
|
|
let note_openid = enter_params.seller_openid;
|
|
|
|
let note_name = sc.seller_user.nick_name || sc.seller_user.nickname;
|
|
|
|
form.note_openid = note_openid || '';
|
|
|
|
if (form.rid) {//修改时传递uid
|
|
|
|
form.note_openid = enter_params.manager_id || '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
form.note_name = note_name || '';
|
|
|
|
} catch (e) {}
|
|
|
|
|
|
|
|
form.ddate = d_rdate.substr(0, 10);
|
|
|
|
if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间
|
|
|
|
let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");
|
|
...
|
...
|
@@ -489,7 +499,7 @@ Page({ |
|
|
|
[changeDay]: clickDay,
|
|
|
|
[changeBg]: "#84e7d0",
|
|
|
|
//[`form.tid`]: [], //切换日期时间清空桌位
|
|
|
|
buttonhide: true,
|
|
|
|
//buttonhide: true,
|
|
|
|
})
|
|
|
|
this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime)
|
|
|
|
this.getTables();
|
...
|
...
|
|