fix kashkool

This commit is contained in:
2026-06-29 22:43:28 +03:30
parent be17631109
commit 8b855e5ee4
150 changed files with 11974 additions and 4445 deletions
+38
View File
@@ -0,0 +1,38 @@
<template>
<div class="desktop-app-layout">
<DesktopSidebar v-if="!hideMenu" />
<main
class="desktop-app-layout__main"
:class="{ 'desktop-app-layout__main--full': hideMenu }"
>
<router-view v-slot="{ Component, route }">
<div :key="route.fullPath" class="desktop-app-layout__content">
<component :is="Component" />
</div>
</router-view>
</main>
</div>
</template>
<script lang="ts" setup>
import { onUnmounted, watch } from 'vue'
import { useAppNavigation } from '../composables/useAppNavigation'
import DesktopSidebar from './DesktopSidebar.vue'
const NO_SIDEBAR_CLASS = 'app-layout--desktop-no-sidebar'
const { hideMenu } = useAppNavigation()
watch(
hideMenu,
(hidden) => {
document.documentElement.classList.toggle(NO_SIDEBAR_CLASS, hidden)
},
{ immediate: true }
)
onUnmounted(() => {
document.documentElement.classList.remove(NO_SIDEBAR_CLASS)
})
</script>
<style lang="less" src="./desktop-layout.less"></style>
+65
View File
@@ -0,0 +1,65 @@
<template>
<button
type="button"
class="desktop-nav-item"
:class="{ 'desktop-nav-item--active': active }"
@click="$emit('click')"
>
<span class="desktop-nav-item__icon-wrap">
<img
v-if="iconSrc"
:src="iconSrc"
alt=""
class="desktop-nav-item__icon desktop-nav-item__icon--image"
/>
<BasicIcon v-else :icon="icon" size="20" class="desktop-nav-item__icon" />
<span v-if="badgeCount && badgeCount > 0" class="desktop-nav-item__badge">{{ badgeCount }}</span>
</span>
<span class="desktop-nav-item__label">{{ label }}</span>
</button>
</template>
<script lang="ts" setup>
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
defineProps<{
icon: string
iconSrc?: string
label: string
active: boolean
badgeCount?: number
}>()
defineEmits<{
click: []
}>()
</script>
<style scoped>
.desktop-nav-item__icon-wrap {
position: relative;
}
.desktop-nav-item__badge {
position: absolute;
top: -4px;
left: -4px;
min-width: 18px;
height: 18px;
padding: 0 4px;
border-radius: 999px;
background: #a72b77;
color: #fff;
font-size: 10px;
font-weight: 700;
line-height: 18px;
text-align: center;
}
.desktop-nav-item__icon--image {
width: 32px;
height: 32px;
object-fit: contain;
transform: scale(1.75);
}
</style>
+57
View File
@@ -0,0 +1,57 @@
<template>
<aside class="desktop-sidebar">
<div class="desktop-sidebar__brand">
<img :src="navLogo" alt="کشکول گلد" class="desktop-sidebar__logo" />
</div>
<nav class="desktop-sidebar__section" aria-label="منوی اصلی">
<DesktopNavItem
v-for="item in primaryItems"
:key="item.id"
:icon="item.icon"
:icon-src="item.iconSrc"
:label="item.label"
:active="isNavActive(item.routeName)"
:badge-count="item.routeName === 'cart' && cartCount ? cartCount : undefined"
@click="navigateTo(item.routeName)"
/>
</nav>
<div v-if="secondaryItems.length" class="desktop-sidebar__divider" />
<nav
v-if="secondaryItems.length"
class="desktop-sidebar__section desktop-sidebar__section--secondary"
aria-label="منوی فرعی"
>
<DesktopNavItem
v-for="item in secondaryItems"
:key="item.id"
:icon="item.icon"
:icon-src="item.iconSrc"
:label="item.label"
:active="isNavActive(item.routeName)"
@click="navigateTo(item.routeName)"
/>
</nav>
</aside>
</template>
<script lang="ts" setup>
import { computed } from 'vue'
import logoFull from '@/assets/img/logo_full_.png'
import { isToken } from '@/utils'
import { useCartStore } from '@/store/cartStore'
import { getPrimaryNavItems, getSecondaryNavItems } from '../config/navigation'
import { useAppNavigation } from '../composables/useAppNavigation'
import DesktopNavItem from './DesktopNavItem.vue'
const cartStore = useCartStore()
const authenticated = computed(() => isToken())
const navLogo = logoFull
const primaryItems = computed(() => getPrimaryNavItems(authenticated.value))
const secondaryItems = computed(() => getSecondaryNavItems(authenticated.value))
const cartCount = computed(() => cartStore.itemCount || 0)
const { isNavActive, navigateTo } = useAppNavigation()
</script>
+151
View File
@@ -0,0 +1,151 @@
.desktop-app-layout {
display: flex;
flex-direction: row;
height: 100vh;
max-height: 100vh;
width: 100%;
max-width: 100vw;
background: @prefixCls-background-color;
overflow: hidden;
}
.desktop-app-layout__main {
flex: 1;
min-width: 0;
min-height: 0;
height: 100%;
max-height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
margin-right: var(--app-desktop-sidebar-width, 260px);
}
.desktop-app-layout__main--full {
width: 100%;
margin-right: 0;
}
.desktop-app-layout__content {
flex: 1 1 0;
min-height: 0;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
background: @prefixCls-background-color;
}
.desktop-sidebar {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: var(--app-desktop-sidebar-width, 260px);
height: 100vh;
display: flex;
flex-direction: column;
background: #fff;
z-index: 100;
padding: 20px 12px 16px;
box-sizing: border-box;
border-left: 1px solid rgba(0, 0, 0, 0.06);
overflow: hidden;
overscroll-behavior: contain;
}
.desktop-sidebar__brand {
display: flex;
align-items: center;
justify-content: center;
padding: 8px 12px 20px;
margin-bottom: 4px;
}
.desktop-sidebar__logo {
max-width: 140px;
max-height: 56px;
width: auto;
height: auto;
object-fit: contain;
}
.desktop-sidebar__section {
display: flex;
flex-direction: column;
gap: 4px;
}
.desktop-sidebar__section--secondary {
margin-top: auto;
flex: 1;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
}
.desktop-sidebar__divider {
height: 1px;
background: rgba(0, 0, 0, 0.08);
margin: 12px 8px;
}
.desktop-nav-item {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 10px 12px;
border: none;
border-radius: 10px;
background: transparent;
cursor: pointer;
text-align: right;
font-family: inherit;
font-size: 14px;
font-weight: 600;
color: #6b7280;
transition: background 0.15s ease, color 0.15s ease;
&:hover {
background: rgba(167, 43, 119, 0.06);
color: @primary-color;
}
&--active {
background: rgba(167, 43, 119, 0.1);
color: @primary-color;
.desktop-nav-item__icon {
color: @primary-color;
}
}
}
.desktop-nav-item__icon {
flex-shrink: 0;
color: #9ca3af;
}
.desktop-nav-item__icon-wrap {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 12px;
background: transparent;
flex-shrink: 0;
}
.desktop-nav-item__label {
flex: 1;
line-height: 1.3;
}
.desktop-sidebar__section--secondary .desktop-nav-item {
font-size: 13px;
font-weight: 500;
padding: 8px 12px;
}
@@ -0,0 +1,255 @@
/* Shared desktop layouts for inner pages */
.dinner {
min-height: 100%;
background: #f6f7f9;
color: #111827;
}
.dinner__container {
max-width: 1180px;
margin: 0 auto;
padding: 28px 36px 40px;
box-sizing: border-box;
}
.dinner-surface {
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.06);
border-radius: 16px;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
/* Cart */
.dcart-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
gap: 20px;
align-items: start;
}
.dcart-items {
display: flex;
flex-direction: column;
gap: 12px;
}
.dcart-item {
display: flex;
gap: 16px;
padding: 16px;
border-radius: 14px;
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.06);
&__image {
width: 88px;
height: 88px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
background: #f9fafb;
border-radius: 12px;
padding: 8px;
}
&__main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 8px;
}
&__title {
font-size: 14px;
font-weight: 600;
color: #111827;
line-height: 1.5;
}
&__meta {
font-size: 12px;
color: #6b7280;
}
&__footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
&__price {
font-size: 15px;
font-weight: 700;
color: @App-primary-color;
}
}
.dcart-summary {
position: sticky;
top: 88px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 16px;
&__title {
font-size: 16px;
font-weight: 700;
margin: 0;
}
&__row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
font-size: 14px;
}
&__total {
font-size: 20px;
font-weight: 700;
color: @App-primary-color;
}
}
/* Product detail */
.dproduct-grid {
display: grid;
grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
gap: 24px;
align-items: start;
}
.dproduct-gallery {
padding: 20px;
display: flex;
align-items: center;
justify-content: center;
min-height: 280px;
background: #f9fafb;
border-radius: 16px;
}
.dproduct-info {
display: flex;
flex-direction: column;
gap: 16px;
}
.dproduct-info__price-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
}
.dproduct-info__price {
font-size: 22px;
font-weight: 700;
color: @App-primary-color;
}
.dproduct-info__desc {
padding: 20px;
font-size: 14px;
line-height: 1.8;
color: #4b5563;
white-space: pre-line;
}
/* Simple form pages (gift card, etc.) */
.dform-page {
max-width: 560px;
}
.dform-card {
padding: 24px;
}
/* Earn money */
.dearn-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
margin: 16px 0;
}
.dearn-stat {
padding: 16px;
border-radius: 12px;
text-align: center;
&--blue {
background: #dbeafe;
color: #2563eb;
}
&--yellow {
background: #fef9c3;
color: #ca8a04;
}
&__value {
font-size: 18px;
font-weight: 700;
}
&__label {
font-size: 12px;
margin-top: 6px;
}
}
.dearn-list {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: 16px;
}
.dearn-list-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 14px 16px;
border-radius: 12px;
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.06);
}
/* Physical receive */
.dphysical-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.dphysical-add {
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 14px;
border: 1px dashed rgba(15, 23, 42, 0.15);
border-radius: 12px;
background: #fff;
font-family: inherit;
font-size: 14px;
font-weight: 600;
color: #374151;
cursor: pointer;
&:hover {
background: #f9fafb;
}
}
@@ -0,0 +1,165 @@
html.app-layout--desktop {
.dpage {
max-width: 1180px;
margin: 0 auto;
padding: 28px 36px 48px;
box-sizing: border-box;
}
.dpage-topbar {
display: flex;
align-items: flex-start;
gap: 16px;
margin-bottom: 24px;
padding-bottom: 24px;
border-bottom: 1px solid rgba(15, 23, 42, 0.06);
&--sticky {
position: sticky;
top: 0;
z-index: 30;
margin: -4px 0 20px;
padding: 12px 0 20px;
background: #f6f7f9;
}
&__back {
display: inline-flex;
align-items: center;
gap: 8px;
border: none;
background: transparent;
color: #6b7280;
font-size: 13px;
font-weight: 500;
font-family: inherit;
cursor: pointer;
padding: 8px 0;
flex-shrink: 0;
&:hover {
color: #111827;
}
}
&__meta {
flex: 1;
min-width: 0;
}
&__eyebrow {
font-size: 12px;
font-weight: 500;
color: #9ca3af;
margin: 0 0 4px;
}
&__title {
font-size: 26px;
font-weight: 700;
letter-spacing: -0.03em;
color: #111827;
line-height: 1.2;
margin: 0;
}
&__subtitle {
font-size: 14px;
color: #6b7280;
margin: 6px 0 0;
line-height: 1.5;
}
}
/* Hide mobile fixed headers on desktop inner pages */
.fund-info-page-root,
.cart-page-root,
.gift-card-page-root,
.earn-money-page-root,
.physical-receive-page-root,
.product-detail-page-root,
.dinner-page,
.cart-page,
.gift-card-page,
.earn-money-page,
.physical-receive-page,
.product-detail-page,
.about-page-root,
.rules-page-root {
> .wrap-fix,
> div > .wrap-fix,
.transaction-list {
display: none !important;
}
}
.products-page .grid-cols-2 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media screen and (min-width: 1100px) {
.products-page .grid-cols-2 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
.dpage-surface {
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.06);
border-radius: 16px;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dhome-topbar {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 24px;
margin-bottom: 28px;
padding-bottom: 24px;
border-bottom: 1px solid rgba(15, 23, 42, 0.06);
&__eyebrow {
font-size: 12px;
font-weight: 500;
color: #9ca3af;
margin: 0 0 4px;
}
&__title {
font-size: 26px;
font-weight: 600;
letter-spacing: -0.03em;
color: #111827;
line-height: 1.2;
margin: 0;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
}
}
.dhome-btn-ghost {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
border: none;
border-radius: 8px;
background: transparent;
font-family: inherit;
font-size: 13px;
font-weight: 500;
color: #6b7280;
cursor: pointer;
transition: color 0.15s ease, background 0.15s ease;
&:hover {
color: #111827;
background: rgba(15, 23, 42, 0.04);
}
}
}