|
@@ -15,7 +15,7 @@ Page({
|
|
|
province: '',
|
|
|
city: '',
|
|
|
county: '',
|
|
|
- timeActive: '1',
|
|
|
+ timeActive: '',
|
|
|
appointmentSuccess: false,
|
|
|
curYear: '-',
|
|
|
curMonth: '-',
|
|
@@ -28,8 +28,11 @@ Page({
|
|
|
appusername: '',
|
|
|
appuserheadimg: '',
|
|
|
durationOne: false,
|
|
|
+ durationOneBusy: false,
|
|
|
durationTwo: false,
|
|
|
- durationThree: false
|
|
|
+ durationTwoBusy: false,
|
|
|
+ durationThree: false,
|
|
|
+ durationThreeBusy: false
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -83,17 +86,20 @@ Page({
|
|
|
console.log(item);
|
|
|
if (item.duration == 1) {
|
|
|
that.setData({
|
|
|
- durationOne: item.isBusy
|
|
|
+ durationOne: item.isBusy,
|
|
|
+ durationOneBusy: item.rest == 0 ? true : false
|
|
|
})
|
|
|
}
|
|
|
if (item.duration == 2) {
|
|
|
that.setData({
|
|
|
- durationTwo: item.isBusy
|
|
|
+ durationTwo: item.isBusy,
|
|
|
+ durationTwoBusy: item.rest == 0 ? true : false
|
|
|
})
|
|
|
}
|
|
|
if (item.duration == 3) {
|
|
|
that.setData({
|
|
|
- durationThree: item.isBusy
|
|
|
+ durationThree: item.isBusy,
|
|
|
+ durationThreeBusy: item.rest == 0 ? true : false
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -233,9 +239,9 @@ Page({
|
|
|
}
|
|
|
if (index == that.data.currentWeek + 2) {
|
|
|
// item.active = true
|
|
|
- that.setData({
|
|
|
+ /* that.setData({
|
|
|
choseDate: _year + '-' + _month + '-' + _day
|
|
|
- })
|
|
|
+ }) */
|
|
|
}
|
|
|
item.dateStr = _year + '-' + _month + '-' + _day
|
|
|
} else {
|
|
@@ -322,10 +328,29 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
handleTime (e) {
|
|
|
+ if (!this.data.hasAddress) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '请选择地址',
|
|
|
+ icon: 'error',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.data.choseDate == '') {
|
|
|
+ wx.showToast({
|
|
|
+ title: '请选择日期',
|
|
|
+ icon: 'error',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
var timeActiveIndex = e.currentTarget.dataset.time
|
|
|
- this.setData({
|
|
|
- timeActive: timeActiveIndex
|
|
|
- })
|
|
|
+ var disabled = e.currentTarget.dataset.dis
|
|
|
+ if (!disabled) {
|
|
|
+ this.setData({
|
|
|
+ timeActive: timeActiveIndex
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 去充值
|
|
|
handleCharge () {},
|
|
@@ -357,7 +382,23 @@ Page({
|
|
|
mask: true
|
|
|
})
|
|
|
} else {
|
|
|
- this.submitAppointmentFn()
|
|
|
+ if (this.data.choseDate == '') {
|
|
|
+ wx.showToast({
|
|
|
+ title: '请选择日期',
|
|
|
+ icon: 'error',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (this.data.timeActive == '') {
|
|
|
+ wx.showToast({
|
|
|
+ title: '请选择时间段',
|
|
|
+ icon: 'error',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.submitAppointmentFn()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 提交预约信息
|
|
@@ -406,7 +447,7 @@ Page({
|
|
|
this.setData({
|
|
|
hasAddress: true,
|
|
|
appointmentSuccess: false,
|
|
|
- timeActive: '1',
|
|
|
+ timeActive: '',
|
|
|
addressId: '',
|
|
|
address: '',
|
|
|
province: '',
|