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 login: true
}) })
} }
/**
* 旅居团购订单检查日期是否可预约
* @param {*} params
* @returns
*/
export function sojoumOrderCheckDate(params) {
return request.post("/travel/travelGroupOrder/checkDate", params, {
login: true
})
}
+21 -9
View File
@@ -62,7 +62,7 @@
</template> </template>
<script> <script>
import { sojoumOrderCalendar } from "@/api/sojoumOrder"; import { sojoumOrderCalendar, sojoumOrderCheckDate } from "@/api/sojoumOrder";
export default { export default {
name: 'DateRangePicker', name: 'DateRangePicker',
@@ -398,16 +398,21 @@ export default {
const currentDate = new Date(this.tempStartDate) const currentDate = new Date(this.tempStartDate)
while (currentDate <= this.tempEndDate) { while (currentDate <= this.tempEndDate) {
const day = currentDate.getDate() const day = currentDate.getDate()
// if (this.isDisabled(day)) { if (this.isDisabled(day)) {
// uni.showToast({ uni.showToast({
// title: '所选日期范围包含不可预约日期,请重新选择', title: '所选日期范围包含不可预约日期,请重新选择',
// icon: 'none' icon: 'none'
// }) })
// return return
// } }
currentDate.setDate(currentDate.getDate() + 1) currentDate.setDate(currentDate.getDate() + 1)
} }
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.startDate = this.tempStartDate
this.endDate = this.tempEndDate this.endDate = this.tempEndDate
@@ -417,6 +422,13 @@ export default {
this.endDate ? this.formatDate(this.endDate) : null this.endDate ? this.formatDate(this.endDate) : null
]) ])
this.handleClose(false) this.handleClose(false)
} else {
uni.showToast({
title: res.msg || '所选日期范围包含不可预约日期,请重新选择',
icon: 'none'
})
}
})
}, },
handleClose(shouldClear = false) { handleClose(shouldClear = false) {