| src/robotaxi/pages/begin-route/components/calling-car-modules/door-trunk-control.tsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/robotaxi/pages/begin-route/hooks/use-route-manager.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/robotaxi/pages/begin-route/hooks/use-web-socket-events.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/utils/websocket.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/robotaxi/pages/begin-route/components/calling-car-modules/door-trunk-control.tsx
@@ -132,8 +132,6 @@ } } }).catch(() => { console.log(res,'***********'); Taro.showToast({ title: '解锁失败,请重试或联系客服', icon: 'none' }); }); }; src/robotaxi/pages/begin-route/hooks/use-route-manager.ts
@@ -113,19 +113,11 @@ orderRouteInitializedRef.current = false; }; // 擦除已行驶路段 const erasePassedRouteSegments = (newPoints: any[], servedPoints: any[] = []) => { // 擦除已行驶路段(仅基于前后两次路线点差分,不依赖后端 served) const erasePassedRouteSegments = (newPoints: any[], _servedPoints: any[] = []) => { const oldPoints = currentFullRouteRef.current; if (!oldPoints?.length || !newPoints?.length) return; const servedLast = Array.isArray(servedPoints) && servedPoints.length > 0 ? servedPoints[servedPoints.length - 1] : null; const hasServedBoundary = !!( servedLast && typeof servedLast.latitude === 'number' && typeof servedLast.longitude === 'number' ); const boundaryPoint = hasServedBoundary ? servedLast : newPoints[0]; const boundaryPoint = newPoints[0]; if ( !boundaryPoint || typeof boundaryPoint.latitude !== 'number' || @@ -147,7 +139,7 @@ } if (dist > bestDistance * 3 && bestDistance < 100) break; } if (bestMatchIndex >= startIndex && bestDistance < 500) { if (bestMatchIndex >= startIndex && bestDistance < 120) { Taro.createMapContext('map').eraseLines({ lines: [{ id: 2001, @@ -159,19 +151,15 @@ clear: true }] }); if (hasServedBoundary) { currentFullRouteRef.current = [...newPoints]; lastErasedIndexRef.current = 0; } else { lastErasedIndexRef.current = bestMatchIndex; } // 同步 React 路由状态,避免仅原生擦线导致线和车不同步 currentFullRouteRef.current = [...newPoints]; lastErasedIndexRef.current = 0; applyRoutePoints([...newPoints]); return; } currentFullRouteRef.current = [...newPoints]; lastErasedIndexRef.current = 0; lastRoutePointRef.current = null; lastRouteUpdateAtRef.current = 0; setRoutePoints([...newPoints]); applyRoutePoints([...newPoints]); }; // 确保路线请求可用城市信息 src/robotaxi/pages/begin-route/hooks/use-web-socket-events.ts
@@ -67,8 +67,8 @@ return null; } const currentTripStatus = Number(deps.tripStatusRef.current); if (currentTripStatus > mappedTripStatus && currentTripStatus !== 10) { return null; if (currentTripStatus === mappedTripStatus) { return mappedTripStatus; } deps.setTripStatus(mappedTripStatus); deps.tripStatusRef.current = mappedTripStatus; @@ -193,7 +193,7 @@ const handleEraseRouteStatus = (points: any[], servedPoints: any[], deps: UseWebSocketEventsDeps) => { const targetPoint = resolveVehiclePoint(points, servedPoints); if (deps.orderRouteInitializedRef.current && deps.currentFullRouteRef.current.length > 0) { deps.erasePassedRouteSegments(points, servedPoints); deps.erasePassedRouteSegments(points); } else { deps.orderRouteInitializedRef.current = true; deps.currentFullRouteRef.current = [...points]; @@ -230,11 +230,13 @@ deps.lastRouteUpdateAtRef.current = 0; Taro.nextTick(() => { deps.orderRouteInitializedRef.current = true; deps.orderRouteInitializedRef.current = points.length > 0; deps.currentFullRouteRef.current = [...points]; deps.lastErasedIndexRef.current = 0; deps.applyRoutePoints(points); syncVehiclePointWithRoute(points, deps, servedPoints); if (points.length > 0) { syncVehiclePointWithRoute(points, deps, servedPoints); } }); }; src/utils/websocket.ts
@@ -467,16 +467,16 @@ cached.latest = points; } Taro.setStorageSync('orderRoutePoints', cached); this.notifyListeners('order_route', { routeType, direction, points, servedPoints, data, content, forceFullRedraw: data?.type === 'ORDER_UPDATE_LINE' }); } this.notifyListeners('order_route', { routeType, direction, points, servedPoints, data, content, forceFullRedraw: data?.type === 'ORDER_UPDATE_LINE' }); } if (data?.type === 'ORDER_UPDATE_PRICE') { const orderId = content?.orderId ?? data?.orderId;