@10yun/cv-mobile-ui 0.5.34 → 0.5.36

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.
@@ -1,8 +1,27 @@
1
+ export * from './date.js';
1
2
  import { toast } from '../function/index.js';
2
3
  import { colorToRgba } from '../function/colorGradient.js';
3
4
  export function cc_toast(title, duration = 1600) {
4
5
  toast(title, duration);
5
6
  }
7
+
8
+ /**
9
+ * 判断是否在微信中
10
+ * 浏览器判断是否微信
11
+ * 是否微信客户端
12
+ * @returns
13
+ */
14
+ export function cc_isWechat() {
15
+ let ua = navigator.userAgent.toLowerCase() || window.navigator.userAgent.toLowerCase();
16
+ let ua_match1 = String(ua.match(/MicroMessenger/i));
17
+ let ua_match2 = ua.match(/micromessenger/i);
18
+ let ua_match3 = ua.match(/MicroMessenger/i);
19
+ if (ua_match1 === 'micromessenger' || ua_match2 == 'micromessenger' || ua_match3 == 'micromessenger') {
20
+ return true;
21
+ }
22
+ return false;
23
+ }
24
+
6
25
  /**
7
26
  * 判断是否为空
8
27
  */