@tarojs/taro-h5 3.6.22-alpha.5 → 3.6.22

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.esm.js CHANGED
@@ -5,12 +5,14 @@ import { isFunction, toKebabCase, PLATFORM_TYPE } from '@tarojs/shared';
5
5
  import { getCurrentPage, getHomePage } from '@tarojs/router/dist/utils';
6
6
  import { hooks, Current as Current$1, eventCenter as eventCenter$1 } from '@tarojs/runtime';
7
7
  import { fromByteArray, toByteArray } from 'base64-js';
8
- import { getMobileDetect, setTitle } from '@tarojs/router/dist/utils/navigate';
8
+ import platform from 'platform';
9
9
  import isNil from 'lodash-es/isNil';
10
10
  import { parse, stringify } from 'query-string';
11
11
  import throttle from 'lodash-es/throttle';
12
12
  import * as ics from 'ics';
13
13
  import { defineCustomElementTaroSwiperCore, defineCustomElementTaroSwiperItemCore } from '@tarojs/components/dist/components';
14
+ import { isMobile } from 'is-mobile';
15
+ import { setTitle } from '@tarojs/router/dist/utils/navigate';
14
16
  import 'whatwg-fetch';
15
17
  import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
16
18
  import jsonpRetry from 'jsonp-retry';
@@ -667,7 +669,7 @@ const getSystemSetting = () => {
667
669
  };
668
670
  /** 获取设备设置 */
669
671
  const getDeviceInfo = () => {
670
- const md = getMobileDetect();
672
+ var _a, _b;
671
673
  const info = {
672
674
  /** 应用二进制接口类型(仅 Android 支持) */
673
675
  abi: '',
@@ -676,13 +678,13 @@ const getDeviceInfo = () => {
676
678
  /** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
677
679
  benchmarkLevel: -1,
678
680
  /** 设备品牌 */
679
- brand: md.mobile() || '',
681
+ brand: platform.manufacturer || 'unknown',
680
682
  /** 设备型号 */
681
- model: md.mobile() || '',
683
+ model: platform.product || 'unknown',
682
684
  /** 操作系统及版本 */
683
- system: md.os(),
685
+ system: ((_a = platform.os) === null || _a === void 0 ? void 0 : _a.toString()) || 'unknown',
684
686
  /** 客户端平台 */
685
- platform: navigator.platform,
687
+ platform: ((_b = platform.os) === null || _b === void 0 ? void 0 : _b.family) || 'unknown',
686
688
  /** 设备二进制接口类型(仅 Android 支持) */
687
689
  CPUType: '',
688
690
  };
@@ -4449,8 +4451,7 @@ const chooseMedia = function (options, methodName = 'chooseMedia') {
4449
4451
  el.removeAttribute('multiple');
4450
4452
  }
4451
4453
  // Note: Input 仅在移动端支持 capture 属性,可以使用 getUserMedia 替代(暂不考虑)
4452
- const md = getMobileDetect();
4453
- if (md.mobile()) {
4454
+ if (isMobile()) {
4454
4455
  if (sourceType.length > 1 || sourceType.length < 1) {
4455
4456
  try {
4456
4457
  const { tapIndex } = yield showActionSheet({