integration new apis
This commit is contained in:
@@ -154,7 +154,8 @@
|
|||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"options": {
|
"options": {
|
||||||
"allowedHosts": ["novo.market", "dexarmarket.ru", "localhost"]
|
"allowedHosts": ["novo.market", "dexarmarket.ru", "localhost"],
|
||||||
|
"proxyConfig": "proxy.conf.json"
|
||||||
},
|
},
|
||||||
"builder": "@angular/build:dev-server",
|
"builder": "@angular/build:dev-server",
|
||||||
"configurations": {
|
"configurations": {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<div class="item-card">
|
<div class="item-card">
|
||||||
<a [routerLink]="['/item', product.itemID] | langRoute" class="item-link">
|
<a [routerLink]="['/item', product.itemID] | langRoute" class="item-link">
|
||||||
<div class="item-image">
|
<div class="item-image">
|
||||||
<img [src]="getItemImage(product)" [alt]="product.name" loading="lazy" />
|
<img [src]="getItemImage(product)" [alt]="itemName(product)" loading="lazy" />
|
||||||
@if (product.discount > 0) {
|
@if (product.discount > 0) {
|
||||||
<span class="discount-badge">-{{ product.discount }}%</span>
|
<span class="discount-badge">-{{ product.discount }}%</span>
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-details">
|
<div class="item-details">
|
||||||
<h3 class="item-name">{{ product.name }}</h3>
|
<h3 class="item-name">{{ itemName(product) }}</h3>
|
||||||
|
|
||||||
@if (product.rating) {
|
@if (product.rating) {
|
||||||
<div class="item-rating">
|
<div class="item-rating">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit, signal, ChangeDetectionStrategy } from '@angular/core';
|
import { Component, OnInit, signal, ChangeDetectionStrategy, inject } from '@angular/core';
|
||||||
import { DecimalPipe } from '@angular/common';
|
import { DecimalPipe } from '@angular/common';
|
||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
import { CarouselModule } from 'primeng/carousel';
|
import { CarouselModule } from 'primeng/carousel';
|
||||||
@@ -7,7 +7,8 @@ import { TagModule } from 'primeng/tag';
|
|||||||
import { ApiService, CartService } from '../../services';
|
import { ApiService, CartService } from '../../services';
|
||||||
import { Item } from '../../models';
|
import { Item } from '../../models';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../../environments/environment';
|
||||||
import { getDiscountedPrice, getMainImage, getBadgeClass } from '../../utils/item.utils';
|
import { getDiscountedPrice, getMainImage, getBadgeClass, getTranslatedField } from '../../utils/item.utils';
|
||||||
|
import { LanguageService } from '../../services/language.service';
|
||||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||||
|
|
||||||
@@ -100,6 +101,9 @@ export class ItemsCarouselComponent implements OnInit {
|
|||||||
readonly getDiscountedPrice = getDiscountedPrice;
|
readonly getDiscountedPrice = getDiscountedPrice;
|
||||||
readonly getBadgeClass = getBadgeClass;
|
readonly getBadgeClass = getBadgeClass;
|
||||||
|
|
||||||
|
private langService = inject(LanguageService);
|
||||||
|
itemName(product: Item): string { return getTranslatedField(product, 'name', this.langService.currentLanguage()); }
|
||||||
|
|
||||||
addToCart(event: Event, item: Item): void {
|
addToCart(event: Event, item: Item): void {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|||||||
@@ -22,4 +22,25 @@
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button class="currency-button" (click)="toggleCurrency()">
|
||||||
|
<span class="currency-symbol">{{ languageService.getCurrentCurrency()?.symbol }}</span>
|
||||||
|
<span class="currency-code">{{ languageService.currentCurrency() }}</span>
|
||||||
|
<svg class="dropdown-arrow" [class.rotated]="currencyOpen" width="12" height="12" viewBox="0 0 12 12" fill="none">
|
||||||
|
<path d="M2.5 4.5L6 8L9.5 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="currency-dropdown" [class.open]="currencyOpen">
|
||||||
|
@for (cur of languageService.currencies; track cur.code) {
|
||||||
|
<button
|
||||||
|
class="currency-option"
|
||||||
|
[class.active]="languageService.currentCurrency() === cur.code"
|
||||||
|
(click)="selectCurrency(cur)">
|
||||||
|
<span class="cur-symbol">{{ cur.symbol }}</span>
|
||||||
|
<span class="cur-name">{{ cur.name }}</span>
|
||||||
|
<span class="cur-code">{{ cur.code }}</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -301,3 +301,162 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Currency selector ──
|
||||||
|
.language-selector {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
background: transparent;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #ffffff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
border-color: rgba(255, 255, 255, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-symbol {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-code {
|
||||||
|
font-size: 13px;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-arrow {
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
opacity: 0.7;
|
||||||
|
&.rotated { transform: rotate(180deg); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 8px);
|
||||||
|
right: 0;
|
||||||
|
min-width: 170px;
|
||||||
|
background: var(--card-bg, #1a1a1a);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
||||||
|
opacity: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
transform: translateY(-10px);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
z-index: 1000;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&.open {
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-option {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 11px 16px;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
color: #ffffff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cur-symbol {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cur-name {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cur-code {
|
||||||
|
font-size: 12px;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Light / Novo / Dexar theme adjustments for currency
|
||||||
|
:host-context(.novo-header),
|
||||||
|
:host-context(.header) {
|
||||||
|
.currency-button {
|
||||||
|
border-color: rgba(0, 0, 0, 0.2);
|
||||||
|
color: #333333;
|
||||||
|
&:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.05);
|
||||||
|
border-color: rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:host-context(.light-theme) {
|
||||||
|
.currency-dropdown {
|
||||||
|
background: #ffffff;
|
||||||
|
border-color: rgba(0, 0, 0, 0.1);
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
.currency-option {
|
||||||
|
color: #333333;
|
||||||
|
&:hover { background: rgba(0, 0, 0, 0.05); }
|
||||||
|
&.active { background: rgba(0, 0, 0, 0.1); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:host-context(.dexar-header),
|
||||||
|
:host-context(.dexar-mobile-menu) {
|
||||||
|
.currency-button {
|
||||||
|
padding: 4px 8px;
|
||||||
|
gap: 3px;
|
||||||
|
background: rgba(255, 255, 255, 0.3);
|
||||||
|
border: 1px solid #677b78;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #1e3c38;
|
||||||
|
&:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
}
|
||||||
|
.currency-symbol { font-size: 14px; color: #1e3c38; }
|
||||||
|
.currency-code { font-size: 13px; color: #1e3c38; }
|
||||||
|
.dropdown-arrow path { stroke: #1e3c38; }
|
||||||
|
}
|
||||||
|
.currency-dropdown {
|
||||||
|
background: #ffffff;
|
||||||
|
border-color: #d3dad9;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
.currency-option {
|
||||||
|
color: #1e3c38;
|
||||||
|
&:hover { background: rgba(161, 180, 181, 0.2); }
|
||||||
|
&.active { background: rgba(73, 118, 113, 0.1); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, HostListener, ElementRef, ChangeDetectionStrategy } from '@angular/core';
|
import { Component, HostListener, ElementRef, ChangeDetectionStrategy } from '@angular/core';
|
||||||
import { LanguageService, Language } from '../../services/language.service';
|
import { LanguageService, Language, Currency } from '../../services/language.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-language-selector',
|
selector: 'app-language-selector',
|
||||||
@@ -10,6 +10,7 @@ import { LanguageService, Language } from '../../services/language.service';
|
|||||||
})
|
})
|
||||||
export class LanguageSelectorComponent {
|
export class LanguageSelectorComponent {
|
||||||
dropdownOpen = false;
|
dropdownOpen = false;
|
||||||
|
currencyOpen = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public languageService: LanguageService,
|
public languageService: LanguageService,
|
||||||
@@ -18,6 +19,12 @@ export class LanguageSelectorComponent {
|
|||||||
|
|
||||||
toggleDropdown(): void {
|
toggleDropdown(): void {
|
||||||
this.dropdownOpen = !this.dropdownOpen;
|
this.dropdownOpen = !this.dropdownOpen;
|
||||||
|
this.currencyOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleCurrency(): void {
|
||||||
|
this.currencyOpen = !this.currencyOpen;
|
||||||
|
this.dropdownOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
selectLanguage(lang: Language): void {
|
selectLanguage(lang: Language): void {
|
||||||
@@ -27,14 +34,21 @@ export class LanguageSelectorComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectCurrency(currency: Currency): void {
|
||||||
|
this.languageService.setCurrency(currency.code);
|
||||||
|
this.currencyOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
closeDropdown(): void {
|
closeDropdown(): void {
|
||||||
this.dropdownOpen = false;
|
this.dropdownOpen = false;
|
||||||
|
this.currencyOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('document:click', ['$event'])
|
@HostListener('document:click', ['$event'])
|
||||||
onClickOutside(event: Event): void {
|
onClickOutside(event: Event): void {
|
||||||
if (!this.elementRef.nativeElement.contains(event.target)) {
|
if (!this.elementRef.nativeElement.contains(event.target)) {
|
||||||
this.dropdownOpen = false;
|
this.dropdownOpen = false;
|
||||||
|
this.currencyOpen = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ export const en: Translations = {
|
|||||||
emailNeedsAt: 'Email must contain @',
|
emailNeedsAt: 'Email must contain @',
|
||||||
emailNeedsDomain: 'Email must contain a domain (.com, .ru, etc.)',
|
emailNeedsDomain: 'Email must contain a domain (.com, .ru, etc.)',
|
||||||
emailInvalid: 'Invalid email format',
|
emailInvalid: 'Invalid email format',
|
||||||
|
loginRequired: 'Log in to checkout',
|
||||||
|
loginRequiredDesc: 'Please log in via Telegram to place your order',
|
||||||
|
loginWithTelegram: 'Log in with Telegram',
|
||||||
|
orScanQr: 'Or scan the QR code',
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
title: 'Product search',
|
title: 'Product search',
|
||||||
@@ -134,6 +138,7 @@ export const en: Translations = {
|
|||||||
emptyTitle: 'Oops! No subcategories yet',
|
emptyTitle: 'Oops! No subcategories yet',
|
||||||
emptyDesc: 'There are no subcategories in this section yet, but they will appear soon',
|
emptyDesc: 'There are no subcategories in this section yet, but they will appear soon',
|
||||||
goHome: 'Go home',
|
goHome: 'Go home',
|
||||||
|
itemsInCategory: 'Items in this category',
|
||||||
},
|
},
|
||||||
itemDetail: {
|
itemDetail: {
|
||||||
loading: 'Loading...',
|
loading: 'Loading...',
|
||||||
@@ -170,6 +175,8 @@ export const en: Translations = {
|
|||||||
yesterday: 'Yesterday',
|
yesterday: 'Yesterday',
|
||||||
daysAgo: 'd. ago',
|
daysAgo: 'd. ago',
|
||||||
weeksAgo: 'w. ago',
|
weeksAgo: 'w. ago',
|
||||||
|
colour: 'Colour',
|
||||||
|
size: 'Size',
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
connecting: 'Connecting to server...',
|
connecting: 'Connecting to server...',
|
||||||
|
|||||||
@@ -2,202 +2,208 @@ import { Translations } from './translations';
|
|||||||
|
|
||||||
export const hy: Translations = {
|
export const hy: Translations = {
|
||||||
header: {
|
header: {
|
||||||
home: '╘│╒м╒н╒б╒╛╒╕╓А',
|
home: 'Գլխավոր',
|
||||||
search: '╒И╓А╒╕╒╢╒╕╓В╒┤',
|
search: 'Որոնում',
|
||||||
about: '╒Д╒е╓А ╒┤╒б╒╜╒л╒╢',
|
about: 'Մեր մասին',
|
||||||
contacts: '╘┐╒б╒║',
|
contacts: 'Կապ',
|
||||||
searchPlaceholder: '╒И╓А╒╕╒╢╒е╒м...',
|
searchPlaceholder: 'Փնտրել...',
|
||||||
catalog: '╘┐╒б╒┐╒б╒м╒╕╒г',
|
catalog: 'Կատալոգ',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
description: '╘║╒б╒┤╒б╒╢╒б╒п╒б╒п╒л╓Б ╒┤╒б╓А╓Д╒е╒й╓Г╒м╒е╒╡╒╜ ╒░╒б╓А╒┤╒б╓А ╒г╒╢╒╕╓В╒┤╒╢╒е╓А╒л ╒░╒б╒┤╒б╓А',
|
description: 'Ժամանակակից մարքեթփլեյս հարմար գնումների համար',
|
||||||
company: '╘╕╒╢╒п╒е╓А╒╕╓В╒й╒╡╒╕╓В╒╢',
|
company: 'Ընկերություն',
|
||||||
aboutUs: '╒Д╒е╓А ╒┤╒б╒╜╒л╒╢',
|
aboutUs: 'Մեր մասին',
|
||||||
contacts: '╘┐╒б╒║',
|
contacts: 'Կապ',
|
||||||
requisites: '╒О╒б╒╛╒е╓А╒б╒║╒б╒╡╒┤╒б╒╢╒╢╒е╓А',
|
requisites: 'Վճարային տվյալներ',
|
||||||
support: '╘▒╒╗╒б╒п╓Б╒╕╓В╒й╒╡╒╕╓В╒╢',
|
support: 'Աջակցություն',
|
||||||
faq: '╒А╒П╒А',
|
faq: 'ՀՏՀ',
|
||||||
delivery: '╘▒╒╝╒б╓Д╒╕╓В╒┤',
|
delivery: 'Առաքում',
|
||||||
guarantee: '╘╡╓А╒б╒╖╒н╒л╓Д',
|
guarantee: 'Երաշխիք',
|
||||||
legal: '╘╗╓А╒б╒╛╒б╒п╒б╒╢ ╒┐╒е╒▓╒е╒п╒б╒┐╒╛╒╕╓В╒й╒╡╒╕╓В╒╢',
|
legal: 'Իրավական տեղեկատվություն',
|
||||||
offer: '╒Х╓Ж╒е╓А╒┐╒б',
|
offer: 'Օֆերտա',
|
||||||
privacy: '╘│╒б╒▓╒┐╒╢╒л╒╕╓В╒й╒╡╒╕╓В╒╢',
|
privacy: 'Գաղտնիություն',
|
||||||
returns: '╒О╒е╓А╒б╒д╒б╓А╒▒',
|
returns: 'Վերադարձ',
|
||||||
info: '╒П╒е╒▓╒е╒п╒б╒┐╒╛╒╕╓В╒й╒╡╒╕╓В╒╢',
|
info: 'Տեղեկատվություն',
|
||||||
aboutCompany: '╘╕╒╢╒п╒е╓А╒╕╓В╒й╒╡╒б╒╢ ╒┤╒б╒╜╒л╒╢',
|
aboutCompany: 'Ընկերության մասին',
|
||||||
documents: '╒У╒б╒╜╒┐╒б╒й╒▓╒й╒е╓А',
|
documents: 'Փաստաթղթեր',
|
||||||
paymentRules: '╒О╒│╒б╓А╒┤╒б╒╢ ╒п╒б╒╢╒╕╒╢╒╢╒е╓А',
|
paymentRules: 'Վճարման կանոններ',
|
||||||
returnPolicy: '╒О╒е╓А╒б╒д╒б╓А╒▒╒л ╓Д╒б╒▓╒б╓Д╒б╒п╒б╒╢╒╕╓В╒й╒╡╒╕╓В╒╢',
|
returnPolicy: 'Վերադարձի քաղաքականություն',
|
||||||
publicOffer: '╒А╒б╒╢╓А╒б╒╡╒л╒╢ ╓Е╓Ж╒е╓А╒┐╒б',
|
publicOffer: 'Հանրային օֆերտա',
|
||||||
help: '╒Х╒г╒╢╒╕╓В╒й╒╡╒╕╓В╒╢',
|
help: 'Օգնություն',
|
||||||
payment: '╒О╒│╒б╓А╒╕╓В╒┤',
|
payment: 'Վճարում',
|
||||||
allRightsReserved: '╘▓╒╕╒м╒╕╓А ╒л╓А╒б╒╛╒╕╓В╒╢╓Д╒╢╒е╓А╒и ╒║╒б╒╖╒┐╒║╒б╒╢╒╛╒б╒о ╒е╒╢╓Й',
|
allRightsReserved: 'Բոլոր իրավունքները պաշտպանված են։',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
welcomeTo: '╘▓╒б╓А╒л ╒г╒б╒м╒╕╓В╒╜╒┐ {{brand}}',
|
welcomeTo: 'Բարի գալուստ {{brand}}',
|
||||||
subtitle: '╘│╒┐╒е╓Д ╒б╒┤╒е╒╢ ╒л╒╢╒╣ ╒┤╒е╒п ╒╛╒б╒╡╓А╒╕╓В╒┤',
|
subtitle: 'Գտեք այն ամենը, ինչ պետք է՝ մեկ վայրում',
|
||||||
startSearch: '╒Н╒п╒╜╒е╒м ╒╕╓А╒╕╒╢╒╕╓В╒┤╒и',
|
startSearch: 'Սկսել որոնումը',
|
||||||
loading: '╘┐╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒е╒╢...',
|
loading: 'Բեռնում ենք կատեգորիաները...',
|
||||||
errorTitle: '╘╗╒╢╒╣-╒╕╓А ╒в╒б╒╢ ╒╜╒н╒б╒м ╒з ╒г╒╢╒б╓Б╒е╒м',
|
errorTitle: 'Ինչ-որ բան սխալ գնաց',
|
||||||
retry: '╒У╒╕╓А╒▒╒е╒м ╒п╓А╒п╒л╒╢',
|
retry: 'Փորձել կրկին',
|
||||||
categoriesTitle: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А╒л ╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А',
|
categoriesTitle: 'Ապրանքների կատեգորիաներ',
|
||||||
categoriesSubtitle: '╘╕╒╢╒┐╓А╒е╓Д ╒░╒е╒┐╒б╓Д╓А╓Д╓А╒╕╒▓ ╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢',
|
categoriesSubtitle: 'Ընտրեք ձեզ հետաքրքիր կատեգորիան',
|
||||||
categoriesEmpty: '╘┐╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А╒и ╒╖╒╕╓В╒┐╒╕╒╛ ╒п╒░╒б╒╡╒┐╒╢╒╛╒е╒╢',
|
categoriesEmpty: 'Կատեգորիաները շուտով կհայտնվեն',
|
||||||
categoriesEmptyDesc: '╒Д╒е╒╢╓Д ╒б╒╖╒н╒б╒┐╒╕╓В╒┤ ╒е╒╢╓Д ╒п╒б╒┐╒б╒м╒╕╒г╒л ╒░╒б╒┤╒б╒м╓А╒┤╒б╒╢ ╒╛╓А╒б',
|
categoriesEmptyDesc: 'Մենք աշխատում ենք կատալոգի լրացման վրա',
|
||||||
dexarHeroTitle: '╘▒╒╡╒╜╒┐╒е╒▓ ╒д╒╕╓В ╒п╒г╒┐╒╢╒е╒╜ ╒б╒┤╒е╒╢ ╒л╒╢╒╣',
|
dexarHeroTitle: 'Այստեղ կգտնես ամեն ինչ',
|
||||||
dexarHeroSubtitle: '╒А╒б╒ж╒б╓А╒б╒╛╒╕╓А ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А ╒┤╒е╒п ╒╛╒б╒╡╓А╒╕╓В╒┤',
|
dexarHeroSubtitle: 'Հազարավոր ապրանքներ մեկ վայրում',
|
||||||
dexarHeroTagline: '╒║╒б╓А╒ж ╓З ╒░╒б╓А╒┤╒б╓А',
|
dexarHeroTagline: 'պարզ և հարմար',
|
||||||
goToCatalog: '╘▒╒╢╓Б╒╢╒е╒м ╒п╒б╒┐╒б╒м╒╕╒г',
|
goToCatalog: 'Գնալ կատալոգ',
|
||||||
findProduct: '╘│╒┐╒╢╒е╒м ╒б╒║╓А╒б╒╢╓Д',
|
findProduct: 'Գտնել ապրանք',
|
||||||
loadingDexar: '╘┐╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒е╒╢...',
|
loadingDexar: 'Կատեգորիաների բեռնում...',
|
||||||
catalogTitle: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А╒л ╒п╒б╒┐╒б╒м╒╕╒г',
|
catalogTitle: 'Ապրանքների կատալոգ',
|
||||||
emptyCategoriesDexar: '╘┐╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А╒и ╒д╒е╒╝ ╒╣╒п╒б╒╢',
|
emptyCategoriesDexar: 'Կատեգորիաները դեռ չկան',
|
||||||
categoriesSoonDexar: '╒З╒╕╓В╒┐╒╕╒╛ ╒б╒╡╒╜╒┐╒е╒▓ ╒п╒░╒б╒╡╒┐╒╢╒╛╒е╒╢ ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А╒л ╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А',
|
categoriesSoonDexar: 'Շուտով այստեղ կհայտնվեն կատեգորիաներ',
|
||||||
itemsCount: '{{count}} ╒б╒║╓А╒б╒╢╓Д',
|
itemsCount: '{{count}} ապրանք',
|
||||||
},
|
},
|
||||||
cart: {
|
cart: {
|
||||||
title: '╘╢╒б╒┤╒в╒╡╒╕╓В╒▓',
|
title: 'Զամբյուղ',
|
||||||
clear: '╒Д╒б╓Д╓А╒е╒м',
|
clear: 'Մաքրել',
|
||||||
empty: '╘╢╒б╒┤╒в╒╡╒╕╓В╒▓╒и ╒д╒б╒┐╒б╓А╒п ╒з',
|
empty: 'Զամբյուղը դատարկ է',
|
||||||
emptyDesc: '╘▒╒╛╒е╒м╒б╓Б╓А╒е╓Д ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А ╒г╒╢╒╕╓В╒┤╒╢╒е╓А╒и ╒╜╒п╒╜╒е╒м╒╕╓В ╒░╒б╒┤╒б╓А',
|
emptyDesc: 'Ավելացրեք ապրանքներ՝ գնումները սկսելու համար',
|
||||||
goShopping: '╘▒╒╢╓Б╒╢╒е╒м ╒г╒╢╒╕╓В╒┤╒╢╒е╓А╒л',
|
goShopping: 'Գնալ գնումների',
|
||||||
total: '╘╕╒╢╒д╒б╒┤╒е╒╢╒и',
|
total: 'Ընդամենը',
|
||||||
items: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А',
|
items: 'Ապրանքներ',
|
||||||
deliveryLabel: '╘▒╒╝╒б╓Д╒╕╓В╒┤',
|
deliveryLabel: 'Առաքում',
|
||||||
toPay: '╒О╒│╒б╓А╒┤╒б╒╢ ╒е╒╢╒й╒б╒п╒б',
|
toPay: 'Վճարման ենթակա',
|
||||||
agreeWith: '╘╡╒╜ ╒░╒б╒┤╒б╒▒╒б╒╡╒╢ ╒е╒┤',
|
agreeWith: 'Ես համաձայն եմ',
|
||||||
publicOffer: '╒░╒б╒╢╓А╒б╒╡╒л╒╢ ╓Е╓Ж╒е╓А╒┐╒б╒╡╒л╒╢',
|
publicOffer: 'հանրային օֆերտայի',
|
||||||
returnPolicy: '╒╛╒е╓А╒б╒д╒б╓А╒▒╒л ╓Д╒б╒▓╒б╓Д╒б╒п╒б╒╢╒╕╓В╒й╒╡╒б╒╢╒и',
|
returnPolicy: 'վերադարձի քաղաքականության',
|
||||||
guaranteeTerms: '╒е╓А╒б╒╖╒н╒л╓Д╒б╒╡╒л╒╢ ╒║╒б╒╡╒┤╒б╒╢╒╢╒е╓А╒л╒╢',
|
guaranteeTerms: 'երաշխիքային պայմանների',
|
||||||
privacyPolicy: '╒г╒б╒▓╒┐╒╢╒л╒╕╓В╒й╒╡╒б╒╢ ╓Д╒б╒▓╒б╓Д╒б╒п╒б╒╢╒╕╓В╒й╒╡╒б╒╢╒и',
|
privacyPolicy: 'գաղտնիության քաղաքականության',
|
||||||
and: '╓З',
|
and: 'և',
|
||||||
checkout: '╒Б╓З╒б╒п╒е╓А╒║╒е╒м ╒║╒б╒┐╒╛╒е╓А',
|
checkout: 'Ձևակերպել պատվերը',
|
||||||
close: '╒У╒б╒п╒е╒м',
|
close: 'Փակել',
|
||||||
creatingPayment: '╒О╒│╒б╓А╒╕╓В╒┤╒и ╒╜╒┐╒е╒▓╒о╒╛╒╕╓В╒┤ ╒з...',
|
creatingPayment: 'Վճարման ստեղծում...',
|
||||||
waitFewSeconds: '╒Н╒║╒б╒╜╒е╓Д ╒┤╒л ╓Д╒б╒╢╒л ╒╛╒б╒╡╓А╒п╒╡╒б╒╢',
|
waitFewSeconds: 'Խնդրում ենք սպասել մի քանի վայրկյան',
|
||||||
scanQr: '╒Н╒п╒б╒╢╒б╒╛╒╕╓А╒е╓Д QR ╒п╒╕╒д╒и ╒╛╒│╒б╓А╒┤╒б╒╢ ╒░╒б╒┤╒б╓А',
|
scanQr: 'Սքանավորեք QR կոդը վճարման համար',
|
||||||
amountToPay: '╒О╒│╒б╓А╒┤╒б╒╢ ╒г╒╕╓В╒┤╒б╓А╒и╒Э',
|
amountToPay: 'Վճարման գումար՝',
|
||||||
waitingPayment: '╒Н╒║╒б╒╜╒╕╓В╒┤ ╒е╒╢╓Д ╒╛╒│╒б╓А╒┤╒б╒╢╒и...',
|
waitingPayment: 'Սպասում ենք վճարմանը...',
|
||||||
copied: 'тЬУ ╒К╒б╒┐╒│╒е╒╢╒╛╒б╒о ╒з',
|
copied: '✓ Պատճենված է',
|
||||||
copyLink: '╒К╒б╒┐╒│╒е╒╢╒е╒м ╒░╒▓╒╕╓В╒┤╒и',
|
copyLink: 'Պատճենել հղումը',
|
||||||
openNewTab: '╘▓╒б╓Б╒е╒м ╒╢╒╕╓А ╒╢╒е╓А╒д╒л╓А╒╕╓В╒┤',
|
openNewTab: 'Բացել նոր ներդիրում',
|
||||||
paymentSuccess: '╒З╒╢╒╕╓А╒░╒б╒╛╒╕╓А╒╕╓В╒┤ ╒е╒╢╓Д╓Й ╒О╒│╒б╓А╒╕╓В╒┤╒и ╒░╒б╒╗╒╕╒▓╒╕╓В╒й╒╡╒б╒┤╒в ╒п╒б╒┐╒б╓А╒╛╒е╒м ╒з╓Й',
|
paymentSuccess: 'Շնորհավորում ենք! Վճարումը հաջող է անցել!',
|
||||||
paymentSuccessDesc: '╒Д╒╕╓В╒┐╓Д╒б╒г╓А╒е╓Д ╒▒╒е╓А ╒п╒╕╒╢╒┐╒б╒п╒┐╒б╒╡╒л╒╢ ╒┐╒╛╒╡╒б╒м╒╢╒е╓А╒и, ╓З ╒┤╒е╒╢╓Д ╒п╒╕╓В╒▓╒б╓А╒п╒е╒╢╓Д ╒г╒╢╒╕╓В╒┤╒и ╒┤╒л ╓Д╒б╒╢╒л ╓А╒╕╒║╒е╒л ╒и╒╢╒й╒б╓Б╓Д╒╕╓В╒┤',
|
paymentSuccessDesc: 'Մուտքագրեք ձեր տվյալները, և մենք կուղարկենք գնումը մի քանի րոպեի ընթացքում',
|
||||||
sending: '╒И╓В╒▓╒б╓А╒п╒╛╒╕╓В╒┤ ╒з...',
|
sending: 'Ուղարկվում է...',
|
||||||
send: '╒И╓В╒▓╒б╓А╒п╒е╒м',
|
send: 'Ուղարկել',
|
||||||
paymentTimeout: '╒Н╒║╒б╒╜╒┤╒б╒╢ ╒к╒б╒┤╒б╒╢╒б╒п╒и ╒╜╒║╒б╒╝╒╛╒е╒м ╒з',
|
paymentTimeout: 'Ժամանակը սպառվեց',
|
||||||
paymentTimeoutDesc: '╒Д╒е╒╢╓Д ╒╣╒е╒╢╓Д ╒╜╒┐╒б╓Б╒е╒м ╒╛╒│╒б╓А╒┤╒б╒╢ ╒░╒б╒╜╒┐╒б╒┐╒╕╓В╒┤ 3 ╓А╒╕╒║╒е╒л ╒и╒╢╒й╒б╓Б╓Д╒╕╓В╒┤╓Й',
|
paymentTimeoutDesc: 'Մենք չստացանք վճարման հաստատում 3 րոպեի ընթացքում։',
|
||||||
autoClose: '╒К╒б╒┐╒╕╓В╒░╒б╒╢╒и ╒п╓Г╒б╒п╒╛╒л ╒б╒╛╒┐╒╕╒┤╒б╒┐...',
|
autoClose: 'Պատուհանը կփակվի ավտոմատ...',
|
||||||
confirmClear: '╒А╒б╒┤╒╕╒ж╒╛╒б╒Ю╒о ╒е╓Д, ╒╕╓А ╓Б╒б╒╢╒п╒б╒╢╒╕╓В╒┤ ╒е╓Д ╒┤╒б╓Д╓А╒е╒м ╒ж╒б╒┤╒в╒╡╒╕╓В╒▓╒и╓Й',
|
confirmClear: 'Վստա՞հ եք, որ ցանկանում եք մաքրել զամբյուղը',
|
||||||
acceptTerms: '╘╜╒╢╒д╓А╒╕╓В╒┤ ╒е╒╢╓Д ╒и╒╢╒д╒╕╓В╒╢╒е╒м ╓Е╓Ж╒е╓А╒┐╒б╒╡╒л, ╒╛╒е╓А╒б╒д╒б╓А╒▒╒л ╓З ╒е╓А╒б╒╖╒н╒л╓Д╒л ╒║╒б╒╡╒┤╒б╒╢╒╢╒е╓А╒и ╒║╒б╒┐╒╛╒е╓А╒и ╒░╒б╒╜╒┐╒б╒┐╒е╒м╒╕╓В ╒░╒б╒┤╒б╓А╓Й',
|
acceptTerms: 'Խնդրում ենք ընդունել պայմանները՝ պատվերը հաստատելու համար։',
|
||||||
copyError: '╒К╒б╒┐╒│╒е╒╢╒┤╒б╒╢ ╒╜╒н╒б╒м╒Э',
|
copyError: 'Պատճենման սխալ՝',
|
||||||
emailSuccess: 'Email-╒и ╒░╒б╒╗╒╕╒▓╒╕╓В╒й╒╡╒б╒┤╒в ╒╕╓В╒▓╒б╓А╒п╒╛╒е╒м ╒з╓Й ╒Н╒┐╒╕╓В╒г╒е╓Д ╒▒╒е╓А ╓Г╒╕╒╜╒┐╒и╓Й',
|
emailSuccess: 'Email-ը հաջողությամբ ուղարկվեց։ Ստուգեք ձեր փոստը։',
|
||||||
emailError: 'Email ╒╕╓В╒▓╒б╓А╒п╒е╒м╒╕╓В ╒к╒б╒┤╒б╒╢╒б╒п ╒┐╒е╒▓╒л ╒╕╓В╒╢╒е╓Б╒б╒╛ ╒╜╒н╒б╒м╓Й ╘╜╒╢╒д╓А╒╕╓В╒┤ ╒е╒╢╓Д ╓Г╒╕╓А╒▒╒е╒м ╒п╓А╒п╒л╒╢╓Й',
|
emailError: 'Սխալ email ուղարկելիս։ Խնդրում ենք փորձել կրկին։',
|
||||||
phoneRequired: '╒А╒е╒╝╒б╒н╒╕╒╜╒б╒░╒б╒┤╒б╓А╒и ╒║╒б╓А╒┐╒б╒д╒л╓А ╒з',
|
phoneRequired: 'Հեռախոսահամարը պարտադիր է',
|
||||||
phoneMoreDigits: '╒Д╒╕╓В╒┐╓Д╒б╒г╓А╒е╓Д ╓З╒╜ {{count}} ╒й╒л╒╛',
|
phoneMoreDigits: 'Մուտքագրեք ևս {{count}} թիվ',
|
||||||
phoneTooMany: '╒Й╒б╓Г╒б╒ж╒б╒╢╓Б ╒╖╒б╒┐ ╒й╒╛╒е╓А',
|
phoneTooMany: 'Չափազանց շատ թվեր',
|
||||||
emailRequired: 'Email-╒и ╒║╒б╓А╒┐╒б╒д╒л╓А ╒з',
|
emailRequired: 'Email-ը պարտադիր է',
|
||||||
emailTooShort: 'Email-╒и ╒╣╒б╓Г╒б╒ж╒б╒╢╓Б ╒п╒б╓А╒│ ╒з (╒╢╒╛╒б╒ж╒б╒г╒╕╓В╒╡╒╢╒и 5 ╒╢╒л╒╖)',
|
emailTooShort: 'Email-ը չափազանց կարճ է (առնվազն 5 նիշ)',
|
||||||
emailTooLong: 'Email-╒и ╒╣╒б╓Г╒б╒ж╒б╒╢╓Б ╒е╓А╒п╒б╓А ╒з (╒б╒╝╒б╒╛╒е╒м╒б╒г╒╕╓В╒╡╒╢╒и 100 ╒╢╒л╒╖)',
|
emailTooLong: 'Email-ը չափազանց երկար է (առավելագույնը 100 նիշ)',
|
||||||
emailNeedsAt: 'Email-╒и ╒║╒е╒┐╓Д ╒з ╒║╒б╓А╒╕╓В╒╢╒б╒п╒л @ ╒╢╒╖╒б╒╢╒и',
|
emailNeedsAt: 'Email-ը պետք է պարունակի @',
|
||||||
emailNeedsDomain: 'Email-╒и ╒║╒е╒┐╓Д ╒з ╒║╒б╓А╒╕╓В╒╢╒б╒п╒л ╒д╒╕╒┤╒е╒╢ (.com, .ru ╓З ╒б╒╡╒м╒╢)',
|
emailNeedsDomain: 'Email-ը պետք է պարունակի դոմեյն (.com, .ru և այլն)',
|
||||||
emailInvalid: 'Email-╒л ╒▒╓З╒б╒╣╒б╓Г╒и ╒╜╒н╒б╒м ╒з',
|
emailInvalid: 'Սխալ email ձևաչափ',
|
||||||
|
loginRequired: 'Մուտք գործեք ձևակերպելու համար',
|
||||||
|
loginRequiredDesc: 'Պատվեր ձևակերպելու համար մուտք գործեք Telegram-ով',
|
||||||
|
loginWithTelegram: 'Մուտք Telegram-ով',
|
||||||
|
orScanQr: 'Կամ սքանավորեք QR կոդը',
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
title: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А╒л ╒╕╓А╒╕╒╢╒╕╓В╒┤',
|
title: 'Ապրանքների որոնում',
|
||||||
placeholder: '╒Д╒╕╓В╒┐╓Д╒б╒г╓А╒е╓Д ╒б╒║╓А╒б╒╢╓Д╒л ╒б╒╢╒╕╓В╒╢╒и...',
|
placeholder: 'Մուտքագրեք ապրանքի անվանումը...',
|
||||||
resultsCount: '╘│╒┐╒╢╒╛╒б╒о ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А╒Э',
|
resultsCount: 'Գտնված ապրանքներ՝',
|
||||||
searching: '╒И╓А╒╕╒╢╒╕╓В╒┤...',
|
searching: 'Որոնում...',
|
||||||
retry: '╒У╒╕╓А╒▒╒е╒м ╒п╓А╒п╒л╒╢',
|
retry: 'Փորձել կրկին',
|
||||||
noResults: '╒И╒╣╒л╒╢╒╣ ╒╣╒л ╒г╒┐╒╢╒╛╒е╒м',
|
noResults: 'Ոչինչ չի գտնվել',
|
||||||
noResultsFor: '"{{query}}" ╒░╒б╓А╓Б╒┤╒б╒╢ ╒░╒б╒┤╒б╓А ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А ╒╣╒е╒╢ ╒г╒┐╒╢╒╛╒е╒м',
|
noResultsFor: '"{{query}}" հարցմամբ ապրանքներ չեն գտնվել',
|
||||||
noResultsHint: '╒У╒╕╓А╒▒╒е╓Д ╓Г╒╕╒н╒е╒м ╒░╒б╓А╓Б╒╕╓В╒┤╒и ╒п╒б╒┤ ╓Е╒г╒┐╒б╒г╒╕╓А╒о╒е╒м ╒б╒╡╒м ╒в╒б╒╢╒б╒м╒л ╒в╒б╒╝╒е╓А',
|
noResultsHint: 'Փորձեք փոխել հարցումը կամ օգտագործել այլ բանալի բառեր',
|
||||||
addToCart: '╘▒╒╛╒е╒м╒б╓Б╒╢╒е╒м ╒ж╒б╒┤╒в╒╡╒╕╓В╒▓',
|
addToCart: 'Ավելացնել զամբյուղ',
|
||||||
loadingMore: '╘▓╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒з...',
|
loadingMore: 'Բեռնում...',
|
||||||
allLoaded: '╘▓╒╕╒м╒╕╓А ╒б╓А╒д╒╡╒╕╓В╒╢╓Д╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒б╒о ╒е╒╢',
|
allLoaded: 'Բոլոր արդյունքները բեռնված են',
|
||||||
emptyState: '╒Д╒╕╓В╒┐╓Д╒б╒г╓А╒е╓Д ╒░╒б╓А╓Б╒╕╓В╒┤ ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А ╒╕╓А╒╕╒╢╒е╒м╒╕╓В ╒░╒б╒┤╒б╓А',
|
emptyState: 'Մուտքագրեք հարցում որոնման համար',
|
||||||
of: '╒л╓Б',
|
of: '-ից',
|
||||||
},
|
},
|
||||||
category: {
|
category: {
|
||||||
retry: '╒У╒╕╓А╒▒╒е╒м ╒п╓А╒п╒л╒╢',
|
retry: 'Փորձել կրկին',
|
||||||
addToCart: '╘▒╒╛╒е╒м╒б╓Б╒╢╒е╒м ╒ж╒б╒┤╒в╒╡╒╕╓В╒▓',
|
addToCart: 'Ավելացնել զամբյուղ',
|
||||||
loadingMore: '╘▓╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒з...',
|
loadingMore: 'Բեռնում...',
|
||||||
allLoaded: '╘▓╒╕╒м╒╕╓А ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒б╒о ╒е╒╢',
|
allLoaded: 'Բոլոր ապրանքները բեռնված են',
|
||||||
emptyTitle: '╒И╓В╒║╒╜╓Й ╘▒╒╡╒╜╒┐╒е╒▓ ╒д╒е╒╝ ╒д╒б╒┐╒б╓А╒п ╒з',
|
emptyTitle: 'Վա՜յ, այստեղ դեռ դատարկ է',
|
||||||
emptyDesc: '╘▒╒╡╒╜ ╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╡╒╕╓В╒┤ ╒д╒е╒╝ ╒б╒║╓А╒б╒╢╓Д╒╢╒е╓А ╒╣╒п╒б╒╢, ╒в╒б╒╡╓Б ╒╖╒╕╓В╒┐╒╕╒╛ ╒п╒░╒б╒╡╒┐╒╢╒╛╒е╒╢',
|
emptyDesc: 'Այս կատեգորիայում դեռ ապրանքներ չկան',
|
||||||
goHome: '╘│╒м╒н╒б╒╛╒╕╓А ╒з╒╗',
|
goHome: 'Գլխավոր',
|
||||||
loading: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒е╒╢...',
|
loading: 'Ապրանքների բեռնում...',
|
||||||
},
|
},
|
||||||
subcategories: {
|
subcategories: {
|
||||||
loading: '╘╡╒╢╒й╒б╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒е╒╢...',
|
loading: 'Ենթակատեգորիաների բեռնում...',
|
||||||
retry: '╒У╒╕╓А╒▒╒е╒м ╒п╓А╒п╒л╒╢',
|
retry: 'Փորձել կրկին',
|
||||||
emptyTitle: '╒И╓В╒║╒╜╓Й ╘╡╒╢╒й╒б╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А ╒д╒е╒╝ ╒╣╒п╒б╒╢',
|
emptyTitle: 'Ենթակատեգորիաներ չկան',
|
||||||
emptyDesc: '╘▒╒╡╒╜ ╒в╒б╒к╒╢╒╕╓В╒┤ ╒д╒е╒╝ ╒е╒╢╒й╒б╒п╒б╒┐╒е╒г╒╕╓А╒л╒б╒╢╒е╓А ╒╣╒п╒б╒╢, ╒в╒б╒╡╓Б ╒╖╒╕╓В╒┐╒╕╒╛ ╒п╒░╒б╒╡╒┐╒╢╒╛╒е╒╢',
|
emptyDesc: 'Այս բաժնում դեռ ենթակատեգորիաներ չկան',
|
||||||
goHome: '╘│╒м╒н╒б╒╛╒╕╓А ╒з╒╗',
|
goHome: 'Գլխավոր',
|
||||||
|
itemsInCategory: 'Ապրանքներ այս կատեգորիայում',
|
||||||
},
|
},
|
||||||
itemDetail: {
|
itemDetail: {
|
||||||
loading: '╘▓╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒з...',
|
loading: 'Բեռնում...',
|
||||||
loadingDexar: '╘▒╒║╓А╒б╒╢╓Д╒и ╒в╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒з...',
|
loadingDexar: 'Ապրանքի բեռնում...',
|
||||||
back: '╒О╒е╓А╒б╒д╒б╒╝╒╢╒б╒м',
|
back: 'Վերադառնալ',
|
||||||
backHome: '╒О╒е╓А╒б╒д╒б╒╝╒╢╒б╒м ╒г╒м╒н╒б╒╛╒╕╓А ╒з╒╗',
|
backHome: 'Վերադառնալ գլխավոր էջ',
|
||||||
noImage: '╒К╒б╒┐╒п╒е╓А ╒╣╒п╒б',
|
noImage: 'Պատկեր չկա',
|
||||||
stock: '╘▒╒╝╒п╒б╒╡╒╕╓В╒й╒╡╒╕╓В╒╢╒Э',
|
stock: 'Առկայություն՝',
|
||||||
inStock: '╘▒╒╝╒п╒б ╒з',
|
inStock: 'Առկա է',
|
||||||
lowStock: '╒Д╒╢╒б╓Б╒е╒м ╒з ╓Д╒л╒╣',
|
lowStock: 'Քիչ է մնացել',
|
||||||
lastItems: '╒О╒е╓А╒╗╒л╒╢ ╒░╒б╒┐╒е╓А╒и',
|
lastItems: 'Վերջին հատերը',
|
||||||
mediumStock: '╒О╒е╓А╒╗╒б╒╢╒╕╓В╒┤ ╒з',
|
mediumStock: 'Ավարտվում է',
|
||||||
addToCart: '╘▒╒╛╒е╒м╒б╓Б╒╢╒е╒м ╒ж╒б╒┤╒в╒╡╒╕╓В╒▓',
|
addToCart: 'Ավելացնել զամբյուղ',
|
||||||
description: '╒Ж╒п╒б╓А╒б╒г╓А╒╕╓В╒й╒╡╒╕╓В╒╢',
|
description: 'Նկարագրություն',
|
||||||
specifications: 'u{0532}u{0576}u{0578}u{0582}u{0569}u{0561}u{0563}u{0580}u{0565}u{0580}',
|
specifications: 'Բնութագրեր',
|
||||||
reviews: '╘┐╒б╓А╒о╒л╓Д╒╢╒е╓А',
|
reviews: 'Կարծիքներ',
|
||||||
yourReview: '╒Б╒е╓А ╒п╒б╓А╒о╒л╓Д╒и',
|
yourReview: 'Ձեր կարծիքը',
|
||||||
leaveReview: '╘╣╒╕╒▓╒╢╒е╒м ╒п╒б╓А╒о╒л╓Д',
|
leaveReview: 'Թողնել կարծիք',
|
||||||
rating: '╘│╒╢╒б╒░╒б╒┐╒б╒п╒б╒╢╒Э',
|
rating: 'Գնահատական՝',
|
||||||
reviewPlaceholder: '╘┐╒л╒╜╒╛╒е╓Д ╒▒╒е╓А ╒┐╒║╒б╒╛╒╕╓А╒╕╓В╒й╒╡╒╕╓В╒╢╒╢╒е╓А╒╕╒╛ ╒б╒║╓А╒б╒╢╓Д╒л ╒┤╒б╒╜╒л╒╢...',
|
reviewPlaceholder: 'Կիսվեք ձեր կարծիքով...',
|
||||||
reviewPlaceholderDexar: '╘┐╒л╒╜╒╛╒е╓Д ╒▒╒е╓А ╒┐╒║╒б╒╛╒╕╓А╒╕╓В╒й╒╡╒╕╓В╒╢╒╢╒е╓А╒╕╒╛...',
|
reviewPlaceholderDexar: 'Կիսվեք տպավորություններով...',
|
||||||
anonymous: '╘▒╒╢╒б╒╢╒╕╓В╒╢',
|
anonymous: 'Անանուն',
|
||||||
submitting: '╒И╓В╒▓╒б╓А╒п╒╛╒╕╓В╒┤ ╒з...',
|
submitting: 'Ուղարկվում է...',
|
||||||
submit: '╒И╓В╒▓╒б╓А╒п╒е╒м',
|
submit: 'Ուղարկել',
|
||||||
reviewSuccess: '╒З╒╢╒╕╓А╒░╒б╒п╒б╒м╒╕╓В╒й╒╡╒╕╓В╒╢ ╒▒╒е╓А ╒п╒б╓А╒о╒л╓Д╒л ╒░╒б╒┤╒б╓А╓Й',
|
reviewSuccess: 'Շնորհակալություն ձեր կարծիքի համար!',
|
||||||
reviewError: '╒И╓В╒▓╒б╓А╒п╒┤╒б╒╢ ╒╜╒н╒б╒м╓Й ╒У╒╕╓А╒▒╒е╓Д ╒б╒╛╒е╒м╒л ╒╕╓В╒╖╓Й',
|
reviewError: 'Սխալ ուղարկելիս։ Փորձեք ավելի ուշ։',
|
||||||
defaultUser: '╒Х╒г╒┐╒б╒┐╒е╓А',
|
defaultUser: 'Օգտատեր',
|
||||||
defaultUserDexar: '╘▒╒╢╒б╒╢╒╕╓В╒╢',
|
defaultUserDexar: 'Անանուն',
|
||||||
noReviews: '╘┤╒е╒╝ ╒п╒б╓А╒о╒л╓Д╒╢╒е╓А ╒╣╒п╒б╒╢╓Й ╘┤╒б╓А╒▒╒е╓Д ╒б╒╝╒б╒╗╒л╒╢╒и╓Й',
|
noReviews: 'Կարծիքներ դեռ չկան',
|
||||||
qna: '╒А╒б╓А╓Б╒е╓А ╓З ╒║╒б╒┐╒б╒╜╒н╒б╒╢╒╢╒е╓А',
|
qna: 'Հարցեր և պատասխաններ',
|
||||||
photo: '╘╝╒╕╓В╒╜╒б╒╢╒п╒б╓А',
|
photo: 'Լուսանկար',
|
||||||
reviewsCount: '╒п╒б╓А╒о╒л╓Д',
|
reviewsCount: 'կարծիք',
|
||||||
today: '╘▒╒╡╒╜╓Е╓А',
|
today: 'Այսօր',
|
||||||
yesterday: '╘╡╓А╒е╒п',
|
yesterday: 'Երեկ',
|
||||||
daysAgo: '╓Е╓А ╒б╒╝╒б╒╗',
|
daysAgo: 'օր առաջ',
|
||||||
weeksAgo: '╒╖╒б╒в╒б╒й ╒б╒╝╒б╒╗',
|
weeksAgo: 'շաբաթ առաջ',
|
||||||
|
colour: 'Գույն',
|
||||||
|
size: 'Չափ',
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
connecting: '╒Д╒л╒б╓Б╒╕╓В╒┤ ╒╜╒е╓А╒╛╒е╓А╒л╒╢...',
|
connecting: 'Կապ սերվերի հետ...',
|
||||||
serverUnavailable: '╒Н╒е╓А╒╛╒е╓А╒и ╒░╒б╒╜╒б╒╢╒е╒м╒л ╒╣╒з',
|
serverUnavailable: 'Սերվերը անհասանելի է',
|
||||||
serverError: '╒Й╒░╒б╒╗╒╕╒▓╒╛╒е╓Б ╒┤╒л╒б╒╢╒б╒м ╒╜╒е╓А╒╛╒е╓А╒л╒╢╓Й ╒Н╒┐╒╕╓В╒г╒е╓Д ╒л╒╢╒┐╒е╓А╒╢╒е╒┐ ╒п╒б╒║╒и╓Й',
|
serverError: 'Չհաջողվեց միանալ սերվերին։ Ստուգեք ինտերնետը։',
|
||||||
retryConnection: '╘┐╓А╒п╒╢╒е╒м ╓Г╒╕╓А╒▒╒и',
|
retryConnection: 'Փորձել կրկին',
|
||||||
pageTitle: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А╒л ╓З ╒о╒б╒╝╒б╒╡╒╕╓В╒й╒╡╒╕╓В╒╢╒╢╒е╓А╒л ╒┤╒б╓А╓Д╒е╒й╓Г╒м╒е╒╡╒╜',
|
pageTitle: 'Ապրանքների և ծառայությունների մարքեթփլեյս',
|
||||||
},
|
},
|
||||||
carousel: {
|
carousel: {
|
||||||
loading: '╘▒╒║╓А╒б╒╢╓Д╒╢╒е╓А╒и ╒в╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒е╒╢...',
|
loading: 'Ապրանքների բեռնում...',
|
||||||
addToCart: '╘▒╒╛╒е╒м╒б╓Б╒╢╒е╒м ╒ж╒б╒┤╒в╒╡╒╕╓В╒▓',
|
addToCart: 'Ավելացնել զամբյուղ',
|
||||||
},
|
},
|
||||||
common: {
|
common: {
|
||||||
retry: '╒У╒╕╓А╒▒╒е╒м ╒п╓А╒п╒л╒╢',
|
retry: 'Փորձել կրկին',
|
||||||
loading: '╘▓╒е╒╝╒╢╒╛╒╕╓В╒┤ ╒з...',
|
loading: 'Բեռնում...',
|
||||||
},
|
},
|
||||||
|
|
||||||
location: {
|
location: {
|
||||||
allRegions: 'Բոլոր տարածաշրջաններ',
|
allRegions: 'Բոլոր տարածաշրջանները',
|
||||||
chooseRegion: 'Ընտրեք տարածաշրջան',
|
chooseRegion: 'Ընտրեք տարածաշրջանը',
|
||||||
detectAuto: 'Որոշել ինքնաշխատ',
|
detectAuto: 'Որոշել ավտոմատ',
|
||||||
},
|
},
|
||||||
auth: {
|
auth: {
|
||||||
loginRequired: 'Մուտք պահանջվում է',
|
loginRequired: 'Պահանջվում է մուտք',
|
||||||
loginDescription: 'Պատվերի կատարման համար մուտք արեք Telegram-ի միջոցով',
|
loginDescription: 'Պատվերի համար մուտք գործեք Telegram-ով',
|
||||||
checking: 'Ստուգում է...',
|
checking: 'Ստուգում...',
|
||||||
loginWithTelegram: 'Մուտք գործել Telegram-ով',
|
loginWithTelegram: 'Մուտք Telegram-ով',
|
||||||
orScanQr: 'Կամ սկանավորեք QR կոդը',
|
orScanQr: 'Կամ սքանավորեք QR կոդը',
|
||||||
loginNote: 'Մուտքից հետո դուք կվերադառնավեք',
|
loginNote: 'Մուտքից հետո դուք կվերաուղղվեք',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ export const ru: Translations = {
|
|||||||
emailNeedsAt: 'Email должен содержать @',
|
emailNeedsAt: 'Email должен содержать @',
|
||||||
emailNeedsDomain: 'Email должен содержать домен (.com, .ru и т.д.)',
|
emailNeedsDomain: 'Email должен содержать домен (.com, .ru и т.д.)',
|
||||||
emailInvalid: 'Некорректный формат email',
|
emailInvalid: 'Некорректный формат email',
|
||||||
|
loginRequired: 'Войдите для оформления',
|
||||||
|
loginRequiredDesc: 'Для оформления заказа войдите через Telegram',
|
||||||
|
loginWithTelegram: 'Войти через Telegram',
|
||||||
|
orScanQr: 'Или отсканируйте QR-код',
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
title: 'Поиск товаров',
|
title: 'Поиск товаров',
|
||||||
@@ -134,6 +138,7 @@ export const ru: Translations = {
|
|||||||
emptyTitle: 'Упс! Подкатегорий пока нет',
|
emptyTitle: 'Упс! Подкатегорий пока нет',
|
||||||
emptyDesc: 'В этом разделе ещё нет подкатегорий, но скоро они появятся',
|
emptyDesc: 'В этом разделе ещё нет подкатегорий, но скоро они появятся',
|
||||||
goHome: 'На главную',
|
goHome: 'На главную',
|
||||||
|
itemsInCategory: 'Товары в этой категории',
|
||||||
},
|
},
|
||||||
itemDetail: {
|
itemDetail: {
|
||||||
loading: 'Загрузка...',
|
loading: 'Загрузка...',
|
||||||
@@ -170,6 +175,8 @@ export const ru: Translations = {
|
|||||||
yesterday: 'Вчера',
|
yesterday: 'Вчера',
|
||||||
daysAgo: 'дн. назад',
|
daysAgo: 'дн. назад',
|
||||||
weeksAgo: 'нед. назад',
|
weeksAgo: 'нед. назад',
|
||||||
|
colour: 'Цвет',
|
||||||
|
size: 'Размер',
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
connecting: 'Подключение к серверу...',
|
connecting: 'Подключение к серверу...',
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ export interface Translations {
|
|||||||
emailNeedsAt: string;
|
emailNeedsAt: string;
|
||||||
emailNeedsDomain: string;
|
emailNeedsDomain: string;
|
||||||
emailInvalid: string;
|
emailInvalid: string;
|
||||||
|
loginRequired: string;
|
||||||
|
loginRequiredDesc: string;
|
||||||
|
loginWithTelegram: string;
|
||||||
|
orScanQr: string;
|
||||||
};
|
};
|
||||||
search: {
|
search: {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -132,6 +136,7 @@ export interface Translations {
|
|||||||
emptyTitle: string;
|
emptyTitle: string;
|
||||||
emptyDesc: string;
|
emptyDesc: string;
|
||||||
goHome: string;
|
goHome: string;
|
||||||
|
itemsInCategory: string;
|
||||||
};
|
};
|
||||||
itemDetail: {
|
itemDetail: {
|
||||||
loading: string;
|
loading: string;
|
||||||
@@ -168,6 +173,8 @@ export interface Translations {
|
|||||||
yesterday: string;
|
yesterday: string;
|
||||||
daysAgo: string;
|
daysAgo: string;
|
||||||
weeksAgo: string;
|
weeksAgo: string;
|
||||||
|
colour: string;
|
||||||
|
size: string;
|
||||||
};
|
};
|
||||||
app: {
|
app: {
|
||||||
connecting: string;
|
connecting: string;
|
||||||
|
|||||||
@@ -2,35 +2,48 @@ import { HttpInterceptorFn } from '@angular/common/http';
|
|||||||
import { inject } from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import { LocationService } from '../services/location.service';
|
import { LocationService } from '../services/location.service';
|
||||||
import { LanguageService } from '../services/language.service';
|
import { LanguageService } from '../services/language.service';
|
||||||
|
import { AuthService } from '../services/auth.service';
|
||||||
import { environment } from '../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
|
|
||||||
/**
|
/** Map internal language codes to API header values */
|
||||||
* Interceptor that attaches X-Region and X-Language headers
|
const LANG_HEADER_MAP: Record<string, string> = {
|
||||||
* to every outgoing request aimed at our API.
|
'ru': 'RU',
|
||||||
*
|
'en': 'EN',
|
||||||
* The backend reads these headers to:
|
'hy': 'AM',
|
||||||
* - filter catalog by region
|
};
|
||||||
* - return translated content in the requested language
|
|
||||||
*/
|
/** Map region IDs to API header values */
|
||||||
|
const REGION_HEADER_MAP: Record<string, string> = {
|
||||||
|
'moscow': 'Moscow',
|
||||||
|
'spb': 'ST. Petersburg',
|
||||||
|
'yerevan': 'Yerevan',
|
||||||
|
};
|
||||||
|
|
||||||
export const apiHeadersInterceptor: HttpInterceptorFn = (req, next) => {
|
export const apiHeadersInterceptor: HttpInterceptorFn = (req, next) => {
|
||||||
// Only attach headers to our own API requests
|
|
||||||
if (!req.url.startsWith(environment.apiUrl)) {
|
if (!req.url.startsWith(environment.apiUrl)) {
|
||||||
return next(req);
|
return next(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
const locationService = inject(LocationService);
|
const locationService = inject(LocationService);
|
||||||
const languageService = inject(LanguageService);
|
const languageService = inject(LanguageService);
|
||||||
|
const authService = inject(AuthService);
|
||||||
|
|
||||||
const regionId = locationService.regionId(); // '' when global
|
const regionId = locationService.regionId();
|
||||||
const lang = languageService.currentLanguage(); // 'ru' | 'en' | 'hy'
|
const lang = languageService.currentLanguage();
|
||||||
|
const currency = languageService.currentCurrency();
|
||||||
|
const session = authService.session();
|
||||||
|
|
||||||
let headers = req.headers;
|
let headers = req.headers;
|
||||||
|
|
||||||
if (regionId) {
|
if (regionId) {
|
||||||
headers = headers.set('X-Region', regionId);
|
headers = headers.set('X-Region', REGION_HEADER_MAP[regionId] ?? regionId);
|
||||||
}
|
}
|
||||||
if (lang) {
|
if (lang) {
|
||||||
headers = headers.set('X-Language', lang);
|
headers = headers.set('X-Language', LANG_HEADER_MAP[lang] ?? lang.toUpperCase());
|
||||||
|
}
|
||||||
|
headers = headers.set('Currency', currency || 'RUB');
|
||||||
|
if (session?.sessionId) {
|
||||||
|
headers = headers.set('WebSessionID', session.sessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return next(req.clone({ headers }));
|
return next(req.clone({ headers }));
|
||||||
|
|||||||
@@ -167,6 +167,22 @@ const MOCK_ITEMS: any[] = [
|
|||||||
],
|
],
|
||||||
tags: ['new', 'featured', 'apple'],
|
tags: ['new', 'featured', 'apple'],
|
||||||
badges: ['new', 'bestseller'],
|
badges: ['new', 'bestseller'],
|
||||||
|
colour: 'Натуральный титан',
|
||||||
|
size: '',
|
||||||
|
names: [
|
||||||
|
{ language: 'ru', value: 'iPhone 15 Pro Max' },
|
||||||
|
{ language: 'en', value: 'iPhone 15 Pro Max' },
|
||||||
|
{ language: 'hy', value: 'iPhone 15 Pro Max' }
|
||||||
|
],
|
||||||
|
descriptions: [
|
||||||
|
{ language: 'ru', value: 'Новейший iPhone с титановым корпусом и чипом A17 Pro' },
|
||||||
|
{ language: 'en', value: 'Latest iPhone with titanium body and A17 Pro chip' }
|
||||||
|
],
|
||||||
|
attributes: [
|
||||||
|
{ key: 'Цвет', value: 'Натуральный титан' },
|
||||||
|
{ key: 'Память', value: '256 ГБ' },
|
||||||
|
{ key: 'Процессор', value: 'A17 Pro' }
|
||||||
|
],
|
||||||
simpleDescription: 'Новейший iPhone с титановым корпусом и чипом A17 Pro',
|
simpleDescription: 'Новейший iPhone с титановым корпусом и чипом A17 Pro',
|
||||||
description: [
|
description: [
|
||||||
{ key: 'Цвет', value: 'Натуральный титан' },
|
{ key: 'Цвет', value: 'Натуральный титан' },
|
||||||
@@ -230,6 +246,20 @@ const MOCK_ITEMS: any[] = [
|
|||||||
],
|
],
|
||||||
tags: ['new', 'android', 'samsung'],
|
tags: ['new', 'android', 'samsung'],
|
||||||
badges: ['new', 'sale'],
|
badges: ['new', 'sale'],
|
||||||
|
colour: 'Титановый серый',
|
||||||
|
size: '',
|
||||||
|
names: [
|
||||||
|
{ language: 'ru', value: 'Samsung Galaxy S24 Ultra' },
|
||||||
|
{ language: 'en', value: 'Samsung Galaxy S24 Ultra' }
|
||||||
|
],
|
||||||
|
descriptions: [
|
||||||
|
{ language: 'ru', value: 'Премиальный флагман Samsung с S Pen' },
|
||||||
|
{ language: 'en', value: 'Premium Samsung flagship with S Pen' }
|
||||||
|
],
|
||||||
|
attributes: [
|
||||||
|
{ key: 'Память', value: '512 ГБ' },
|
||||||
|
{ key: 'ОЗУ', value: '12 ГБ' }
|
||||||
|
],
|
||||||
simpleDescription: 'Премиальный флагман Samsung с S Pen',
|
simpleDescription: 'Премиальный флагман Samsung с S Pen',
|
||||||
description: [
|
description: [
|
||||||
{ key: 'Цвет', value: 'Титановый серый' },
|
{ key: 'Цвет', value: 'Титановый серый' },
|
||||||
|
|||||||
@@ -42,6 +42,24 @@ export interface Question {
|
|||||||
downvotes: number;
|
downvotes: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Localized name entry from backend */
|
||||||
|
export interface ItemName {
|
||||||
|
language: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Localized description entry from backend */
|
||||||
|
export interface ItemDescription {
|
||||||
|
language: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Key-value attribute pair */
|
||||||
|
export interface ItemAttribute {
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Item {
|
export interface Item {
|
||||||
categoryID: number;
|
categoryID: number;
|
||||||
itemID: number;
|
itemID: number;
|
||||||
@@ -55,9 +73,16 @@ export interface Item {
|
|||||||
rating: number;
|
rating: number;
|
||||||
callbacks: Review[] | null;
|
callbacks: Review[] | null;
|
||||||
questions: Question[] | null;
|
questions: Question[] | null;
|
||||||
partnerID?: string;
|
|
||||||
quantity?: number;
|
quantity?: number;
|
||||||
|
|
||||||
|
// Backend API fields
|
||||||
|
colour?: string;
|
||||||
|
size?: string;
|
||||||
|
language?: string;
|
||||||
|
names?: ItemName[];
|
||||||
|
descriptions?: ItemDescription[];
|
||||||
|
attributes?: ItemAttribute[];
|
||||||
|
|
||||||
// BackOffice API fields
|
// BackOffice API fields
|
||||||
id?: string;
|
id?: string;
|
||||||
visible?: boolean;
|
visible?: boolean;
|
||||||
|
|||||||
@@ -31,12 +31,12 @@
|
|||||||
(touchstart)="onSwipeStart(item.itemID, $event)">
|
(touchstart)="onSwipeStart(item.itemID, $event)">
|
||||||
<div class="cart-item">
|
<div class="cart-item">
|
||||||
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-image">
|
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-image">
|
||||||
<img [src]="getMainImage(item)" [alt]="item.name" loading="lazy" />
|
<img [src]="getMainImage(item)" [alt]="itemName(item)" loading="lazy" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="item-info">
|
<div class="item-info">
|
||||||
<div class="item-header">
|
<div class="item-header">
|
||||||
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-name">{{ item.name }}</a>
|
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-name">{{ itemName(item) }}</a>
|
||||||
<button class="remove-btn" (click)="removeItem(item.itemID)" title="Remove">
|
<button class="remove-btn" (click)="removeItem(item.itemID)" title="Remove">
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
<path d="M18 6L6 18M6 6l12 12"/>
|
<path d="M18 6L6 18M6 6l12 12"/>
|
||||||
@@ -44,7 +44,18 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="item-description">{{ item.simpleDescription || item?.description?.substring?.(0, 100) || '' }}...</p>
|
<p class="item-description">{{ itemDesc(item) || '' }}...</p>
|
||||||
|
|
||||||
|
@if (item.colour || item.size) {
|
||||||
|
<div class="cart-item-variants">
|
||||||
|
@if (item.colour) {
|
||||||
|
<span class="cart-variant">{{ 'itemDetail.colour' | translate }}: {{ item.colour }}</span>
|
||||||
|
}
|
||||||
|
@if (item.size) {
|
||||||
|
<span class="cart-variant">{{ 'itemDetail.size' | translate }}: {{ item.size }}</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
@if (item.badges && item.badges.length > 0) {
|
@if (item.badges && item.badges.length > 0) {
|
||||||
<div class="cart-item-badges">
|
<div class="cart-item-badges">
|
||||||
@@ -58,11 +69,11 @@
|
|||||||
<div class="item-pricing">
|
<div class="item-pricing">
|
||||||
@if (item.discount > 0) {
|
@if (item.discount > 0) {
|
||||||
<div class="price-with-discount">
|
<div class="price-with-discount">
|
||||||
<span class="original-price">{{ item.price }} ₽</span>
|
<span class="original-price">{{ item.price }} {{ item.currency }}</span>
|
||||||
<span class="current-price">{{ getDiscountedPrice(item) | number:'1.2-2' }} ₽</span>
|
<span class="current-price">{{ getDiscountedPrice(item) | number:'1.2-2' }} {{ item.currency }}</span>
|
||||||
</div>
|
</div>
|
||||||
} @else {
|
} @else {
|
||||||
<span class="current-price">{{ item.price }} ₽</span>
|
<span class="current-price">{{ item.price }} {{ item.currency }}</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -99,17 +110,17 @@
|
|||||||
|
|
||||||
<div class="summary-row">
|
<div class="summary-row">
|
||||||
<span>{{ 'cart.items' | translate }} ({{ itemCount() }})</span>
|
<span>{{ 'cart.items' | translate }} ({{ itemCount() }})</span>
|
||||||
<span class="value">{{ totalPrice() | number:'1.2-2' }} ₽</span>
|
<span class="value">{{ totalPrice() | number:'1.2-2' }} {{ currentCurrency }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="summary-row delivery">
|
<div class="summary-row delivery">
|
||||||
<span>{{ 'cart.deliveryLabel' | translate }}</span>
|
<span>{{ 'cart.deliveryLabel' | translate }}</span>
|
||||||
<span>0 ₽</span>
|
<span>0 {{ currentCurrency }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="summary-row total">
|
<div class="summary-row total">
|
||||||
<span>{{ 'cart.toPay' | translate }}</span>
|
<span>{{ 'cart.toPay' | translate }}</span>
|
||||||
<span class="total-price">{{ totalPrice() | number:'1.2-2' }} ₽</span>
|
<span class="total-price">{{ totalPrice() | number:'1.2-2' }} {{ currentCurrency }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="terms-agreement">
|
<div class="terms-agreement">
|
||||||
@@ -138,6 +149,36 @@
|
|||||||
>
|
>
|
||||||
{{ 'cart.checkout' | translate }}
|
{{ 'cart.checkout' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@if (!isAuthenticated()) {
|
||||||
|
<div class="cart-login-gate">
|
||||||
|
<div class="login-gate-icon">
|
||||||
|
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||||
|
<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<p class="login-gate-title">{{ 'cart.loginRequired' | translate }}</p>
|
||||||
|
<p class="login-gate-desc">{{ 'cart.loginRequiredDesc' | translate }}</p>
|
||||||
|
|
||||||
|
<button class="telegram-login-btn" (click)="requestLogin()">
|
||||||
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
|
||||||
|
<path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/>
|
||||||
|
</svg>
|
||||||
|
{{ 'cart.loginWithTelegram' | translate }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="login-gate-qr">
|
||||||
|
<p class="qr-hint">{{ 'cart.orScanQr' | translate }}</p>
|
||||||
|
<div class="qr-wrapper">
|
||||||
|
<img [src]="'https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=' + loginUrl()"
|
||||||
|
alt="QR Code"
|
||||||
|
width="150"
|
||||||
|
height="150"
|
||||||
|
loading="lazy" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -174,7 +215,7 @@
|
|||||||
<div class="payment-info">
|
<div class="payment-info">
|
||||||
<div class="payment-amount">
|
<div class="payment-amount">
|
||||||
<span class="label">{{ 'cart.amountToPay' | translate }}</span>
|
<span class="label">{{ 'cart.amountToPay' | translate }}</span>
|
||||||
<span class="amount">{{ totalPrice() | number:'1.2-2' }} RUB</span>
|
<span class="amount">{{ totalPrice() | number:'1.2-2' }} {{ currentCurrency }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="waiting-indicator">
|
<div class="waiting-indicator">
|
||||||
@@ -264,3 +305,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<app-telegram-login />
|
||||||
|
|||||||
@@ -364,6 +364,22 @@
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cart-item-variants {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 4px;
|
||||||
|
|
||||||
|
.cart-variant {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #497671;
|
||||||
|
background: rgba(73, 118, 113, 0.08);
|
||||||
|
padding: 3px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.item-footer {
|
.item-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -464,6 +480,22 @@
|
|||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cart-item-variants {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 4px;
|
||||||
|
|
||||||
|
.cart-variant {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #6366f1;
|
||||||
|
background: rgba(99, 102, 241, 0.08);
|
||||||
|
padding: 3px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.item-footer {
|
.item-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -689,6 +721,85 @@
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cart-login-gate {
|
||||||
|
margin-top: 16px;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: rgba(42, 171, 238, 0.05);
|
||||||
|
border: 1px dashed rgba(42, 171, 238, 0.3);
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.login-gate-icon {
|
||||||
|
margin: 0 auto 10px;
|
||||||
|
width: 56px;
|
||||||
|
height: 56px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(42, 171, 238, 0.1);
|
||||||
|
color: #2AABEE;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-gate-title {
|
||||||
|
margin: 0 0 4px;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1a1a1a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-gate-desc {
|
||||||
|
margin: 0 0 16px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #6b7280;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.telegram-login-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #2AABEE;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #229ED9;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 4px 12px rgba(42, 171, 238, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-gate-qr {
|
||||||
|
margin-top: 14px;
|
||||||
|
|
||||||
|
.qr-hint {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-wrapper {
|
||||||
|
display: inline-flex;
|
||||||
|
padding: 10px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
|
||||||
|
img {
|
||||||
|
display: block;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Novo Cart Summary - Green Modern
|
// Novo Cart Summary - Green Modern
|
||||||
|
|||||||
@@ -7,15 +7,16 @@ import { Item, CartItem } from '../../models';
|
|||||||
import { interval, Subscription } from 'rxjs';
|
import { interval, Subscription } from 'rxjs';
|
||||||
import { switchMap, take } from 'rxjs/operators';
|
import { switchMap, take } from 'rxjs/operators';
|
||||||
import { EmptyCartIconComponent } from '../../components/empty-cart-icon/empty-cart-icon.component';
|
import { EmptyCartIconComponent } from '../../components/empty-cart-icon/empty-cart-icon.component';
|
||||||
|
import { TelegramLoginComponent } from '../../components/telegram-login/telegram-login.component';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../../environments/environment';
|
||||||
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass } from '../../utils/item.utils';
|
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass, getTranslatedField } from '../../utils/item.utils';
|
||||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||||
import { TranslateService } from '../../i18n/translate.service';
|
import { TranslateService } from '../../i18n/translate.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-cart',
|
selector: 'app-cart',
|
||||||
imports: [DecimalPipe, RouterLink, FormsModule, EmptyCartIconComponent, LangRoutePipe, TranslatePipe],
|
imports: [DecimalPipe, RouterLink, FormsModule, EmptyCartIconComponent, TelegramLoginComponent, LangRoutePipe, TranslatePipe],
|
||||||
templateUrl: './cart.component.html',
|
templateUrl: './cart.component.html',
|
||||||
styleUrls: ['./cart.component.scss'],
|
styleUrls: ['./cart.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
@@ -30,6 +31,9 @@ export class CartComponent implements OnDestroy {
|
|||||||
private i18n = inject(TranslateService);
|
private i18n = inject(TranslateService);
|
||||||
private authService = inject(AuthService);
|
private authService = inject(AuthService);
|
||||||
|
|
||||||
|
isAuthenticated = this.authService.isAuthenticated;
|
||||||
|
loginUrl = signal('');
|
||||||
|
|
||||||
// Swipe state
|
// Swipe state
|
||||||
swipedItemId = signal<number | null>(null);
|
swipedItemId = signal<number | null>(null);
|
||||||
|
|
||||||
@@ -64,6 +68,11 @@ export class CartComponent implements OnDestroy {
|
|||||||
this.items = this.cartService.items;
|
this.items = this.cartService.items;
|
||||||
this.itemCount = this.cartService.itemCount;
|
this.itemCount = this.cartService.itemCount;
|
||||||
this.totalPrice = this.cartService.totalPrice;
|
this.totalPrice = this.cartService.totalPrice;
|
||||||
|
this.loginUrl.set(this.authService.getTelegramLoginUrl());
|
||||||
|
}
|
||||||
|
|
||||||
|
requestLogin(): void {
|
||||||
|
this.authService.requestLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
@@ -131,6 +140,10 @@ export class CartComponent implements OnDestroy {
|
|||||||
readonly getDiscountedPrice = getDiscountedPrice;
|
readonly getDiscountedPrice = getDiscountedPrice;
|
||||||
readonly getBadgeClass = getBadgeClass;
|
readonly getBadgeClass = getBadgeClass;
|
||||||
|
|
||||||
|
itemName(item: Item): string { return getTranslatedField(item, 'name', this.langService.currentLanguage()); }
|
||||||
|
itemDesc(item: Item): string { return getTranslatedField(item, 'simpleDescription', this.langService.currentLanguage()); }
|
||||||
|
get currentCurrency(): string { return this.langService.currentCurrency(); }
|
||||||
|
|
||||||
checkout(): void {
|
checkout(): void {
|
||||||
if (!this.termsAccepted) {
|
if (!this.termsAccepted) {
|
||||||
alert(this.i18n.t('cart.acceptTerms'));
|
alert(this.i18n.t('cart.acceptTerms'));
|
||||||
@@ -174,7 +187,7 @@ export class CartComponent implements OnDestroy {
|
|||||||
|
|
||||||
const paymentData = {
|
const paymentData = {
|
||||||
amount: this.totalPrice(),
|
amount: this.totalPrice(),
|
||||||
currency: 'RUB',
|
currency: this.langService.currentCurrency(),
|
||||||
siteuserID: userId,
|
siteuserID: userId,
|
||||||
siteorderID: orderId,
|
siteorderID: orderId,
|
||||||
redirectUrl: '',
|
redirectUrl: '',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="item-card">
|
<div class="item-card">
|
||||||
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-link">
|
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-link">
|
||||||
<div class="item-image">
|
<div class="item-image">
|
||||||
<img [src]="getMainImage(item)" [alt]="item.name" loading="lazy" decoding="async" width="300" height="300" />
|
<img [src]="getMainImage(item)" [alt]="itemName(item)" loading="lazy" decoding="async" width="300" height="300" />
|
||||||
@if (item.discount > 0) {
|
@if (item.discount > 0) {
|
||||||
<div class="discount-badge">-{{ item.discount }}%</div>
|
<div class="discount-badge">-{{ item.discount }}%</div>
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-details">
|
<div class="item-details">
|
||||||
<h3 class="item-name">{{ item.name }}</h3>
|
<h3 class="item-name">{{ itemName(item) }}</h3>
|
||||||
|
|
||||||
<div class="item-rating">
|
<div class="item-rating">
|
||||||
<span class="rating-stars">⭐ {{ item.rating }}</span>
|
<span class="rating-stars">⭐ {{ item.rating }}</span>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Component, OnInit, OnDestroy, signal, HostListener, ChangeDetectionStrategy } from '@angular/core';
|
import { Component, OnInit, OnDestroy, signal, HostListener, ChangeDetectionStrategy, inject } from '@angular/core';
|
||||||
import { DecimalPipe } from '@angular/common';
|
import { DecimalPipe } from '@angular/common';
|
||||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||||
import { ApiService, CartService } from '../../services';
|
import { ApiService, CartService } from '../../services';
|
||||||
import { Item } from '../../models';
|
import { Item } from '../../models';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass } from '../../utils/item.utils';
|
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass, getTranslatedField } from '../../utils/item.utils';
|
||||||
|
import { LanguageService } from '../../services/language.service';
|
||||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ export class CategoryComponent implements OnInit, OnDestroy {
|
|||||||
hasMore = signal(true);
|
hasMore = signal(true);
|
||||||
|
|
||||||
private skip = 0;
|
private skip = 0;
|
||||||
private readonly count = 20;
|
private readonly count = 50;
|
||||||
private isLoadingMore = false;
|
private isLoadingMore = false;
|
||||||
private routeSubscription?: Subscription;
|
private routeSubscription?: Subscription;
|
||||||
private scrollTimeout?: ReturnType<typeof setTimeout>;
|
private scrollTimeout?: ReturnType<typeof setTimeout>;
|
||||||
@@ -108,4 +109,7 @@ export class CategoryComponent implements OnInit, OnDestroy {
|
|||||||
readonly getMainImage = getMainImage;
|
readonly getMainImage = getMainImage;
|
||||||
readonly trackByItemId = trackByItemId;
|
readonly trackByItemId = trackByItemId;
|
||||||
readonly getBadgeClass = getBadgeClass;
|
readonly getBadgeClass = getBadgeClass;
|
||||||
|
|
||||||
|
private langService = inject(LanguageService);
|
||||||
|
itemName(item: Item): string { return getTranslatedField(item, 'name', this.langService.currentLanguage()); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,30 @@
|
|||||||
<h2>{{ parentName() }}</h2>
|
<h2>{{ parentName() }}</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<!-- Nested subcategories from API (backOffice format with hasItems) -->
|
||||||
|
@if (nestedSubcategories().length > 0) {
|
||||||
|
<div class="categories-grid">
|
||||||
|
@for (sub of nestedSubcategories(); track trackBySubId($index, sub)) {
|
||||||
|
<a [routerLink]="['/category', sub.id] | langRoute" class="category-card">
|
||||||
|
<div class="category-image">
|
||||||
|
@if (sub.img) {
|
||||||
|
<img [src]="sub.img" [alt]="sub.name" loading="lazy" decoding="async" />
|
||||||
|
} @else {
|
||||||
|
<div class="category-fallback">{{ sub.name.charAt(0) }}</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="category-info">
|
||||||
|
<h3 class="category-name">{{ sub.name }}</h3>
|
||||||
|
@if (sub.itemCount) {
|
||||||
|
<span class="category-count">{{ sub.itemCount }}</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<!-- Legacy flat subcategories -->
|
||||||
@if (subcategories().length > 0) {
|
@if (subcategories().length > 0) {
|
||||||
<div class="categories-grid">
|
<div class="categories-grid">
|
||||||
@for (cat of subcategories(); track trackByCategoryId($index, cat)) {
|
@for (cat of subcategories(); track trackByCategoryId($index, cat)) {
|
||||||
@@ -35,7 +59,53 @@
|
|||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<!-- Items directly in this category -->
|
||||||
|
@if (categoryItems().length > 0) {
|
||||||
|
<div class="category-items-section">
|
||||||
|
<h3 class="items-section-title">{{ 'subcategories.itemsInCategory' | translate }}</h3>
|
||||||
|
<div class="items-grid">
|
||||||
|
@for (item of categoryItems(); track trackByItemId($index, item)) {
|
||||||
|
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-card">
|
||||||
|
<div class="item-image">
|
||||||
|
<img [src]="getMainImage(item)" [alt]="itemName(item)" loading="lazy" decoding="async" />
|
||||||
|
@if (item.discount > 0) {
|
||||||
|
<span class="item-discount">-{{ item.discount }}%</span>
|
||||||
|
}
|
||||||
|
@if (item.badges && item.badges.length > 0) {
|
||||||
|
<div class="item-badges">
|
||||||
|
@for (badge of item.badges; track badge) {
|
||||||
|
<span class="item-badge" [class]="getBadgeClass(badge)">{{ badge }}</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="item-info">
|
||||||
|
<h4 class="item-name">{{ itemName(item) }}</h4>
|
||||||
|
<div class="item-price">
|
||||||
|
@if (item.discount > 0) {
|
||||||
|
<span class="old-price">{{ item.price }} {{ item.currency }}</span>
|
||||||
|
<span class="current-price">{{ getDiscountedPrice(item) | number:'1.0-0' }} {{ item.currency }}</span>
|
||||||
} @else {
|
} @else {
|
||||||
|
<span class="current-price">{{ item.price }} {{ item.currency }}</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<button class="item-cart-btn" (click)="addToCart(item.itemID, $event)">
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<circle cx="9" cy="21" r="1"></circle>
|
||||||
|
<circle cx="20" cy="21" r="1"></circle>
|
||||||
|
<path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (!hasSubcategories() && categoryItems().length === 0) {
|
||||||
<div class="no-subcats">
|
<div class="no-subcats">
|
||||||
<div class="no-subcats-icon">
|
<div class="no-subcats-icon">
|
||||||
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|||||||
@@ -235,6 +235,149 @@
|
|||||||
min-height: calc(2 * 1.3em);
|
min-height: calc(2 * 1.3em);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.category-count {
|
||||||
|
font-family: "DM Sans", sans-serif;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #697777;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Items section within subcategories page
|
||||||
|
.category-items-section {
|
||||||
|
margin-top: 40px;
|
||||||
|
|
||||||
|
.items-section-title {
|
||||||
|
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1e3c38;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.items-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #d3dad9;
|
||||||
|
border-radius: 13px;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-image {
|
||||||
|
position: relative;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f5f5f5;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-card:hover & img {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-discount {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
background: #dc2626;
|
||||||
|
color: white;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-badges {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
left: 8px;
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-badge {
|
||||||
|
font-size: 0.65rem;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-info {
|
||||||
|
padding: 12px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-name {
|
||||||
|
font-family: "DM Sans", sans-serif;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1e3c38;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 1.3;
|
||||||
|
display: -webkit-box;
|
||||||
|
line-clamp: 2;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-price {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.old-price {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #a1b4b5;
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
.current-price {
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1e3c38;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-cart-btn {
|
||||||
|
align-self: flex-end;
|
||||||
|
background: #497671;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #3a5f5b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Keyframes
|
// Keyframes
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
to { transform: rotate(360deg); }
|
to { transform: rotate(360deg); }
|
||||||
@@ -248,6 +391,11 @@
|
|||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.items-grid {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 992px) {
|
@media (max-width: 992px) {
|
||||||
@@ -273,6 +421,11 @@
|
|||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.items-grid {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.category-info {
|
.category-info {
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
}
|
}
|
||||||
@@ -294,6 +447,11 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.items-grid {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.category-info {
|
.category-info {
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
import { Component, OnInit, OnDestroy, signal, ChangeDetectionStrategy, inject } from '@angular/core';
|
import { Component, OnInit, OnDestroy, signal, ChangeDetectionStrategy, inject } from '@angular/core';
|
||||||
|
import { DecimalPipe } from '@angular/common';
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||||
import { ApiService, LanguageService } from '../../services';
|
import { ApiService, CartService, LanguageService } from '../../services';
|
||||||
import { Category } from '../../models';
|
import { Category, Item, Subcategory } from '../../models';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||||
import { TranslateService } from '../../i18n/translate.service';
|
import { TranslateService } from '../../i18n/translate.service';
|
||||||
|
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass, getTranslatedField } from '../../utils/item.utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-subcategories',
|
selector: 'app-subcategories',
|
||||||
imports: [RouterLink, LangRoutePipe, TranslatePipe],
|
imports: [DecimalPipe, RouterLink, LangRoutePipe, TranslatePipe],
|
||||||
templateUrl: './subcategories.component.html',
|
templateUrl: './subcategories.component.html',
|
||||||
styleUrls: ['./subcategories.component.scss'],
|
styleUrls: ['./subcategories.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
@@ -17,6 +19,10 @@ import { TranslateService } from '../../i18n/translate.service';
|
|||||||
export class SubcategoriesComponent implements OnInit, OnDestroy {
|
export class SubcategoriesComponent implements OnInit, OnDestroy {
|
||||||
categories = signal<Category[]>([]);
|
categories = signal<Category[]>([]);
|
||||||
subcategories = signal<Category[]>([]);
|
subcategories = signal<Category[]>([]);
|
||||||
|
/** Nested subcategories from API with hasItems support */
|
||||||
|
nestedSubcategories = signal<Subcategory[]>([]);
|
||||||
|
/** Items belonging directly to this category (when hasItems is true) */
|
||||||
|
categoryItems = signal<Item[]>([]);
|
||||||
loading = signal(true);
|
loading = signal(true);
|
||||||
error = signal<string | null>(null);
|
error = signal<string | null>(null);
|
||||||
|
|
||||||
@@ -29,7 +35,8 @@ export class SubcategoriesComponent implements OnInit, OnDestroy {
|
|||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private langService: LanguageService
|
private langService: LanguageService,
|
||||||
|
private cartService: CartService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@@ -45,19 +52,40 @@ export class SubcategoriesComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
private loadForParent(parentID: number): void {
|
private loadForParent(parentID: number): void {
|
||||||
this.loading.set(true);
|
this.loading.set(true);
|
||||||
|
this.categoryItems.set([]);
|
||||||
|
this.nestedSubcategories.set([]);
|
||||||
|
|
||||||
this.apiService.getCategories().subscribe({
|
this.apiService.getCategories().subscribe({
|
||||||
next: (cats) => {
|
next: (cats) => {
|
||||||
this.categories.set(cats);
|
this.categories.set(cats);
|
||||||
const subs = cats.filter(c => c.parentID === parentID);
|
|
||||||
const parent = cats.find(c => c.categoryID === parentID);
|
const parent = cats.find(c => c.categoryID === parentID);
|
||||||
this.parentName.set(parent ? parent.name : this.i18n.t('home.categoriesTitle'));
|
this.parentName.set(parent ? parent.name : this.i18n.t('home.categoriesTitle'));
|
||||||
|
|
||||||
if (!subs || subs.length === 0) {
|
// Check for nested subcategories from API response (backOffice format)
|
||||||
|
const nested = parent?.subcategories || [];
|
||||||
|
const visibleNested = nested.filter(s => s.visible !== false);
|
||||||
|
|
||||||
|
// Also check flat legacy subcategories
|
||||||
|
const flatSubs = cats.filter(c => c.parentID === parentID);
|
||||||
|
|
||||||
|
if (visibleNested.length > 0) {
|
||||||
|
// Use nested subcategories from API
|
||||||
|
this.nestedSubcategories.set(visibleNested);
|
||||||
|
this.subcategories.set([]);
|
||||||
|
|
||||||
|
// If this category itself has items, load them too
|
||||||
|
this.loadCategoryItems(parentID);
|
||||||
|
} else if (flatSubs.length > 0) {
|
||||||
|
// Legacy flat subcategories
|
||||||
|
this.subcategories.set(flatSubs);
|
||||||
|
this.nestedSubcategories.set([]);
|
||||||
|
|
||||||
|
// Also load items for this category in case it has direct items
|
||||||
|
this.loadCategoryItems(parentID);
|
||||||
|
} else {
|
||||||
// No subcategories: redirect to items list for this category
|
// No subcategories: redirect to items list for this category
|
||||||
const lang = this.langService.currentLanguage();
|
const lang = this.langService.currentLanguage();
|
||||||
this.router.navigate([`/${lang}/category`, parentID, 'items'], { replaceUrl: true });
|
this.router.navigate([`/${lang}/category`, parentID, 'items'], { replaceUrl: true });
|
||||||
} else {
|
|
||||||
this.subcategories.set(subs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loading.set(false);
|
this.loading.set(false);
|
||||||
@@ -70,8 +98,41 @@ export class SubcategoriesComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Load items that belong directly to this category */
|
||||||
|
private loadCategoryItems(categoryID: number): void {
|
||||||
|
this.apiService.getCategoryItems(categoryID, 50, 0).subscribe({
|
||||||
|
next: (items) => {
|
||||||
|
this.categoryItems.set(items);
|
||||||
|
},
|
||||||
|
error: () => {
|
||||||
|
// Not critical — subcategories still work
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
hasSubcategories(): boolean {
|
||||||
|
return this.subcategories().length > 0 || this.nestedSubcategories().length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
addToCart(itemID: number, event: Event): void {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
this.cartService.addItem(itemID);
|
||||||
|
}
|
||||||
|
|
||||||
// TrackBy function for performance optimization
|
// TrackBy function for performance optimization
|
||||||
trackByCategoryId(index: number, category: Category): number {
|
trackByCategoryId(index: number, category: Category): number {
|
||||||
return category.categoryID;
|
return category.categoryID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trackBySubId(index: number, sub: Subcategory): string {
|
||||||
|
return sub.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly getDiscountedPrice = getDiscountedPrice;
|
||||||
|
readonly getMainImage = getMainImage;
|
||||||
|
readonly trackByItemId = trackByItemId;
|
||||||
|
readonly getBadgeClass = getBadgeClass;
|
||||||
|
|
||||||
|
itemName(item: Item): string { return getTranslatedField(item, 'name', this.langService.currentLanguage()); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Frequently Asked Questions (FAQ) 📌</h1>
|
<h1>Frequently Asked Questions (FAQ) 📌</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -238,3 +240,5 @@
|
|||||||
<h2>Need Help?</h2>
|
<h2>Need Help?</h2>
|
||||||
<p>If you have any additional questions, please contact us at <a href="mailto:info@dexarmarket.ru">info@dexarmarket.ru</a> — we will promptly resolve any of your questions!</p>
|
<p>If you have any additional questions, please contact us at <a href="mailto:info@dexarmarket.ru">info@dexarmarket.ru</a> — we will promptly resolve any of your questions!</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Հաճախ տրվող հարցեր (FAQ) 📌</h1>
|
<h1>Հաճախ տրվող հարցեր (FAQ) 📌</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -238,3 +240,5 @@
|
|||||||
<h2>Օգնություն է հարկավոր։</h2>
|
<h2>Օգնություն է հարկավոր։</h2>
|
||||||
<p>Եթե լրացուցիչ հարցեր ունեք, դիմեք <a href="mailto:info@dexarmarket.ru">info@dexarmarket.ru</a> — մենք արագորեն կլուծենք ձեր հարցերը։</p>
|
<p>Եթե լրացուցիչ հարցեր ունեք, դիմեք <a href="mailto:info@dexarmarket.ru">info@dexarmarket.ru</a> — մենք արագորեն կլուծենք ձեր հարցերը։</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Часто задаваемые вопросы (FAQ) 📌</h1>
|
<h1>Часто задаваемые вопросы (FAQ) 📌</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -238,3 +240,5 @@
|
|||||||
<h2>Нужна помощь?</h2>
|
<h2>Нужна помощь?</h2>
|
||||||
<p>Если возникнут дополнительные вопросы, обращайтесь на <a href="mailto:info@dexarmarket.ru">info@dexarmarket.ru</a> — мы оперативно решим любые ваши вопросы!</p>
|
<p>Если возникнут дополнительные вопросы, обращайтесь на <a href="mailto:info@dexarmarket.ru">info@dexarmarket.ru</a> — мы оперативно решим любые ваши вопросы!</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -102,6 +102,34 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if (item()!.colour || item()!.size) {
|
||||||
|
<div class="novo-variants">
|
||||||
|
@if (item()!.colour) {
|
||||||
|
<div class="variant-group">
|
||||||
|
<span class="variant-label">{{ 'itemDetail.colour' | translate }}:</span>
|
||||||
|
<span class="variant-chip colour-chip">{{ item()!.colour }}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (item()!.size) {
|
||||||
|
<div class="variant-group">
|
||||||
|
<span class="variant-label">{{ 'itemDetail.size' | translate }}:</span>
|
||||||
|
<span class="variant-chip size-chip">{{ item()!.size }}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (item()!.attributes && item()!.attributes!.length > 0) {
|
||||||
|
<div class="novo-attributes">
|
||||||
|
@for (attr of item()!.attributes!; track attr.key) {
|
||||||
|
<div class="attribute-row">
|
||||||
|
<span class="attribute-key">{{ attr.key }}</span>
|
||||||
|
<span class="attribute-value">{{ attr.value }}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<button class="novo-add-cart" (click)="addToCart()">
|
<button class="novo-add-cart" (click)="addToCart()">
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
<circle cx="9" cy="21" r="1"></circle>
|
<circle cx="9" cy="21" r="1"></circle>
|
||||||
@@ -339,6 +367,34 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if (item()!.colour || item()!.size) {
|
||||||
|
<div class="dx-variants">
|
||||||
|
@if (item()!.colour) {
|
||||||
|
<div class="variant-group">
|
||||||
|
<span class="variant-label">{{ 'itemDetail.colour' | translate }}:</span>
|
||||||
|
<span class="variant-chip colour-chip">{{ item()!.colour }}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (item()!.size) {
|
||||||
|
<div class="variant-group">
|
||||||
|
<span class="variant-label">{{ 'itemDetail.size' | translate }}:</span>
|
||||||
|
<span class="variant-chip size-chip">{{ item()!.size }}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (item()!.attributes && item()!.attributes!.length > 0) {
|
||||||
|
<div class="dx-attributes">
|
||||||
|
@for (attr of item()!.attributes!; track attr.key) {
|
||||||
|
<div class="attribute-row">
|
||||||
|
<span class="attribute-key">{{ attr.key }}</span>
|
||||||
|
<span class="attribute-value">{{ attr.value }}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<button class="dx-add-cart" (click)="addToCart()">
|
<button class="dx-add-cart" (click)="addToCart()">
|
||||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
<circle cx="9" cy="21" r="1"></circle>
|
<circle cx="9" cy="21" r="1"></circle>
|
||||||
|
|||||||
@@ -291,6 +291,64 @@ $dx-card-bg: #f5f3f9;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Variant chips (colour/size) — shared between dexar and novo
|
||||||
|
.dx-variants, .novo-variants {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
.variant-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.variant-label {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: #6b7280;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.variant-chip {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 6px 14px;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 600;
|
||||||
|
border: 1.5px solid $dx-border;
|
||||||
|
background: rgba(73, 118, 113, 0.06);
|
||||||
|
color: $dx-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dx-attributes, .novo-attributes {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px 16px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
padding: 10px 14px;
|
||||||
|
background: #f8fafa;
|
||||||
|
border-radius: 10px;
|
||||||
|
|
||||||
|
.attribute-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attribute-key {
|
||||||
|
color: #6b7280;
|
||||||
|
&::after { content: ':'; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.attribute-value {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1a1a1a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.dx-description {
|
.dx-description {
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
border-top: 1px solid $dx-border;
|
border-top: 1px solid $dx-border;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Company Details</h1>
|
<h1>Company Details</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -96,3 +98,5 @@
|
|||||||
<p><strong>General Director:</strong> Hovhannisyan Ashot Rafikovich</p>
|
<p><strong>General Director:</strong> Hovhannisyan Ashot Rafikovich</p>
|
||||||
<p><strong>Basis of authority:</strong> Charter</p>
|
<p><strong>Basis of authority:</strong> Charter</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Կազմակերպության տվյալներ</h1>
|
<h1>Կազմակերպության տվյալներ</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -96,3 +98,5 @@
|
|||||||
<p><strong>Գլխավոր տնօրեն՝</strong> Օհաննիսյան Աշոտ Ռաֆիկի</p>
|
<p><strong>Գլխավոր տնօրեն՝</strong> Օհաննիսյան Աշոտ Ռաֆիկի</p>
|
||||||
<p><strong>Գործողության հիմք՝</strong> Կանոնադրություն</p>
|
<p><strong>Գործողության հիմք՝</strong> Կանոնադրություն</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Реквизиты организации</h1>
|
<h1>Реквизиты организации</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -96,3 +98,5 @@
|
|||||||
<p><strong>Генеральный директор:</strong> Оганнисян Ашот Рафикович</p>
|
<p><strong>Генеральный директор:</strong> Оганнисян Ашот Рафикович</p>
|
||||||
<p><strong>Основание действий:</strong> Устав</p>
|
<p><strong>Основание действий:</strong> Устав</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Payment Terms</h1>
|
<h1>Payment Terms</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -111,3 +113,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>When contacting us, please provide your order number and a brief description of the issue for a faster resolution.</p>
|
<p>When contacting us, please provide your order number and a brief description of the issue for a faster resolution.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Վճարման կանոններ</h1>
|
<h1>Վճարման կանոններ</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -111,3 +113,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>Դիմելիս նշեք պատվերի համարը և խնդրի հակիրճ նկարագրությունը՝ հարցի ավելի արագ լուծման համար։</p>
|
<p>Դիմելիս նշեք պատվերի համարը և խնդրի հակիրճ նկարագրությունը՝ հարցի ավելի արագ լուծման համար։</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Правила оплаты</h1>
|
<h1>Правила оплаты</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -111,3 +113,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>При обращении указывайте номер заказа и краткое описание проблемы для более быстрого решения вопроса.</p>
|
<p>При обращении указывайте номер заказа и краткое описание проблемы для более быстрого решения вопроса.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>PERSONAL DATA PROCESSING POLICY</h1>
|
<h1>PERSONAL DATA PROCESSING POLICY</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -361,3 +363,5 @@
|
|||||||
|
|
||||||
<p>12.3. If the Operator can reasonably associate the information specified in this section with the personal account of a specific User, then such information may be processed together with the PD and other personal information of such User.</p>
|
<p>12.3. If the Operator can reasonably associate the information specified in this section with the personal account of a specific User, then such information may be processed together with the PD and other personal information of such User.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>PERSONAL DATA PROCESSING POLICY</h1>
|
<h1>PERSONAL DATA PROCESSING POLICY</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -361,3 +363,5 @@
|
|||||||
|
|
||||||
<p>12.3. If the Operator can reasonably associate the information specified in this section with the personal account of a specific User, then such information may be processed together with the PD and other personal information of such User.</p>
|
<p>12.3. If the Operator can reasonably associate the information specified in this section with the personal account of a specific User, then such information may be processed together with the PD and other personal information of such User.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>ПОЛИТИКА В ОТНОШЕНИИ ОБРАБОТКИ ПЕРСОНАЛЬНЫХ ДАННЫХ</h1>
|
<h1>ПОЛИТИКА В ОТНОШЕНИИ ОБРАБОТКИ ПЕРСОНАЛЬНЫХ ДАННЫХ</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -361,3 +363,5 @@
|
|||||||
|
|
||||||
<p>12.3. Если Оператор может разумно соотнести указанные в настоящем разделе сведения с личным кабинетом конкретного Пользователя, то такие сведения могут обрабатываться совместно с ПДн и иной личной информацией такого Пользователя.</p>
|
<p>12.3. Если Оператор может разумно соотнести указанные в настоящем разделе сведения с личным кабинетом конкретного Пользователя, то такие сведения могут обрабатываться совместно с ПДн и иной личной информацией такого Пользователя.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>PUBLIC OFFER AGREEMENT</h1>
|
<h1>PUBLIC OFFER AGREEMENT</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -459,3 +461,5 @@
|
|||||||
<p><strong>16.8. Response to Violations</strong></p>
|
<p><strong>16.8. Response to Violations</strong></p>
|
||||||
<p>Non-intervention by the Site Owner in the event of violations of agreements by Users does not prevent subsequent measures to protect the Owner's interests at a later date.</p>
|
<p>Non-intervention by the Site Owner in the event of violations of agreements by Users does not prevent subsequent measures to protect the Owner's interests at a later date.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
<h1>Հdelays DELAYS ՀԱՄDELAYS</h1>
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
|
<h1>Հdelays DELAYS ՀԱՄDELAYS</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>СОГЛАШЕНИЕ ПУБЛИЧНОЙ ОФЕРТЫ</h1>
|
<h1>СОГЛАШЕНИЕ ПУБЛИЧНОЙ ОФЕРТЫ</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -459,3 +461,5 @@
|
|||||||
<p><strong>16.8. Реакция на нарушения</strong></p>
|
<p><strong>16.8. Реакция на нарушения</strong></p>
|
||||||
<p>Невмешательство Владельца сайта в случае нарушений соглашений Пользователями не препятствует последующим мерам защиты интересов Владельца позже.</p>
|
<p>Невмешательство Владельца сайта в случае нарушений соглашений Пользователями не препятствует последующим мерам защиты интересов Владельца позже.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Return Policy</h1>
|
<h1>Return Policy</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -128,3 +130,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>If the conflict cannot be resolved amicably, the Buyer has the right to file a complaint with Rospotrebnadzor or the court at the Seller's location.</p>
|
<p>If the conflict cannot be resolved amicably, the Buyer has the right to file a complaint with Rospotrebnadzor or the court at the Seller's location.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Ապրանքների վերադարձի քաղաքականություն</h1>
|
<h1>Ապրանքների վերադարձի քաղաքականություն</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -128,3 +130,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>Եթե կոնֆլիկտը հնարավոր չէ լուծել խաղաղ ճանապարհով՝ Գնորդը իրավունք ունի բողոք ներկայացնելու Ռոսպոտրեբնաձոր կամ դատարան Վաճառողի գտնվելու վայրում։</p>
|
<p>Եթե կոնֆլիկտը հնարավոր չէ լուծել խաղաղ ճանապարհով՝ Գնորդը իրավունք ունի բողոք ներկայացնելու Ռոսպոտրեբնաձոր կամ դատարան Վաճառողի գտնվելու վայրում։</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div class="legal-page">
|
||||||
|
<div class="legal-container">
|
||||||
<h1>Политика возврата товаров</h1>
|
<h1>Политика возврата товаров</h1>
|
||||||
|
|
||||||
<section class="legal-section">
|
<section class="legal-section">
|
||||||
@@ -128,3 +130,5 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>Если конфликт невозможно разрешить мирно, Покупатель вправе подать жалобу в Роспотребнадзор или суд по месту расположения Продавца.</p>
|
<p>Если конфликт невозможно разрешить мирно, Покупатель вправе подать жалобу в Роспотребнадзор или суд по месту расположения Продавца.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<div class="item-card">
|
<div class="item-card">
|
||||||
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-link">
|
<a [routerLink]="['/item', item.itemID] | langRoute" class="item-link">
|
||||||
<div class="item-image">
|
<div class="item-image">
|
||||||
<img [src]="getMainImage(item)" [alt]="item.name" loading="lazy" decoding="async" width="300" height="300" />
|
<img [src]="getMainImage(item)" [alt]="itemName(item)" loading="lazy" decoding="async" width="300" height="300" />
|
||||||
@if (item.discount > 0) {
|
@if (item.discount > 0) {
|
||||||
<div class="discount-badge">-{{ item.discount }}%</div>
|
<div class="discount-badge">-{{ item.discount }}%</div>
|
||||||
}
|
}
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-details">
|
<div class="item-details">
|
||||||
<h3 class="item-name">{{ item.name }}</h3>
|
<h3 class="item-name">{{ itemName(item) }}</h3>
|
||||||
|
|
||||||
@if (item.simpleDescription) {
|
@if (itemDesc(item)) {
|
||||||
<p class="item-simple-desc">{{ item.simpleDescription }}</p>
|
<p class="item-simple-desc">{{ itemDesc(item) }}</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="item-rating">
|
<div class="item-rating">
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import { ApiService, CartService } from '../../services';
|
|||||||
import { Item } from '../../models';
|
import { Item } from '../../models';
|
||||||
import { Subject, Subscription } from 'rxjs';
|
import { Subject, Subscription } from 'rxjs';
|
||||||
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
||||||
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass } from '../../utils/item.utils';
|
import { getDiscountedPrice, getMainImage, trackByItemId, getBadgeClass, getTranslatedField } from '../../utils/item.utils';
|
||||||
|
import { LanguageService } from '../../services/language.service';
|
||||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||||
import { TranslateService } from '../../i18n/translate.service';
|
import { TranslateService } from '../../i18n/translate.service';
|
||||||
@@ -27,7 +28,7 @@ export class SearchComponent implements OnDestroy {
|
|||||||
totalResults = signal<number>(0);
|
totalResults = signal<number>(0);
|
||||||
|
|
||||||
private skip = 0;
|
private skip = 0;
|
||||||
private readonly count = 20;
|
private readonly count = 50;
|
||||||
private isLoadingMore = false;
|
private isLoadingMore = false;
|
||||||
private searchSubject = new Subject<string>();
|
private searchSubject = new Subject<string>();
|
||||||
private searchSubscription: Subscription;
|
private searchSubscription: Subscription;
|
||||||
@@ -137,4 +138,8 @@ export class SearchComponent implements OnDestroy {
|
|||||||
readonly getMainImage = getMainImage;
|
readonly getMainImage = getMainImage;
|
||||||
readonly trackByItemId = trackByItemId;
|
readonly trackByItemId = trackByItemId;
|
||||||
readonly getBadgeClass = getBadgeClass;
|
readonly getBadgeClass = getBadgeClass;
|
||||||
|
|
||||||
|
private langService = inject(LanguageService);
|
||||||
|
itemName(item: Item): string { return getTranslatedField(item, 'name', this.langService.currentLanguage()); }
|
||||||
|
itemDesc(item: Item): string { return getTranslatedField(item, 'simpleDescription', this.langService.currentLanguage()); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ export class ApiService {
|
|||||||
* legacy marketplace format and the new backOffice API format.
|
* legacy marketplace format and the new backOffice API format.
|
||||||
*/
|
*/
|
||||||
private normalizeItem(raw: any): Item {
|
private normalizeItem(raw: any): Item {
|
||||||
const item: Item = { ...raw };
|
const { partnerID, ...rest } = raw;
|
||||||
|
const item: Item = { ...rest };
|
||||||
|
|
||||||
// Map backOffice string id → legacy numeric itemID
|
// Map backOffice string id → legacy numeric itemID
|
||||||
if (raw.id != null && raw.itemID == null) {
|
if (raw.id != null && raw.itemID == null) {
|
||||||
@@ -30,6 +31,13 @@ export class ApiService {
|
|||||||
if (raw.imgs && (!raw.photos || raw.photos.length === 0)) {
|
if (raw.imgs && (!raw.photos || raw.photos.length === 0)) {
|
||||||
item.photos = raw.imgs.map((url: string) => ({ url }));
|
item.photos = raw.imgs.map((url: string) => ({ url }));
|
||||||
}
|
}
|
||||||
|
// Normalize photo type: API sends type='video'|'photo', template checks .video
|
||||||
|
if (item.photos) {
|
||||||
|
item.photos = item.photos.map((p: any) => ({
|
||||||
|
...p,
|
||||||
|
video: p.video || (p.type === 'video' ? p.url : undefined),
|
||||||
|
}));
|
||||||
|
}
|
||||||
item.imgs = raw.imgs || raw.photos?.map((p: any) => p.url) || [];
|
item.imgs = raw.imgs || raw.photos?.map((p: any) => p.url) || [];
|
||||||
|
|
||||||
// Map backOffice description (key-value array) → legacy description string
|
// Map backOffice description (key-value array) → legacy description string
|
||||||
@@ -40,6 +48,33 @@ export class ApiService {
|
|||||||
item.description = raw.description || raw.simpleDescription || '';
|
item.description = raw.description || raw.simpleDescription || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Map backend names[] → translations (multi-lang name support)
|
||||||
|
if (raw.names && Array.isArray(raw.names)) {
|
||||||
|
item.names = raw.names;
|
||||||
|
if (!item.translations) item.translations = {};
|
||||||
|
for (const entry of raw.names) {
|
||||||
|
if (!item.translations[entry.language]) item.translations[entry.language] = {};
|
||||||
|
item.translations[entry.language].name = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map backend descriptions[] → translations (multi-lang descriptions)
|
||||||
|
if (raw.descriptions && Array.isArray(raw.descriptions)) {
|
||||||
|
item.descriptions = raw.descriptions;
|
||||||
|
if (!item.translations) item.translations = {};
|
||||||
|
for (const entry of raw.descriptions) {
|
||||||
|
if (!item.translations[entry.language]) item.translations[entry.language] = {};
|
||||||
|
item.translations[entry.language].simpleDescription = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Preserve attributes from backend
|
||||||
|
item.attributes = raw.attributes || [];
|
||||||
|
|
||||||
|
// Preserve colour & size
|
||||||
|
item.colour = raw.colour || '';
|
||||||
|
item.size = raw.size || '';
|
||||||
|
|
||||||
// Map backOffice comments → legacy callbacks
|
// Map backOffice comments → legacy callbacks
|
||||||
if (raw.comments && (!raw.callbacks || raw.callbacks.length === 0)) {
|
if (raw.comments && (!raw.callbacks || raw.callbacks.length === 0)) {
|
||||||
item.callbacks = raw.comments.map((c: any) => ({
|
item.callbacks = raw.comments.map((c: any) => ({
|
||||||
@@ -77,7 +112,7 @@ export class ApiService {
|
|||||||
item.badges = raw.badges || [];
|
item.badges = raw.badges || [];
|
||||||
item.tags = raw.tags || [];
|
item.tags = raw.tags || [];
|
||||||
item.simpleDescription = raw.simpleDescription || '';
|
item.simpleDescription = raw.simpleDescription || '';
|
||||||
item.translations = raw.translations || {};
|
item.translations = item.translations || raw.translations || {};
|
||||||
item.visible = raw.visible ?? true;
|
item.visible = raw.visible ?? true;
|
||||||
item.priority = raw.priority ?? 0;
|
item.priority = raw.priority ?? 0;
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,18 @@ export interface Language {
|
|||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Currency {
|
||||||
|
code: string;
|
||||||
|
symbol: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class LanguageService {
|
export class LanguageService {
|
||||||
private currentLanguageSignal = signal<string>('ru');
|
private currentLanguageSignal = signal<string>('ru');
|
||||||
|
private currentCurrencySignal = signal<string>('RUB');
|
||||||
|
|
||||||
languages: Language[] = [
|
languages: Language[] = [
|
||||||
{ code: 'ru', name: 'Русский', flag: '🇷🇺', flagSvg: '/flags/ru.svg', enabled: true },
|
{ code: 'ru', name: 'Русский', flag: '🇷🇺', flagSvg: '/flags/ru.svg', enabled: true },
|
||||||
@@ -21,7 +28,15 @@ export class LanguageService {
|
|||||||
{ code: 'hy', name: 'Հայերեն', flag: '🇦🇲', flagSvg: '/flags/arm.svg', enabled: true }
|
{ code: 'hy', name: 'Հայերեն', flag: '🇦🇲', flagSvg: '/flags/arm.svg', enabled: true }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
currencies: Currency[] = [
|
||||||
|
{ code: 'RUB', symbol: '₽', name: 'Рубль' },
|
||||||
|
{ code: 'USD', symbol: '$', name: 'Dollar' },
|
||||||
|
{ code: 'EUR', symbol: '€', name: 'Euro' },
|
||||||
|
{ code: 'AMD', symbol: '֏', name: 'Դրամ' },
|
||||||
|
];
|
||||||
|
|
||||||
currentLanguage = this.currentLanguageSignal.asReadonly();
|
currentLanguage = this.currentLanguageSignal.asReadonly();
|
||||||
|
currentCurrency = this.currentCurrencySignal.asReadonly();
|
||||||
|
|
||||||
constructor(private router: Router) {
|
constructor(private router: Router) {
|
||||||
// Load saved language from localStorage
|
// Load saved language from localStorage
|
||||||
@@ -29,6 +44,11 @@ export class LanguageService {
|
|||||||
if (savedLang && this.languages.find(l => l.code === savedLang && l.enabled)) {
|
if (savedLang && this.languages.find(l => l.code === savedLang && l.enabled)) {
|
||||||
this.currentLanguageSignal.set(savedLang);
|
this.currentLanguageSignal.set(savedLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const savedCurrency = localStorage.getItem('selectedCurrency');
|
||||||
|
if (savedCurrency && this.currencies.find(c => c.code === savedCurrency)) {
|
||||||
|
this.currentCurrencySignal.set(savedCurrency);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setLanguage(langCode: string): void {
|
setLanguage(langCode: string): void {
|
||||||
@@ -39,6 +59,18 @@ export class LanguageService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCurrency(code: string): void {
|
||||||
|
const currency = this.currencies.find(c => c.code === code);
|
||||||
|
if (currency) {
|
||||||
|
this.currentCurrencySignal.set(code);
|
||||||
|
localStorage.setItem('selectedCurrency', code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getCurrentCurrency(): Currency | undefined {
|
||||||
|
return this.currencies.find(c => c.code === this.currentCurrencySignal());
|
||||||
|
}
|
||||||
|
|
||||||
/** Change language and navigate to the same page with the new prefix */
|
/** Change language and navigate to the same page with the new prefix */
|
||||||
switchLanguage(langCode: string): void {
|
switchLanguage(langCode: string): void {
|
||||||
const lang = this.languages.find(l => l.code === langCode);
|
const lang = this.languages.find(l => l.code === langCode);
|
||||||
|
|||||||
@@ -61,17 +61,31 @@ export function getBadgeClass(badge: string): string {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the translated name/description for the current language.
|
* Get the translated name/description for the current language.
|
||||||
* Falls back to the default (base) field if no translation exists.
|
* Checks translations map first, then names[]/descriptions[] arrays,
|
||||||
|
* then falls back to the default (base) field.
|
||||||
*/
|
*/
|
||||||
export function getTranslatedField(
|
export function getTranslatedField(
|
||||||
item: Item,
|
item: Item,
|
||||||
field: 'name' | 'simpleDescription',
|
field: 'name' | 'simpleDescription',
|
||||||
lang: string
|
lang: string
|
||||||
): string {
|
): string {
|
||||||
|
// 1. Check translations map (backOffice format)
|
||||||
const translation = item.translations?.[lang];
|
const translation = item.translations?.[lang];
|
||||||
if (translation && translation[field]) {
|
if (translation && translation[field]) {
|
||||||
return translation[field]!;
|
return translation[field]!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. Check names[]/descriptions[] arrays (backend API format)
|
||||||
|
if (field === 'name' && item.names?.length) {
|
||||||
|
const entry = item.names.find(n => n.language === lang);
|
||||||
|
if (entry) return entry.value;
|
||||||
|
}
|
||||||
|
if (field === 'simpleDescription' && item.descriptions?.length) {
|
||||||
|
const entry = item.descriptions.find(d => d.language === lang);
|
||||||
|
if (entry) return entry.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Fallback to base field
|
||||||
if (field === 'name') return item.name;
|
if (field === 'name') return item.name;
|
||||||
if (field === 'simpleDescription') return item.simpleDescription || item.description || '';
|
if (field === 'simpleDescription') return item.simpleDescription || item.description || '';
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// Dexar Market Configuration
|
// Dexar Market Configuration
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
useMockData: true, // Toggle to test with backOffice mock data
|
useMockData: false, // Toggle to test with backOffice mock data
|
||||||
brandName: 'Dexarmarket',
|
brandName: 'Dexarmarket',
|
||||||
brandFullName: 'Dexar Market',
|
brandFullName: 'Dexar Market',
|
||||||
theme: 'dexar',
|
theme: 'dexar',
|
||||||
apiUrl: 'https://api.dexarmarket.ru:445',
|
apiUrl: '/api',
|
||||||
logo: '/assets/images/dexar-logo.svg',
|
logo: '/assets/images/dexar-logo.svg',
|
||||||
contactEmail: 'info@dexarmarket.ru',
|
contactEmail: 'info@dexarmarket.ru',
|
||||||
supportEmail: 'info@dexarmarket.ru',
|
supportEmail: 'info@dexarmarket.ru',
|
||||||
|
|||||||
Reference in New Issue
Block a user