feat(catalog): two-level offers navigation + map auto-centering
All checks were successful
Build Docker Image / build (push) Successful in 3m45s
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user