mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-12-22 19:55:12 +00:00
wip: hot-deals vendors
This commit is contained in:
parent
9821c004ec
commit
fe2c064e30
|
@ -20,7 +20,7 @@
|
|||
<div class="bbb_deals_item_category">Amazon: <span id="bbb_deals_item_price_a"><strike>{{productsPricesMap[productId]?.amazonPrice?.price_in_cents/100}}$</strike></span></div>
|
||||
</div>
|
||||
<div class="bbb_deals_info_line d-flex flex-row justify-content-start">
|
||||
<div class="bbb_deals_item_category">Plantshub: <span id="bbb_deals_item_price_b">{{productsPricesMap[productId]?.lowestPrice?.price_in_cents/100}}</span></div>
|
||||
<div class="bbb_deals_item_category">{{productsPricesMap[productId]?.vendor?.name}}: <span id="bbb_deals_item_price_b">{{productsPricesMap[productId]?.lowestPrice?.price_in_cents/100}}</span></div>
|
||||
</div>
|
||||
<div class="available_bar">
|
||||
<span style="width:17%"></span>
|
||||
|
|
|
@ -13,7 +13,7 @@ export class HotDealsWidgetComponent implements OnInit {
|
|||
products: Product[] = [];
|
||||
bestDealsProductIds = [];
|
||||
amazonPrices = [];
|
||||
productsPricesMap: any = {};
|
||||
productsPricesMap = new Map();
|
||||
@Input() numberOfProducts: number;
|
||||
@Input() showProductPicture: boolean;
|
||||
@Input() searchQuery: string;
|
||||
|
@ -52,6 +52,7 @@ export class HotDealsWidgetComponent implements OnInit {
|
|||
default: {
|
||||
this.getProductsByIds();
|
||||
this.getAmazonPricesForBestDeals();
|
||||
this.getVendors()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +80,16 @@ export class HotDealsWidgetComponent implements OnInit {
|
|||
);
|
||||
}
|
||||
|
||||
getVendors(): void {
|
||||
this.productsPricesMap.keys().forEach(
|
||||
key => {
|
||||
const currentDeal = this.productsPricesMap[key].lowestPrice;
|
||||
this.apiService.getVendorById(currentDeal.vendor_id).subscribe(
|
||||
vendor => {
|
||||
this.productsPricesMap[key].vendor = vendor
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getAmazonPricesForBestDeals(): void{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<nav class="navbar navbar-expand-lg bg-secondary text-uppercase fixed-top" id="mainNav">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" routerLink=""> Betterzon</a>
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
<div class="form-inline my-2 my-lg-0">
|
||||
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" (keyup.enter)="getSearchedProducts()" [(ngModel)]="searchQuery">
|
||||
</form>
|
||||
</div>
|
||||
<button class="navbar-toggler text-uppercase font-weight-bold bg-primary text-white rounded" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
Menu
|
||||
<i class="fas fa-bars"></i>
|
||||
|
|
Loading…
Reference in New Issue
Block a user