feat(catalog): two-level offers navigation + map auto-centering
All checks were successful
Build Docker Image / build (push) Successful in 3m45s

- Add fitBounds to CatalogMap for auto-centering on all points
- Add productUuid filter to useCatalogOffers composable
- Create useCatalogProducts composable for products list
- Update offers/index.vue: show products first, then offers by product
- Update offers/map.vue: same two-level navigation
- Add translations for new UI elements

Navigation flow:
/catalog/offers → product selection → offers for that product

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ruslan Bakiev
2026-01-07 15:09:14 +07:00
parent ee2374f92a
commit ce30652252
7 changed files with 241 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ const PAGE_SIZE = 24
const items = ref<any[]>([])
const total = ref(0)
const selectedFilter = ref('all')
const productUuid = ref<string | null>(null)
const isLoading = ref(false)
const isLoadingMore = ref(false)
const isInitialized = ref(false)
@@ -39,7 +40,12 @@ export function useCatalogOffers() {
const status = selectedFilter.value === 'active' ? 'active' : null
const data = await execute(
GetOffersDocument,
{ limit: PAGE_SIZE, offset, status },
{
limit: PAGE_SIZE,
offset,
status,
productUuid: productUuid.value
},
'public',
'exchange'
)
@@ -52,6 +58,14 @@ export function useCatalogOffers() {
}
}
const setProductUuid = (uuid: string | null) => {
if (productUuid.value !== uuid) {
productUuid.value = uuid
isInitialized.value = false
items.value = []
}
}
const loadMore = async () => {
if (isLoadingMore.value) return
isLoadingMore.value = true
@@ -80,6 +94,7 @@ export function useCatalogOffers() {
items,
total,
selectedFilter,
productUuid,
filters,
isLoading,
isLoadingMore,
@@ -87,6 +102,7 @@ export function useCatalogOffers() {
canLoadMore,
fetchPage,
loadMore,
init
init,
setProductUuid
}
}