From 338dc421db06ddc9b582ac94d8dd26a3409cdef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sat, 28 Feb 2026 00:40:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(ticket):=20=E4=BF=AE=E5=A4=8D=E9=85=8D?= =?UTF-8?q?=E9=80=81=E5=9C=B0=E5=9D=80=E8=B6=85=E5=87=BA=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 仅在用户允许修改门票配送地址时显示提示 - 避免在冷却窗口期间显示冗余提示 - 添加对地址修改限制状态的检查 - 更新 useEffect 依赖数组以包含地址修改限制状态 --- src/user/ticket/use.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/user/ticket/use.tsx b/src/user/ticket/use.tsx index 8f8abb3..04a2d1e 100644 --- a/src/user/ticket/use.tsx +++ b/src/user/ticket/use.tsx @@ -878,6 +878,10 @@ const OrderConfirm = () => { // When user changes the delivery address to an out-of-fence one, prompt immediately (once per address). const outOfRangePromptedAddressIdRef = useRef(undefined) useEffect(() => { + // Only prompt when user is allowed to change the ticket delivery address. + // Otherwise this toast is noisy (they can't fix it within the cooldown window). + if (!ticketAddressModifyLimit.loaded) return + if (!ticketAddressModifyLimit.canModify) return const id = address?.id if (!id) return if (deliveryRangeCheckedAddressId !== id) return @@ -885,7 +889,14 @@ const OrderConfirm = () => { if (outOfRangePromptedAddressIdRef.current === id) return outOfRangePromptedAddressIdRef.current = id Taro.showToast({ title: addressHasCoords ? '该地址不在配送范围,请更换围栏内地址' : '该地址缺少定位,请在地址里选择地图定位后重试', icon: 'none' }) - }, [address?.id, addressHasCoords, deliveryRangeCheckedAddressId, inDeliveryRange]) + }, [ + address?.id, + addressHasCoords, + deliveryRangeCheckedAddressId, + inDeliveryRange, + ticketAddressModifyLimit.loaded, + ticketAddressModifyLimit.canModify + ]) // When tickets/stock change, clamp quantity into [0..maxQuantity]. useEffect(() => {