|
@@ -3,6 +3,21 @@ import util from '../../utils/util'; |
|
@@ -3,6 +3,21 @@ import util from '../../utils/util'; |
|
3
|
import comm from '../../utils/bookCommon';
|
3
|
import comm from '../../utils/bookCommon';
|
|
4
|
import App from '../../utils/api';
|
4
|
import App from '../../utils/api';
|
|
5
|
const {regeneratorRuntime} = global
|
5
|
const {regeneratorRuntime} = global
|
|
|
|
6
|
+const formTpl={
|
|
|
|
7
|
+
|
|
|
|
8
|
+ date:0,
|
|
|
|
9
|
+ time:0,
|
|
|
|
10
|
+ pnum_str:'1-4',
|
|
|
|
11
|
+ tabid:0,
|
|
|
|
12
|
+
|
|
|
|
13
|
+ rname:'',
|
|
|
|
14
|
+ phone:'',
|
|
|
|
15
|
+ sex:1,
|
|
|
|
16
|
+ cusdem:'',
|
|
|
|
17
|
+
|
|
|
|
18
|
+ tid:[],
|
|
|
|
19
|
+
|
|
|
|
20
|
+}
|
|
6
|
Page({
|
21
|
Page({
|
|
7
|
|
22
|
|
|
8
|
/**
|
23
|
/**
|
|
@@ -10,21 +25,7 @@ Page({ |
|
@@ -10,21 +25,7 @@ Page({ |
|
10
|
*/
|
25
|
*/
|
|
11
|
data: {
|
26
|
data: {
|
|
12
|
dateStr:[],
|
27
|
dateStr:[],
|
|
13
|
- form:{
|
|
|
|
14
|
-
|
|
|
|
15
|
- date:0,
|
|
|
|
16
|
- time:0,
|
|
|
|
17
|
- pnum_str:'1-4',
|
|
|
|
18
|
- tabid:0,
|
|
|
|
19
|
-
|
|
|
|
20
|
- rname:'',
|
|
|
|
21
|
- phone:'',
|
|
|
|
22
|
- sex:1,
|
|
|
|
23
|
- cusdem:'',
|
|
|
|
24
|
-
|
|
|
|
25
|
- tid:[],
|
|
|
|
26
|
-
|
|
|
|
27
|
- },
|
28
|
+ form:JSON.parse(JSON.stringify(formTpl)),
|
|
28
|
tables:[],
|
29
|
tables:[],
|
|
29
|
grand:[
|
30
|
grand:[
|
|
30
|
{
|
31
|
{
|
|
@@ -58,11 +59,13 @@ Page({ |
|
@@ -58,11 +59,13 @@ Page({ |
|
58
|
/**
|
59
|
/**
|
|
59
|
* 生命周期函数--监听页面加载
|
60
|
* 生命周期函数--监听页面加载
|
|
60
|
*/
|
61
|
*/
|
|
61
|
- onLoad: function (options) {
|
62
|
+ onLoad: async function (options) {
|
|
62
|
this.setDateStr();
|
63
|
this.setDateStr();
|
|
63
|
this.sellerid=util.cache('sellerid');
|
64
|
this.sellerid=util.cache('sellerid');
|
|
64
|
- this.getTables()
|
|
|
|
65
|
- comm.getDayTimeSpace();
|
65
|
+ let timePickerArray= await comm.getDayTimeSpace();
|
|
|
|
66
|
+ this.setData({
|
|
|
|
67
|
+ timePickerArray: timePickerArray,
|
|
|
|
68
|
+ })
|
|
66
|
},
|
69
|
},
|
|
67
|
/**
|
70
|
/**
|
|
68
|
*
|
71
|
*
|
|
@@ -90,6 +93,7 @@ Page({ |
|
@@ -90,6 +93,7 @@ Page({ |
|
90
|
* 生命周期函数--监听页面显示
|
93
|
* 生命周期函数--监听页面显示
|
|
91
|
*/
|
94
|
*/
|
|
92
|
onShow: function () {
|
95
|
onShow: function () {
|
|
|
|
96
|
+ this.getTables();
|
|
93
|
setTimeout(()=>{
|
97
|
setTimeout(()=>{
|
|
94
|
this.setData({
|
98
|
this.setData({
|
|
95
|
calendarMaskLoad:true,
|
99
|
calendarMaskLoad:true,
|
|
@@ -222,7 +226,10 @@ Page({ |
|
@@ -222,7 +226,10 @@ Page({ |
|
222
|
async formsubmit(){
|
226
|
async formsubmit(){
|
|
223
|
if(this.data.buttonhide) return;
|
227
|
if(this.data.buttonhide) return;
|
|
224
|
try {
|
228
|
try {
|
|
225
|
- let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time);
|
229
|
+ let stimestr=this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
|
|
|
|
230
|
+ console.log('stimestr', stimestr,this.data.form.time,this.data.timePickerIndex);
|
|
|
|
231
|
+ let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
|
|
|
|
232
|
+ this.data.form.time,stimestr);
|
|
226
|
console.log('rdate', rdate);
|
233
|
console.log('rdate', rdate);
|
|
227
|
this.setData({
|
234
|
this.setData({
|
|
228
|
buttonhide: true,
|
235
|
buttonhide: true,
|
|
@@ -233,6 +240,9 @@ Page({ |
|
@@ -233,6 +240,9 @@ Page({ |
|
233
|
form.rdate =rdate
|
240
|
form.rdate =rdate
|
|
234
|
App.Reserve.SetReserveInfo(form).then(res => {
|
241
|
App.Reserve.SetReserveInfo(form).then(res => {
|
|
235
|
if(res.ret==200){
|
242
|
if(res.ret==200){
|
|
|
|
243
|
+ this.setData({
|
|
|
|
244
|
+ form:JSON.parse(JSON.stringify(formTpl))
|
|
|
|
245
|
+ })
|
|
236
|
wx.navigateTo({
|
246
|
wx.navigateTo({
|
|
237
|
url:'b_detail?id='+res.data.id,
|
247
|
url:'b_detail?id='+res.data.id,
|
|
238
|
});
|
248
|
});
|