export default class SystemInfoUtil { static PC = 'pc'; static IOS = 'ios'; static ANDROID = 'android'; static APP = 'app'; /** * 平台 ios,andorid,pc */ static platform; static port; /** * 基础库版本 已处理成数值7.0.0->700 容易比较 可以查map到微信什么版本 */ static wxSDKVersion; static init() { uni.getSystemInfo({ success: function(res) { if (res.platform == 'devtools') { SystemInfoUtil.platform = SystemInfoUtil.PC; SystemInfoUtil.port = SystemInfoUtil.PC; } else if (res.platform == 'ios') { SystemInfoUtil.platform = SystemInfoUtil.IOS; SystemInfoUtil.port = SystemInfoUtil.APP; } else if (res.platform == 'android') { SystemInfoUtil.platform = SystemInfoUtil.ANDROID; SystemInfoUtil.port = SystemInfoUtil.APP; } //#ifdef MP-WEIXIN let version = res.SDKVersion; version = version.replace(/\./g, ''); SystemInfoUtil.wxSDKVersion = version; //#endif } }); } }