diff --git a/app/app.vue b/app/app.vue index bc6e7eb..902c1f7 100644 --- a/app/app.vue +++ b/app/app.vue @@ -44,12 +44,17 @@ const managerPageTabs = computed(() => { ]; } - if (route.path === '/bonus-system') { + if (route.path === '/bonus-system' || route.path.startsWith('/bonus-system/')) { return [ { key: 'balances', label: 'Балансы', - active: route.query.tab !== 'withdrawals' && route.query.tab !== 'products' && route.query.tab !== 'manager', + active: route.path !== '/bonus-system/withdrawals' + && !route.path.startsWith('/bonus-system/withdrawals/') + && route.query.tab !== 'withdrawals' + && route.query.tab !== 'rewards' + && route.query.tab !== 'products' + && route.query.tab !== 'manager', to: { path: '/bonus-system', query: { @@ -61,7 +66,9 @@ const managerPageTabs = computed(() => { { key: 'withdrawals', label: 'Заявки на выплату', - active: route.query.tab === 'withdrawals', + active: route.path === '/bonus-system/withdrawals' + || route.path.startsWith('/bonus-system/withdrawals/') + || route.query.tab === 'withdrawals', to: { path: '/bonus-system', query: { @@ -71,20 +78,34 @@ const managerPageTabs = computed(() => { }, }, { - key: 'products', - label: 'Товары', - active: route.query.tab === 'products' || route.query.tab === 'manager', + key: 'rewards', + label: 'Вознаграждения', + active: route.query.tab === 'rewards' || route.query.tab === 'products' || route.query.tab === 'manager', to: { path: '/bonus-system', query: { ...route.query, - tab: 'products', + tab: 'rewards', }, }, }, ]; } + if (route.path === '/messages') { + return [ + { + key: 'messages', + label: 'Сообщения', + active: true, + to: { + path: '/messages', + query: {}, + }, + }, + ]; + } + return []; }); diff --git a/app/pages/bonus-system/index.vue b/app/pages/bonus-system/index.vue index a08d6b9..8ca7735 100644 --- a/app/pages/bonus-system/index.vue +++ b/app/pages/bonus-system/index.vue @@ -29,7 +29,6 @@ type ProductCard = { }; const route = useRoute(); -const router = useRouter(); const search = ref(''); const balancesQuery = useQuery(ManagerBonusBalancesDocument); const referralLinksQuery = useQuery(ManagerReferralLinksDocument); @@ -222,24 +221,6 @@ const WITHDRAWAL_DATE_FORMATTER = new Intl.DateTimeFormat('ru-RU', { minute: '2-digit', }); -const bonusTabs = computed>(() => [ - { id: 'balances', label: 'Балансы' }, - { id: 'withdrawals', label: 'Выплаты' }, - { id: 'rewards', label: 'Вознаграждения' }, -]); - -function setActiveTab(tab: 'balances' | 'withdrawals' | 'rewards') { - const query = { ...route.query }; - - if (tab === 'balances') { - delete query.tab; - } else { - query.tab = tab; - } - - void router.replace({ query }); -} - function userInitials(fullName: string) { const parts = fullName .trim() @@ -323,23 +304,6 @@ function productVisualLabel(product: ProductCard) { : 'Название или номинал'" /> -
-
- -
-
-