| | |
| | | import { queryVehicleByOrderId } from '../../../../api/begin-route'; |
| | | import { clearOrderTripStorage, reportEvent } from '../../../../../utils/Robotaxi-public-method'; |
| | | import { getOrderId } from '../../../../utils/order'; |
| | | import { SocketOrderStatus, TripStatus, toTripStatus } from '../../../../constants/trip-status'; |
| | | import { SocketOrderStatus, TripStatus, toTripStatus, CancelType } from '../../../../constants/trip-status'; |
| | | import { ARRIVED_DROPOFF_PAGE_VIEW_EVENT_ID, PICKUP_ARRIVED_PAGE_VIEW_EVENT_ID, TRIP_IN_PROGRESS_PAGE_VIEW_EVENT_ID, TRIP_IN_PROGRESS_COMPLETE_TRIP_BUTTON_EVENT_ID } from '../../../../constants/report-events'; |
| | | import { createTripInProgressCompleteTripReportPayload } from '../../../../constants/confirm-ride-report'; |
| | | import { clearPassedRouteCache } from '../passed-route-cache'; |
| | |
| | | } |
| | | const matchedPendingCancelContext = isPendingCancelContextMatched(payload, pendingCancelContext); |
| | | if (matchedPendingCancelContext) { |
| | | deps.setCancelType(pendingCancelContext?.cancelType || 4); |
| | | deps.setCancelType(pendingCancelContext?.cancelType || CancelType.OrderCanceled); |
| | | deps.pendingCancelContextRef.current = null; |
| | | } else if (changeStatusOld === TripStatus.VehicleApproaching || changeStatusOld === TripStatus.VehicleArrivedPickup) { |
| | | deps.setOrderId(''); |
| | |
| | | Taro.removeStorageSync('pickupEndTime'); |
| | | Taro.removeStorageSync('waitingTimerStartAt'); |
| | | Taro.removeStorageSync('waitingTimerElapsed'); |
| | | deps.setCancelType(4); |
| | | deps.setCancelType(CancelType.OrderCanceled); |
| | | } else { |
| | | deps.setCancelType(5); |
| | | deps.setCancelType(CancelType.NoAvailableVehicle); |
| | | } |
| | | deps.setTripStatus(TripStatus.CancelOnlyPickup); |
| | | deps.setShowCancelPopup(true); |
| | |
| | | reportTripInProgressEventIfNeeded(effectiveTripStatus, changeStatusOld, effectiveOrderId, currentDeps); |
| | | reportTripCompleteEventIfNeeded(effectiveTripStatus, changeStatusOld, effectiveOrderId, currentDeps); |
| | | handleStatusSideEffects(effectiveTripStatus, changeStatusOld, currentDeps); |
| | | // 改派场景兜底:若当前展示的是"正在为您重新派车中"弹窗(cancelType=6), |
| | | // 改派场景兜底:若当前展示的是"正在为您重新派车中"弹窗(CancelType.Redispatching), |
| | | // 一旦订单状态推进回接驾中/已到达上车点,说明改派成功,自动关闭弹窗。 |
| | | // 用同步 ref 镜像判断,避免依赖经 useEffect 异步回流的 cancelType 造成漏关。 |
| | | const isReassignPopupShowing = currentDeps.showCancelPopupRef.current && currentDeps.cancelTypeRef.current === 6; |
| | | const isReassignPopupShowing = currentDeps.showCancelPopupRef.current && currentDeps.cancelTypeRef.current === CancelType.Redispatching; |
| | | const isAdvancingIntoPickup = ( |
| | | effectiveTripStatus === TripStatus.VehicleApproaching |
| | | || effectiveTripStatus === TripStatus.VehicleArrivedPickup |