Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
菜鸟程序猿_c
uni-app
提交
492cb704
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,发现更多精彩内容 >>
提交
492cb704
编写于
5月 27, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
5f20eac5
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
490 addition
and
259 deletion
+490
-259
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+10
-7
packages/uni-app-plus/dist/view.umd.min.js
packages/uni-app-plus/dist/view.umd.min.js
+1
-1
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+45
-27
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+29
-11
packages/uni-mp-jd/dist/index.js
packages/uni-mp-jd/dist/index.js
+45
-27
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+45
-27
packages/uni-mp-lark/dist/index.js
packages/uni-mp-lark/dist/index.js
+39
-24
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+45
-27
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+39
-24
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+101
-29
packages/uni-mp-xhs/dist/index.js
packages/uni-mp-xhs/dist/index.js
+45
-27
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+45
-27
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
492cb704
...
@@ -6484,7 +6484,7 @@ var serviceContext = (function () {
...
@@ -6484,7 +6484,7 @@ var serviceContext = (function () {
weexGetSystemInfoSync();
weexGetSystemInfoSync();
const {
const {
deviceBrand, deviceModel, osName,
deviceBrand, deviceModel, osName,
osVersion
osVersion
, deviceOrientation, deviceType
} = systemInfo;
} = systemInfo;
const brand = deviceBrand.toLowerCase();
const brand = deviceBrand.toLowerCase();
...
@@ -6492,6 +6492,10 @@ var serviceContext = (function () {
...
@@ -6492,6 +6492,10 @@ var serviceContext = (function () {
return {
return {
deviceBrand: brand,
deviceBrand: brand,
deviceModel,
deviceModel,
devicePixelRatio: plus.screen.scale,
deviceId: deviceId$1(),
deviceOrientation,
deviceType,
brand,
brand,
model: deviceModel,
model: deviceModel,
system: `${osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}`,
system: `${osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}`,
...
@@ -6502,7 +6506,7 @@ var serviceContext = (function () {
...
@@ -6502,7 +6506,7 @@ var serviceContext = (function () {
function getAppBaseInfo () {
function getAppBaseInfo () {
weexGetSystemInfoSync();
weexGetSystemInfoSync();
const {
const {
hostPackageName, hostName,
osLanguage,
hostPackageName, hostName,
hostVersion, hostLanguage, hostTheme,
hostVersion, hostLanguage, hostTheme,
appId, appName, appVersion, appVersionCode
appId, appName, appVersion, appVersionCode
} = systemInfo;
} = systemInfo;
...
@@ -6517,7 +6521,7 @@ var serviceContext = (function () {
...
@@ -6517,7 +6521,7 @@ var serviceContext = (function () {
appVersionCode,
appVersionCode,
appLanguage: uni.getLocale(),
appLanguage: uni.getLocale(),
version: plus.runtime.innerVersion,
version: plus.runtime.innerVersion,
language:
os
Language,
language:
host
Language,
theme: '',
theme: '',
hostPackageName,
hostPackageName,
hostName,
hostName,
...
@@ -6536,11 +6540,12 @@ var serviceContext = (function () {
...
@@ -6536,11 +6540,12 @@ var serviceContext = (function () {
_initSystemInfo = true;
_initSystemInfo = true;
weexGetSystemInfoSync();
weexGetSystemInfoSync();
_initSystemInfo = false;
_initSystemInfo = false;
const windowInfo = getWindowInfo();
const deviceInfo = getDeviceInfo();
const deviceInfo = getDeviceInfo();
const appBaseInfo = getAppBaseInfo();
const appBaseInfo = getAppBaseInfo();
_initSystemInfo = true;
_initSystemInfo = true;
const { osName, osLanguage, osVersion
, pixelRatio
} = systemInfo;
const { osName, osLanguage, osVersion } = systemInfo;
const osLanguageSplit = osLanguage.split('-');
const osLanguageSplit = osLanguage.split('-');
const osLanguageSplitLast = osLanguageSplit[osLanguageSplit.length - 1];
const osLanguageSplitLast = osLanguageSplit[osLanguageSplit.length - 1];
const _osLanguage = `${osLanguageSplit[0]}${osLanguageSplitLast ? '-' + osLanguageSplitLast : ''}`;
const _osLanguage = `${osLanguageSplit[0]}${osLanguageSplitLast ? '-' + osLanguageSplitLast : ''}`;
...
@@ -6548,8 +6553,6 @@ var serviceContext = (function () {
...
@@ -6548,8 +6553,6 @@ var serviceContext = (function () {
const extraData = {
const extraData = {
errMsg: 'getSystemInfo:ok',
errMsg: 'getSystemInfo:ok',
fontSizeSetting: appBaseInfo.hostFontSizeSetting,
fontSizeSetting: appBaseInfo.hostFontSizeSetting,
devicePixelRatio: pixelRatio,
deviceId: deviceId$1(),
uniCompileVersion: __uniConfig.compilerVersion,
uniCompileVersion: __uniConfig.compilerVersion,
uniRuntimeVersion: __uniConfig.compilerVersion,
uniRuntimeVersion: __uniConfig.compilerVersion,
osLanguage: _osLanguage
osLanguage: _osLanguage
...
@@ -6563,7 +6566,7 @@ var serviceContext = (function () {
...
@@ -6563,7 +6566,7 @@ var serviceContext = (function () {
const _systemInfo = Object.assign(
const _systemInfo = Object.assign(
{},
{},
systemInfo,
systemInfo,
getWindowInfo()
,
windowInfo
,
deviceInfo,
deviceInfo,
appBaseInfo,
appBaseInfo,
extraData
extraData
...
...
packages/uni-app-plus/dist/view.umd.min.js
浏览文件 @
492cb704
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
492cb704
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
packages/uni-mp-alipay/dist/index.js
浏览文件 @
492cb704
...
@@ -636,9 +636,10 @@ function removeStorageSync (key) {
...
@@ -636,9 +636,10 @@ function removeStorageSync (key) {
})
})
}
}
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
function
addSafeAreaInsets
(
result
)
{
function
addSafeAreaInsets
(
result
)
{
...
@@ -655,8 +656,8 @@ function addSafeAreaInsets (result) {
...
@@ -655,8 +656,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -673,31 +674,10 @@ function populateParameters (result) {
...
@@ -673,31 +674,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-alipay
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-alipay
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -732,7 +712,7 @@ function populateParameters (result) {
...
@@ -732,7 +712,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -750,6 +730,44 @@ function populateParameters (result) {
...
@@ -750,6 +730,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
let
deviceId
;
function
addUuid
(
result
)
{
function
addUuid
(
result
)
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
492cb704
...
@@ -651,9 +651,10 @@ var previewImage = {
...
@@ -651,9 +651,10 @@ var previewImage = {
}
}
};
};
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -706,15 +707,10 @@ function populateParameters (result) {
...
@@ -706,15 +707,10 @@ function populateParameters (result) {
}
}
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
)
;
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-baidu
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-baidu
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -750,7 +746,7 @@ function populateParameters (result) {
...
@@ -750,7 +746,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -768,6 +764,28 @@ function populateParameters (result) {
...
@@ -768,6 +764,28 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
return
deviceType
}
function
getDeviceBrand
(
brand
,
model
,
isQuickApp
=
false
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-mp-jd/dist/index.js
浏览文件 @
492cb704
...
@@ -480,9 +480,10 @@ var baseApi = /*#__PURE__*/Object.freeze({
...
@@ -480,9 +480,10 @@ var baseApi = /*#__PURE__*/Object.freeze({
interceptors
:
interceptors
interceptors
:
interceptors
});
});
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -513,8 +514,8 @@ function addSafeAreaInsets (result) {
...
@@ -513,8 +514,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -534,31 +535,10 @@ function populateParameters (result) {
...
@@ -534,31 +535,10 @@ function populateParameters (result) {
}
}
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-jd
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-jd
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -591,7 +571,7 @@ function populateParameters (result) {
...
@@ -591,7 +571,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -609,6 +589,44 @@ function populateParameters (result) {
...
@@ -609,6 +589,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
492cb704
...
@@ -651,9 +651,10 @@ var previewImage = {
...
@@ -651,9 +651,10 @@ var previewImage = {
}
}
};
};
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -702,31 +703,10 @@ function populateParameters (result) {
...
@@ -702,31 +703,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-kuaishou
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-kuaishou
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -760,7 +740,7 @@ function populateParameters (result) {
...
@@ -760,7 +740,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -778,6 +758,44 @@ function populateParameters (result) {
...
@@ -778,6 +758,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-mp-lark/dist/index.js
浏览文件 @
492cb704
...
@@ -679,12 +679,13 @@ function addSafeAreaInsets (result) {
...
@@ -679,12 +679,13 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
}
=
result
;
}
=
result
;
const
isQuickApp
=
"
mp-lark
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
// osName osVersion
let
osName
=
''
;
let
osName
=
''
;
...
@@ -696,29 +697,10 @@ function populateParameters (result) {
...
@@ -696,29 +697,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-lark
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-lark
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -752,7 +734,7 @@ function populateParameters (result) {
...
@@ -752,7 +734,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -770,6 +752,39 @@ function populateParameters (result) {
...
@@ -770,6 +752,39 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
492cb704
...
@@ -651,9 +651,10 @@ var previewImage = {
...
@@ -651,9 +651,10 @@ var previewImage = {
}
}
};
};
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -702,31 +703,10 @@ function populateParameters (result) {
...
@@ -702,31 +703,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-qq
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-qq
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -760,7 +740,7 @@ function populateParameters (result) {
...
@@ -760,7 +740,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -778,6 +758,44 @@ function populateParameters (result) {
...
@@ -778,6 +758,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
492cb704
...
@@ -679,12 +679,13 @@ function addSafeAreaInsets (result) {
...
@@ -679,12 +679,13 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
}
=
result
;
}
=
result
;
const
isQuickApp
=
"
mp-toutiao
"
.
indexOf
(
'
quickapp-webview
'
)
!==
-
1
;
// osName osVersion
// osName osVersion
let
osName
=
''
;
let
osName
=
''
;
...
@@ -696,29 +697,10 @@ function populateParameters (result) {
...
@@ -696,29 +697,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-toutiao
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-toutiao
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -752,7 +734,7 @@ function populateParameters (result) {
...
@@ -752,7 +734,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -770,6 +752,39 @@ function populateParameters (result) {
...
@@ -770,6 +752,39 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
492cb704
...
@@ -546,9 +546,10 @@ var previewImage = {
...
@@ -546,9 +546,10 @@ var previewImage = {
}
}
};
};
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -579,8 +580,8 @@ function addSafeAreaInsets (result) {
...
@@ -579,8 +580,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -597,38 +598,17 @@ function populateParameters (result) {
...
@@ -597,38 +598,17 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-weixin
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-weixin
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
{
if
(
environment
)
{
if
(
environment
)
{
_hostName
=
environment
;
_hostName
=
environment
;
}
else
if
(
result
.
host
)
{
}
else
if
(
result
.
host
&&
result
.
host
.
env
)
{
_hostName
=
result
.
host
.
env
;
_hostName
=
result
.
host
.
env
;
}
}
}
}
...
@@ -661,7 +641,7 @@ function populateParameters (result) {
...
@@ -661,7 +641,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -679,6 +659,44 @@ function populateParameters (result) {
...
@@ -679,6 +659,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
@@ -695,6 +713,57 @@ var showActionSheet = {
...
@@ -695,6 +713,57 @@ var showActionSheet = {
}
}
};
};
var
getAppBaseInfo
=
{
returnValue
:
function
(
result
)
{
const
{
version
,
language
,
SDKVersion
,
theme
}
=
result
;
let
_hostName
=
"
mp-weixin
"
.
split
(
'
-
'
)[
1
];
// mp-jd
{
if
(
result
.
host
&&
result
.
host
.
env
)
{
_hostName
=
result
.
host
.
env
;
}
}
Object
.
assign
(
result
,
{
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
});
}
};
var
getDeviceInfo
=
{
returnValue
:
function
(
result
)
{
const
{
brand
,
model
}
=
result
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
);
useDeviceId
(
result
);
Object
.
assign
(
result
,
{
deviceType
,
deviceBrand
,
deviceModel
:
model
});
}
};
var
getWindowInfo
=
{
returnValue
:
function
(
result
)
{
addSafeAreaInsets
(
result
);
Object
.
assign
(
result
,
{
windowTop
:
0
,
windowBottom
:
0
});
}
};
// import navigateTo from 'uni-helpers/navigate-to'
// import navigateTo from 'uni-helpers/navigate-to'
const
protocols
=
{
const
protocols
=
{
...
@@ -703,7 +772,10 @@ const protocols = {
...
@@ -703,7 +772,10 @@ const protocols = {
previewImage
,
previewImage
,
getSystemInfo
,
getSystemInfo
,
getSystemInfoSync
:
getSystemInfo
,
getSystemInfoSync
:
getSystemInfo
,
showActionSheet
showActionSheet
,
getAppBaseInfo
,
getDeviceInfo
,
getWindowInfo
};
};
const
todos
=
[
const
todos
=
[
'
vibrate
'
,
'
vibrate
'
,
...
...
packages/uni-mp-xhs/dist/index.js
浏览文件 @
492cb704
...
@@ -480,9 +480,10 @@ var baseApi = /*#__PURE__*/Object.freeze({
...
@@ -480,9 +480,10 @@ var baseApi = /*#__PURE__*/Object.freeze({
interceptors
:
interceptors
interceptors
:
interceptors
});
});
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -513,8 +514,8 @@ function addSafeAreaInsets (result) {
...
@@ -513,8 +514,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -531,31 +532,10 @@ function populateParameters (result) {
...
@@ -531,31 +532,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
mp-xhs
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
mp-xhs
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -588,7 +568,7 @@ function populateParameters (result) {
...
@@ -588,7 +568,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -606,6 +586,44 @@ function populateParameters (result) {
...
@@ -606,6 +586,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
492cb704
...
@@ -651,9 +651,10 @@ var previewImage = {
...
@@ -651,9 +651,10 @@ var previewImage = {
}
}
};
};
function
getDeviceBrand
(
model
)
{
function
_
getDeviceBrand
(
model
)
{
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/iphone/gi
.
test
(
model
)
||
/ipad/gi
.
test
(
model
)
||
/mac/gi
.
test
(
model
))
{
return
'
apple
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
if
(
/windows/gi
.
test
(
model
))
{
return
'
microsoft
'
}
return
''
}
}
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
...
@@ -684,8 +685,8 @@ function addSafeAreaInsets (result) {
function
populateParameters
(
result
)
{
function
populateParameters
(
result
)
{
const
{
const
{
brand
,
model
,
system
,
brand
=
''
,
model
=
''
,
system
=
''
,
language
,
theme
,
version
,
language
=
''
,
theme
,
version
,
hostName
,
platform
,
fontSizeSetting
,
hostName
,
platform
,
fontSizeSetting
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
SDKVersion
,
pixelRatio
,
deviceOrientation
,
environment
environment
...
@@ -702,31 +703,10 @@ function populateParameters (result) {
...
@@ -702,31 +703,10 @@ function populateParameters (result) {
let
hostVersion
=
version
;
let
hostVersion
=
version
;
// deviceType
// deviceType
let
deviceType
=
result
.
deviceType
||
'
phone
'
;
const
deviceType
=
getGetDeviceType
(
result
,
model
);
{
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
}
}
}
// deviceModel
// deviceModel
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
const
deviceBrand
=
getDeviceBrand
(
brand
,
model
,
isQuickApp
);
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
getDeviceBrand
(
deviceBrand
);
}
// hostName
// hostName
let
_hostName
=
hostName
||
"
quickapp-webview
"
.
split
(
'
-
'
)[
1
];
// mp-jd
let
_hostName
=
hostName
||
"
quickapp-webview
"
.
split
(
'
-
'
)[
1
];
// mp-jd
...
@@ -759,7 +739,7 @@ function populateParameters (result) {
...
@@ -759,7 +739,7 @@ function populateParameters (result) {
osVersion
,
osVersion
,
hostTheme
:
theme
,
hostTheme
:
theme
,
hostVersion
,
hostVersion
,
hostLanguage
:
language
.
split
(
'
_
'
,
'
-
'
),
hostLanguage
:
language
.
replace
(
'
_
'
,
'
-
'
),
hostName
:
_hostName
,
hostName
:
_hostName
,
hostSDKVersion
:
_SDKVersion
,
hostSDKVersion
:
_SDKVersion
,
hostFontSizeSetting
:
fontSizeSetting
,
hostFontSizeSetting
:
fontSizeSetting
,
...
@@ -777,6 +757,44 @@ function populateParameters (result) {
...
@@ -777,6 +757,44 @@ function populateParameters (result) {
Object
.
assign
(
result
,
parameters
);
Object
.
assign
(
result
,
parameters
);
}
}
function
getGetDeviceType
(
result
,
model
)
{
let
deviceType
=
result
.
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
)
{
let
deviceBrand
=
model
.
split
(
'
'
)[
0
].
toLocaleLowerCase
();
if
(
isQuickApp
)
{
deviceBrand
=
brand
.
toLocaleLowerCase
();
}
else
{
deviceBrand
=
_getDeviceBrand
(
deviceBrand
);
}
return
deviceBrand
}
var
getSystemInfo
=
{
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
returnValue
:
function
(
result
)
{
useDeviceId
(
result
);
useDeviceId
(
result
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录