chore: 升级 Taro 依赖至 3.6.40 并调整多项 UI 与代码细节
- 升级所有 @tarojs 相关依赖包至 3.6.40 版本
- 删除预估路线页面中未使用的 useEffect 钩子函数
- 注释onTap点击地图事件
- 调整运营区域地图覆盖物的填充色与线条样式
- 更新路线选择面板的默认偏好设置显示文本
- 将 RGBA 颜色格式统一转换为十六进制简写格式
| | |
| | | "dependencies": { |
| | | "@babel/runtime": "^7.7.7", |
| | | "@rematch/core": "^1.1.304", |
| | | "@tarojs/components": "3.4.9", |
| | | "@tarojs/plugin-framework-react": "3.4.9", |
| | | "@tarojs/components": "3.6.40", |
| | | "@tarojs/plugin-framework-react": "3.6.40", |
| | | "@tarojs/plugin-platform-kwai": "^2.0.0", |
| | | "@tarojs/plugin-platform-xhs": "^1.1.0", |
| | | "@tarojs/react": "3.4.9", |
| | | "@tarojs/runtime": "3.4.9", |
| | | "@tarojs/taro": "3.4.9", |
| | | "@tarojs/react": "3.6.40", |
| | | "@tarojs/runtime": "3.6.40", |
| | | "@tarojs/taro": "3.6.40", |
| | | "ahooks": "^3.7.6", |
| | | "arrify": "^1.0.1", |
| | | "babel-plugin-setname": "^0.1.1", |
| | |
| | | }, |
| | | "devDependencies": { |
| | | "@babel/core": "^7.8.0", |
| | | "@tarojs/cli": "3.4.9", |
| | | "@tarojs/mini-runner": "3.4.9", |
| | | "@tarojs/cli": "3.6.40", |
| | | "@tarojs/mini-runner": "3.6.40", |
| | | "@tarojs/plugin-mini-ci": "^4.1.2", |
| | | "@tarojs/webpack-runner": "3.4.9", |
| | | "@tarojs/webpack-runner": "3.6.40", |
| | | "@types/react": "^17.0.2", |
| | | "@types/webpack-env": "^1.13.6", |
| | | "@typescript-eslint/eslint-plugin": "^4.15.1", |
| | | "@typescript-eslint/parser": "^4.15.1", |
| | | "babel-preset-taro": "3.4.9", |
| | | "babel-preset-taro": "3.6.40", |
| | | "eslint": "^6.8.0", |
| | | "eslint-config-taro": "3.4.9", |
| | | "eslint-config-taro": "3.6.40", |
| | | "eslint-plugin-import": "^2.12.0", |
| | | "eslint-plugin-react": "^7.8.2", |
| | | "eslint-plugin-react-hooks": "^4.2.0", |
| | |
| | | onCalloutTap={handleCalloutTap} |
| | | onRegionChange={handleRegionChange} |
| | | onPolylineTap={onPolylineTap} |
| | | onTap={onMapTap} |
| | | // onTap={onMapTap} |
| | | style={{ width: '100%', height: '87vh' }} |
| | | > |
| | | {renderMapOverlays()} |
| | |
| | | selectedRouteIndex = 0, |
| | | handleSelectRoute |
| | | }: Props) { |
| | | const DEFAULT_PREFERENCE: RoutePreferenceOption = { label: '智能推荐', value: 'default', code: 'default' }; // 路线偏好默认值,避免初始渲染空指针 |
| | | const DEFAULT_PREFERENCE: RoutePreferenceOption = { label: '', value: 'default', code: 'default' }; // 路线偏好默认值,避免初始渲染空指针 |
| | | const [showPreferencePopup, setShowPreferencePopup] = useState(false); |
| | | const [preference, setPreference] = useState<RoutePreferenceOption>(DEFAULT_PREFERENCE); |
| | | const [preferenceOptions, setPreferenceOptions] = useState<RoutePreferenceOption[]>([]); |
| | |
| | | <View className='route-select-type'> |
| | | <View className='route-select-title'>路线选择:</View> |
| | | <View className='route-select-preference' onClick={() => setShowPreferencePopup(true)}> |
| | | <View className='route-select-preference-text'>{preference?.label || '智能推荐'}</View> |
| | | <View className='route-select-preference-text'>{preference?.label || ''}</View> |
| | | <Image src="https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/select-line.png" /> |
| | | </View> |
| | | </View> |
| | |
| | | * 处理 polyline 点击事件。 |
| | | */ |
| | | const handlePolylineTap = (event: any) => { |
| | | console.log('[点击折现事件:',event); |
| | | console.log('[点击折线事件:',event); |
| | | const targetIndex = resolveRouteIndexByTap(event); |
| | | if (targetIndex >= 0 && targetIndex < allRoutePoints.length) { |
| | | handleSelectRoute(targetIndex, { syncSites: false }); |
| | |
| | | } |
| | | updateMapViewportPadding(); |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | if (isRouteSelectExpanded) { |
| | | setOriginOpacity(0); |
| | | } else { |
| | | setOriginOpacity(1); |
| | | } |
| | | }, [isRouteSelectExpanded]); |
| | | const handleModifyDestination = () => { |
| | | isCheckedEnter.current = true; |
| | | handleStartModifyDestination(fareEstimate, routePoints); |
| | |
| | | return []; |
| | | } |
| | | return geofenceList.map(item => { |
| | | const isSelected = item.mapPolygonId === selectedId; |
| | | return { |
| | | points: item.polygonPoints || [], |
| | | strokeWidth: 0, |
| | | strokeColor: 'rgba(0, 0, 0, 0)', |
| | | fillColor: '#6d7fd933', |
| | | fillColor: isSelected ? '#6d7fd933' : '#6d7fd91a', |
| | | zIndex: 1, |
| | | id: item.mapPolygonId |
| | | } |
| | |
| | | const isSelected = item.mapPolygonId === selectedId; |
| | | return { |
| | | points: item.polylinePoints || [], |
| | | color: isSelected ? '#6D7FD9' : '#A1B1FF', |
| | | color: '#A1B1FF', |
| | | width: 2, |
| | | dottedLine: !isSelected, |
| | | arrowLine: false, |
| | | borderColor: isSelected ? '#6D7FD9' : '#A1B1FF', |
| | | borderColor: '#A1B1FF', |
| | | borderWidth: 0, |
| | | zIndex: isSelected ? 3 : 2, |
| | | id: Number(item.mapPolygonId ?? index + 1) |
| | |
| | | const AUTO_SCALE_MAX = 17; // 自动缩放最大等级 |
| | | const AUTO_SCALE_MIN = 11; // 自动缩放最小等级 |
| | | const INCLUDE_POINTS_PADDING = [100, 100, 100, 100] as [number, number, number, number]; // 地图回视图内边距 |
| | | const CROSS_OPERATING_AREA_FILL_COLOR = 'rgba(0, 0, 0, 0.25)'; // 非可选运营区围栏填充色 |
| | | const CROSS_OPERATING_AREA_STROKE_COLOR = 'rgba(0, 0, 0, 0.4)'; // 非可选运营区围栏描边色 |
| | | const CROSS_OPERATING_AREA_FILL_COLOR = '#00000040'; // 非可选运营区围栏填充色 |
| | | const CROSS_OPERATING_AREA_STROKE_COLOR = '#00000066'; // 非可选运营区围栏描边色 |
| | | const SELECT_MAP_POINT_ON_OFF = { |
| | | start: 1, |
| | | end: 2 |