feat(robotaxi): 切换城市时复用用户位置吸附最近站点流程
Co-Authored-By: 廖芳 <liaof@xiaopeng.com>
| | |
| | | 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); |