ai-coding
2026-07-27 08e72463537c8fe0dea533a6f8efbe82b2fd01e4
feat(robotaxi): 切换城市时复用用户位置吸附最近站点流程

Co-Authored-By: 廖芳 <liaof@xiaopeng.com>
1个文件已修改
10 ■■■■■ 已修改文件
src/pages/robotaxi/home/hooks/use-home-bootstrap.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/hooks/use-home-bootstrap.ts
@@ -257,6 +257,16 @@
    const switchState = deps.consumeCitySwitchFlag();
    if (switchState.switched && switchState.shouldMoveToCityCenter) {
      const switchedCity = Taro.getStorageSync('selectedCity');
      const cachedUserLocation = readHomeCachedUserLocation();
      // 切回用户最近一次定位所在城市时,复用按用户位置吸附最近站点的流程。
      if (auth !== false && switchedCity?.name && cachedUserLocation?.city === switchedCity.name) {
        deps.getLocationInfo({
          updateCenter: true,
          forceCityRefresh: true,
          forceNearestSite: true
        });
        return;
      }
      if (switchedCity?.name) {
        try {
          const loc = await deps.getCityLocation(switchedCity.name);