|
...
|
...
|
@@ -3,6 +3,21 @@ import util from '../../utils/util'; |
|
|
|
import comm from '../../utils/bookCommon';
|
|
|
|
import App from '../../utils/api';
|
|
|
|
const {regeneratorRuntime} = global
|
|
|
|
const formTpl={
|
|
|
|
|
|
|
|
date:0,
|
|
|
|
time:0,
|
|
|
|
pnum_str:'1-4',
|
|
|
|
tabid:0,
|
|
|
|
|
|
|
|
rname:'',
|
|
|
|
phone:'',
|
|
|
|
sex:1,
|
|
|
|
cusdem:'',
|
|
|
|
|
|
|
|
tid:[],
|
|
|
|
|
|
|
|
}
|
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -10,21 +25,7 @@ Page({ |
|
|
|
*/
|
|
|
|
data: {
|
|
|
|
dateStr:[],
|
|
|
|
form:{
|
|
|
|
|
|
|
|
date:0,
|
|
|
|
time:0,
|
|
|
|
pnum_str:'1-4',
|
|
|
|
tabid:0,
|
|
|
|
|
|
|
|
rname:'',
|
|
|
|
phone:'',
|
|
|
|
sex:1,
|
|
|
|
cusdem:'',
|
|
|
|
|
|
|
|
tid:[],
|
|
|
|
|
|
|
|
},
|
|
|
|
form:JSON.parse(JSON.stringify(formTpl)),
|
|
|
|
tables:[],
|
|
|
|
grand:[
|
|
|
|
{
|
|
...
|
...
|
@@ -58,11 +59,13 @@ Page({ |
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
onLoad: async function (options) {
|
|
|
|
this.setDateStr();
|
|
|
|
this.sellerid=util.cache('sellerid');
|
|
|
|
this.getTables()
|
|
|
|
comm.getDayTimeSpace();
|
|
|
|
let timePickerArray= await comm.getDayTimeSpace();
|
|
|
|
this.setData({
|
|
|
|
timePickerArray: timePickerArray,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
*
|
|
...
|
...
|
@@ -90,6 +93,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
this.getTables();
|
|
|
|
setTimeout(()=>{
|
|
|
|
this.setData({
|
|
|
|
calendarMaskLoad:true,
|
|
...
|
...
|
@@ -222,7 +226,10 @@ Page({ |
|
|
|
async formsubmit(){
|
|
|
|
if(this.data.buttonhide) return;
|
|
|
|
try {
|
|
|
|
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time);
|
|
|
|
let stimestr=this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
|
|
|
|
console.log('stimestr', stimestr,this.data.form.time,this.data.timePickerIndex);
|
|
|
|
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
|
|
|
|
this.data.form.time,stimestr);
|
|
|
|
console.log('rdate', rdate);
|
|
|
|
this.setData({
|
|
|
|
buttonhide: true,
|
|
...
|
...
|
@@ -233,6 +240,9 @@ Page({ |
|
|
|
form.rdate =rdate
|
|
|
|
App.Reserve.SetReserveInfo(form).then(res => {
|
|
|
|
if(res.ret==200){
|
|
|
|
this.setData({
|
|
|
|
form:JSON.parse(JSON.stringify(formTpl))
|
|
|
|
})
|
|
|
|
wx.navigateTo({
|
|
|
|
url:'b_detail?id='+res.data.id,
|
|
|
|
});
|
...
|
...
|
|