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
})
}
+30 -18
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,25 +398,37 @@ 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,
this.startDate = this.tempStartDate orderStartDate: this.formatDate(this.tempStartDate),
this.endDate = this.tempEndDate orderEndDate: this.formatDate(this.tempEndDate)
this.selectionState = 'completed' }).then(res => {
this.$emit('input', [ if (res.status === 200) {
this.startDate ? this.formatDate(this.startDate) : null, // 验证通过,更新日期并关闭弹窗
this.endDate ? this.formatDate(this.endDate) : null this.startDate = this.tempStartDate
]) this.endDate = this.tempEndDate
this.handleClose(false) 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) { handleClose(shouldClear = false) {