master #1
@@ -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<number | undefined>(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(() => {
|
||||
|
||||
Reference in New Issue
Block a user