hejianhao
2026-06-09 869965ad608f47b6220eb32faaaa2db3f10158a1
修改车头-方向
2个文件已修改
30 ■■■■■ 已修改文件
src/robotaxi/pages/begin-route/hooks/use-map-markers.ts 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/begin-route/hooks/web-socket-handlers/create-order-route-socket-handler.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/begin-route/hooks/use-map-markers.ts
@@ -279,6 +279,7 @@
    const shouldWaitArrivedDirection = deps.tripStatus === TripStatus.ArrivedDestination && !deps.arrivedMarkerReady;
    const effectiveShowCar = deps.statusRule.showCar && !shouldWaitArrivedDirection;
    const carMarker = createCarMarker();
    const currentCarMarker = markersRef.current.find((item: any) => item.id === deps.vehicleMarkerId);
    const nextMarkers: any[] = [];
    if (deps.statusRule.showPickup && pickupMarker) nextMarkers.push(pickupMarker);
    if (effectiveShowCar && carMarker) nextMarkers.push(carMarker);
@@ -287,7 +288,24 @@
    const nextMarkersSignature = buildMarkersSignature(nextMarkers, deps.vehicleMarkerId, shouldUsePureTranslateCarMarker);
    const hasDropoffMarker = markersRef.current.some((m: any) => m.id === 2);
    const shouldHoldMarkerByTranslate = [TripStatus.VehicleApproaching, TripStatus.InService].includes(deps.tripStatus) && carMarkerInitialized.current && deps.statusRule.showCar && (!deps.statusRule.showDropoff || hasDropoffMarker);
    const shouldSkipUpdate = shouldHoldMarkerByTranslate && (deps.isAndroid || tripStatus6MarkerRefreshedRef.current);
    const shouldRefreshInServiceRotate = deps.tripStatus === TripStatus.InService
      && !!carMarker
      && !!currentCarMarker
      && currentCarMarker.rotate !== carMarker.rotate;
    const shouldSkipUpdate = !shouldRefreshInServiceRotate
      && shouldHoldMarkerByTranslate
      && (deps.isAndroid || tripStatus6MarkerRefreshedRef.current);
    if (deps.tripStatus === TripStatus.InService && carMarker) {
      console.log('[开始行程][送驾方向][Marker]', {
        车辆方向: deps.vehicleDirection,
        当前Marker角度: currentCarMarker?.rotate,
        下一次Marker角度: carMarker.rotate,
        是否触发角度刷新: shouldRefreshInServiceRotate,
        是否跳过Marker更新: shouldSkipUpdate,
        车辆位置: deps.vehicleLocation,
        车辆标记ID: deps.vehicleMarkerId,
      });
    }
    applyMarkerState(nextMarkers, nextMarkersSignature, shouldSkipUpdate, carMarker);
  }, [deps.tripStatus, deps.startSite?.name, deps.startSite?.latitude, deps.startSite?.longitude, deps.endSite?.name, deps.endSite?.latitude, deps.endSite?.longitude, deps.beforeUserEndSite?.latitude, deps.beforeUserEndSite?.longitude, deps.vehicleLocation, deps.vehicleDirection, deps.vehicleMarkerId, deps.isAndroid, deps.statusRule.showPickup, deps.statusRule.showCar, deps.statusRule.showDropoff]);
src/robotaxi/pages/begin-route/hooks/web-socket-handlers/create-order-route-socket-handler.ts
@@ -47,12 +47,22 @@
 * 更新路线概要信息。
 */
const updateRouteSummary = (payload: any, deps: WebSocketDepsRef['current']) => {
  const rawDirection = payload?.content?.direction;
  const normalizedDirection = resolveDirectionValue(payload);
  if (typeof normalizedDirection === 'number') {
    if (deps.lastSocketDirectionAtRef) {
      deps.lastSocketDirectionAtRef.current = Date.now();
    }
    deps.setVehicleDirection(normalizedDirection);
    if (deps.tripStatusRef.current === TripStatus.InService) {
      console.log('[开始行程][送驾方向][Socket]', {
        订单ID: getOrderId(deps.orderId),
        原始方向: rawDirection,
        归一化方向: normalizedDirection,
        车辆点位数量: Array.isArray(payload?.content?.vehicleMoveAlongPoints) ? payload.content.vehicleMoveAlongPoints.length : undefined,
        Socket原始数据: payload,
      });
    }
  }
  const route = safeParse(payload?.content?.route, {});
  const distanceMeters = Number(route?.distance);