weex-ui
Version:
A rich interaction, lightweight, high performance UI library based on Weex
20 lines (16 loc) • 465 B
JavaScript
/**
* Created by Tw93 on 2017/6/26.
*/
export function isIOS () {
let { platform } = weex.config.env;
return platform.toLowerCase() === 'ios';
}
export function isWeb () {
let { platform } = weex.config.env;
return typeof(window) === 'object' && platform.toLowerCase() === 'web';
}
export function getPageHeight () {
const { env } = weex.config;
const navHeight = isWeb() ? 0 : 130;
return env.deviceHeight / env.deviceWidth * 750 - navHeight;
}