master #1

Open
gxwebsoft wants to merge 108 commits from developer/template-10584:master into master
Showing only changes of commit 338dc421db - Show all commits

View File

@@ -878,6 +878,10 @@ const OrderConfirm = () => {
// When user changes the delivery address to an out-of-fence one, prompt immediately (once per address). // When user changes the delivery address to an out-of-fence one, prompt immediately (once per address).
const outOfRangePromptedAddressIdRef = useRef<number | undefined>(undefined) const outOfRangePromptedAddressIdRef = useRef<number | undefined>(undefined)
useEffect(() => { 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 const id = address?.id
if (!id) return if (!id) return
if (deliveryRangeCheckedAddressId !== id) return if (deliveryRangeCheckedAddressId !== id) return
@@ -885,7 +889,14 @@ const OrderConfirm = () => {
if (outOfRangePromptedAddressIdRef.current === id) return if (outOfRangePromptedAddressIdRef.current === id) return
outOfRangePromptedAddressIdRef.current = id outOfRangePromptedAddressIdRef.current = id
Taro.showToast({ title: addressHasCoords ? '该地址不在配送范围,请更换围栏内地址' : '该地址缺少定位,请在地址里选择地图定位后重试', icon: 'none' }) 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]. // When tickets/stock change, clamp quantity into [0..maxQuantity].
useEffect(() => { useEffect(() => {