hejianhao
2026-02-28 318ee9e1cbe60a2ff17abcca5f1f7601b157fc67
fix(robotaxi): 修复首页站点选择框高度计算逻辑

修复站点选择框在无轮播图时高度计算错误的问题,将兜底高度统一为266px,并调整高度样式逻辑确保无轮播图时高度自适应
2个文件已修改
13 ■■■■■ 已修改文件
config/dev.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/index.tsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/dev.js
@@ -21,6 +21,8 @@
// const ROBOTAXI_WS_HOST = '"ws://192.168.110.34:8888/websocket"';
const ROBOTAXI_HOST = '"http://221.182.45.100:8000"'; 
const ROBOTAXI_WS_HOST = '"ws://221.182.45.100:8888/websocket"';
// const ROBOTAXI_HOST = '"https://rt-api.deploy-test.xiaopeng.com"';
// const ROBOTAXI_WS_HOST = '"wss://rt-api.deploy-test.xiaopeng.com/websocket"';
const XP_APPID_MAP = {
  weapp: '"xp_cs_wom"',
src/pages/robotaxi/home/index.tsx
@@ -387,16 +387,15 @@
      query.select('.select-site').boundingClientRect(rect => {
        if (rect) {
          const contentHeight = rect.height;
          const baseHeight = bannerList.length > 0 ? 266 : contentHeight;
          const baseHeight = 266;
          fullHeight.current = Math.max(contentHeight, baseHeight);
          minHeight.current = baseHeight;
          setBoxHeight(baseHeight);
        } else {
          // 兜底逻辑
          const baseHeight = bannerList.length > 0 ? 266 : 0;
          minHeight.current = baseHeight;
          fullHeight.current = baseHeight;
          setBoxHeight(baseHeight);
          minHeight.current = 266;
          fullHeight.current = 266;
          setBoxHeight(266);
        }
      }).exec();
    }, 500);
@@ -825,7 +824,7 @@
      {/* 选择站点 */}
      <View
        className="content-box"
        style={{ height: `${boxHeight}px`, transition: isDragging.current ? 'none' : 'height 0.3s ease-out' }}
        style={{ height: bannerList.length > 0 ? `${boxHeight}px` : `auto`, transition: isDragging.current ? 'none' : 'height 0.3s ease-out' }}
        onTouchStart={handleTouchStart}
        onTouchMove={handleTouchMove}
        onTouchEnd={handleTouchEnd}