| | |
| | | }; |
| | | // 优化订单状态回调中的车辆信息拉取逻辑 |
| | | orderStatusHandlerRef.current = (payload) => { |
| | | const changeStatusOld = tripStatus |
| | | const mappedTripStatus = payload?.tripStatus; |
| | | if (typeof mappedTripStatus === 'number') { |
| | | const currentLocalStatus = Number(Taro.getStorageSync('tripStatus')); |
| | |
| | | lastErasedIndexRef.current = 0; |
| | | } |
| | | if (payload?.showCancelPopup) { |
| | | setTripStatus(10); |
| | | if (tripStatus == 4 || tripStatus == 5) { |
| | | if (changeStatusOld == 4 || changeStatusOld == 5) { |
| | | setOrderId(''); |
| | | clearOrderTripStorage(); |
| | | Taro.removeStorageSync('pickupEndTime'); |
| | | Taro.removeStorageSync('waitingTimerStartAt'); |
| | | Taro.removeStorageSync('waitingTimerElapsed'); |
| | | setTripStatus(10); |
| | | setCancelType(4); |
| | | } else { |
| | | setCancelType(5); |
| | | } |
| | | setTripStatus(10); |
| | | setShowCancelPopup(true); |
| | | } |
| | | if (payload?.showPassengerNotice) { |