component-shipinlv 0.0.13 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/lib/Tool.js +14 -10
- package/dist/lib/js-error.js +1 -1
- package/dist/lib/platform.d.ts +1 -1
- package/dist/lib/platform.js +18 -10
- package/package.json +1 -1
package/dist/lib/Tool.d.ts
CHANGED
@@ -163,7 +163,7 @@ declare const Tool: {
|
|
163
163
|
setTimeOffset(serverTime: number): void;
|
164
164
|
getTime(): number;
|
165
165
|
h5Pay(query: Pay.H5PayQuery): void;
|
166
|
-
notification(type: "
|
166
|
+
notification(type: "error" | "success" | "info" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
167
167
|
notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
168
168
|
notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
169
169
|
notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
package/dist/lib/Tool.js
CHANGED
@@ -2,7 +2,6 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
|
-
var _window8;
|
6
5
|
// @ts-nocheck
|
7
6
|
|
8
7
|
import { Modal, message, Tooltip } from 'antd';
|
@@ -65,7 +64,7 @@ var Tool = _objectSpread(_objectSpread({
|
|
65
64
|
GData: {
|
66
65
|
userInfo: {}
|
67
66
|
},
|
68
|
-
//
|
67
|
+
//win dow._GData,
|
69
68
|
data: function data(key, value) {
|
70
69
|
if (typeof value === 'undefined') {
|
71
70
|
this.GData[key] = value;
|
@@ -1095,15 +1094,20 @@ var Tool = _objectSpread(_objectSpread({
|
|
1095
1094
|
var data = JSON.stringify(_objectSpread({
|
1096
1095
|
payBackUrl: document.location.href
|
1097
1096
|
}, query));
|
1098
|
-
|
1097
|
+
document.location.href = 'https://pay.shanren.wang/pay/we-h5?data=' + encodeURIComponent(data);
|
1099
1098
|
}
|
1100
1099
|
});
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
if (window) {
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1100
|
+
|
1101
|
+
//
|
1102
|
+
// if( window ){
|
1103
|
+
// if ( !window?._GData) {
|
1104
|
+
// window._GData = {};
|
1105
|
+
// }
|
1106
|
+
//
|
1107
|
+
// Tool.GData = window._GData;
|
1108
|
+
//
|
1109
|
+
// window._Tool = Tool;
|
1110
|
+
// }
|
1111
|
+
|
1108
1112
|
Tool.onWindowError();
|
1109
1113
|
export default Tool;
|
package/dist/lib/js-error.js
CHANGED
package/dist/lib/platform.d.ts
CHANGED
package/dist/lib/platform.js
CHANGED
@@ -1,32 +1,40 @@
|
|
1
|
-
var
|
2
|
-
var
|
1
|
+
var ua = function ua() {
|
2
|
+
var _window;
|
3
|
+
if (typeof window === 'undefined') {
|
4
|
+
return '';
|
5
|
+
}
|
6
|
+
return (_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent.toLowerCase();
|
7
|
+
};
|
3
8
|
|
4
9
|
// android平台
|
5
10
|
var isAndroid = function () {
|
6
|
-
return /Android|Adr/i.test(ua);
|
11
|
+
return /Android|Adr/i.test(ua());
|
7
12
|
}();
|
8
13
|
|
9
14
|
// ios平台
|
10
15
|
var isIos = function () {
|
11
|
-
return /iPhone|iPod|iPad/i.test(ua);
|
16
|
+
return /iPhone|iPod|iPad/i.test(ua());
|
12
17
|
}();
|
13
18
|
|
14
19
|
// 微信生态
|
15
20
|
var isWechat = function () {
|
16
|
-
return /MicroMessenger/i.test(ua);
|
21
|
+
return /MicroMessenger/i.test(ua());
|
17
22
|
}();
|
18
23
|
|
19
24
|
// 微信小程序
|
20
25
|
var isWxmp = function (_window2) {
|
21
|
-
|
26
|
+
if (typeof window === 'undefined') {
|
27
|
+
return '';
|
28
|
+
}
|
29
|
+
return /miniProgram/i.test(ua()) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__wxjs_environment) === 'miniprogram';
|
22
30
|
}();
|
23
31
|
|
24
32
|
// 钉钉环境
|
25
33
|
var isDingding = function () {
|
26
|
-
return /DingTalk/i.test(ua);
|
34
|
+
return /DingTalk/i.test(ua());
|
27
35
|
}();
|
28
36
|
var isH5 = function () {
|
29
|
-
return !!ua.match(/AppleWebKit.*Mobile.*/) || isAndroid || isIos; //是否为移动终端
|
37
|
+
return !!ua().match(/AppleWebKit.*Mobile.*/) || isAndroid || isIos; //是否为移动终端
|
30
38
|
}();
|
31
39
|
|
32
40
|
// 钉钉环境
|
@@ -41,9 +49,9 @@ var Platform = {
|
|
41
49
|
isDingding: isDingding,
|
42
50
|
isH5: isH5,
|
43
51
|
isWeb: isWeb,
|
44
|
-
isIPhone: ua.indexOf('iPhone') > -1,
|
52
|
+
isIPhone: ua().indexOf('iPhone') > -1,
|
45
53
|
//iPhone
|
46
|
-
isIPad: ua.indexOf('iPad') > -1 //iPad
|
54
|
+
isIPad: ua().indexOf('iPad') > -1 //iPad
|
47
55
|
};
|
48
56
|
|
49
57
|
export default Platform;
|