From f9778966479f62ad8169fd631fdcbc218f76c018 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Fri, 3 Apr 2026 12:17:05 +0700 Subject: [PATCH] feat(catalog): unify home with catalog and add clear qty controls --- .../catalog/CatalogConfigurator.vue | 490 ++++++++++++++++++ app/components/ui/AppHeader.vue | 5 +- app/middleware/auth.global.ts | 2 +- app/pages/index.vue | 159 +----- app/pages/login.vue | 2 +- app/pages/products.vue | 443 +--------------- 6 files changed, 500 insertions(+), 601 deletions(-) create mode 100644 app/components/catalog/CatalogConfigurator.vue diff --git a/app/components/catalog/CatalogConfigurator.vue b/app/components/catalog/CatalogConfigurator.vue new file mode 100644 index 0000000..2fb4406 --- /dev/null +++ b/app/components/catalog/CatalogConfigurator.vue @@ -0,0 +1,490 @@ + + + diff --git a/app/components/ui/AppHeader.vue b/app/components/ui/AppHeader.vue index 7bb5f5d..00693bb 100644 --- a/app/components/ui/AppHeader.vue +++ b/app/components/ui/AppHeader.vue @@ -8,7 +8,7 @@ const route = useRoute(); const { totalItems } = useClientCart(); const centerCapsule: NavItem[] = [ - { to: '/products', label: 'Каталог' }, + { to: '/', label: 'Каталог' }, { to: '/orders', label: 'Мои заказы' }, ]; @@ -18,6 +18,9 @@ const rightCapsule: NavItem[] = [ ]; function isActive(path: string) { + if (path === '/') { + return route.path === '/' || route.path.startsWith('/products'); + } if (path === '/orders') { return route.path === '/orders' || route.path.startsWith('/orders/'); } diff --git a/app/middleware/auth.global.ts b/app/middleware/auth.global.ts index 7ee9f25..6c18fd2 100644 --- a/app/middleware/auth.global.ts +++ b/app/middleware/auth.global.ts @@ -9,6 +9,6 @@ export default defineNuxtRouteMiddleware((to) => { } if (authToken.value && isLoginPage) { - return navigateTo('/products'); + return navigateTo('/'); } }); diff --git a/app/pages/index.vue b/app/pages/index.vue index e8bcdbd..2fca92b 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,162 +1,7 @@ diff --git a/app/pages/login.vue b/app/pages/login.vue index ea9be48..2f4d8b2 100644 --- a/app/pages/login.vue +++ b/app/pages/login.vue @@ -53,7 +53,7 @@ async function navigateAfterLogin(user: { company?: { id: string } | null }) { return; } - await navigateTo('/products'); + await navigateTo('/'); } function clearAutoRequestTimer() { diff --git a/app/pages/products.vue b/app/pages/products.vue index 224ba22..2fca92b 100644 --- a/app/pages/products.vue +++ b/app/pages/products.vue @@ -1,446 +1,7 @@