Fix:4454 【旅居商城小程序】待确认/待入住订单,修改入住时间-选择天数中间有不可预约时间时,没有提示信息

This commit is contained in:
linxi
2025-11-11 16:28:16 +08:00
parent 9151f3326b
commit 2748950b81
2 changed files with 41 additions and 18 deletions
+11
View File
@@ -55,3 +55,14 @@ export function sojoumOrderRefundInfo(params) {
login: true
})
}
/**
* 旅居团购订单检查日期是否可预约
* @param {*} params
* @returns
*/
export function sojoumOrderCheckDate(params) {
return request.post("/travel/travelGroupOrder/checkDate", params, {
login: true
})
}
+30 -18
View File
@@ -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) {