From c9683398de309119e9c23c8262feb3f3a95deeef Mon Sep 17 00:00:00 2001 From: zoujing Date: Mon, 30 Mar 2026 22:10:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E4=BB=98=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages-booking/index.vue | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/pages-booking/index.vue b/src/pages-booking/index.vue index ba98143..09d98d1 100644 --- a/src/pages-booking/index.vue +++ b/src/pages-booking/index.vue @@ -224,13 +224,6 @@ const handlePayClick = ThrottleUtils.createThrottle(async (goodsData) => { return; } - // 校验预约日期 - if (!selectedReservationDate.value) { - uni.hideLoading(); - uni.showToast({ title: "请选择预约日期", icon: "none" }); - return; - } - // 购买的商品id const commodityId = goodsData.commodityId; // 消费者信息 @@ -241,17 +234,20 @@ const handlePayClick = ThrottleUtils.createThrottle(async (goodsData) => { const payWay = "0"; // 支付渠道 0-app 1-小程序 2-h5 const paySource = "1"; - const reservationDate = selectedReservationDate.value; // 预约日期,酒店类型可能不需要,根据实际情况调整 const params = { commodityId, purchaseAmount, payWay, paySource, - consumerInfoEntityList, - reservationDate + consumerInfoEntityList }; + // 预约日期,酒店类型不需要 + if (orderData.value.orderType !== 0) { + params.reservationDate = selectedReservationDate.value; + } + //酒店类型添加入住时间、离店时间 if (goodsData.orderType === 0 && selectedDate.value) { const { startDate, endDate } = selectedDate.value; @@ -267,7 +263,7 @@ const handlePayClick = ThrottleUtils.createThrottle(async (goodsData) => { // 检查接口返回数据 if (!res || !res.data) { uni.hideLoading(); - uni.showToast({ title: "订单创建失败,请重试", icon: "none" }); + uni.showToast({ title: res.msg || "订单创建失败,请重试", icon: "none" }); return; } @@ -303,7 +299,8 @@ const handlePayClick = ThrottleUtils.createThrottle(async (goodsData) => { }, }); }, - fail: () => { + fail: (e) => { + console.error("支付失败:", e); uni.showToast({ title: "支付失败,请重试", icon: "none" }); }, });