.
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
import milano from '@/assets/images/catalogs/milano.jpg'
|
||||
import najran from '@/assets/images/catalogs/najran.jpg'
|
||||
import payizeh from '@/assets/images/catalogs/payizeh.jpg'
|
||||
import classic from '@/assets/images/catalogs/classic.jpg'
|
||||
import tarhdar from '@/assets/images/catalogs/tarhdar.jpg'
|
||||
import fastoni from '@/assets/images/catalogs/fastoni.jpg'
|
||||
import type { CatalogGalleryCard } from '@/utils/catalogGallery'
|
||||
import type { CatalogProductCard } from '@/types/crm'
|
||||
|
||||
export const CALITE_COVERS = [milano, najran, payizeh, classic, tarhdar, fastoni]
|
||||
|
||||
export const MOCK_CALITE_CARDS: CatalogGalleryCard[] = [
|
||||
{
|
||||
id: 'demo-milano',
|
||||
companyId: '',
|
||||
name: 'میلانو',
|
||||
title: 'کالیته میلانو',
|
||||
latinName: 'Milano',
|
||||
subtitle: 'پارچههای کتوشلواری',
|
||||
imageUrl: milano,
|
||||
patternCount: 16,
|
||||
badge: 'new',
|
||||
season: 'all_season',
|
||||
isNew: true,
|
||||
isPopular: false,
|
||||
},
|
||||
{
|
||||
id: 'demo-najran',
|
||||
companyId: '',
|
||||
name: 'نجران',
|
||||
title: 'کالیته نجران',
|
||||
latinName: 'Najran',
|
||||
subtitle: 'پارچههای پیراهنی',
|
||||
imageUrl: najran,
|
||||
patternCount: 14,
|
||||
season: 'all_season',
|
||||
isNew: false,
|
||||
isPopular: false,
|
||||
},
|
||||
{
|
||||
id: 'demo-payizeh',
|
||||
companyId: '',
|
||||
name: 'پاییزه',
|
||||
title: 'کالیته پاییزه',
|
||||
latinName: 'Payizeh',
|
||||
subtitle: 'پارچههای شلواری',
|
||||
imageUrl: payizeh,
|
||||
patternCount: 18,
|
||||
season: 'all_season',
|
||||
isNew: false,
|
||||
isPopular: false,
|
||||
},
|
||||
{
|
||||
id: 'demo-classic',
|
||||
companyId: '',
|
||||
name: 'کلاسیک',
|
||||
title: 'کالیته کلاسیک',
|
||||
latinName: 'Classic',
|
||||
subtitle: 'پارچههای کتوشلواری',
|
||||
imageUrl: classic,
|
||||
patternCount: 16,
|
||||
season: 'all_season',
|
||||
isNew: false,
|
||||
isPopular: false,
|
||||
},
|
||||
{
|
||||
id: 'demo-tarhdar',
|
||||
companyId: '',
|
||||
name: 'طرحدار',
|
||||
title: 'کالیته طرحدار',
|
||||
latinName: 'Tarhdar',
|
||||
subtitle: 'پارچههای مجلسی',
|
||||
imageUrl: tarhdar,
|
||||
patternCount: 20,
|
||||
badge: 'popular',
|
||||
season: 'winter',
|
||||
isNew: false,
|
||||
isPopular: true,
|
||||
},
|
||||
{
|
||||
id: 'demo-fastoni',
|
||||
companyId: '',
|
||||
name: 'فاستونی',
|
||||
title: 'کالیته فاستونی',
|
||||
latinName: 'Fastoni',
|
||||
subtitle: 'پارچههای مناسب چهار فصل',
|
||||
imageUrl: fastoni,
|
||||
patternCount: 20,
|
||||
season: 'all_season',
|
||||
isNew: false,
|
||||
isPopular: false,
|
||||
},
|
||||
]
|
||||
|
||||
export function coverForIndex(index: number) {
|
||||
return CALITE_COVERS[index % CALITE_COVERS.length]
|
||||
}
|
||||
|
||||
export function seasonLine(card: CatalogGalleryCard) {
|
||||
if (card.id === 'demo-classic') return 'مناسب چهار فصل'
|
||||
if (card.season === 'winter') return 'مناسب زمستان'
|
||||
if (card.season === 'summer') return 'مناسب تابستان'
|
||||
return 'مناسب چهار فصل'
|
||||
}
|
||||
|
||||
export function findMockCalite(id: string) {
|
||||
return MOCK_CALITE_CARDS.find((card) => card.id === id)
|
||||
}
|
||||
|
||||
export function demoProductsFor(card: CatalogGalleryCard): CatalogProductCard[] {
|
||||
const names = [`${card.name} ۱۰۱`, `${card.name} ۱۰۲`, `${card.name} ۱۰۳`, `${card.name} ۱۰۴`]
|
||||
const kinds = ['plain', 'melange', 'patterned', 'plain'] as const
|
||||
return names.map((name, index) => ({
|
||||
id: `${card.id}-${index + 1}`,
|
||||
name,
|
||||
code: `${card.latinName || card.name}-${101 + index}`,
|
||||
categoryId: card.subtitle.includes('پیراهن')
|
||||
? 'shirt'
|
||||
: card.subtitle.includes('شلوار')
|
||||
? 'trousers'
|
||||
: 'suit',
|
||||
season: card.season,
|
||||
widthCm: 150,
|
||||
composition: 'پشم و پلیاستر',
|
||||
weaveType: kinds[index] === 'plain' ? 'ساده' : kinds[index] === 'melange' ? 'ملانژ' : 'طرحدار',
|
||||
colors: ['#111827', '#6b7280', '#d6d3d1', '#1e3a5f'].slice(0, 3 + (index % 2)),
|
||||
tags: [kinds[index] === 'patterned' ? 'طرحدار' : kinds[index] === 'melange' ? 'ملانژ' : 'ساده'],
|
||||
isNew: index === 0,
|
||||
imageUrl: card.imageUrl,
|
||||
subtitle: card.subtitle,
|
||||
rollMeters: 50,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user