@dcloudio/uni-quickapp-webview 3.0.0-5000720260410001 → 3.0.0-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.
@@ -974,21 +974,40 @@ function addSafeAreaInsets(fromRes, toRes) {
974
974
  }
975
975
  }
976
976
  function getOSInfo(system, platform) {
977
+ /**
978
+ * system 枚举值说明:
979
+ *
980
+ * weixin: 操作系统及版本
981
+ * qq: 操作系统及版本
982
+ * kuaishou: 操作系统及版本
983
+ *
984
+ * alipay、dingding: 系统版本
985
+ * baidu: 操作系统版本
986
+ * toutiao/douyin: 操作系统版本
987
+ * jd: 操作系统版本
988
+ * harmony: 操作系统版本
989
+ *
990
+ * lark: 文档无此字段
991
+ */
977
992
  let osName = '';
978
993
  let osVersion = '';
979
994
  if (platform &&
980
- ("quickapp-webview" === 'mp-baidu')) {
995
+ ("quickapp-webview" === 'mp-harmony')) {
981
996
  osName = platform;
982
997
  osVersion = system;
998
+ system = `${osName} ${osVersion}`;
983
999
  }
984
1000
  else {
985
- osName = system.split(' ')[0] || platform;
1001
+ {
1002
+ osName = system.split(' ')[0] || platform;
1003
+ }
986
1004
  osVersion = system.split(' ')[1] || '';
987
1005
  }
988
1006
  osName = osName.toLowerCase();
989
1007
  switch (osName) {
990
1008
  case 'harmony': // alipay
991
- case 'ohos': // weixin
1009
+ case 'ohos': // weixin harmony
1010
+ case 'openharmonyos': // weixin 由 HarmonyOS 改为了 OpenHarmonyOS
992
1011
  case 'openharmony': // feishu
993
1012
  osName = 'harmonyos';
994
1013
  break;
@@ -1006,13 +1025,45 @@ function getOSInfo(system, platform) {
1006
1025
  return {
1007
1026
  osName,
1008
1027
  osVersion,
1028
+ system,
1009
1029
  };
1010
1030
  }
1031
+ function getPlatform(platform) {
1032
+ /**
1033
+ * platform 枚举值说明:
1034
+ *
1035
+ * weixin:ios、android、windows、mac、ohos、ohos_pc、devtools
1036
+ * alipay、dingding:Android,iOS / iPhone OS,Harmony
1037
+ * harmony: 固定 ohos
1038
+ *
1039
+ * toutiao: Android,iOS 无 harmony 平台,暂不处理
1040
+ * lark: 'pc' | 'mobile' | 'android' | 'ios', 无 harmony 平台,暂不处理
1041
+ *
1042
+ * baidu:无相关描述
1043
+ * qq: 无相关描述
1044
+ * kuaishou: 无相关描述
1045
+ * jd: 无相关描述
1046
+ */
1047
+ platform = platform.toLowerCase();
1048
+ {
1049
+ switch (platform) {
1050
+ case 'iphone os':
1051
+ platform = 'ios';
1052
+ break;
1053
+ case 'openharmonyos':
1054
+ case 'openharmony':
1055
+ case 'harmony':
1056
+ platform = 'harmonyos';
1057
+ break;
1058
+ }
1059
+ }
1060
+ return platform;
1061
+ }
1011
1062
  function populateParameters(fromRes, toRes) {
1012
1063
  const { brand = '', model = '', system = '', language = '', theme, version, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation, } = fromRes;
1013
1064
  // const isQuickApp = "quickapp-webview".indexOf('quickapp-webview') !== -1
1014
1065
  // osName osVersion
1015
- const { osName, osVersion } = getOSInfo(system, platform);
1066
+ const { osName, osVersion, system: updatedSystem, } = getOSInfo(system, platform);
1016
1067
  let hostVersion = version;
1017
1068
  // deviceType
1018
1069
  let deviceType = getGetDeviceType(fromRes, model);
@@ -1054,6 +1105,8 @@ function populateParameters(fromRes, toRes) {
1054
1105
  hostFontSizeSetting: fontSizeSetting,
1055
1106
  windowTop: 0,
1056
1107
  windowBottom: 0,
1108
+ platform: getPlatform(platform),
1109
+ system: updatedSystem,
1057
1110
  // TODO
1058
1111
  osLanguage: undefined,
1059
1112
  osTheme: undefined,
@@ -1066,6 +1119,7 @@ function populateParameters(fromRes, toRes) {
1066
1119
  extend(toRes, parameters);
1067
1120
  }
1068
1121
  function getGetDeviceType(fromRes, model) {
1122
+ fromRes.platform || '';
1069
1123
  // deviceType
1070
1124
  let deviceType = fromRes.deviceType || 'phone';
1071
1125
  {
@@ -1073,6 +1127,8 @@ function getGetDeviceType(fromRes, model) {
1073
1127
  ipad: 'pad',
1074
1128
  windows: 'pc',
1075
1129
  mac: 'pc',
1130
+ linux: 'pc',
1131
+ pc: 'pc',
1076
1132
  };
1077
1133
  const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
1078
1134
  const _model = model.toLowerCase();
@@ -579,6 +579,7 @@ function initPropsObserver(componentOptions) {
579
579
  // 小程序组件
580
580
  updateMiniProgramComponentProperties(resolvePropValue(up), this);
581
581
  }
582
+ else ;
582
583
  };
583
584
  {
584
585
  componentOptions.properties.uP.observer = observe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-quickapp-webview",
3
- "version": "3.0.0-5000720260410001",
3
+ "version": "3.0.0-5010520260709001",
4
4
  "description": "uni-app quickapp-webview",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -23,14 +23,14 @@
23
23
  },
24
24
  "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
25
25
  "devDependencies": {
26
- "@dcloudio/uni-mp-compiler": "3.0.0-5000720260410001"
26
+ "@dcloudio/uni-mp-compiler": "3.0.0-5010520260709001"
27
27
  },
28
28
  "dependencies": {
29
29
  "@vue/shared": "3.4.21",
30
- "@dcloudio/uni-cli-shared": "3.0.0-5000720260410001",
31
- "@dcloudio/uni-mp-vite": "3.0.0-5000720260410001",
32
- "@dcloudio/uni-shared": "3.0.0-5000720260410001",
33
- "@dcloudio/uni-mp-vue": "3.0.0-5000720260410001"
30
+ "@dcloudio/uni-cli-shared": "3.0.0-5010520260709001",
31
+ "@dcloudio/uni-shared": "3.0.0-5010520260709001",
32
+ "@dcloudio/uni-mp-vite": "3.0.0-5010520260709001",
33
+ "@dcloudio/uni-mp-vue": "3.0.0-5010520260709001"
34
34
  },
35
35
  "scripts": {
36
36
  "test": "echo \"Error: no test specified\" && exit 1"