public ngOnInit(): void {
    if (this.shopTabList && this.shopTabList.length) {
      for (let shopTab of this.shopTabList) {
        let productLevel = this.productService.getShopTypeProductLevel(shopTab.shopTypeId);
        let shopProductList = {
          groupName: shopTab.displayName,
          productList: null,
          productsDisplay: null,
          shopId: shopTab.shopId,
          shopTypeId: shopTab.shopTypeId,
        };

        this.shopGroup.push(shopProductList);

        if (productLevel == ShopTypeProductLevel.PRODUCT) {
          let volumePerPage: number = 4;
          if (this.plt.platforms().indexOf('ipad') > -1) {
            volumePerPage = 8;
          }
          else if (this.plt.platforms().indexOf('tablet') > -1 || this.plt.platforms().indexOf('phablet') > -1) {
            volumePerPage = 6;
          }
          this.productService.getPopularProducts(shopTab.shopId, {
            volumePerPage: volumePerPage
          }).subscribe((productModelList) => {
            shopProductList.productList = productModelList;
            // shopProductList.productsDisplay = ProductMapper.productToProductGrid(productModelList);
          });
        } else if (productLevel == ShopTypeProductLevel.PRODUCTITEM) {
          let volumePerPage: number = 4;
          if (this.plt.platforms().indexOf('ipad') > -1) {
            volumePerPage = 8;
          }
          else if (this.plt.platforms().indexOf('tablet') > -1 || this.plt.platforms().indexOf('phablet') > -1) {
            volumePerPage = 6;
          }
          this.productService.getPopularProductItems(shopTab.shopId, {
            volumePerPage: volumePerPage,
          }).subscribe((productModelList) => {
            shopProductList.productList = productModelList;
            // shopProductList.productsDisplay = ProductMapper.productItemToProductGrid(productModelList);
          });
        } else {
          console.warn(`Product Level : ${productLevel} / is invalid`);
          return;
        }
      }

      // console.debug('💭 Shop group: ', this.shopGroup);

    }
  }
 constructor(platform: Platform, generic: Generic) {
   this.platform = platform;
   platform.ready().then(() => {
     this.appBrowser = InAppBrowser;
     this.generic = generic;
   });
   console.log("plataform: ", platform.platforms());
 }
Example #3
0
    insert(logsM: LogsModel) {

        logsM.platform = JSON.stringify(this.plt.platforms());

        let request: RequestModel = new RequestModel();
        request.functionName = FunctionName.LOGS;

        let header: HttpHeaders = new HttpHeaders();
        header = header.set("Content-Type","application/json")
        .set("Authorization", this.key.getAuthToken());

        let configURL: URLConfig = new URLConfig(request);
        this.http.post(configURL.url, JSON.stringify(logsM), {headers : header})
        .subscribe(data => {
            console.log("Insert logs error success!!");
        }, (err) => {
            console.log(JSON.stringify(err));
        });
    }
Example #4
0
 constructor(platform: Platform) {
   //get platforms
   this.platforms = platform.platforms();
   //get platform's version
   console.log(platform.version());
 }
Example #5
0
	ngOnInit() {
		this.loader.dismiss();
		this.platformMessage = this.platform.platforms().toString();
	}