| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | <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> |
| | | |
| | | {/* 底部面板 */} |