diff --git a/components/Calender/index.vue b/components/Calender/index.vue index b95225c..717fc73 100644 --- a/components/Calender/index.vue +++ b/components/Calender/index.vue @@ -1,5 +1,10 @@ - + @@ -7,7 +12,7 @@ 日历选择 选择入住和离店日期,以下价格为单晚参考价选择住宿日期,以下价格为单晚参考价 @@ -269,8 +274,12 @@ const getDateLabel = (dateStr) => { return props.customLabels[dateStr]; } - // 为范围选择模式自动生成入住/离店标签 + // 为范围选择模式自动生成住/离标签 if (props.mode === "range") { + if (dateStr === rangeStart.value && dateStr === rangeEnd.value) { + // 当入住和离店是同一天时,显示"住/离" + return "住/离"; + } if (dateStr === rangeStart.value) { return "入住"; } @@ -343,26 +352,26 @@ const handleRangeSelection = (dateInfo) => { rangeEnd.value = dateInfo.date; isRangeSelecting.value = false; - // 确保开始日期小于结束日期 + // 允许选择相同日期,但确保开始日期不大于结束日期 if (new Date(rangeStart.value) > new Date(rangeEnd.value)) { [rangeStart.value, rangeEnd.value] = [rangeEnd.value, rangeStart.value]; } - // 检查日期跨度是否超过28天 + // 检查日期跨度是否超过28天(相同日期跨度为0天,允许通过) const daysBetween = calculateDaysBetween(rangeStart.value, rangeEnd.value); if (daysBetween > 28) { // 使用uni.showToast显示错误提示 uni.showToast({ - title: '预定时间不能超过28天', - icon: 'none', - duration: 3000 + title: "预定时间不能超过28天", + icon: "none", + duration: 3000, }); - + // 重置选择状态 rangeStart.value = null; rangeEnd.value = null; isRangeSelecting.value = false; - + return; } diff --git a/pages/goods/components/GoodConfirm/index.vue b/pages/goods/components/GoodConfirm/index.vue index 854944a..fbf569f 100644 --- a/pages/goods/components/GoodConfirm/index.vue +++ b/pages/goods/components/GoodConfirm/index.vue @@ -39,13 +39,25 @@ }} ¥ - {{ goodsData.price || 399 }} + + {{ goodsData.specificationPrice || 399 }} + - + 包含服务 - - 随时可退 - 1份 + + {{ item.serviceTitle }} + {{ item.serviceAmount }} @@ -54,7 +66,11 @@ - + @@ -67,7 +83,11 @@ > - + @@ -107,7 +127,9 @@ import SumCard from "@/components/SumCard/index.vue"; const props = defineProps({ goodsData: { type: Object, - default: () => ({}), + default: () => ({ + commodityTypeCode: "0", // 商品类型 0-酒店 1-门票 2-餐饮 + }), }, }); diff --git a/pages/goods/components/GoodInfo/index.vue b/pages/goods/components/GoodInfo/index.vue index e7e4dcc..b03bdb5 100644 --- a/pages/goods/components/GoodInfo/index.vue +++ b/pages/goods/components/GoodInfo/index.vue @@ -8,6 +8,15 @@ {{ goodsData.timeTag || "随时可退" }} + + @@ -31,9 +40,12 @@