@dcloudio/uni-quickapp-webview 2.0.2-5000720260410001 → 2.0.2-5010520260709001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +64 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -829,24 +829,44 @@ function addSafeAreaInsets (result) {
|
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
function getOSInfo (system, platform) {
|
|
832
|
+
/**
|
|
833
|
+
* system 枚举值说明:
|
|
834
|
+
*
|
|
835
|
+
* weixin: 操作系统及版本
|
|
836
|
+
* qq: 操作系统及版本
|
|
837
|
+
* kuaishou: 操作系统及版本
|
|
838
|
+
*
|
|
839
|
+
* alipay、dingding: 系统版本
|
|
840
|
+
* baidu: 操作系统版本
|
|
841
|
+
* toutiao/douyin: 操作系统版本
|
|
842
|
+
* jd: 操作系统版本
|
|
843
|
+
* harmony: 操作系统版本
|
|
844
|
+
*
|
|
845
|
+
* lark: 文档无此字段
|
|
846
|
+
*/
|
|
832
847
|
let osName = '';
|
|
833
848
|
let osVersion = '';
|
|
834
849
|
|
|
835
850
|
if (
|
|
836
851
|
platform &&
|
|
837
|
-
( "quickapp-webview" === 'mp-
|
|
852
|
+
( "quickapp-webview" === 'mp-harmony')
|
|
838
853
|
) {
|
|
839
854
|
osName = platform;
|
|
840
855
|
osVersion = system;
|
|
856
|
+
system = `${osName} ${osVersion}`;
|
|
841
857
|
} else {
|
|
842
|
-
|
|
858
|
+
{
|
|
859
|
+
osName = system.split(' ')[0] || platform;
|
|
860
|
+
}
|
|
843
861
|
osVersion = system.split(' ')[1] || '';
|
|
844
862
|
}
|
|
845
863
|
|
|
846
864
|
osName = osName.toLocaleLowerCase();
|
|
865
|
+
|
|
847
866
|
switch (osName) {
|
|
848
867
|
case 'harmony': // alipay
|
|
849
|
-
case 'ohos': // weixin
|
|
868
|
+
case 'ohos': // weixin harmony
|
|
869
|
+
case 'openharmonyos': // weixin 由 HarmonyOS 改为了 OpenHarmonyOS
|
|
850
870
|
case 'openharmony': // feishu
|
|
851
871
|
osName = 'harmonyos';
|
|
852
872
|
break
|
|
@@ -864,8 +884,41 @@ function getOSInfo (system, platform) {
|
|
|
864
884
|
|
|
865
885
|
return {
|
|
866
886
|
osName,
|
|
867
|
-
osVersion
|
|
887
|
+
osVersion,
|
|
888
|
+
system
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
function getPlatform (platform) {
|
|
893
|
+
/**
|
|
894
|
+
* platform 枚举值说明:
|
|
895
|
+
*
|
|
896
|
+
* weixin:ios、android、windows、mac、ohos、ohos_pc、devtools
|
|
897
|
+
* alipay、dingding:Android,iOS / iPhone OS,Harmony
|
|
898
|
+
* harmony: 固定 ohos
|
|
899
|
+
*
|
|
900
|
+
* toutiao: Android,iOS 无 harmony 平台,暂不处理
|
|
901
|
+
* lark: 'pc' | 'mobile' | 'android' | 'ios', 无 harmony 平台,暂不处理
|
|
902
|
+
*
|
|
903
|
+
* baidu:无相关描述
|
|
904
|
+
* qq: 无相关描述
|
|
905
|
+
* kuaishou: 无相关描述
|
|
906
|
+
* jd: 无相关描述
|
|
907
|
+
*/
|
|
908
|
+
platform = platform.toLowerCase();
|
|
909
|
+
{
|
|
910
|
+
switch (platform) {
|
|
911
|
+
case 'iphone os':
|
|
912
|
+
platform = 'ios';
|
|
913
|
+
break
|
|
914
|
+
case 'openharmonyos':
|
|
915
|
+
case 'openharmony':
|
|
916
|
+
case 'harmony':
|
|
917
|
+
platform = 'harmonyos';
|
|
918
|
+
break
|
|
919
|
+
}
|
|
868
920
|
}
|
|
921
|
+
return platform
|
|
869
922
|
}
|
|
870
923
|
|
|
871
924
|
function populateParameters (result) {
|
|
@@ -880,7 +933,7 @@ function populateParameters (result) {
|
|
|
880
933
|
const extraParam = {};
|
|
881
934
|
|
|
882
935
|
// osName osVersion
|
|
883
|
-
const { osName, osVersion } = getOSInfo(system, platform);
|
|
936
|
+
const { osName, osVersion, system: updatedSystem } = getOSInfo(system, platform);
|
|
884
937
|
let hostVersion = version;
|
|
885
938
|
|
|
886
939
|
// deviceType
|
|
@@ -931,6 +984,8 @@ function populateParameters (result) {
|
|
|
931
984
|
hostFontSizeSetting: fontSizeSetting,
|
|
932
985
|
windowTop: 0,
|
|
933
986
|
windowBottom: 0,
|
|
987
|
+
platform: getPlatform(platform),
|
|
988
|
+
system: updatedSystem,
|
|
934
989
|
// TODO
|
|
935
990
|
osLanguage: undefined,
|
|
936
991
|
osTheme: undefined,
|
|
@@ -945,12 +1000,15 @@ function populateParameters (result) {
|
|
|
945
1000
|
}
|
|
946
1001
|
|
|
947
1002
|
function getGetDeviceType (result, model) {
|
|
1003
|
+
const platform = result.platform || '';
|
|
948
1004
|
let deviceType = result.deviceType || 'phone';
|
|
949
1005
|
{
|
|
950
1006
|
const deviceTypeMaps = {
|
|
951
1007
|
ipad: 'pad',
|
|
952
1008
|
windows: 'pc',
|
|
953
|
-
mac: 'pc'
|
|
1009
|
+
mac: 'pc',
|
|
1010
|
+
linux: 'pc',
|
|
1011
|
+
pc: 'pc'
|
|
954
1012
|
};
|
|
955
1013
|
const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
|
|
956
1014
|
const _model = model.toLocaleLowerCase();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-quickapp-webview",
|
|
3
|
-
"version": "2.0.2-
|
|
3
|
+
"version": "2.0.2-5010520260709001",
|
|
4
4
|
"description": "uni-app quickapp-webview",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"name": "quickapp-webview",
|
|
18
18
|
"title": "快应用(Webview)版"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "f17eaf4bf390726fa12db98e6efbe0557841bed0"
|
|
21
21
|
}
|