diff --git a/app/pages/catalog/hubs/[id]/[productId].vue b/app/pages/catalog/hubs/[id]/[productId].vue index e7dbdc4..47391a2 100644 --- a/app/pages/catalog/hubs/[id]/[productId].vue +++ b/app/pages/catalog/hubs/[id]/[productId].vue @@ -34,16 +34,16 @@ point-color="#10b981" v-model:selected-id="selectedSourceUuid" > + + + + - - - {{ product.name }} @@ -117,6 +117,38 @@ const offersData = ref>(new Map()) const hubId = computed(() => route.params.id as string) const productId = computed(() => route.params.productId as string) +// Navigation filters for search bar badges +const navigationFilters = computed(() => { + const filters: Array<{ id: string; label: string; key: string }> = [] + + if (hub.value?.name) { + filters.push({ + id: 'hub', + key: 'Хаб', + label: hub.value.name + }) + } + + if (product.value?.name) { + filters.push({ + id: 'product', + key: 'Товар', + label: product.value.name + }) + } + + return filters +}) + +// Handle removing navigation filter (navigate back) +const handleRemoveFilter = (filterId: string) => { + if (filterId === 'product') { + navigateTo(localePath(`/catalog/hubs/${hubId.value}`)) + } else if (filterId === 'hub') { + navigateTo(localePath('/catalog/hubs')) + } +} + // Mock price history generator (seeded by uuid for consistent results) const getMockPriceHistory = (uuid: string): number[] => { const seed = uuid.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0) diff --git a/app/pages/catalog/hubs/[id]/index.vue b/app/pages/catalog/hubs/[id]/index.vue index 7091475..74b2e3d 100644 --- a/app/pages/catalog/hubs/[id]/index.vue +++ b/app/pages/catalog/hubs/[id]/index.vue @@ -11,8 +11,10 @@ @@ -33,9 +35,6 @@ - - - {{ hub?.name }} @@ -78,6 +77,28 @@ const products = ref>([]) const hubId = computed(() => route.params.id as string) +// Navigation filters for search bar badges +const navigationFilters = computed(() => { + const filters: Array<{ id: string; label: string; key: string }> = [] + + if (hub.value?.name) { + filters.push({ + id: 'hub', + key: 'Хаб', + label: hub.value.name + }) + } + + return filters +}) + +// Handle removing navigation filter (navigate back) +const handleRemoveFilter = (filterId: string) => { + if (filterId === 'hub') { + navigateTo(localePath('/catalog/hubs')) + } +} + // Search const searchQuery = ref('') diff --git a/app/pages/catalog/offers/[productId]/[hubId].vue b/app/pages/catalog/offers/[productId]/[hubId].vue index 039f1c3..a092251 100644 --- a/app/pages/catalog/offers/[productId]/[hubId].vue +++ b/app/pages/catalog/offers/[productId]/[hubId].vue @@ -34,16 +34,16 @@ point-color="#10b981" v-model:selected-id="selectedSourceUuid" > + + + + - - - {{ product.name }} @@ -117,6 +117,38 @@ const offersData = ref>(new Map()) const productId = computed(() => route.params.productId as string) const hubId = computed(() => route.params.hubId as string) +// Navigation filters for search bar badges +const navigationFilters = computed(() => { + const filters: Array<{ id: string; label: string; key: string }> = [] + + if (product.value?.name) { + filters.push({ + id: 'product', + key: 'Товар', + label: product.value.name + }) + } + + if (hub.value?.name) { + filters.push({ + id: 'hub', + key: 'Хаб', + label: hub.value.name + }) + } + + return filters +}) + +// Handle removing navigation filter (navigate back) +const handleRemoveFilter = (filterId: string) => { + if (filterId === 'hub') { + navigateTo(localePath(`/catalog/offers/${productId.value}`)) + } else if (filterId === 'product') { + navigateTo(localePath('/catalog/offers')) + } +} + // Mock price history generator (seeded by uuid for consistent results) const getMockPriceHistory = (uuid: string): number[] => { const seed = uuid.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0) diff --git a/app/pages/catalog/offers/[productId]/index.vue b/app/pages/catalog/offers/[productId]/index.vue index c99177c..8a4bff6 100644 --- a/app/pages/catalog/offers/[productId]/index.vue +++ b/app/pages/catalog/offers/[productId]/index.vue @@ -15,8 +15,10 @@ @@ -37,9 +39,6 @@ - - - {{ product?.name }} @@ -96,6 +95,28 @@ const hoveredHubId = ref() const productId = computed(() => route.params.productId as string) +// Navigation filters for search bar badges +const navigationFilters = computed(() => { + const filters: Array<{ id: string; label: string; key: string }> = [] + + if (product.value?.name) { + filters.push({ + id: 'product', + key: 'Товар', + label: product.value.name + }) + } + + return filters +}) + +// Handle removing navigation filter (navigate back) +const handleRemoveFilter = (filterId: string) => { + if (filterId === 'product') { + navigateTo(localePath('/catalog/offers')) + } +} + // Search const searchQuery = ref('')