1405/04/27

-responive bugs
This commit is contained in:
2026-07-18 15:46:38 +03:30
parent c2a355f2de
commit 37d86ba36e
39 changed files with 1910 additions and 404 deletions
+16 -2
View File
@@ -16,6 +16,13 @@ export const GUEST_PRIMARY_NAV: AppNavItem[] = [
{ id: 'login', routeName: 'login', label: 'ورود', icon: 'vuesax-linear:login' },
]
export const RECOVERY_SITES_NAV_ITEM: AppNavItem = {
id: 'recoverySites',
routeName: 'recoverySites',
label: 'سایت‌های ری‌گیری',
icon: 'vuesax-linear:global',
}
/** منوی FAB موبایل + بخش فرعی سایدبار دسکتاپ — کاربر لاگین‌شده */
export const AUTH_SECONDARY_NAV: AppNavItem[] = [
{ id: 'notifyTrigger', routeName: 'notifyTrigger', label: 'هشدار قیمت', icon: 'vuesax-linear:bill' },
@@ -34,6 +41,13 @@ export function getPrimaryNavItems(isAuthenticated: boolean): AppNavItem[] {
return isAuthenticated ? AUTH_PRIMARY_NAV : GUEST_PRIMARY_NAV
}
export function getSecondaryNavItems(isAuthenticated: boolean): AppNavItem[] {
return isAuthenticated ? AUTH_SECONDARY_NAV : []
export function getSecondaryNavItems(
isAuthenticated: boolean,
options?: { includeRecoverySites?: boolean },
): AppNavItem[] {
if (!isAuthenticated) return []
if (options?.includeRecoverySites) {
return [...AUTH_SECONDARY_NAV, RECOVERY_SITES_NAV_ITEM]
}
return AUTH_SECONDARY_NAV
}
+9 -1
View File
@@ -42,6 +42,7 @@ import { computed } from 'vue'
import logoFull from '@/assets/img/logo_full_.png'
import { isToken } from '@/utils'
import { useCartStore } from '@/store/cartStore'
import { useTrackingSystemsFeature } from '@/composables/useTrackingSystemsFeature'
import { getPrimaryNavItems, getSecondaryNavItems } from '../config/navigation'
import { useAppNavigation } from '../composables/useAppNavigation'
import DesktopNavItem from './DesktopNavItem.vue'
@@ -49,8 +50,15 @@ import DesktopNavItem from './DesktopNavItem.vue'
const cartStore = useCartStore()
const authenticated = computed(() => isToken())
const navLogo = logoFull
const { trackingSystemsEnabled } = useTrackingSystemsFeature()
const primaryItems = computed(() => getPrimaryNavItems(authenticated.value))
const secondaryItems = computed(() => getSecondaryNavItems(authenticated.value))
/** «لیست دریافتی‌ها» فقط در موبایل نمایش داده می‌شود */
const DESKTOP_HIDDEN_NAV_IDS = ['list']
const secondaryItems = computed(() =>
getSecondaryNavItems(authenticated.value, {
includeRecoverySites: trackingSystemsEnabled.value,
}).filter((item) => !DESKTOP_HIDDEN_NAV_IDS.includes(item.id)),
)
const cartCount = computed(() => cartStore.itemCount || 0)
const { isNavActive, navigateTo } = useAppNavigation()
+13
View File
@@ -87,6 +87,17 @@
<div>درباره ما</div>
</div>
</BasicButton>
<BasicButton
v-if="authenticated && trackingSystemsEnabled"
icon-size="16"
class="!font-bold w-15rem"
@click="go('recoverySites')"
>
<div class="flex gap-2 items-center">
<BasicIcon icon="vuesax-linear:global" size="16" class="absolute right-2" />
<div>سایت‌های ری‌گیری</div>
</div>
</BasicButton>
<BasicButton
v-if="authenticated"
icon-size="16"
@@ -108,6 +119,7 @@
import { computed } from 'vue'
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import { useTrackingSystemsFeature } from '@/composables/useTrackingSystemsFeature'
import { isToken } from '@/utils'
defineProps<{
@@ -120,6 +132,7 @@ const emit = defineEmits<{
}>()
const authenticated = computed(() => isToken())
const { trackingSystemsEnabled } = useTrackingSystemsFeature()
function go(routeName: string) {
emit('navigate', routeName)