From 429208957f30ab9eedc5533a81aaa284048d09f5 Mon Sep 17 00:00:00 2001
From: zjk <852185829@qq.com>
Date: 星期三, 29 七月 2026 21:51:54 +0800
Subject: [PATCH] Merge branch 'feature_v2.4.0' into fix-0716-blue-dev
---
src/pages/robotaxi/home/index.tsx | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/pages/robotaxi/home/index.tsx b/src/pages/robotaxi/home/index.tsx
index 468fad2..d72ff5d 100644
--- a/src/pages/robotaxi/home/index.tsx
+++ b/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}
--
Gitblit v1.7.1