hejianhao
2026-03-12 77f364e8fa83fe053933153c7f39d2b5f48b0842
fix: 修复页面元素重叠与逻辑条件问题

- 在 begin-route 页面中,为等待提示框和地图容器添加 z-index 以防止元素重叠,并优化复位按钮的显示逻辑,避免与地图入口按钮重叠
- 在 site-search 页面中,调整附近站点获取逻辑,确保在无 OTP 验证时也能获取,并修正起点站点缓存的应用条件
3个文件已修改
89 ■■■■■ 已修改文件
src/robotaxi/pages/begin-route/index.less 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/begin-route/index.tsx 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/site-search/index.tsx 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/begin-route/index.less
@@ -88,6 +88,7 @@
}
.waiting-callout-content {
    z-index: 2;
    position: absolute;
    top: 240px;
    left: 50%;
@@ -155,6 +156,7 @@
    width: 100%;
    height: 350px;
    pointer-events: none;
    z-index: 1;
}
.waiting-radar-img {
@@ -213,4 +215,4 @@
.pr-6 {
    padding-right: 6px;
}
}
src/robotaxi/pages/begin-route/index.tsx
@@ -79,6 +79,7 @@
  const [evaluateSubmitVersion, setEvaluateSubmitVersion] = useState(0);
  const [evaluateCloseVersion, setEvaluateCloseVersion] = useState(0);
  const [originOpacity, setOriginOpacity] = useState(1);
  const [originBoxHidden, setOriginBoxHidden] = useState(false);
  const [mapBottomPadding, setMapBottomPadding] = useState(280);
  const [carCalloutStyle, setCarCalloutStyle] = useState<any>({});
  const [carCalloutVisible, setCarCalloutVisible] = useState(false);
@@ -332,15 +333,33 @@
  const updateMapViewportPadding = () => {
    Taro.nextTick(() => {
      Taro.createSelectorQuery()
        .select('.container')
        .boundingClientRect((rect) => {
          const safeInset = resolveSafeBottomInset();
          const measured = rect?.height ? rect.height + safeInset + 16 : 0;
          const nextPadding = Math.max(280, Math.round(measured));
          setMapBottomPadding(nextPadding);
        })
        .exec();
      const query = Taro.createSelectorQuery();
      query.select('.container').boundingClientRect();
      query.select('.origin-box').boundingClientRect();
      query.select('.map-entry').boundingClientRect();
      query.exec((res) => {
        const rect = res?.[0];
        const originRect = res?.[1];
        const mapEntryRect = res?.[2];
        const safeInset = resolveSafeBottomInset();
        const measured = rect?.height ? rect.height + safeInset + 16 : 0;
        const nextPadding = Math.max(280, Math.round(measured));
        setMapBottomPadding(nextPadding);
        if (originRect && mapEntryRect) {
          const originLeft = originRect.left ?? 0;
          const originTop = originRect.top ?? 0;
          const originRight = originLeft + (originRect.width ?? 0);
          const originBottom = originTop + (originRect.height ?? 0);
          const entryLeft = mapEntryRect.left ?? 0;
          const entryTop = mapEntryRect.top ?? 0;
          const entryRight = entryLeft + (mapEntryRect.width ?? 0);
          const entryBottom = entryTop + (mapEntryRect.height ?? 0);
          const overlap = !(originRight < entryLeft || originLeft > entryRight || originBottom < entryTop || originTop > entryBottom);
          setOriginBoxHidden(overlap);
        } else {
          setOriginBoxHidden(false);
        }
      });
    });
  };
@@ -1568,7 +1587,7 @@
        <View className="container">
          <View className="container-inner">
            {/* 复位按钮 */}
            <View className="origin-box" style={{ opacity: originOpacity, transition: 'opacity 0.2s ease-out' }}>
            <View className="origin-box" style={{ opacity: originBoxHidden ? 0 : originOpacity, transition: 'opacity 0.2s ease-out', pointerEvents: originBoxHidden ? 'none' : 'auto' }}>
              <Image onClick={toOrigin} className="origin-icon" src={originIcon} />
            </View>
            <View catchMove onClick={(e) => e.stopPropagation()}>
src/robotaxi/pages/site-search/index.tsx
@@ -62,30 +62,30 @@
  useEffect(() => {
    const { pageType: type, latitude: lat, longitude: lon, electronicAreaId } = router.params;
    if (lat && lon) {
      fetchNearbySites(Number(lat), Number(lon));
    }
    checkOtp(false).then(otp => {
      if (otp) {
        if (lat && lon) {
          fetchNearbySites(Number(lat), Number(lon));
          const payload = {
            lat: Number(lat),
            lon: Number(lon)
          };
      if (otp && lat && lon) {
        const payload = {
          lat: Number(lat),
          lon: Number(lon)
        };
          const handleSuccess = (res) => {
            if (Array.isArray(res)) {
              const list = res.map(item => ({
                ...item,
                distance: item.distance
              }));
              setHistorySite(list);
            }
          };
          if (type === 'start') {
            getStartPoints(payload).then(handleSuccess);
          } else if (type === 'end') {
            getEndPoints(payload).then(handleSuccess);
        const handleSuccess = (res) => {
          if (Array.isArray(res)) {
            const list = res.map(item => ({
              ...item,
              distance: formatDistance(item.distance)
            }));
            setHistorySite(list);
          }
        };
        if (type === 'start') {
          getStartPoints(payload).then(handleSuccess);
        } else if (type === 'end') {
          getEndPoints(payload).then(handleSuccess);
        }
      }
    });
@@ -315,8 +315,8 @@
    }
  }
  const startSiteCache = pageType === 'end' ? Taro.getStorageSync('startSite') : null;
  const filteredNearbyList = pageType === 'end' && startSiteCache
  const startSiteCache = pageType === 'end' || pageType === 'start' ? Taro.getStorageSync('startSite') : null;
  const filteredNearbyList = startSiteCache
    ? nearbySiteList.filter((item: any) => {
      const startId = startSiteCache?.id;
      const itemId = item?.id;