hejianhao
2026-02-28 42a076688f9f8addc8150b720cf6845c2cee1b84
fix(robotaxi): 动态计算首页内容区域高度

当 banner 列表为空时,不再使用固定高度 266,而是根据实际内容高度或 0 进行动态计算,避免出现不必要的空白区域。
1个文件已修改
9 ■■■■■ 已修改文件
src/pages/robotaxi/home/index.tsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/index.tsx
@@ -387,15 +387,16 @@
      query.select('.select-site').boundingClientRect(rect => {
        if (rect) {
          const contentHeight = rect.height;
          const baseHeight = 266;
          const baseHeight = bannerList.length > 0 ? 266 : contentHeight;
          fullHeight.current = Math.max(contentHeight, baseHeight);
          minHeight.current = baseHeight;
          setBoxHeight(baseHeight);
        } else {
          // 兜底逻辑
          minHeight.current = 266;
          fullHeight.current = 266;
          setBoxHeight(266);
          const baseHeight = bannerList.length > 0 ? 266 : 0;
          minHeight.current = baseHeight;
          fullHeight.current = baseHeight;
          setBoxHeight(baseHeight);
        }
      }).exec();
    }, 500);