From 679bea91357b242dae05b891ebe0a5839d656c34 Mon Sep 17 00:00:00 2001 From: zoujing Date: Thu, 2 Apr 2026 21:22:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=8B=E5=8D=95=E7=9A=84loading=20?= =?UTF-8?q?=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages-booking/index.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages-booking/index.vue b/src/pages-booking/index.vue index 77edaf0..896fd20 100644 --- a/src/pages-booking/index.vue +++ b/src/pages-booking/index.vue @@ -206,20 +206,16 @@ const validateUserForms = () => { // 处理支付点击事件 const handlePayClick = ThrottleUtils.createThrottle(async (goodsData) => { - // 点击后立即展示 loading - uni.showLoading({ title: "正在提交订单..." }); - + try { console.log("处理支付点击事件", userFormList.value); // 校验用户姓名 if (!validateUserForms()) { - uni.hideLoading(); return; } // 校验手机号 if (!PhoneUtils.validatePhone(userFormList.value[0].contactPhone)) { - uni.hideLoading(); uni.showToast({ title: "请输入正确的手机号", icon: "none" }); return; } @@ -257,12 +253,14 @@ const handlePayClick = ThrottleUtils.createThrottle(async (goodsData) => { params.checkOutData = endDate; } + // 点击后立即展示 loading + uni.showLoading({ title: "正在提交订单..." }); const res = await orderPay(params); console.log("确认订单---2:", res); + uni.hideLoading(); // 检查接口返回数据 if (!res || !res.data) { - uni.hideLoading(); uni.showToast({ title: res.msg || "订单创建失败,请重试", icon: "none" }); return; }