Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
菜鸟程序猿_c
uni-app
提交
bef408a8
U
uni-app
项目概览
菜鸟程序猿_c
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bef408a8
编写于
5月 27, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
b6780df2
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
343 addition
and
216 deletion
+343
-216
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+9
-6
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+2
-16
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+38
-27
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+22
-11
packages/uni-mp-kuaishou/dist/uni.api.esm.js
packages/uni-mp-kuaishou/dist/uni.api.esm.js
+38
-27
packages/uni-mp-lark/dist/uni.api.esm.js
packages/uni-mp-lark/dist/uni.api.esm.js
+34
-23
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+38
-27
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+34
-23
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+90
-29
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+38
-27
未找到文件。
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
bef408a8
...
...
@@ -13376,6 +13376,7 @@ const getDeviceInfo = defineSyncApi('getDeviceInfo', () => {
weexGetSystemInfoSync();
const { deviceBrand, deviceModel, osName, osVersion, deviceOrientation, deviceType, } = systemInfo;
const brand = deviceBrand.toLowerCase();
const _osName = osName.toLowerCase();
return {
deviceBrand: brand,
deviceModel,
...
...
@@ -13385,13 +13386,13 @@ const getDeviceInfo = defineSyncApi('getDeviceInfo', () => {
deviceType,
brand,
model: deviceModel,
system: `${osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}`,
platform: osName,
system: `${
_
osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}`,
platform:
_
osName,
};
});
const getAppBaseInfo = defineSyncApi('getAppBaseInfo', () => {
weexGetSystemInfoSync();
const { hostPackageName, hostName,
osLanguage,
hostVersion, hostLanguage, hostTheme, appId, appName, appVersion, appVersionCode, } = systemInfo;
const { hostPackageName, hostName, hostVersion, hostLanguage, hostTheme, appId, appName, appVersion, appVersionCode, } = systemInfo;
return {
SDKVersion: '',
hostSDKVersion: '',
...
...
@@ -13402,7 +13403,7 @@ const getAppBaseInfo = defineSyncApi('getAppBaseInfo', () => {
appVersionCode,
appLanguage: uni.getLocale(),
version: plus.runtime.innerVersion,
language:
os
Language,
language:
host
Language,
theme: '',
hostPackageName,
hostName,
...
...
@@ -13421,6 +13422,7 @@ const getSystemInfoSync = defineSyncApi('getSystemInfoSync', () => {
const appBaseInfo = getAppBaseInfo();
_initSystemInfo = true;
const { osName, osLanguage, osVersion } = systemInfo;
const _osName = osName.toLowerCase();
const osLanguageSplit = osLanguage.split('-');
const osLanguageSplitLast = osLanguageSplit[osLanguageSplit.length - 1];
let _osLanguage = `${osLanguageSplit[0]}${osLanguageSplitLast ? '-' + osLanguageSplitLast : ''}`;
...
...
@@ -13430,9 +13432,10 @@ const getSystemInfoSync = defineSyncApi('getSystemInfoSync', () => {
uniCompileVersion: __uniConfig.compilerVersion,
uniRuntimeVersion: __uniConfig.compilerVersion,
osLanguage: _osLanguage,
osName: _osName,
};
if (osName === 'ios') {
extraData.romName = osName;
if (
_
osName === 'ios') {
extraData.romName =
_
osName;
extraData.romVersion = osVersion;
}
const _systemInfo = extend(systemInfo, windowInfo, deviceInfo, appBaseInfo, extraData);
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
bef408a8
...
...
@@ -10021,20 +10021,6 @@ const getStorageInfoSync = /* @__PURE__ */ defineSyncApi("getStorageInfoSync", (
const
getStorageInfo
=
/* @__PURE__ */
defineAsyncApi
(
"
getStorageInfo
"
,
(
_
,
{
resolve
})
=>
{
resolve
(
getStorageInfoSync
());
});
const
UUID_KEY
=
"
__DC_STAT_UUID
"
;
const
storage
=
window
.
localStorage
||
window
.
sessionStorage
||
{};
let
deviceId
;
function
deviceId$1
()
{
deviceId
=
deviceId
||
storage
[
UUID_KEY
];
if
(
!
deviceId
)
{
deviceId
=
Date
.
now
()
+
""
+
Math
.
floor
(
Math
.
random
()
*
1
e7
);
try
{
storage
[
UUID_KEY
]
=
deviceId
;
}
catch
(
error
)
{
}
}
return
deviceId
;
}
let
browserInfo
;
function
initBrowserInfo
()
{
{
...
...
@@ -10056,8 +10042,8 @@ const getDeviceInfo = /* @__PURE__ */ defineSyncApi("getDeviceInfo", () => {
return
{
deviceBrand
,
deviceModel
,
devicePixelRatio
:
window
.
devicePixelRatio
,
deviceId
:
deviceId$1
(
),
devicePixelRatio
:
1
,
deviceId
:
Date
.
now
()
+
""
+
Math
.
floor
(
Math
.
random
()
*
1
e7
),
deviceOrientation
,
deviceType
,
brand
,
...
...
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -860,13 +860,14 @@ function initGetProvider(providers) {
};
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
;
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
;
}
return
''
;
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
...
...
@@ -895,7 +896,7 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-alipay
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
...
...
@@ -906,31 +907,9 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-alipay
"
.
split
(
'
-
'
)[
1
];
// mp-jd
_hostName
=
fromRes
.
app
;
...
...
@@ -976,6 +955,38 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
;
}
const
redirectTo
=
{};
...
...
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -860,13 +860,14 @@ function initGetProvider(providers) {
};
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
;
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
;
}
return
''
;
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
...
...
@@ -895,7 +896,7 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-baidu
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
...
...
@@ -910,15 +911,9 @@ function populateParameters(fromRes, toRes) {
hostVersion
=
fromRes
.
swanNativeVersion
;
}
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
let
deviceType
=
getGetDeviceType
(
fromRes
)
;
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-baidu
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
...
...
@@ -969,6 +964,22 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
packages/uni-mp-kuaishou/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -860,13 +860,14 @@ function initGetProvider(providers) {
};
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
;
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
;
}
return
''
;
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
...
...
@@ -895,7 +896,7 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-kuaishou
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
...
...
@@ -906,31 +907,9 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-kuaishou
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
...
...
@@ -975,6 +954,38 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
packages/uni-mp-lark/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -887,7 +887,8 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-lark
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
let
osVersion
=
''
;
...
...
@@ -897,28 +898,9 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-lark
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
...
...
@@ -963,6 +945,35 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -860,13 +860,14 @@ function initGetProvider(providers) {
};
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
;
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
;
}
return
''
;
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
...
...
@@ -895,7 +896,7 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-qq
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
...
...
@@ -906,31 +907,9 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-qq
"
.
split
(
'
-
'
)[
1
];
// mp-jd
_hostName
=
fromRes
.
AppPlatform
;
...
...
@@ -973,6 +952,38 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -887,7 +887,8 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-toutiao
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
let
osVersion
=
''
;
...
...
@@ -897,28 +898,9 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-toutiao
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
...
...
@@ -963,6 +945,35 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -588,7 +588,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -824,13 +824,14 @@ function initGetProvider(providers) {
};
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
;
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
;
}
return
''
;
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
...
...
@@ -859,7 +860,7 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
mp-weixin
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
...
...
@@ -870,38 +871,16 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
mp-weixin
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
if
(
environment
)
{
_hostName
=
environment
;
}
else
if
(
fromRes
.
host
)
{
else
if
(
fromRes
.
host
&&
fromRes
.
host
.
env
)
{
_hostName
=
fromRes
.
host
.
env
;
}
}
...
...
@@ -944,6 +923,38 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
@@ -998,6 +1009,53 @@ const showActionSheet = {
},
};
const
getDeviceInfo
=
{
returnValue
:
(
fromRes
,
toRes
)
=>
{
const
{
brand
,
model
}
=
fromRes
;
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
);
useDeviceId
()(
fromRes
,
toRes
);
extend
(
toRes
,
{
deviceType
,
deviceBrand
,
deviceModel
:
model
,
});
},
};
const
getAppBaseInfo
=
{
returnValue
:
(
fromRes
,
toRes
)
=>
{
const
{
version
,
language
,
SDKVersion
,
theme
}
=
fromRes
;
let
_hostName
=
"
mp-weixin
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
if
(
fromRes
.
host
&&
fromRes
.
host
.
env
)
{
_hostName
=
fromRes
.
host
.
env
;
}
}
extend
(
toRes
,
{
hostVersion
:
version
,
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostSDKVersion
:
SDKVersion
,
hostTheme
:
theme
,
appId
:
process
.
env
.
UNI_APP_ID
,
appName
:
process
.
env
.
UNI_APP_NAME
,
appVersion
:
process
.
env
.
UNI_APP_VERSION_NAME
,
appVersionCode
:
process
.
env
.
UNI_APP_VERSION_CODE
,
});
},
};
const
getWindowInfo
=
{
returnValue
:
(
fromRes
,
toRes
)
=>
{
addSafeAreaInsets
(
fromRes
,
toRes
);
extend
(
toRes
,
{
windowTop
:
0
,
windowBottom
:
0
,
});
},
};
const
mocks
=
[
'
__route__
'
,
'
__wxExparserNodeId__
'
,
'
__wxWebviewId__
'
];
const
getProvider
=
initGetProvider
({
...
...
@@ -1039,7 +1097,10 @@ var protocols = /*#__PURE__*/Object.freeze({
previewImage
:
previewImage
,
getSystemInfo
:
getSystemInfo
,
getSystemInfoSync
:
getSystemInfoSync
,
showActionSheet
:
showActionSheet
showActionSheet
:
showActionSheet
,
getDeviceInfo
:
getDeviceInfo
,
getAppBaseInfo
:
getAppBaseInfo
,
getWindowInfo
:
getWindowInfo
});
var
index
=
initUni
(
shims
,
protocols
);
...
...
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
bef408a8
...
...
@@ -624,7 +624,7 @@ const offPushMessage = (fn) => {
}
};
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
SYNC_API_RE
=
/^
\$
|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getDeviceInfo|getAppBaseInfo|getWindowInfo
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
// Context例外情况
const
CONTEXT_API_RE_EXC
=
[
'
createBLEConnection
'
];
...
...
@@ -860,13 +860,14 @@ function initGetProvider(providers) {
};
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
;
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
;
}
return
''
;
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
...
...
@@ -895,7 +896,7 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
function
populateParameters
(
fromRes
,
toRes
)
{
const
{
brand
,
model
,
system
,
language
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
{
brand
=
''
,
model
=
''
,
system
=
''
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
,
}
=
fromRes
;
const
isQuickApp
=
"
quickapp-webview
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
let
osName
=
''
;
...
...
@@ -906,31 +907,9 @@ function populateParameters(fromRes, toRes) {
}
let
hostVersion
=
version
;
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
let
deviceType
=
getGetDeviceType
(
fromRes
,
model
);
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
let
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
// hostName
let
_hostName
=
hostName
||
"
quickapp-webview
"
.
split
(
'
-
'
)[
1
];
// mp-jd
// deviceOrientation
...
...
@@ -972,6 +951,38 @@ function populateParameters(fromRes, toRes) {
browseVersion
:
undefined
,
};
extend
(
toRes
,
parameters
);
}
function
getGetDeviceType
(
fromRes
,
model
)
{
// deviceType
let
deviceType
=
fromRes
.
deviceType
||
'
phone
'
;
{
const
deviceTypeMaps
=
{
ipad
:
'
pad
'
,
windows
:
'
pc
'
,
mac
:
'
pc
'
,
};
const
deviceTypeMapsKeys
=
Object
.
keys
(
deviceTypeMaps
);
const
_model
=
model
.
toLocaleLowerCase
();
for
(
let
index
=
0
;
index
<
deviceTypeMapsKeys
.
length
;
index
++
)
{
const
_m
=
deviceTypeMapsKeys
[
index
];
if
(
_model
.
indexOf
(
_m
)
!==
-
1
)
{
deviceType
=
deviceTypeMaps
[
_m
];
break
;
}
}
}
return
deviceType
;
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
;
}
const
getSystemInfo
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录