mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
[HIMA-69][HIMA-73] fixed price format
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="price align-right">
|
||||
<span>{{ product.price }}</span>
|
||||
<span>{{ price }}</span>
|
||||
<span class="currency">{{ product.currency }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,13 @@ export class ProductCardComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
get price() {
|
||||
if (this._product.price.toString().indexOf('.') === -1) {
|
||||
return this._product.price + ',00';
|
||||
}
|
||||
return this._product.price.toString().replace('.', ',');
|
||||
}
|
||||
|
||||
eanChangedSub = new ReplaySubject<string>();
|
||||
|
||||
imageUrl$: Observable<string>;
|
||||
|
||||
@@ -86,7 +86,7 @@ export class ProductDetailsComponent implements OnInit {
|
||||
if (item.pr) {
|
||||
ean = item.pr.ean;
|
||||
eanTag = ean;
|
||||
productIcon$ = this.catImageService.getImageUrl(ean, { width: 469, height: 575});
|
||||
productIcon$ = this.catImageService.getImageUrl(ean, { width: 469, height: 575 });
|
||||
locale = item.pr.locale;
|
||||
publicationDate = getFormatedPublicationDate(item.pr.publicationDate);
|
||||
format = this.selectedItem ? this.selectedItem.pr.formatDetail : null;
|
||||
@@ -109,6 +109,11 @@ export class ProductDetailsComponent implements OnInit {
|
||||
if (item.av.length > 0) {
|
||||
quantity = (item.av[0].qty ? item.av[0].qty : 0) + 'x';
|
||||
price = item.av[0].price.value.value + ' ' + item.av[0].price.value.currency;
|
||||
if (item.av[0].price.value.value.toString().indexOf('.') === -1) {
|
||||
price = item.av[0].price.value.value + ',00 ' + item.av[0].price.value.currency;
|
||||
} else {
|
||||
price = item.av[0].price.value.value.toString().replace('.', ',') + ' ' + item.av[0].price.value.currency;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -26,7 +26,8 @@ export class FeedMapping {
|
||||
firstBookType: feed.items[0].pr.formatDetail,
|
||||
firstBookIcon: feed.items[0].pr.format,
|
||||
firstBookLanguage: feed.items[0].pr.locale,
|
||||
firstBookPrice: feed.items[0].av[0].price.value.value + ' ' + feed.items[0].av[0].price.value.currency
|
||||
firstBookPrice: feed.items[0].av[0].price.value.value,
|
||||
firstBookCurrency: feed.items[0].av[0].price.value.currency
|
||||
};
|
||||
if (feed.items[1]) {
|
||||
books = {
|
||||
@@ -38,7 +39,8 @@ export class FeedMapping {
|
||||
secondBookTypeIcon: feed.items[1].pr.format,
|
||||
secondBookIcon: feed.items[1].pr.format,
|
||||
secondBookLanguage: feed.items[1].pr.locale,
|
||||
secondBookPrice: feed.items[1].av[0].price.value.value + ' ' + feed.items[0].av[0].price.value.currency
|
||||
secondBookPrice: feed.items[1].av[0].price.value.value,
|
||||
secondBookCurrency: feed.items[1].av[0].price.value.currency
|
||||
};
|
||||
}
|
||||
} else if (feed.type === 'events') {
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface FeedBook {
|
||||
firstBookTypeIcon: string;
|
||||
firstBookLanguage: string;
|
||||
firstBookPrice: string;
|
||||
firstBookCurrency: string;
|
||||
firstBookIcon: string;
|
||||
secondBookEan?: string;
|
||||
secondBookAuthor?: string;
|
||||
@@ -16,4 +17,5 @@ export interface FeedBook {
|
||||
secondBookLanguage?: string;
|
||||
secondBookPrice?: string;
|
||||
secondBookIcon?: string;
|
||||
secondBookCurrency?: string;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="item-details wrap-text-more">{{card.books.firstBookLanguage}}</div>
|
||||
<div class="separator">|</div>
|
||||
</div>
|
||||
<div class="item-details wrap-text-more">{{card.books.firstBookPrice}}</div>
|
||||
<div class="item-details wrap-text-more">{{price}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="item-details wrap-text-more">{{card.books.secondBookLanguage}}</div>
|
||||
<div class="separator">|</div>
|
||||
</div>
|
||||
<div class="item-details wrap-text-more">{{card.books.secondBookPrice}}</div>
|
||||
<div class="item-details wrap-text-more">{{secondPrice}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,20 @@ export class BookCardComponent implements OnInit {
|
||||
|
||||
constructor(private catImageService: CatImageService) { }
|
||||
|
||||
get price() {
|
||||
if (this.card.books.firstBookPrice.toString().indexOf('.') === -1) {
|
||||
return this.card.books.firstBookPrice + ',00 ' + this.card.books.firstBookCurrency;
|
||||
}
|
||||
return this.card.books.firstBookPrice.replace('.', ',') + ' ' + this.card.books.firstBookCurrency;
|
||||
}
|
||||
|
||||
get secondPrice() {
|
||||
if (this.card.books.secondBookPrice.toString().indexOf('.') === -1) {
|
||||
return this.card.books.secondBookPrice + ',00 ' + this.card.books.secondBookPrice;
|
||||
}
|
||||
return this.card.books.secondBookPrice.replace('.', ',') + ' ' + this.card.books.secondBookPrice;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.catImageService.getImageUrl(this.card.books.firstBookEan).subscribe(
|
||||
(url: string) => this.firstBookImageUrl$ = of(url)
|
||||
|
||||
Reference in New Issue
Block a user