feat: show transport type on routes + unify map height
All checks were successful
Build Docker Image / build (push) Successful in 4m33s
All checks were successful
Build Docker Image / build (push) Successful in 4m33s
- Add transportType display (🚂 ЖД / 🚛 Авто) in RouteStagesList - Pass transportType from CalcResultContent to RouteStagesList - Unify map height in CatalogPage for orders/addresses pages
This commit is contained in:
@@ -221,7 +221,8 @@ const mapRouteStages = (route: RoutePathType): RouteStageItem[] => {
|
|||||||
from: stage?.fromName || 'Начало',
|
from: stage?.fromName || 'Начало',
|
||||||
to: stage?.toName || 'Конец',
|
to: stage?.toName || 'Конец',
|
||||||
distanceKm: stage?.distanceKm,
|
distanceKm: stage?.distanceKm,
|
||||||
durationSeconds: stage?.travelTimeSeconds
|
durationSeconds: stage?.travelTimeSeconds,
|
||||||
|
transportType: stage?.transportType
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="stage.distanceKm" class="text-sm text-base-content/70 shrink-0">
|
<div class="flex items-center gap-2 shrink-0">
|
||||||
<span>{{ formatDistance(stage.distanceKm) }} км</span>
|
<span v-if="stage.transportType" class="badge badge-sm badge-outline">
|
||||||
|
{{ stage.transportType === 'rail' ? '🚂 ЖД' : '🚛 Авто' }}
|
||||||
|
</span>
|
||||||
|
<span v-if="stage.distanceKm" class="text-sm text-base-content/70">
|
||||||
|
{{ formatDistance(stage.distanceKm) }} км
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -40,6 +45,7 @@ export type RouteStageItem = {
|
|||||||
label?: string | null
|
label?: string | null
|
||||||
distanceKm?: number | null
|
distanceKm?: number | null
|
||||||
durationSeconds?: number | null
|
durationSeconds?: number | null
|
||||||
|
transportType?: string | null
|
||||||
meta?: string[]
|
meta?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,9 +181,9 @@ const props = withDefaults(defineProps<{
|
|||||||
hasSubNav: true
|
hasSubNav: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// Map positioning based on navigation height (no search bar on catalog pages now)
|
// Map positioning - unified height for all pages with map
|
||||||
const mapTopClass = computed(() => props.hasSubNav ? 'top-32' : 'top-24')
|
const mapTopClass = 'top-32'
|
||||||
const mapHeightClass = computed(() => props.hasSubNav ? 'h-[calc(100vh-9rem)]' : 'h-[calc(100vh-7rem)]')
|
const mapHeightClass = 'h-[calc(100vh-9rem)]'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
'select': [item: MapItem]
|
'select': [item: MapItem]
|
||||||
|
|||||||
Reference in New Issue
Block a user