Fix:4454 【旅居商城小程序】待确认/待入住订单,修改入住时间-选择天数中间有不可预约时间时,没有提示信息
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sojoumOrderCalendar } from "@/api/sojoumOrder";
|
||||
import { sojoumOrderCalendar, sojoumOrderCheckDate } from "@/api/sojoumOrder";
|
||||
export default {
|
||||
name: 'DateRangePicker',
|
||||
|
||||
@@ -398,25 +398,37 @@ export default {
|
||||
const currentDate = new Date(this.tempStartDate)
|
||||
while (currentDate <= this.tempEndDate) {
|
||||
const day = currentDate.getDate()
|
||||
// if (this.isDisabled(day)) {
|
||||
// uni.showToast({
|
||||
// title: '所选日期范围包含不可预约日期,请重新选择',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if (this.isDisabled(day)) {
|
||||
uni.showToast({
|
||||
title: '所选日期范围包含不可预约日期,请重新选择',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
currentDate.setDate(currentDate.getDate() + 1)
|
||||
}
|
||||
|
||||
// 验证通过,更新日期并关闭弹窗
|
||||
this.startDate = this.tempStartDate
|
||||
this.endDate = this.tempEndDate
|
||||
this.selectionState = 'completed'
|
||||
this.$emit('input', [
|
||||
this.startDate ? this.formatDate(this.startDate) : null,
|
||||
this.endDate ? this.formatDate(this.endDate) : null
|
||||
])
|
||||
this.handleClose(false)
|
||||
sojoumOrderCheckDate({
|
||||
travelGroupProductId: this.travelGroupProductId,
|
||||
orderStartDate: this.formatDate(this.tempStartDate),
|
||||
orderEndDate: this.formatDate(this.tempEndDate)
|
||||
}).then(res => {
|
||||
if (res.status === 200) {
|
||||
// 验证通过,更新日期并关闭弹窗
|
||||
this.startDate = this.tempStartDate
|
||||
this.endDate = this.tempEndDate
|
||||
this.selectionState = 'completed'
|
||||
this.$emit('input', [
|
||||
this.startDate ? this.formatDate(this.startDate) : null,
|
||||
this.endDate ? this.formatDate(this.endDate) : null
|
||||
])
|
||||
this.handleClose(false)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '所选日期范围包含不可预约日期,请重新选择',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleClose(shouldClear = false) {
|
||||
|
||||
Reference in New Issue
Block a user