@pisell/utils 1.0.55 → 1.0.56
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/es/format.js +6 -2
- package/es/miniRedux.js +3 -1
- package/es/otherUtils.js +15 -6
- package/lib/format.js +8 -2
- package/lib/miniRedux.js +7 -4
- package/lib/otherUtils.js +9 -2
- package/package.json +2 -1
- package/es/constants/index.d.ts +0 -7
- package/es/index.d.ts +0 -20
- package/es/jsBridge/types.d.ts +0 -149
- package/es/locales.d.ts +0 -12
- package/lib/constants/index.d.ts +0 -7
- package/lib/index.d.ts +0 -20
- package/lib/jsBridge/types.d.ts +0 -149
- package/lib/locales.d.ts +0 -12
package/es/format.js
CHANGED
|
@@ -21,7 +21,9 @@ export var formatAmount = function formatAmount() {
|
|
|
21
21
|
}
|
|
22
22
|
try {
|
|
23
23
|
// 四舍五入
|
|
24
|
-
var roundedAmount =
|
|
24
|
+
var roundedAmount =
|
|
25
|
+
//@ts-ignore
|
|
26
|
+
Math.round(amount * Math.pow(10, precision)) / Math.pow(10, precision);
|
|
25
27
|
// 处理负数情况
|
|
26
28
|
var absoluteAmount = Math.abs(roundedAmount);
|
|
27
29
|
// 截取整数
|
|
@@ -78,7 +80,9 @@ export var formatAmountWithOptions = function formatAmountWithOptions() {
|
|
|
78
80
|
}
|
|
79
81
|
try {
|
|
80
82
|
// 四舍五入
|
|
81
|
-
var roundedAmount =
|
|
83
|
+
var roundedAmount =
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
Math.round(amount * Math.pow(10, precision)) / Math.pow(10, precision);
|
|
82
86
|
// 处理负数情况
|
|
83
87
|
var absoluteAmount = Math.abs(roundedAmount);
|
|
84
88
|
// 截取整数
|
package/es/miniRedux.js
CHANGED
|
@@ -10,7 +10,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { createContext, useCallback, useMemo, useReducer, forwardRef, useRef
|
|
13
|
+
import React, { createContext, useCallback, useMemo, useReducer, forwardRef, useRef
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
} from 'react';
|
|
14
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
17
|
export var miniRedux = function miniRedux(_ref2) {
|
|
16
18
|
var _ref2$namespace = _ref2.namespace,
|
package/es/otherUtils.js
CHANGED
|
@@ -20,23 +20,32 @@ export var detectIncognito = /*#__PURE__*/function () {
|
|
|
20
20
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
22
22
|
case 0:
|
|
23
|
+
_context.prev = 0;
|
|
23
24
|
if (!navigator.userAgent.toLowerCase().includes('honor')) {
|
|
24
|
-
_context.next =
|
|
25
|
+
_context.next = 3;
|
|
25
26
|
break;
|
|
26
27
|
}
|
|
27
28
|
return _context.abrupt("return", {
|
|
28
29
|
isPrivate: false
|
|
29
30
|
});
|
|
30
|
-
case
|
|
31
|
-
_context.next =
|
|
31
|
+
case 3:
|
|
32
|
+
_context.next = 5;
|
|
32
33
|
return originDetectIncognito();
|
|
33
|
-
case 4:
|
|
34
|
-
return _context.abrupt("return", _context.sent);
|
|
35
34
|
case 5:
|
|
35
|
+
return _context.abrupt("return", _context.sent);
|
|
36
|
+
case 8:
|
|
37
|
+
_context.prev = 8;
|
|
38
|
+
_context.t0 = _context["catch"](0);
|
|
39
|
+
// 当无法检测浏览器类型时,默认返回非隐私模式,确保支付流程可以继续
|
|
40
|
+
console.warn('detectIncognito failed:', _context.t0);
|
|
41
|
+
return _context.abrupt("return", {
|
|
42
|
+
isPrivate: false
|
|
43
|
+
});
|
|
44
|
+
case 12:
|
|
36
45
|
case "end":
|
|
37
46
|
return _context.stop();
|
|
38
47
|
}
|
|
39
|
-
}, _callee);
|
|
48
|
+
}, _callee, null, [[0, 8]]);
|
|
40
49
|
}));
|
|
41
50
|
return function detectIncognito() {
|
|
42
51
|
return _ref.apply(this, arguments);
|
package/lib/format.js
CHANGED
|
@@ -30,7 +30,10 @@ var formatAmount = (amount = 0, precision = 2, symbol = "") => {
|
|
|
30
30
|
return amount;
|
|
31
31
|
}
|
|
32
32
|
try {
|
|
33
|
-
const roundedAmount =
|
|
33
|
+
const roundedAmount = (
|
|
34
|
+
//@ts-ignore
|
|
35
|
+
Math.round(amount * Math.pow(10, precision)) / Math.pow(10, precision)
|
|
36
|
+
);
|
|
34
37
|
const absoluteAmount = Math.abs(roundedAmount);
|
|
35
38
|
const integerPart = Math.floor(absoluteAmount);
|
|
36
39
|
const decimalPart = (absoluteAmount - integerPart).toFixed(precision).substring(2);
|
|
@@ -65,7 +68,10 @@ var formatAmountWithOptions = (amount = 0, symbol = "", options) => {
|
|
|
65
68
|
return amount;
|
|
66
69
|
}
|
|
67
70
|
try {
|
|
68
|
-
const roundedAmount =
|
|
71
|
+
const roundedAmount = (
|
|
72
|
+
//@ts-ignore
|
|
73
|
+
Math.round(amount * Math.pow(10, precision)) / Math.pow(10, precision)
|
|
74
|
+
);
|
|
69
75
|
const absoluteAmount = Math.abs(roundedAmount);
|
|
70
76
|
const integerPart = Math.floor(absoluteAmount);
|
|
71
77
|
const decimalPart = (absoluteAmount - integerPart).toFixed(precision).substring(2);
|
package/lib/miniRedux.js
CHANGED
|
@@ -61,10 +61,13 @@ var miniRedux = ({
|
|
|
61
61
|
dispatch({ type, payload });
|
|
62
62
|
}
|
|
63
63
|
}, []);
|
|
64
|
-
const contextValue = (0, import_react.useMemo)(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
const contextValue = (0, import_react.useMemo)(
|
|
65
|
+
() => ({
|
|
66
|
+
[namespace]: providerState,
|
|
67
|
+
dispatch: _dispatch
|
|
68
|
+
}),
|
|
69
|
+
[providerState, _dispatch]
|
|
70
|
+
);
|
|
68
71
|
let _props = {
|
|
69
72
|
...props,
|
|
70
73
|
[namespace]: providerState,
|
package/lib/otherUtils.js
CHANGED
|
@@ -41,12 +41,19 @@ var import_md5 = __toESM(require("crypto-js/md5"));
|
|
|
41
41
|
var import_enc_hex = __toESM(require("crypto-js/enc-hex"));
|
|
42
42
|
var import_detectincognitojs = require("detectincognitojs");
|
|
43
43
|
var detectIncognito = async () => {
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
if (navigator.userAgent.toLowerCase().includes("honor")) {
|
|
46
|
+
return {
|
|
47
|
+
isPrivate: false
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return await (0, import_detectincognitojs.detectIncognito)();
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.warn("detectIncognito failed:", error);
|
|
45
53
|
return {
|
|
46
54
|
isPrivate: false
|
|
47
55
|
};
|
|
48
56
|
}
|
|
49
|
-
return await (0, import_detectincognitojs.detectIncognito)();
|
|
50
57
|
};
|
|
51
58
|
var getUniqueId = (prefix = "", maxLength = 11) => {
|
|
52
59
|
return prefix + (Math.random() + "").replace(/\D/g, "").substring(0, maxLength);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "father build",
|
|
30
|
+
"build:tsdown": "tsdown",
|
|
30
31
|
"dev": "father dev"
|
|
31
32
|
}
|
|
32
33
|
}
|
package/es/constants/index.d.ts
DELETED
package/es/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export * from './otherUtils';
|
|
2
|
-
export * from './typeUtils';
|
|
3
|
-
export * from './document';
|
|
4
|
-
export * from './date';
|
|
5
|
-
export * from './platform';
|
|
6
|
-
export * from './log';
|
|
7
|
-
export * from './format';
|
|
8
|
-
export * from './escPosPrinter';
|
|
9
|
-
export * from './miniRedux';
|
|
10
|
-
export * from './jsBridge';
|
|
11
|
-
export * from './image';
|
|
12
|
-
export * from './locales';
|
|
13
|
-
export * from './arrayUtils';
|
|
14
|
-
export * from './walletValidity';
|
|
15
|
-
export declare const setPisellUtilsConfig: (config: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}) => void;
|
|
18
|
-
export declare const getPisellUtilsConfig: () => {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
};
|
package/es/jsBridge/types.d.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
declare type LanguageNumber = {
|
|
2
|
-
en: number;
|
|
3
|
-
zh_CN: number;
|
|
4
|
-
zh_HK: number;
|
|
5
|
-
};
|
|
6
|
-
declare type LanguageString = {
|
|
7
|
-
en: string;
|
|
8
|
-
zh_CN: string;
|
|
9
|
-
zh_HK: string;
|
|
10
|
-
} | string;
|
|
11
|
-
/**
|
|
12
|
-
* 打印小票
|
|
13
|
-
*/
|
|
14
|
-
export declare type WebPrint0 = {
|
|
15
|
-
/**
|
|
16
|
-
* 打印类型
|
|
17
|
-
* 0: 小票
|
|
18
|
-
* 1:ITS备货单/划菜单
|
|
19
|
-
* 2:手环
|
|
20
|
-
*/
|
|
21
|
-
type: '0';
|
|
22
|
-
data: {
|
|
23
|
-
/** 订单ID */
|
|
24
|
-
order_id: string;
|
|
25
|
-
};
|
|
26
|
-
/** 打印语言对应的数量 */
|
|
27
|
-
language: LanguageNumber;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* 打印ITS备货单/划菜单
|
|
31
|
-
*/
|
|
32
|
-
export declare type WebPrint1 = {
|
|
33
|
-
/**
|
|
34
|
-
* 打印类型
|
|
35
|
-
* 0: 小票
|
|
36
|
-
* 1:ITS备货单/划菜单
|
|
37
|
-
* 2:手环
|
|
38
|
-
*/
|
|
39
|
-
type: '1';
|
|
40
|
-
data: {
|
|
41
|
-
/** 0:备货 1:划单 */
|
|
42
|
-
mode: '0' | '1';
|
|
43
|
-
resource: LanguageString;
|
|
44
|
-
/** 订单备注 */
|
|
45
|
-
order_note: string;
|
|
46
|
-
/** 订单时间或商品下单时间 */
|
|
47
|
-
time: string;
|
|
48
|
-
/** 订单编号 */
|
|
49
|
-
order_number?: string;
|
|
50
|
-
/** 商品 */
|
|
51
|
-
products: {
|
|
52
|
-
/** 商品名称 */
|
|
53
|
-
product_title: LanguageString;
|
|
54
|
-
/** 商品规格 */
|
|
55
|
-
product_option_string: LanguageString;
|
|
56
|
-
/** 商品备注 */
|
|
57
|
-
product_note: string;
|
|
58
|
-
/** 商品数量 */
|
|
59
|
-
product_quantity: number;
|
|
60
|
-
/** 加菜标识 待定 */
|
|
61
|
-
is_append?: boolean;
|
|
62
|
-
/** 退菜标识 待定 */
|
|
63
|
-
is_removed?: boolean;
|
|
64
|
-
}[];
|
|
65
|
-
};
|
|
66
|
-
/** 打印语言对应的数量 */
|
|
67
|
-
language: LanguageNumber;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* 打印手环
|
|
71
|
-
*/
|
|
72
|
-
export declare type WebPrint2 = {
|
|
73
|
-
/**
|
|
74
|
-
* 打印类型
|
|
75
|
-
* 0: 小票
|
|
76
|
-
* 1:ITS备货单/划菜单
|
|
77
|
-
* 2:手环
|
|
78
|
-
*/
|
|
79
|
-
type: '2';
|
|
80
|
-
data: {
|
|
81
|
-
/** 0: 普通票 1:成人票 2:免费成人票 */
|
|
82
|
-
type: '0' | '1' | '2';
|
|
83
|
-
/** 发行编码 */
|
|
84
|
-
encoded: string;
|
|
85
|
-
/** 编码 */
|
|
86
|
-
code: string;
|
|
87
|
-
/** 到期时间 */
|
|
88
|
-
expire_date: string;
|
|
89
|
-
areas: {
|
|
90
|
-
/** 区域名字 */
|
|
91
|
-
area_name: string;
|
|
92
|
-
/** 区域代码 */
|
|
93
|
-
area_code: string;
|
|
94
|
-
/** 可用次数 */
|
|
95
|
-
limit_num: number;
|
|
96
|
-
/** 已用次数 */
|
|
97
|
-
used_num: number;
|
|
98
|
-
}[];
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* 打印充值卡
|
|
103
|
-
*/
|
|
104
|
-
export declare type WebPrint4 = {
|
|
105
|
-
type: '4';
|
|
106
|
-
data: {
|
|
107
|
-
order_id: string;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* 打印订单中所有
|
|
112
|
-
*/
|
|
113
|
-
export declare type WebPrint99 = {
|
|
114
|
-
type: '99';
|
|
115
|
-
data: {
|
|
116
|
-
order_id: string;
|
|
117
|
-
machine_code_print_info: {
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
}[];
|
|
120
|
-
small_ticket_data: {
|
|
121
|
-
[key: string]: any;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* 打印
|
|
127
|
-
*/
|
|
128
|
-
export declare type WebPrintParams = WebPrint0 | WebPrint1 | WebPrint2 | WebPrint4 | WebPrint99;
|
|
129
|
-
/**
|
|
130
|
-
* 数据管理
|
|
131
|
-
*/
|
|
132
|
-
export declare type DataManagerParams = {
|
|
133
|
-
module: 'set' | 'get';
|
|
134
|
-
key: string;
|
|
135
|
-
data?: any;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* 支付
|
|
139
|
-
*/
|
|
140
|
-
export declare type WebPaymentParams = {
|
|
141
|
-
module: 'payment' | 'refund' | string;
|
|
142
|
-
key: 'mx51' | string;
|
|
143
|
-
data?: {
|
|
144
|
-
order_id: string | number;
|
|
145
|
-
amount: string | number;
|
|
146
|
-
surcharge?: string | number;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export {};
|
package/es/locales.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const locales: {
|
|
2
|
-
init: (_localeMaps: any, _locale: string) => void;
|
|
3
|
-
getText: (id: string) => any;
|
|
4
|
-
locale: string;
|
|
5
|
-
localeMap: any;
|
|
6
|
-
localeMaps: {
|
|
7
|
-
en: {};
|
|
8
|
-
'zh-CN': {};
|
|
9
|
-
'zh-HK': {};
|
|
10
|
-
};
|
|
11
|
-
formatLocale: (_locale: string) => string;
|
|
12
|
-
};
|
package/lib/constants/index.d.ts
DELETED
package/lib/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export * from './otherUtils';
|
|
2
|
-
export * from './typeUtils';
|
|
3
|
-
export * from './document';
|
|
4
|
-
export * from './date';
|
|
5
|
-
export * from './platform';
|
|
6
|
-
export * from './log';
|
|
7
|
-
export * from './format';
|
|
8
|
-
export * from './escPosPrinter';
|
|
9
|
-
export * from './miniRedux';
|
|
10
|
-
export * from './jsBridge';
|
|
11
|
-
export * from './image';
|
|
12
|
-
export * from './locales';
|
|
13
|
-
export * from './arrayUtils';
|
|
14
|
-
export * from './walletValidity';
|
|
15
|
-
export declare const setPisellUtilsConfig: (config: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}) => void;
|
|
18
|
-
export declare const getPisellUtilsConfig: () => {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
};
|
package/lib/jsBridge/types.d.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
declare type LanguageNumber = {
|
|
2
|
-
en: number;
|
|
3
|
-
zh_CN: number;
|
|
4
|
-
zh_HK: number;
|
|
5
|
-
};
|
|
6
|
-
declare type LanguageString = {
|
|
7
|
-
en: string;
|
|
8
|
-
zh_CN: string;
|
|
9
|
-
zh_HK: string;
|
|
10
|
-
} | string;
|
|
11
|
-
/**
|
|
12
|
-
* 打印小票
|
|
13
|
-
*/
|
|
14
|
-
export declare type WebPrint0 = {
|
|
15
|
-
/**
|
|
16
|
-
* 打印类型
|
|
17
|
-
* 0: 小票
|
|
18
|
-
* 1:ITS备货单/划菜单
|
|
19
|
-
* 2:手环
|
|
20
|
-
*/
|
|
21
|
-
type: '0';
|
|
22
|
-
data: {
|
|
23
|
-
/** 订单ID */
|
|
24
|
-
order_id: string;
|
|
25
|
-
};
|
|
26
|
-
/** 打印语言对应的数量 */
|
|
27
|
-
language: LanguageNumber;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* 打印ITS备货单/划菜单
|
|
31
|
-
*/
|
|
32
|
-
export declare type WebPrint1 = {
|
|
33
|
-
/**
|
|
34
|
-
* 打印类型
|
|
35
|
-
* 0: 小票
|
|
36
|
-
* 1:ITS备货单/划菜单
|
|
37
|
-
* 2:手环
|
|
38
|
-
*/
|
|
39
|
-
type: '1';
|
|
40
|
-
data: {
|
|
41
|
-
/** 0:备货 1:划单 */
|
|
42
|
-
mode: '0' | '1';
|
|
43
|
-
resource: LanguageString;
|
|
44
|
-
/** 订单备注 */
|
|
45
|
-
order_note: string;
|
|
46
|
-
/** 订单时间或商品下单时间 */
|
|
47
|
-
time: string;
|
|
48
|
-
/** 订单编号 */
|
|
49
|
-
order_number?: string;
|
|
50
|
-
/** 商品 */
|
|
51
|
-
products: {
|
|
52
|
-
/** 商品名称 */
|
|
53
|
-
product_title: LanguageString;
|
|
54
|
-
/** 商品规格 */
|
|
55
|
-
product_option_string: LanguageString;
|
|
56
|
-
/** 商品备注 */
|
|
57
|
-
product_note: string;
|
|
58
|
-
/** 商品数量 */
|
|
59
|
-
product_quantity: number;
|
|
60
|
-
/** 加菜标识 待定 */
|
|
61
|
-
is_append?: boolean;
|
|
62
|
-
/** 退菜标识 待定 */
|
|
63
|
-
is_removed?: boolean;
|
|
64
|
-
}[];
|
|
65
|
-
};
|
|
66
|
-
/** 打印语言对应的数量 */
|
|
67
|
-
language: LanguageNumber;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* 打印手环
|
|
71
|
-
*/
|
|
72
|
-
export declare type WebPrint2 = {
|
|
73
|
-
/**
|
|
74
|
-
* 打印类型
|
|
75
|
-
* 0: 小票
|
|
76
|
-
* 1:ITS备货单/划菜单
|
|
77
|
-
* 2:手环
|
|
78
|
-
*/
|
|
79
|
-
type: '2';
|
|
80
|
-
data: {
|
|
81
|
-
/** 0: 普通票 1:成人票 2:免费成人票 */
|
|
82
|
-
type: '0' | '1' | '2';
|
|
83
|
-
/** 发行编码 */
|
|
84
|
-
encoded: string;
|
|
85
|
-
/** 编码 */
|
|
86
|
-
code: string;
|
|
87
|
-
/** 到期时间 */
|
|
88
|
-
expire_date: string;
|
|
89
|
-
areas: {
|
|
90
|
-
/** 区域名字 */
|
|
91
|
-
area_name: string;
|
|
92
|
-
/** 区域代码 */
|
|
93
|
-
area_code: string;
|
|
94
|
-
/** 可用次数 */
|
|
95
|
-
limit_num: number;
|
|
96
|
-
/** 已用次数 */
|
|
97
|
-
used_num: number;
|
|
98
|
-
}[];
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* 打印充值卡
|
|
103
|
-
*/
|
|
104
|
-
export declare type WebPrint4 = {
|
|
105
|
-
type: '4';
|
|
106
|
-
data: {
|
|
107
|
-
order_id: string;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* 打印订单中所有
|
|
112
|
-
*/
|
|
113
|
-
export declare type WebPrint99 = {
|
|
114
|
-
type: '99';
|
|
115
|
-
data: {
|
|
116
|
-
order_id: string;
|
|
117
|
-
machine_code_print_info: {
|
|
118
|
-
[key: string]: any;
|
|
119
|
-
}[];
|
|
120
|
-
small_ticket_data: {
|
|
121
|
-
[key: string]: any;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* 打印
|
|
127
|
-
*/
|
|
128
|
-
export declare type WebPrintParams = WebPrint0 | WebPrint1 | WebPrint2 | WebPrint4 | WebPrint99;
|
|
129
|
-
/**
|
|
130
|
-
* 数据管理
|
|
131
|
-
*/
|
|
132
|
-
export declare type DataManagerParams = {
|
|
133
|
-
module: 'set' | 'get';
|
|
134
|
-
key: string;
|
|
135
|
-
data?: any;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* 支付
|
|
139
|
-
*/
|
|
140
|
-
export declare type WebPaymentParams = {
|
|
141
|
-
module: 'payment' | 'refund' | string;
|
|
142
|
-
key: 'mx51' | string;
|
|
143
|
-
data?: {
|
|
144
|
-
order_id: string | number;
|
|
145
|
-
amount: string | number;
|
|
146
|
-
surcharge?: string | number;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export {};
|
package/lib/locales.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const locales: {
|
|
2
|
-
init: (_localeMaps: any, _locale: string) => void;
|
|
3
|
-
getText: (id: string) => any;
|
|
4
|
-
locale: string;
|
|
5
|
-
localeMap: any;
|
|
6
|
-
localeMaps: {
|
|
7
|
-
en: {};
|
|
8
|
-
'zh-CN': {};
|
|
9
|
-
'zh-HK': {};
|
|
10
|
-
};
|
|
11
|
-
formatLocale: (_locale: string) => string;
|
|
12
|
-
};
|