Merge remote-tracking branch 'origin' into back-office-integration
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
@if (loading()) {
|
||||
<div class="carousel-loading">
|
||||
<div class="spinner"></div>
|
||||
<p>Загрузка товаров...</p>
|
||||
<p>{{ 'carousel.loading' | translate }}</p>
|
||||
</div>
|
||||
} @else if (products().length > 0) {
|
||||
<p-carousel
|
||||
@@ -16,7 +16,7 @@
|
||||
[showIndicators]="true">
|
||||
<ng-template let-product pTemplate="item">
|
||||
<div class="item-card">
|
||||
<a [routerLink]="['/item', product.itemID]" class="item-link">
|
||||
<a [routerLink]="['/item', product.itemID] | langRoute" class="item-link">
|
||||
<div class="item-image">
|
||||
<img [src]="getItemImage(product)" [alt]="product.name" loading="lazy" />
|
||||
@if (product.discount > 0) {
|
||||
@@ -53,7 +53,7 @@
|
||||
<span class="current-price">{{ product.price }} {{ product.currency }}</span>
|
||||
}
|
||||
</div>
|
||||
<button class="cart-icon-btn" (click)="addToCart($event, product)" title="Добавить в корзину">
|
||||
<button class="cart-icon-btn" (click)="addToCart($event, product)" [title]="'carousel.addToCart' | translate">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path>
|
||||
<line x1="3" y1="6" x2="21" y2="6"></line>
|
||||
|
||||
@@ -8,11 +8,13 @@ import { ApiService, CartService } from '../../services';
|
||||
import { Item } from '../../models';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { getDiscountedPrice, getMainImage, getBadgeClass } from '../../utils/item.utils';
|
||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-items-carousel',
|
||||
templateUrl: './items-carousel.component.html',
|
||||
imports: [DecimalPipe, RouterLink, CarouselModule, ButtonModule, TagModule],
|
||||
imports: [DecimalPipe, RouterLink, CarouselModule, ButtonModule, TagModule, LangRoutePipe, TranslatePipe],
|
||||
styleUrls: ['./items-carousel.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
@@ -21,7 +23,7 @@ export class ItemsCarouselComponent implements OnInit {
|
||||
loading = signal(true);
|
||||
isnovo = environment.theme === 'novo';
|
||||
|
||||
responsiveOptions: any[] | undefined;
|
||||
responsiveOptions: { breakpoint: string; numVisible: number; numScroll: number }[] | undefined;
|
||||
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
@@ -68,7 +70,7 @@ export class ItemsCarouselComponent implements OnInit {
|
||||
];
|
||||
}
|
||||
|
||||
getSeverity(remainings: string) {
|
||||
getSeverity(remainings: string): 'success' | 'info' | 'warn' | 'danger' | 'secondary' | 'contrast' {
|
||||
switch (remainings) {
|
||||
case 'high':
|
||||
return 'success';
|
||||
|
||||
Reference in New Issue
Block a user