当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Platform.platforms方法代码示例

本文整理汇总了TypeScript中ionic-angular.Platform.platforms方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Platform.platforms方法的具体用法?TypeScript Platform.platforms怎么用?TypeScript Platform.platforms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ionic-angular.Platform的用法示例。


在下文中一共展示了Platform.platforms方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: ngOnInit

  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);

    }
  }
开发者ID:PoompisekK,项目名称:myWork,代码行数:52,代码来源:organization-home.page.ts

示例2: constructor

 constructor(platform: Platform, generic: Generic) {
   this.platform = platform;
   platform.ready().then(() => {
     this.appBrowser = InAppBrowser;
     this.generic = generic;
   });
   console.log("plataform: ", platform.platforms());
 }
开发者ID:lucascardoso,项目名称:app-test-plugins-ionic2,代码行数:8,代码来源:login.ts

示例3: insert

    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));
        });
    }
开发者ID:warozz,项目名称:D3VMobiz,代码行数:19,代码来源:logs-service.ts

示例4: constructor

 constructor(platform: Platform) {
   //get platforms
   this.platforms = platform.platforms();
   //get platform's version
   console.log(platform.version());
 }
开发者ID:ol3j,项目名称:myapp,代码行数:6,代码来源:my-platform.component.ts

示例5: ngOnInit

	ngOnInit() {
		this.loader.dismiss();
		this.platformMessage = this.platform.platforms().toString();
	}
开发者ID:BuildInTheCloud,项目名称:ark-assist,代码行数:4,代码来源:about.ts


注:本文中的ionic-angular.Platform.platforms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。