Loading packages/shop-mobile-ionic/src/app/pages/+products/+searchProducts/searchProducts.component.html +8 −5 Original line number Diff line number Diff line Loading @@ -12,7 +12,10 @@ <ion-list class="brand-dark"> <div class="products-container"> <h5 *ngIf="searchResultProducts?.length === 0" *ngIf=" searchResultProducts.length === 0 && searchResultMerchants.length === 0 " class="not-found-text p-3" > Empty List Loading @@ -30,11 +33,11 @@ <ion-label>{{ merchant.name }} </ion-label> </ion-item> <div class="center"> <div class="center" *ngIf="searchResultMerchants.length"> <ion-button color="tertiary" size="small" (click)="loadMerchants()" (click)="loadMoreMerchants()" >View More</ion-button > </div> Loading Loading @@ -84,11 +87,11 @@ </ion-row> </ion-card> <div class="center"> <div class="center" *ngIf="searchResultProducts.length"> <ion-button color="tertiary" size="small" (click)="loadProducts()" (click)="loadMoreProducts()" >View More</ion-button > </div> Loading packages/shop-mobile-ionic/src/app/pages/+products/+searchProducts/searchProducts.component.ts +32 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,14 @@ export class SearchProductsComponent implements OnInit { } async loadMerchants() { const location = this.getOrdersGeoObj.loc; const merchants = await this.merchantsService.getMerchantsBuyName( this.searchInput, { loc: location } ); this.searchResultMerchants = merchants.slice(0, 5); } async loadMoreMerchants() { const location = this.getOrdersGeoObj.loc; const merchants = await this.merchantsService.getMerchantsBuyName( this.searchInput, Loading @@ -73,6 +81,30 @@ export class SearchProductsComponent implements OnInit { this.store.deliveryType === DeliveryType.Delivery; const isTakeaway = this.store.deliveryType === DeliveryType.Takeaway; await this.geoLocationProductsService .geoLocationProductsByPaging( this.getOrdersGeoObj, { limit: this.loadingOrdersLimit, skip: 0, }, { isDeliveryRequired, isTakeaway, }, this.searchInput ) .pipe(first()) .subscribe((products) => { this.searchResultProducts = products; // products.map((pr) => this.searchResultProducts.push(pr)); }); } async loadMoreProducts() { const isDeliveryRequired = this.store.deliveryType === DeliveryType.Delivery; const isTakeaway = this.store.deliveryType === DeliveryType.Takeaway; await this.geoLocationProductsService .geoLocationProductsByPaging( this.getOrdersGeoObj, Loading Loading
packages/shop-mobile-ionic/src/app/pages/+products/+searchProducts/searchProducts.component.html +8 −5 Original line number Diff line number Diff line Loading @@ -12,7 +12,10 @@ <ion-list class="brand-dark"> <div class="products-container"> <h5 *ngIf="searchResultProducts?.length === 0" *ngIf=" searchResultProducts.length === 0 && searchResultMerchants.length === 0 " class="not-found-text p-3" > Empty List Loading @@ -30,11 +33,11 @@ <ion-label>{{ merchant.name }} </ion-label> </ion-item> <div class="center"> <div class="center" *ngIf="searchResultMerchants.length"> <ion-button color="tertiary" size="small" (click)="loadMerchants()" (click)="loadMoreMerchants()" >View More</ion-button > </div> Loading Loading @@ -84,11 +87,11 @@ </ion-row> </ion-card> <div class="center"> <div class="center" *ngIf="searchResultProducts.length"> <ion-button color="tertiary" size="small" (click)="loadProducts()" (click)="loadMoreProducts()" >View More</ion-button > </div> Loading
packages/shop-mobile-ionic/src/app/pages/+products/+searchProducts/searchProducts.component.ts +32 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,14 @@ export class SearchProductsComponent implements OnInit { } async loadMerchants() { const location = this.getOrdersGeoObj.loc; const merchants = await this.merchantsService.getMerchantsBuyName( this.searchInput, { loc: location } ); this.searchResultMerchants = merchants.slice(0, 5); } async loadMoreMerchants() { const location = this.getOrdersGeoObj.loc; const merchants = await this.merchantsService.getMerchantsBuyName( this.searchInput, Loading @@ -73,6 +81,30 @@ export class SearchProductsComponent implements OnInit { this.store.deliveryType === DeliveryType.Delivery; const isTakeaway = this.store.deliveryType === DeliveryType.Takeaway; await this.geoLocationProductsService .geoLocationProductsByPaging( this.getOrdersGeoObj, { limit: this.loadingOrdersLimit, skip: 0, }, { isDeliveryRequired, isTakeaway, }, this.searchInput ) .pipe(first()) .subscribe((products) => { this.searchResultProducts = products; // products.map((pr) => this.searchResultProducts.push(pr)); }); } async loadMoreProducts() { const isDeliveryRequired = this.store.deliveryType === DeliveryType.Delivery; const isTakeaway = this.store.deliveryType === DeliveryType.Takeaway; await this.geoLocationProductsService .geoLocationProductsByPaging( this.getOrdersGeoObj, Loading