Simplify catalog root pages - show only 'Выберите...' hint
All checks were successful
Build Docker Image / build (push) Successful in 4m9s

This commit is contained in:
Ruslan Bakiev
2026-01-19 12:09:18 +07:00
parent da29a354ff
commit 42c8688561
3 changed files with 9 additions and 33 deletions

View File

@@ -54,10 +54,11 @@
</CatalogSearchBar>
</template>
<template #header>
<Text v-if="!isLoading" tone="muted">Выберите хаб</Text>
</template>
<template #card="{ item }">
<template v-for="country in getCountryForHub(item)" :key="country.name">
<Text v-if="isFirstInCountry(item)" weight="semibold" class="mb-2">{{ country.name }}</Text>
</template>
<HubCard :hub="item" />
</template>
@@ -98,7 +99,6 @@ const {
countryFilters,
isLoading,
isLoadingMore,
itemsByCountry,
canLoadMore,
loadMore,
init
@@ -175,19 +175,6 @@ const onSelectHub = (hub: any) => {
selectedHubId.value = hub.uuid
}
// Helper to get country for hub
const getCountryForHub = (hub: any) => {
return itemsByCountry.value.filter(c => c.hubs.some(h => h.uuid === hub.uuid))
}
// Check if this hub is first in its country group
const isFirstInCountry = (hub: any) => {
for (const country of itemsByCountry.value) {
if (country.hubs[0]?.uuid === hub.uuid) return true
}
return false
}
await init()
useHead(() => ({

View File

@@ -19,22 +19,7 @@
</template>
<template #header>
<!-- Empty -->
<Card v-if="!isLoading && products.length === 0" padding="lg">
<Stack align="center" gap="4">
<IconCircle tone="primary">
<Icon name="lucide:package" size="24" />
</IconCircle>
<Heading :level="2">{{ t('catalogProducts.empty.title') }}</Heading>
<Text tone="muted">{{ t('catalogProducts.empty.subtitle') }}</Text>
</Stack>
</Card>
<!-- Header -->
<div v-else>
<Heading :level="1">{{ t('catalogProducts.header.title') }}</Heading>
<Text tone="muted" size="sm">{{ t('catalogProducts.header.subtitle', { count: products.length }) }}</Text>
</div>
<Text v-if="!isLoading" tone="muted">Выберите товар</Text>
</template>
<template #card="{ item }">

View File

@@ -22,6 +22,10 @@
/>
</template>
<template #header>
<Text v-if="!isLoading" tone="muted">Выберите поставщика</Text>
</template>
<template #card="{ item }">
<SupplierCard :supplier="item" />
</template>