zjk
2026-07-29 429208957f30ab9eedc5533a81aaa284048d09f5
src/pages/robotaxi/home/index.tsx
@@ -192,7 +192,7 @@
    lastSelectedCityCodeRef,
    syncSelectedCityFromStorage,
    consumeCitySwitchFlag
  } = useCitySwitch();
  } = useCitySwitch(selectedCity?.code);
  const { displayPolygons, handleScaleChange } = useStationScaleFocus({
    currentSite: siteState.currentSite,
    originalPolygons: mapState.polygons
@@ -329,7 +329,6 @@
    toSelectSitePage,
    toCoupon,
    toOrderDetail,
    toSelectCityPage,
    toAgreementPage,
    toLogin,
    openService,
@@ -406,6 +405,26 @@
   */
  const handleAgreePrivacy = () => {
    setShowPrivacy(false);
  };
  /**
   * 当前页内联切换城市:写入选中城市缓存后复用启动流程完成切城副作用
   * (清理起终点、移动地图中心、刷新围栏等),与从城市选择页返回保持一致。
   */
  const handleSelectCityInline = (city: any) => {
    if (!city) {
      return;
    }
    const nextCode = city.adcode || city.code;
    if (nextCode && nextCode === selectedCity?.code) {
      return; // 选中的是当前城市,无需切换
    }
    Taro.setStorageSync('selectedCity', {
      name: city.name,
      code: nextCode,
      id: city.id
    });
    bootstrap.onDidShow();
  };
  /**
@@ -556,7 +575,7 @@
        waitingRadarSrc={WAITING_RADAR_SRC}
        onRegionChange={handleRegionChange}
        onMarkerTap={handleMarkerTap}
        onSelectCity={toSelectCityPage}
        onSelectCityInline={handleSelectCityInline}
        onToOrigin={toOrigin}
        onShowPrivacy={() => setShowPrivacy(true)}
        onOpenSetting={handleOpenSetting}