本文整理汇总了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);
}
}
示例2: constructor
constructor(platform: Platform, generic: Generic) {
this.platform = platform;
platform.ready().then(() => {
this.appBrowser = InAppBrowser;
this.generic = generic;
});
console.log("plataform: ", platform.platforms());
}
示例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));
});
}
示例4: constructor
constructor(platform: Platform) {
//get platforms
this.platforms = platform.platforms();
//get platform's version
console.log(platform.version());
}
示例5: ngOnInit
ngOnInit() {
this.loader.dismiss();
this.platformMessage = this.platform.platforms().toString();
}