diff --git a/app/components/GoodsContent.vue b/app/components/GoodsContent.vue index 244e25b..7abeeba 100644 --- a/app/components/GoodsContent.vue +++ b/app/components/GoodsContent.vue @@ -46,16 +46,16 @@ const selectProduct = (product: any) => { searchStore.setProduct(product.name) searchStore.setProductUuid(product.uuid) const locationUuid = searchStore.searchForm.locationUuid + const quantity = searchStore.searchForm.quantity + + const query: Record = {} + if (quantity) query.quantity = String(quantity) + if (locationUuid) { + // Both product and hub selected -> show offers navigateTo({ - path: '/request', - query: { - productUuid: product.uuid, - product: product.name, - locationUuid, - location: searchStore.searchForm.location, - quantity: searchStore.searchForm.quantity || undefined - } + path: `/catalog/offers/${product.uuid}/${locationUuid}`, + query }) return } diff --git a/app/components/search/GlobalSearchBar.vue b/app/components/search/GlobalSearchBar.vue index 0a3835b..fd4979b 100644 --- a/app/components/search/GlobalSearchBar.vue +++ b/app/components/search/GlobalSearchBar.vue @@ -99,30 +99,33 @@ const canSearch = computed(() => { return !!productUuid.value }) -// Search handler - navigate to /request +// Search handler - navigate to catalog offers flow const handleSearch = () => { if (!canSearch.value) return // Sync quantity to store syncQuantityToStore() - const query: Record = { - productUuid: productUuid.value || undefined, - product: productDisplay.value || undefined, - quantity: quantity.value ? String(quantity.value) : undefined, - locationUuid: locationUuid.value || undefined, - location: locationDisplay.value || undefined + // Build query params + const query: Record = {} + if (quantity.value) { + query.quantity = String(quantity.value) } - // Remove undefined/empty values - Object.keys(query).forEach(key => { - if (!query[key]) delete query[key] - }) - - router.push({ - path: localePath('/request'), - query: query as Record - }) + // Navigate to offers flow + if (productUuid.value && locationUuid.value) { + // Both product and hub selected -> show offers + router.push({ + path: localePath(`/catalog/offers/${productUuid.value}/${locationUuid.value}`), + query + }) + } else if (productUuid.value) { + // Only product selected -> select hub + router.push({ + path: localePath(`/catalog/offers/${productUuid.value}`), + query + }) + } emit('search', { productUuid: productUuid.value, diff --git a/app/pages/catalog/offers/[productId]/[hubId].vue b/app/pages/catalog/offers/[productId]/[hubId].vue index 0554cc5..5db1e1a 100644 --- a/app/pages/catalog/offers/[productId]/[hubId].vue +++ b/app/pages/catalog/offers/[productId]/[hubId].vue @@ -73,6 +73,8 @@ :stages="item.stages" :start-name="item.name" :end-name="hub?.name" + :kyc-profile-uuid="getOfferData(item.uuid)?.kycProfileUuid" + @select="navigateTo(localePath(`/catalog/offers/${item.uuid}`))" /> @@ -89,7 +91,7 @@