From c42e4af2bdb406e9f3cce103f7cc0978dff372c2 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Fri, 26 Dec 2025 14:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=80=80=E6=AC=BE=E5=80=92?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=E5=88=B7=E6=96=B0=E6=94=B9=E4=B8=BA=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useOrder.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/useOrder.ts b/src/hooks/useOrder.ts index e069688..5e8ab32 100644 --- a/src/hooks/useOrder.ts +++ b/src/hooks/useOrder.ts @@ -97,11 +97,11 @@ export async function handleRefundOrderHooks(id: number, orderType: number) { await refund({ id: res.id }) toast.info('退款成功,注意查收') - // 退款延迟-1.5秒钟后再执行 - setTimeout(() => { - uni.hideLoading() - return true - }, 1500) + // 退款延迟-1.5秒钟后再执行(同步等待) + await new Promise(resolve => setTimeout(resolve, 1500)); + console.log("🚀 ~ handleRefundOrderHooks ~ 退款延迟:") + uni.hideLoading(); + return true; } catch (error) { toast.info('退款失败') return false