| | |
| | | import { View, Map, Text, Image, ScrollView } from '@tarojs/components'; |
| | | import { useMemo } from 'react'; |
| | | import Taro from '@tarojs/taro'; |
| | | import CustomerServicePopup from '../../../components/customer-service'; |
| | | import TipPopup from '../../../components/tip-popup'; |
| | | import { formatTripDistance, formatTripDurationFromSeconds } from '../../../../utils/Robotaxi-public-method'; |
| | |
| | | const shouldShowSelectedSiteEcho = !showRangeWarning && Boolean(deps.selectedSite.name); |
| | | const shouldShowStationSelection = deps.selectionMode === 'station' && !showRangeWarning; |
| | | |
| | | // 搜索框右侧与小程序胶囊按钮右边缘对齐 |
| | | const searchCardRightPx = useMemo(() => { |
| | | try { |
| | | const menuButton = Taro.getMenuButtonBoundingClientRect(); |
| | | const systemInfo = Taro.getSystemInfoSync(); |
| | | return systemInfo.screenWidth - menuButton.right; |
| | | } catch { |
| | | return 7; // fallback |
| | | } |
| | | }, []); |
| | | |
| | | return ( |
| | | <View className="home-container"> |
| | | <Map |
| | |
| | | style={{ width: '100%', height: '100%' }} |
| | | > |
| | | {/* 返回 */} |
| | | <View onClick={deps.toBack} className="select-city" style={{ left: `${searchCardRightPx}px` }}> |
| | | <View onClick={deps.toBack} className="select-city"> |
| | | <Image className="select-city-icon" src={deps.backIcon} /> |
| | | </View> |
| | | {/* 搜索框 */} |
| | | <View onClick={deps.toSiteSearch} className="search-card" style={{ left: `${searchCardRightPx}px`, right: `${searchCardRightPx}px` }}> |
| | | <View onClick={deps.toSiteSearch} className="search-card"> |
| | | <View className={`search-icon ${deps.pageType == 'end' ? 'end-icon' : ''}`}></View> |
| | | <View className="search-input-box"> |
| | | <View className="search-input-placeholder">{deps.pageType == 'start' ? '请输入上车点' : '请输入目的地'}</View> |