1234567891011121314151617181920212223242526272829303132 |
- export default class SystemInfoUtil {
- static PC = 'pc';
- static IOS = 'ios';
- static ANDROID = 'android';
-
- static platform;
-
- static wxSDKVersion;
- static init() {
- uni.getSystemInfo({
- success: function (res) {
- console.log('SystemInfoUtil');
- console.log(res);
- if (res.platform == 'devtools') {
- SystemInfoUtil.platform = SystemInfoUtil.PC;
- } else if (res.platform == 'ios') {
- SystemInfoUtil.platform = SystemInfoUtil.IOS;
- } else if (res.platform == 'android') {
- SystemInfoUtil.platform = SystemInfoUtil.ANDROID;
- }
- let version = res.SDKVersion;
- version = version.replace(/\./g, '');
- SystemInfoUtil.wxSDKVersion = version;
- }
- });
- }
- }
|