+ {/* ========== 分隔线 ========== */}
+
+
+ {/* ========== 航线区域 ========== */}
+
+ 浏览线路
+
+ {routes.length} 条航线
+
+
+
+
+
{loading ? (
) : routes.length === 0 ? (
-
+
) : (
- routes.map((route) => {
- const isSelected = selectedRouteId === route.routeId;
- const waypoints = routeWaypointsMap[route.routeId] || [];
- const duration = formatDuration(route.totalDuration);
- const distance = formatDistance(route.totalDistance);
+
+ {routes.map((route) => {
+ const isSelected = selectedRouteId === route.routeId;
+ const waypoints = routeWaypointsMap[route.routeId] || [];
+ const duration = formatDuration(route.totalDuration);
+ const distance = formatDistance(route.totalDistance);
+ const wpCount = route.waypointCount || waypoints.length;
- // 构建航点路径名称列表
- const waypointNames = waypoints
- .filter((wp) => wp.pointName)
- .map((wp) => wp.pointName);
-
- return (
-
onSelectRoute(isSelected ? null : route.routeId)}
- >
- {/* 线路名称 */}
-
{route.routeName}
-
- {/* 时长 + 距离 标签 */}
-
- {duration && (
-
-
- {duration}
-
- )}
- {distance && (
-
-
- {distance}
-
- )}
-
-
- {route.waypointCount || waypoints.length}个景点
-
-
-
- {/* 航点路径 */}
- {waypointNames.length > 0 && (
-
- {waypointNames.map((name, idx) => (
-
-
- {name}
- {idx < waypointNames.length - 1 && (
- →
- )}
-
- ))}
+ return (
+
onSelectRoute(isSelected ? null : route.routeId)}
+ >
+
+
+
+ {route.routeName}
+
+
就绪
- )}
-
- );
- })
+
+ {wpCount}个航点{distance ? ` · 约${distance}` : ''}{duration ? ` · 预计${duration}` : ''}
+
+
+ {/* 选中时显示操作按钮 */}
+ {isSelected && (
+
e.stopPropagation()}>
+
+
+
+ )}
+
+ );
+ })}
+
)}
+ {routes.length > 2 &&
上下滑动查看更多航线
}
);
diff --git a/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.less b/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.less
index d0cdf2c6..c0b083e7 100644
--- a/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.less
+++ b/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.less
@@ -23,8 +23,26 @@
font-family: 'Rajdhani', 'DIN', 'Avenir Next', 'PingFang SC', sans-serif;
font-variant-numeric: tabular-nums;
overflow: hidden;
+
+ // 侧边栏垂直布局模式
+ :global(.navigationPanel) & {
+ position: static;
+ transform: none;
+ width: 100%;
+ max-width: none;
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ border-radius: 0;
+ padding: 0;
+ background: transparent;
+ border: none;
+ box-shadow: none;
+ }
}
+.sidebarLayout {}
+
.hudContainer::before {
content: '';
position: absolute;
@@ -60,6 +78,15 @@
.actionCluster {
position: relative;
z-index: 1;
+
+ // 侧边栏垂直布局模式
+ :global(.navigationPanel) & {
+ background: linear-gradient(145deg, rgba(10, 24, 48, 0.7), rgba(8, 18, 38, 0.5));
+ border: 1px solid rgba(65, 170, 255, 0.28);
+ border-radius: 12px;
+ padding: 14px;
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
+ }
}
.primaryCluster {
@@ -68,6 +95,11 @@
align-items: center;
justify-content: center;
gap: 8px;
+
+ :global(.navigationPanel) & {
+ flex-direction: row;
+ justify-content: space-between;
+ }
}
.speedDial {
@@ -138,6 +170,10 @@
flex-direction: column;
justify-content: center;
gap: 10px;
+
+ :global(.navigationPanel) & {
+ gap: 8px;
+ }
}
.routeHeader {
@@ -145,6 +181,12 @@
align-items: baseline;
justify-content: space-between;
gap: 12px;
+
+ :global(.navigationPanel) & {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 4px;
+ }
}
.routeTitle {
@@ -154,12 +196,20 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
+
+ :global(.navigationPanel) & {
+ font-size: 16px;
+ }
}
.routeProgress {
font-size: 14px;
font-weight: 700;
color: #7fd9ff;
+
+ :global(.navigationPanel) & {
+ font-size: 13px;
+ }
}
.routeProgressTrack {
@@ -187,6 +237,13 @@
align-items: center;
justify-content: space-between;
gap: 16px;
+
+ :global(.navigationPanel) & {
+ flex-direction: column;
+ align-items: stretch;
+ gap: 8px;
+ padding: 8px 10px;
+ }
}
.waypointMain {
@@ -194,18 +251,30 @@
align-items: center;
gap: 10px;
min-width: 0;
+
+ :global(.navigationPanel) & {
+ gap: 8px;
+ }
}
.navArrow {
font-size: 20px;
color: #59cbff;
filter: drop-shadow(0 0 6px rgba(89, 203, 255, 0.7));
+
+ :global(.navigationPanel) & {
+ font-size: 16px;
+ }
}
.infoLabel {
font-size: 11px;
letter-spacing: 0.6px;
color: rgba(195, 226, 255, 0.7);
+
+ :global(.navigationPanel) & {
+ font-size: 10px;
+ }
}
.waypointName {
@@ -216,11 +285,21 @@
overflow: hidden;
text-overflow: ellipsis;
max-width: 220px;
+
+ :global(.navigationPanel) & {
+ font-size: 14px;
+ max-width: 100%;
+ }
}
.waypointStats {
display: flex;
gap: 20px;
+
+ :global(.navigationPanel) & {
+ flex-direction: column;
+ gap: 6px;
+ }
}
.infoValue {
@@ -228,6 +307,10 @@
font-size: 17px;
color: #8de5ff;
font-weight: 700;
+
+ :global(.navigationPanel) & {
+ font-size: 15px;
+ }
}
.emptyWaypoint {
@@ -240,10 +323,19 @@
.summaryRow {
display: flex;
gap: 28px;
+
+ :global(.navigationPanel) & {
+ flex-direction: column;
+ gap: 8px;
+ }
}
.summaryItem {
min-width: 92px;
+
+ :global(.navigationPanel) & {
+ min-width: 0;
+ }
}
.summaryValue {
@@ -251,6 +343,10 @@
font-size: 15px;
font-weight: 700;
color: #e6f5ff;
+
+ :global(.navigationPanel) & {
+ font-size: 14px;
+ }
}
.statusCluster {
@@ -258,6 +354,10 @@
flex-direction: column;
justify-content: center;
gap: 10px;
+
+ :global(.navigationPanel) & {
+ gap: 8px;
+ }
}
.compassCard,
@@ -266,6 +366,10 @@
padding: 8px 10px;
background: rgba(12, 29, 48, 0.78);
border: 1px solid rgba(106, 176, 238, 0.22);
+
+ :global(.navigationPanel) & {
+ padding: 8px;
+ }
}
.cardTitle {
@@ -274,6 +378,10 @@
display: flex;
align-items: center;
gap: 6px;
+
+ :global(.navigationPanel) & {
+ font-size: 11px;
+ }
}
.compassDial {
@@ -284,6 +392,11 @@
border: 1px solid rgba(141, 208, 255, 0.3);
background: radial-gradient(circle at center, rgba(68, 157, 226, 0.25) 0%, rgba(8, 23, 38, 0.8) 70%);
position: relative;
+
+ :global(.navigationPanel) & {
+ width: 60px;
+ height: 60px;
+ }
}
.compassRotor {
@@ -321,6 +434,10 @@
font-size: 13px;
font-weight: 700;
color: #ecf8ff;
+
+ :global(.navigationPanel) & {
+ font-size: 12px;
+ }
}
.powerCard {
@@ -340,6 +457,10 @@
font-size: 13px;
font-weight: 700;
color: #f7fbff;
+
+ :global(.navigationPanel) & {
+ font-size: 12px;
+ }
}
.powerTrack {
@@ -369,6 +490,10 @@
flex-direction: column;
justify-content: center;
gap: 10px;
+
+ :global(.navigationPanel) & {
+ gap: 8px;
+ }
}
.actionBtn {
@@ -385,6 +510,11 @@
gap: 8px;
cursor: pointer;
transition: all 0.2s ease;
+
+ :global(.navigationPanel) & {
+ height: 38px;
+ font-size: 13px;
+ }
}
.actionBtn:active {
@@ -410,6 +540,123 @@
filter: brightness(1.06);
}
+@media (max-width: 1400px) {
+ .hudContainer {
+ // 平板通用方案:紧凑的2行布局
+ grid-template-columns: auto 1fr auto;
+ grid-template-rows: auto auto;
+ gap: 10px;
+ padding: 10px 12px;
+ max-width: calc(100% - 100px);
+ }
+
+ .primaryCluster {
+ grid-column: 1;
+ grid-row: 1 / 3;
+ }
+
+ .centerCluster {
+ grid-column: 2;
+ grid-row: 1 / 3;
+ }
+
+ .statusCluster {
+ grid-column: 3;
+ grid-row: 1;
+ }
+
+ .actionCluster {
+ grid-column: 3;
+ grid-row: 2;
+ }
+
+ .speedDial {
+ width: 90px;
+ height: 90px;
+ }
+
+ .speedValue {
+ font-size: 28px;
+ }
+
+ .routeTitle {
+ font-size: 17px;
+ }
+
+ .waypointName {
+ font-size: 14px;
+ max-width: 200px;
+ }
+
+ .compassDial {
+ width: 60px;
+ height: 60px;
+ }
+
+ .compassTick {
+ transform-origin: 50% 25px;
+ }
+
+ .actionBtn {
+ height: 36px;
+ font-size: 13px;
+ }
+}
+
+@media (max-width: 1280px) {
+ .hudContainer {
+ max-width: calc(100% - 80px);
+ gap: 8px;
+ padding: 10px;
+ }
+
+ .speedDial {
+ width: 80px;
+ height: 80px;
+ }
+
+ .speedValue {
+ font-size: 26px;
+ }
+
+ .speedUnit {
+ font-size: 11px;
+ }
+
+ .routeTitle {
+ font-size: 16px;
+ }
+
+ .waypointName {
+ font-size: 13px;
+ max-width: 180px;
+ }
+
+ .compassDial {
+ width: 56px;
+ height: 56px;
+ }
+
+ .compassTick {
+ transform-origin: 50% 23px;
+ height: 6px;
+ }
+
+ .compassNeedle {
+ top: 6px;
+ border-bottom: 12px solid #ff8f66;
+ }
+
+ .compassValue {
+ font-size: 12px;
+ }
+
+ .actionBtn {
+ height: 34px;
+ font-size: 12px;
+ }
+}
+
@media (max-width: 1240px) {
.hudContainer {
grid-template-columns: 154px 1fr 200px 154px;
@@ -429,6 +676,71 @@
}
}
+@media (max-width: 1024px) {
+ .hudContainer {
+ max-width: calc(100% - 60px);
+ bottom: 16px;
+ gap: 6px;
+ padding: 8px 10px;
+ }
+
+ .speedDial {
+ width: 70px;
+ height: 70px;
+ }
+
+ .speedValue {
+ font-size: 24px;
+ }
+
+ .modeChip {
+ font-size: 10px;
+ padding: 2px 8px;
+ }
+
+ .routeTitle {
+ font-size: 15px;
+ }
+
+ .waypointName {
+ font-size: 13px;
+ max-width: 150px;
+ }
+
+ .infoValue {
+ font-size: 14px;
+ }
+
+ .compassDial {
+ width: 52px;
+ height: 52px;
+ }
+
+ .compassTick {
+ transform-origin: 50% 21px;
+ height: 5px;
+ }
+
+ .compassNeedle {
+ top: 5px;
+ border-bottom: 10px solid #ff8f66;
+ }
+
+ .compassValue {
+ font-size: 11px;
+ }
+
+ .powerCard {
+ gap: 3px;
+ }
+
+ .actionBtn {
+ height: 32px;
+ font-size: 12px;
+ gap: 6px;
+ }
+}
+
@media (max-width: 960px) {
.hudContainer {
left: 12px;
@@ -464,4 +776,33 @@
.actionBtn {
flex: 1;
}
+
+ .hudContainer.sidebarLayout {
+ left: auto;
+ right: auto;
+ bottom: auto;
+ transform: none;
+ width: 100%;
+ max-height: none;
+ overflow: visible;
+ }
+
+ .hudContainer.sidebarLayout .statusCluster,
+ .hudContainer.sidebarLayout .actionCluster {
+ flex-direction: column;
+ align-items: stretch;
+ justify-content: center;
+ }
+
+ .hudContainer.sidebarLayout .centerCluster {
+ order: 0;
+ }
+
+ .hudContainer.sidebarLayout .summaryRow {
+ justify-content: flex-start;
+ }
+
+ .hudContainer.sidebarLayout .actionBtn {
+ flex: none;
+ }
}
diff --git a/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.tsx b/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.tsx
index a870fd19..5b3d496c 100644
--- a/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.tsx
+++ b/zlt-web/yingyan/src/pages/client/components/NavigationHUD/index.tsx
@@ -31,6 +31,7 @@ export interface NavigationHUDProps {
onPause: () => void;
onResume: () => void;
onStop: () => void;
+ layout?: 'bottom' | 'sidebar';
}
/** 格式化距离 */
@@ -75,6 +76,7 @@ const NavigationHUD: React.FC
= ({
onPause,
onResume,
onStop,
+ layout = 'bottom',
}) => {
const maxSpeed = 12;
const clampedSpeed = Math.max(0, Math.min(speed, maxSpeed));
@@ -97,9 +99,12 @@ const NavigationHUD: React.FC = ({
const actionText = previewing ? '结束预览' : isPaused ? '继续航行' : '暂停航行';
const actionIcon = previewing ? : isPaused ? : ;
const actionHandler = previewing ? onStop : isPaused ? onResume : onPause;
+ const isSidebar = layout === 'sidebar';
return (
-
+