ai-coding
2026-07-23 8dd85d204e8ff1ac8cc464df5a599e5ff6972e9e
refactor(operating-area): 选择城市修改为下拉选择

Co-Authored-By: 符启基 <fuqj@xiaopeng.com>
2个文件已修改
35 ■■■■■ 已修改文件
src/robotaxi/pages/operating-area/index.less 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/operating-area/index.tsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/operating-area/index.less
@@ -43,28 +43,6 @@
        height: 64px;
      }
    }
    .select-city {
      display: flex;
      align-items: center;
      font-size: 32px;
      font-weight: 500;
      line-height: 48px;
      color: @black-text-main;
      .city-name {
        max-width: 200px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
      .select-city-icon {
        width: 28px;
        height: 28px;
        margin-left: 4px;
      }
    }
  }
  .bottom-sheet {
src/robotaxi/pages/operating-area/index.tsx
@@ -7,6 +7,7 @@
import { getGeofence } from '../../api/home';
import { extractPointsFromPolygons, findMatchedPolygon } from '../../../utils/Robotaxi-public-method';
import { withRobotaxiWhitelist } from '../../../utils/whitelist';
import CitySelect from '../../../pages/robotaxi/home/components/city-select';
const DEFAULT_MAP_LONGITUDE = 116.397128;
const DEFAULT_MAP_LATITUDE = 39.916527;
@@ -140,6 +141,13 @@
  const handleSelectCity = (city: any) => {
    const cityCode = city.code || city.adcode;
    if (!cityCode) return;
    if (selectedCity?.code && selectedCity.code === cityCode) return; // 选中的是当前城市,无需切换
    // 与首页保持一致:内联切城后写入缓存,供本页 useDidShow 及其他页面复用
    Taro.setStorageSync('selectedCity', {
      name: city.name,
      code: cityCode,
      id: city.id
    });
    // 进入/切换城市:先用占位图盖住地图,避免定位与缩放过程的跳动被看到
    setIsMapLoading(true);
    if (revealTimerRef.current) {
@@ -351,10 +359,7 @@
        <View onClick={toBack} className="back-btn">
          <Image className="back-icon" src="https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/v2/back-icon-20260716.png" />
        </View>
        <View className="select-city" onClick={() => Taro.navigateTo({ url: '/robotaxi/pages/select-city/index' })}>
          <Text className="city-name">{selectedCity?.name || '选择城市'}</Text>
          <Image className="select-city-icon" src="https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/select-city.png" />
        </View>
        <CitySelect selectedCityName={selectedCity?.name} onSelectCity={handleSelectCity} />
      </View>
      {/* 底部面板 */}