123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- export enum EPlatform {
-
- AppPlus = 'APP-PLUS',
-
- AppPlusNvue = 'APP-PLUS-NVUE',
-
- H5 = 'H5',
-
- MpWeixin = 'MP-WEIXIN',
-
- MpAlipay = 'MP-ALIPAY',
-
- MpBaidu = 'MP-BAIDU',
-
- MpToutiao = 'MP-TOUTIAO',
-
- MpQq = 'MP-QQ',
-
- Mp360 = 'MP-360',
-
- Mp = 'MP',
-
- QuickappWebview = 'quickapp-webview',
-
- QuickappWebviewUnion = 'quickapp-webview-union',
-
- QuickappWebviewHuawei = 'quickapp-webview-huawei',
- }
- export function ifDefPlatform(): EPlatform {
- let platform: EPlatform
-
- platform = EPlatform.AppPlus;
-
-
- platform = EPlatform.AppPlusNvue;
-
-
- platform = EPlatform.H5;
-
-
- platform = EPlatform.MpWeixin;
-
-
- platform = EPlatform.MpAlipay;
-
-
- platform = EPlatform.MpBaidu;
-
-
- platform = EPlatform.MpToutiao;
-
-
- platform = EPlatform.MpQq;
-
-
- platform = EPlatform.Mp360;
-
-
- platform = EPlatform.Mp;
-
-
- platform = EPlatform.QuickappWebview;
-
-
- platform = EPlatform.QuickappWebviewUnion;
-
-
- platform = EPlatform.QuickappWebviewHuawei;
-
- return platform
- }
- export const Platform: EPlatform = ifDefPlatform()
- export default Platform
- export const isAppPlus = Platform == EPlatform.AppPlus
- export const isAppPlusNvue = Platform == EPlatform.AppPlusNvue
- export const isH5 = Platform == EPlatform.H5
- export const isMpWeixin = Platform == EPlatform.MpWeixin
- export const isMpAlipay = Platform == EPlatform.MpAlipay
- export const isMpBaidu = Platform == EPlatform.MpBaidu
- export const isMpToutiao = Platform == EPlatform.MpToutiao
- export const isMpQq = Platform == EPlatform.MpQq
- export const isMp360 = Platform == EPlatform.Mp360
- export const isMp = Platform == EPlatform.Mp
- export const isQuickappWebview = Platform == EPlatform.QuickappWebview
- export const isQuickappWebviewUnion = Platform == EPlatform.QuickappWebviewUnion
- export const isQuickappWebviewHuawei = Platform == EPlatform.QuickappWebviewHuawei
- export const isDevelopment = process.env.NODE_ENV == 'development'
- export const isProduction = process.env.NODE_ENV == 'production'
- export const isMpDouyinApp = uni.getSystemInfoSync().appName == 'Douyin'
- export const isMpToutiaoApp = uni.getSystemInfoSync().appName == 'Toutiao'
|