@pisell/private-materials 3.0.139 → 3.0.140
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +7 -7
- package/es/components/eftpos/deviceList/index.d.ts +3 -0
- package/es/components/eftpos/deviceList/index.js +52 -0
- package/es/components/eftpos/form/index.js +21 -74
- package/es/components/eftpos/group/index.d.ts +7 -0
- package/es/components/eftpos/group/index.js +65 -0
- package/es/components/eftposPay/component/manual/index.js +15 -15
- package/es/components/eftposPay/helper.d.ts +9 -0
- package/es/components/eftposPay/helper.js +69 -1
- package/es/components/eftposPay/manufacturer.d.ts +1 -1
- package/es/components/eftposPay/manufacturer.js +17 -15
- package/es/components/eftposPay/payo/const.js +6 -3
- package/es/components/eftposPay/payo/hooks.js +31 -2
- package/es/components/eftposPay/tyro/const.js +3 -1
- package/es/components/eftposPay/windcave/const.js +2 -1
- package/lib/components/eftpos/deviceList/index.d.ts +3 -0
- package/lib/components/eftpos/deviceList/index.js +70 -0
- package/lib/components/eftpos/form/index.js +6 -33
- package/lib/components/eftpos/group/index.d.ts +7 -0
- package/lib/components/eftpos/group/index.js +75 -0
- package/lib/components/eftposPay/component/manual/index.js +4 -15
- package/lib/components/eftposPay/helper.d.ts +9 -0
- package/lib/components/eftposPay/helper.js +49 -0
- package/lib/components/eftposPay/manufacturer.d.ts +1 -1
- package/lib/components/eftposPay/manufacturer.js +2 -13
- package/lib/components/eftposPay/payo/const.js +3 -3
- package/lib/components/eftposPay/payo/hooks.js +17 -0
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftpos/deviceList/index.tsx
|
|
30
|
+
var deviceList_exports = {};
|
|
31
|
+
__export(deviceList_exports, {
|
|
32
|
+
default: () => deviceList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(deviceList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_group = require("../group");
|
|
38
|
+
var DeviceList = (props) => {
|
|
39
|
+
const [form] = import_antd.Form.useForm();
|
|
40
|
+
const { list, onChange } = props;
|
|
41
|
+
console.log(list);
|
|
42
|
+
const onValuesChange = () => {
|
|
43
|
+
const val = Object.values(form.getFieldsValue()).flat();
|
|
44
|
+
onChange(val);
|
|
45
|
+
};
|
|
46
|
+
const initialValues = (0, import_react.useMemo)(() => {
|
|
47
|
+
return list.reduce((target, item) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return {
|
|
50
|
+
...target,
|
|
51
|
+
[item.name]: ((_a = item == null ? void 0 : item.input) == null ? void 0 : _a.value) || ((_b = item == null ? void 0 : item.input) == null ? void 0 : _b.defaultValue)
|
|
52
|
+
};
|
|
53
|
+
}, {});
|
|
54
|
+
}, [list]);
|
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
56
|
+
import_antd.Form,
|
|
57
|
+
{
|
|
58
|
+
layout: "vertical",
|
|
59
|
+
onValuesChange,
|
|
60
|
+
form,
|
|
61
|
+
initialValues
|
|
62
|
+
},
|
|
63
|
+
list.map(({ input, ...formItemProps }) => {
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps }, /* @__PURE__ */ import_react.default.createElement(import_group.CheckboxGroup, { ...input }));
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
var deviceList_default = ({ input, ...formItemProps }) => {
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps }, /* @__PURE__ */ import_react.default.createElement(DeviceList, { ...input }));
|
|
70
|
+
};
|
|
@@ -35,44 +35,16 @@ __export(form_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(form_exports);
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_antd = require("antd");
|
|
38
|
+
var import_group = require("../group");
|
|
38
39
|
var import_surcharge = __toESM(require("../surcharge"));
|
|
40
|
+
var import_deviceList = __toESM(require("../deviceList"));
|
|
39
41
|
var Mapping = {
|
|
40
42
|
Input: import_antd.Input,
|
|
41
43
|
InputNumber: import_antd.InputNumber,
|
|
42
44
|
Checkbox: import_antd.Checkbox,
|
|
43
|
-
"Checkbox.Group":
|
|
44
|
-
direction,
|
|
45
|
-
options,
|
|
46
|
-
...props
|
|
47
|
-
}) => {
|
|
48
|
-
if (direction === "vertical") {
|
|
49
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction }, options == null ? void 0 : options.map((item) => {
|
|
50
|
-
if (typeof item === "object") {
|
|
51
|
-
const { label, value, ...other } = item;
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { ...other, value, key: `${item.value}` }, label);
|
|
53
|
-
}
|
|
54
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { value: item, key: `${item}` }, item);
|
|
55
|
-
})));
|
|
56
|
-
}
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props, options });
|
|
58
|
-
},
|
|
45
|
+
"Checkbox.Group": import_group.CheckboxGroup,
|
|
59
46
|
Radio: import_antd.Radio,
|
|
60
|
-
"Radio.Group":
|
|
61
|
-
direction,
|
|
62
|
-
options,
|
|
63
|
-
...props
|
|
64
|
-
}) => {
|
|
65
|
-
if (direction === "vertical") {
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction: "vertical" }, options == null ? void 0 : options.map((item) => {
|
|
67
|
-
if (typeof item === "object") {
|
|
68
|
-
const { label, value, ...other } = item;
|
|
69
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { ...other, value, key: `${item.value}` }, label);
|
|
70
|
-
}
|
|
71
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: item, key: `${item}` }, item);
|
|
72
|
-
})));
|
|
73
|
-
}
|
|
74
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props, options });
|
|
75
|
-
},
|
|
47
|
+
"Radio.Group": import_group.RadioGroup,
|
|
76
48
|
"Radio.Button": import_antd.Radio.Button,
|
|
77
49
|
Cascader: import_antd.Cascader,
|
|
78
50
|
DatePicker: import_antd.DatePicker,
|
|
@@ -85,7 +57,8 @@ var Mapping = {
|
|
|
85
57
|
Upload: import_antd.Upload
|
|
86
58
|
};
|
|
87
59
|
var CustomMapping = {
|
|
88
|
-
Surcharge: import_surcharge.default
|
|
60
|
+
Surcharge: import_surcharge.default,
|
|
61
|
+
DeviceList: import_deviceList.default
|
|
89
62
|
};
|
|
90
63
|
var CustomFormItem = ({
|
|
91
64
|
formItemList,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RadioGroupProps } from 'antd';
|
|
3
|
+
export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
|
|
4
|
+
export declare const RadioGroup: ({ direction, options, component, ...props }: RadioGroupProps & {
|
|
5
|
+
direction?: "vertical" | undefined;
|
|
6
|
+
component: string;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftpos/group/index.tsx
|
|
30
|
+
var group_exports = {};
|
|
31
|
+
__export(group_exports, {
|
|
32
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
33
|
+
RadioGroup: () => RadioGroup
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(group_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var CheckboxGroup = ({
|
|
39
|
+
direction,
|
|
40
|
+
options,
|
|
41
|
+
...props
|
|
42
|
+
}) => {
|
|
43
|
+
if (direction === "vertical") {
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction }, options == null ? void 0 : options.map((item) => {
|
|
45
|
+
if (typeof item === "object") {
|
|
46
|
+
const { label, value, ...other } = item;
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { ...other, value, key: `${item.value}` }, label);
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { value: item, key: `${item}` }, item);
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props, options });
|
|
53
|
+
};
|
|
54
|
+
var RadioGroup = ({
|
|
55
|
+
direction,
|
|
56
|
+
options,
|
|
57
|
+
component,
|
|
58
|
+
...props
|
|
59
|
+
}) => {
|
|
60
|
+
if (direction === "vertical") {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction: "vertical" }, options == null ? void 0 : options.map((item) => {
|
|
62
|
+
if (typeof item === "object") {
|
|
63
|
+
const { label, value, ...other } = item;
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { ...other, value, key: `${item.value}` }, label);
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: item, key: `${item}` }, item);
|
|
67
|
+
})));
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props, options });
|
|
70
|
+
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
CheckboxGroup,
|
|
74
|
+
RadioGroup
|
|
75
|
+
});
|
|
@@ -45,11 +45,11 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
|
|
|
45
45
|
const dispatch = (0, import_store.useDispatch)();
|
|
46
46
|
const { symbol, manual, order_id, mode, device, number, pay, amount } = (0, import_store.useContextData)();
|
|
47
47
|
const start = (0, import_react.useMemo)(() => {
|
|
48
|
-
if (typeof (manual == null ? void 0 : manual.money) === "number") {
|
|
49
|
-
return manual == null ? void 0 : manual.money;
|
|
48
|
+
if (typeof (manual == null ? void 0 : manual.money) === "number" || typeof (manual == null ? void 0 : manual.money) === "string") {
|
|
49
|
+
return Number(manual == null ? void 0 : manual.money);
|
|
50
50
|
}
|
|
51
|
-
if (typeof (pay == null ? void 0 : pay.total) === "number") {
|
|
52
|
-
return pay == null ? void 0 : pay.total;
|
|
51
|
+
if (typeof (pay == null ? void 0 : pay.total) === "number" || typeof (pay == null ? void 0 : pay.total) === "string") {
|
|
52
|
+
return Number(pay == null ? void 0 : pay.total);
|
|
53
53
|
}
|
|
54
54
|
return amount;
|
|
55
55
|
}, [manual == null ? void 0 : manual.money, pay == null ? void 0 : pay.total, amount]);
|
|
@@ -61,17 +61,6 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
|
|
|
61
61
|
if (disabled) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
if (mode === import_const.ModeEnum.Pay) {
|
|
65
|
-
setDisabled(true);
|
|
66
|
-
const obj = pay || {};
|
|
67
|
-
onChange("success", {
|
|
68
|
-
...obj,
|
|
69
|
-
number,
|
|
70
|
-
device,
|
|
71
|
-
order_id
|
|
72
|
-
});
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
64
|
if (mode === import_const.ModeEnum.Refund) {
|
|
76
65
|
setDisabled(true);
|
|
77
66
|
onChange("success", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { State } from './store';
|
|
2
|
+
import { Amount } from './const';
|
|
2
3
|
export declare function getUuid(): string;
|
|
3
4
|
/**
|
|
4
5
|
* @title: Promise化 setTimeout
|
|
@@ -54,4 +55,12 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
|
|
|
54
55
|
device?: undefined;
|
|
55
56
|
};
|
|
56
57
|
export declare const limitDecimals: (value: any) => any;
|
|
58
|
+
/**
|
|
59
|
+
* @title: 通用获取 金额信息
|
|
60
|
+
* @description: 在 amount 页面设置则使用 pay ,如果有 setting 则使用 setting 信息 ,都没有则设置0
|
|
61
|
+
* @param {State} store : 全局store数据管理
|
|
62
|
+
* @Author: hongbing.wang
|
|
63
|
+
* @Date: 2024-08-12 10:24
|
|
64
|
+
*/
|
|
65
|
+
export declare function getAmonunt(store: State): Amount;
|
|
57
66
|
export {};
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var helper_exports = {};
|
|
21
21
|
__export(helper_exports, {
|
|
22
22
|
cloneDeep: () => cloneDeep,
|
|
23
|
+
getAmonunt: () => getAmonunt,
|
|
23
24
|
getPayParams: () => getPayParams,
|
|
24
25
|
getUuid: () => getUuid,
|
|
25
26
|
limitDecimals: () => limitDecimals,
|
|
@@ -116,9 +117,57 @@ var limitDecimals = (value) => {
|
|
|
116
117
|
}
|
|
117
118
|
return "";
|
|
118
119
|
};
|
|
120
|
+
function getAmonunt(store) {
|
|
121
|
+
const { device, pay, custom, name, symbol, amount } = store;
|
|
122
|
+
if (!device || !custom) {
|
|
123
|
+
throw Error("device or custom is not defined");
|
|
124
|
+
}
|
|
125
|
+
const setting = device.setting;
|
|
126
|
+
if (pay) {
|
|
127
|
+
return {
|
|
128
|
+
name,
|
|
129
|
+
symbol,
|
|
130
|
+
// format,
|
|
131
|
+
money: Number(amount),
|
|
132
|
+
amount: Number(pay.amount),
|
|
133
|
+
surRate: Number(pay.surRate),
|
|
134
|
+
surMoney: Number(pay.surMoney),
|
|
135
|
+
surcharge: (setting == null ? void 0 : setting.surcharge) || false,
|
|
136
|
+
useOriginSurcharge: (pay == null ? void 0 : pay.useOriginSurcharge) || false
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (!setting) {
|
|
140
|
+
return {
|
|
141
|
+
name,
|
|
142
|
+
symbol,
|
|
143
|
+
// format,
|
|
144
|
+
money: Number(amount),
|
|
145
|
+
amount: Number(amount),
|
|
146
|
+
surRate: 0,
|
|
147
|
+
surMoney: 0,
|
|
148
|
+
surcharge: false,
|
|
149
|
+
useOriginSurcharge: false
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
153
|
+
const surRate = setting.constant_rate || 0;
|
|
154
|
+
const surMoney = setting.constant_money || 0;
|
|
155
|
+
const surcharge = setting.surcharge;
|
|
156
|
+
return {
|
|
157
|
+
name,
|
|
158
|
+
symbol,
|
|
159
|
+
money: Number(amount),
|
|
160
|
+
amount: Number(amount),
|
|
161
|
+
surRate: useOriginSurcharge ? 0 : surcharge ? surRate : 0,
|
|
162
|
+
surMoney: useOriginSurcharge ? 0 : surcharge ? surMoney : 0,
|
|
163
|
+
surcharge,
|
|
164
|
+
useOriginSurcharge
|
|
165
|
+
};
|
|
166
|
+
}
|
|
119
167
|
// Annotate the CommonJS export names for ESM import in node:
|
|
120
168
|
0 && (module.exports = {
|
|
121
169
|
cloneDeep,
|
|
170
|
+
getAmonunt,
|
|
122
171
|
getPayParams,
|
|
123
172
|
getUuid,
|
|
124
173
|
limitDecimals,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { State } from './store';
|
|
2
|
+
export { getAmonunt } from './helper';
|
|
2
3
|
export { default as Payo } from './payo';
|
|
3
4
|
export { default as Windcave } from './windcave/windcave';
|
|
4
5
|
export { default as Tyro } from './tyro';
|
|
5
6
|
export declare const getInitState: (type: string, params?: any) => State;
|
|
6
|
-
export declare const getAmonunt: (store: State) => import("./const").Amount;
|
|
@@ -32,7 +32,7 @@ __export(manufacturer_exports, {
|
|
|
32
32
|
Payo: () => import_payo.default,
|
|
33
33
|
Tyro: () => import_tyro.default,
|
|
34
34
|
Windcave: () => import_windcave.default,
|
|
35
|
-
getAmonunt: () => getAmonunt,
|
|
35
|
+
getAmonunt: () => import_helper.getAmonunt,
|
|
36
36
|
getInitState: () => getInitState
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(manufacturer_exports);
|
|
@@ -40,6 +40,7 @@ var import_const = require("./const");
|
|
|
40
40
|
var import_const2 = __toESM(require("./payo/const"));
|
|
41
41
|
var import_const3 = __toESM(require("./tyro/const"));
|
|
42
42
|
var import_const4 = __toESM(require("./windcave/const"));
|
|
43
|
+
var import_helper = require("./helper");
|
|
43
44
|
var import_payo = __toESM(require("./payo"));
|
|
44
45
|
var import_windcave = __toESM(require("./windcave/windcave"));
|
|
45
46
|
var import_tyro = __toESM(require("./tyro"));
|
|
@@ -55,18 +56,6 @@ var getInitState = (type, params) => {
|
|
|
55
56
|
throw new Error("未知的厂商类型");
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
var getAmonunt = (store) => {
|
|
59
|
-
if (store.eftpos === import_const.EftposEnum.Payo) {
|
|
60
|
-
return (0, import_const2.getAmonunt)(store);
|
|
61
|
-
}
|
|
62
|
-
if (store.eftpos === import_const.EftposEnum.Windcave) {
|
|
63
|
-
return (0, import_const4.getAmonunt)(store);
|
|
64
|
-
}
|
|
65
|
-
if (store.eftpos === import_const.EftposEnum.Tyro) {
|
|
66
|
-
return (0, import_const3.getAmonunt)(store);
|
|
67
|
-
}
|
|
68
|
-
throw new Error("未知的厂商类型");
|
|
69
|
-
};
|
|
70
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
60
|
0 && (module.exports = {
|
|
72
61
|
Payo,
|
|
@@ -109,10 +109,10 @@ function getAmonunt(store) {
|
|
|
109
109
|
useOriginSurcharge: false
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
const surRate = setting.useOriginSurcharge ? 0 : setting.constant_rate || 0;
|
|
113
|
-
const surMoney = setting.useOriginSurcharge ? 0 : setting.constant_money || 0;
|
|
114
|
-
const surcharge = setting.surcharge;
|
|
115
112
|
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
113
|
+
const surRate = setting.constant_rate || 0;
|
|
114
|
+
const surMoney = setting.constant_money || 0;
|
|
115
|
+
const surcharge = setting.surcharge;
|
|
116
116
|
return {
|
|
117
117
|
name,
|
|
118
118
|
symbol,
|
|
@@ -28,6 +28,7 @@ var import_helper = require("../helper");
|
|
|
28
28
|
var useValidate = (timeout) => {
|
|
29
29
|
const controllerRef = (0, import_react.useRef)();
|
|
30
30
|
const ref = (0, import_react.useRef)(true);
|
|
31
|
+
const isTimeoutCloseRef = (0, import_react.useRef)(false);
|
|
31
32
|
const TimeoutRef = (0, import_react.useRef)();
|
|
32
33
|
const checkApi = (0, import_react.useCallback)(
|
|
33
34
|
async (check, number, time) => {
|
|
@@ -49,6 +50,20 @@ var useValidate = (timeout) => {
|
|
|
49
50
|
await (0, import_helper.sleep)(time - diff);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
53
|
+
if (isTimeoutCloseRef.current) {
|
|
54
|
+
if (!res) {
|
|
55
|
+
return {
|
|
56
|
+
code: import_const.PayStatus.Timeout
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const { code } = res;
|
|
60
|
+
if (`${code}` === `200`) {
|
|
61
|
+
return {
|
|
62
|
+
...res,
|
|
63
|
+
code: import_const.PayStatus.Timeout
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
52
67
|
return res;
|
|
53
68
|
},
|
|
54
69
|
[]
|
|
@@ -59,8 +74,10 @@ var useValidate = (timeout) => {
|
|
|
59
74
|
(_a = controllerRef.current) == null ? void 0 : _a.abort();
|
|
60
75
|
}, []);
|
|
61
76
|
const run = (...params) => {
|
|
77
|
+
isTimeoutCloseRef.current = false;
|
|
62
78
|
TimeoutRef.current && clearTimeout(TimeoutRef.current);
|
|
63
79
|
TimeoutRef.current = setTimeout(() => {
|
|
80
|
+
isTimeoutCloseRef.current = true;
|
|
64
81
|
close();
|
|
65
82
|
}, timeout);
|
|
66
83
|
return checkApi(...params);
|
|
@@ -93,10 +93,10 @@ function getAmonunt(store) {
|
|
|
93
93
|
useOriginSurcharge: false
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
+
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
96
97
|
const surRate = setting.constant_rate || 0;
|
|
97
98
|
const surMoney = setting.constant_money || 0;
|
|
98
99
|
const surcharge = setting.surcharge;
|
|
99
|
-
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
100
100
|
return {
|
|
101
101
|
name,
|
|
102
102
|
symbol,
|
|
@@ -98,10 +98,10 @@ function getAmonunt(store) {
|
|
|
98
98
|
useOriginSurcharge: false
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
101
102
|
const surRate = setting.constant_rate || 0;
|
|
102
103
|
const surMoney = setting.constant_money || 0;
|
|
103
104
|
const surcharge = setting.surcharge;
|
|
104
|
-
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
105
105
|
return {
|
|
106
106
|
name,
|
|
107
107
|
symbol,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.140",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
|
-
"@pisell/materials": "3.0.47",
|
|
63
|
-
"@pisell/icon": "0.0.11",
|
|
64
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
+
"@pisell/icon": "0.0.11",
|
|
64
|
+
"@pisell/materials": "3.0.47",
|
|
65
65
|
"@pisell/date-picker": "1.0.100"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|