|
@@ -32,7 +32,8 @@ Page({
|
|
|
durationTwo: false,
|
|
|
durationTwoBusy: false,
|
|
|
durationThree: false,
|
|
|
- durationThreeBusy: false
|
|
|
+ durationThreeBusy: false,
|
|
|
+ allDayBusy: false
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -66,13 +67,13 @@ Page({
|
|
|
},
|
|
|
|
|
|
// 获取当天可预约的次数
|
|
|
- getResetNumberFn (data) {
|
|
|
+ getResetNumberFn (cDate, index) {
|
|
|
var that = this
|
|
|
var data = {
|
|
|
province: this.data.province,
|
|
|
city: this.data.city,
|
|
|
county: this.data.county,
|
|
|
- appointmentDate: data
|
|
|
+ appointmentDate: cDate
|
|
|
}
|
|
|
wx.showLoading({
|
|
|
title: '加载中...',
|
|
@@ -81,9 +82,14 @@ Page({
|
|
|
getResetNumber(data).then(res => {
|
|
|
wx.hideLoading()
|
|
|
const response = res.data.carDurationConfigs
|
|
|
- console.log(response)
|
|
|
+ const allBusy = response.find(item => {
|
|
|
+ return item.isBusy == false
|
|
|
+ })
|
|
|
+ if (allBusy == undefined) {
|
|
|
+ console.log(index,cDate, '约满')
|
|
|
+ that.handleAllDayBusy(cDate)
|
|
|
+ }
|
|
|
response.forEach(item => {
|
|
|
- console.log(item);
|
|
|
if (item.duration == 1) {
|
|
|
that.setData({
|
|
|
durationOne: item.isBusy,
|
|
@@ -113,6 +119,18 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ handleAllDayBusy (cDate) {
|
|
|
+ const _weekList = this.data.weekList
|
|
|
+ _weekList.forEach(item => {
|
|
|
+ if (item.dateStr == cDate) {
|
|
|
+ item.date = '约满'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ weekList: _weekList
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
onPullDownRefresh () {
|
|
|
wx.vibrateShort({
|
|
|
type: 'medium'
|
|
@@ -308,7 +326,7 @@ Page({
|
|
|
choseDate: cDate,
|
|
|
timeActive: ''
|
|
|
})
|
|
|
- this.getResetNumberFn(cDate)
|
|
|
+ this.getResetNumberFn(cDate,index)
|
|
|
}
|
|
|
}
|
|
|
},
|