@pisell/private-materials 3.0.205 → 3.0.206

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.
Files changed (57) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/eftposPay/component/fail/failCustom.js +0 -1
  12. package/es/components/eftposPay/component/fail/index.js +0 -1
  13. package/es/components/eftposPay/component/manual/index.js +1 -4
  14. package/es/components/eftposPay/const.d.ts +1 -27
  15. package/es/components/eftposPay/const.js +0 -22
  16. package/es/components/eftposPay/device.d.ts +1 -1
  17. package/es/components/eftposPay/device.js +2 -2
  18. package/es/components/eftposPay/helper.d.ts +0 -5
  19. package/es/components/eftposPay/helper.js +4 -10
  20. package/es/components/eftposPay/hooks.d.ts +0 -1
  21. package/es/components/eftposPay/hooks.js +16 -22
  22. package/es/components/eftposPay/index.d.ts +1 -1
  23. package/es/components/eftposPay/index.js +179 -130
  24. package/es/components/eftposPay/locales.d.ts +0 -15
  25. package/es/components/eftposPay/locales.js +0 -15
  26. package/es/components/eftposPay/payo/config.js +8 -20
  27. package/es/components/eftposPay/tyro/index.js +2 -4
  28. package/es/components/eftposPay/windcave/windcave.js +6 -17
  29. package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
  30. package/lib/components/eftposPay/component/fail/index.js +1 -1
  31. package/lib/components/eftposPay/component/manual/index.js +5 -19
  32. package/lib/components/eftposPay/const.d.ts +1 -27
  33. package/lib/components/eftposPay/const.js +0 -18
  34. package/lib/components/eftposPay/device.d.ts +1 -1
  35. package/lib/components/eftposPay/device.js +2 -2
  36. package/lib/components/eftposPay/helper.d.ts +0 -5
  37. package/lib/components/eftposPay/helper.js +4 -8
  38. package/lib/components/eftposPay/hooks.d.ts +0 -1
  39. package/lib/components/eftposPay/hooks.js +2 -8
  40. package/lib/components/eftposPay/index.d.ts +1 -1
  41. package/lib/components/eftposPay/index.js +144 -106
  42. package/lib/components/eftposPay/locales.d.ts +0 -15
  43. package/lib/components/eftposPay/locales.js +0 -15
  44. package/lib/components/eftposPay/payo/config.js +9 -33
  45. package/lib/components/eftposPay/tyro/index.js +2 -4
  46. package/lib/components/eftposPay/windcave/windcave.js +6 -29
  47. package/package.json +4 -4
  48. package/es/components/eftposPay/app.d.ts +0 -11
  49. package/es/components/eftposPay/app.js +0 -173
  50. package/es/components/eftposPay/tip.d.ts +0 -10
  51. package/es/components/eftposPay/tip.js +0 -177
  52. package/es/components/eftposPay/tip.less +0 -9
  53. package/lib/components/eftposPay/app.d.ts +0 -11
  54. package/lib/components/eftposPay/app.js +0 -166
  55. package/lib/components/eftposPay/tip.d.ts +0 -10
  56. package/lib/components/eftposPay/tip.js +0 -159
  57. package/lib/components/eftposPay/tip.less +0 -9
@@ -1,166 +0,0 @@
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/eftposPay/app.tsx
30
- var app_exports = {};
31
- __export(app_exports, {
32
- default: () => app_default
33
- });
34
- module.exports = __toCommonJS(app_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_ahooks = require("ahooks");
37
- var import_amount = __toESM(require("./amount"));
38
- var import_const = require("./const");
39
- var import_device = __toESM(require("./device"));
40
- var import_pay = __toESM(require("./pay"));
41
- var import_store = require("./store");
42
- var App = ({
43
- action,
44
- api,
45
- device_number,
46
- terminal,
47
- tyroUrl,
48
- tyroVersion,
49
- onChangeParams,
50
- isMobile,
51
- channel,
52
- formatAmount = (number, precision, symbol) => `${symbol}${number}`,
53
- ...props
54
- }) => {
55
- const data = (0, import_store.useContextData)();
56
- const dispatch = (0, import_store.useDispatch)();
57
- const [current, setCurrent] = (0, import_react.useState)(action);
58
- const statusRef = (0, import_react.useRef)(data.status);
59
- const network = (0, import_react.useMemo)(
60
- () => typeof terminal.network === "boolean" ? terminal.network : true,
61
- [terminal == null ? void 0 : terminal.network]
62
- );
63
- const { online } = (0, import_ahooks.useNetwork)();
64
- const netRef = (0, import_react.useRef)([network, online]);
65
- const net = (0, import_react.useMemo)(() => {
66
- let networkChange = false, onlineChange = false;
67
- if (netRef.current[0] !== network) {
68
- netRef.current[0] = network;
69
- networkChange = true;
70
- }
71
- if (netRef.current[1] !== online) {
72
- netRef.current[1] = online;
73
- onlineChange = true;
74
- }
75
- if (networkChange) {
76
- return network;
77
- }
78
- return online;
79
- }, [network, online]);
80
- (0, import_react.useEffect)(() => {
81
- statusRef.current = data.status;
82
- }, [data.status]);
83
- const client = (0, import_react.useMemo)(() => {
84
- if (channel === "kiosk") {
85
- return import_const.ClientEnum.User;
86
- }
87
- return import_const.ClientEnum.Merchant;
88
- }, [channel]);
89
- (0, import_react.useEffect)(() => {
90
- dispatch((0, import_store.updateClient)(client));
91
- }, [client]);
92
- (0, import_react.useEffect)(() => {
93
- onChangeParams && onChangeParams({
94
- ...data,
95
- ...data.eftpos === "tyro" ? { custom: { ...data.custom, btnList: [], list: [] } } : {},
96
- form: import_const.RestoreEumn.Restore
97
- });
98
- }, [data, onChangeParams]);
99
- const onChange = (0, import_react.useCallback)(
100
- (status, params, other) => {
101
- if (status === "page" && typeof params === "string") {
102
- if (["amount", "deviceList", "pay"].includes(params)) {
103
- setCurrent(params);
104
- dispatch((0, import_store.updateState)({ action: params }));
105
- }
106
- }
107
- console.log("状态切换 = ", status, params, other);
108
- props.onChangeStatus(status, params, other);
109
- },
110
- []
111
- );
112
- const onClose = () => {
113
- onChange("fail", {
114
- number: data.number,
115
- uniquePaymentNumber: data.number,
116
- device: data.device,
117
- order_id: data.order_id
118
- });
119
- };
120
- if (current === import_const.RouteEnum.DeviceList) {
121
- return /* @__PURE__ */ import_react.default.createElement(
122
- import_device.default,
123
- {
124
- api,
125
- onChange,
126
- onClose,
127
- isMobile,
128
- className: isMobile ? "pisell-lowcode__eft-pay-terminal" : "",
129
- net,
130
- device_number,
131
- formatAmount,
132
- client
133
- }
134
- );
135
- }
136
- if (current === import_const.RouteEnum.Amount) {
137
- return /* @__PURE__ */ import_react.default.createElement(
138
- import_amount.default,
139
- {
140
- onChange,
141
- onClose,
142
- formatAmount,
143
- isMobile,
144
- className: isMobile ? "pisell-lowcode__eft-pay-terminal" : "",
145
- net,
146
- client
147
- }
148
- );
149
- }
150
- return /* @__PURE__ */ import_react.default.createElement(
151
- import_pay.default,
152
- {
153
- api,
154
- tyroUrl,
155
- tyroVersion,
156
- onChange,
157
- className: isMobile ? "pisell-lowcode__eft-pay-terminal" : "",
158
- terminal,
159
- isMobile,
160
- net,
161
- formatAmount,
162
- client
163
- }
164
- );
165
- };
166
- var app_default = App;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import './tip.less';
3
- /**
4
- * @title: 支付状态未知页面
5
- * @description:
6
- * @Author: hongbing.wang
7
- * @Date: 2024-08-20 11:42
8
- */
9
- declare const _default: ({ onChangeStatus, className, formatAmount, cardSurcharge, receipts, successTime, onChangeParams, }: any) => React.JSX.Element;
10
- export default _default;
@@ -1,159 +0,0 @@
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/eftposPay/tip.tsx
30
- var tip_exports = {};
31
- __export(tip_exports, {
32
- default: () => tip_default
33
- });
34
- module.exports = __toCommonJS(tip_exports);
35
- var import_utils = require("@pisell/utils");
36
- var import_antd = require("antd");
37
- var import_react = __toESM(require("react"));
38
- var import_helper = require("./helper");
39
- var import_const = require("./const");
40
- var import_dayjs = __toESM(require("dayjs"));
41
- var import_store = require("./store");
42
- var import_hooks = require("./hooks");
43
- var import_tip = require("./tip.less");
44
- function formatDateUtils(date, format) {
45
- if (!date) {
46
- return date;
47
- }
48
- if (date.includes("undefined")) {
49
- return "";
50
- }
51
- const lang = localStorage.getItem("umi_locale") || "en-US";
52
- let _format = format || ["HH:mm:ss DD/MM/YYYY", "YYYY年MM月DD日 HH:mm:ss"];
53
- let type = lang === "en-US" || lang === "en" ? _format[0] : _format[1];
54
- return (0, import_dayjs.default)(date).locale(lang).format(type);
55
- }
56
- var tip_default = ({
57
- onChangeStatus,
58
- className = "",
59
- formatAmount,
60
- cardSurcharge,
61
- receipts,
62
- successTime,
63
- onChangeParams
64
- }) => {
65
- const [disabled, setDisabled] = (0, import_react.useState)(true);
66
- const [amount, setAmount] = (0, import_react.useState)("");
67
- const [surcharge, setSurcharge] = (0, import_react.useState)("");
68
- const [surMoney, setSurMoney] = (0, import_react.useState)("");
69
- const [rate, setRate] = (0, import_react.useState)("");
70
- const [total, setTotal] = (0, import_react.useState)("");
71
- const [time, setTime] = (0, import_react.useState)("");
72
- const data = (0, import_store.useContextData)();
73
- const { symbol, custom } = data;
74
- const ref = (0, import_react.useRef)();
75
- const dispatch = (0, import_store.useDispatch)();
76
- const listRef = (0, import_react.useRef)(custom == null ? void 0 : custom.list);
77
- const {
78
- deviceRef,
79
- payRef,
80
- numRef,
81
- orderIdRef,
82
- modeRef,
83
- amountRef,
84
- eftposRef
85
- } = (0, import_hooks.useStoreRef)();
86
- const onConfirm = () => {
87
- onChangeStatus("success", { ...ref.current || {} });
88
- };
89
- (0, import_react.useEffect)(() => {
90
- if (eftposRef.current === import_const.EftposEnum.Payo) {
91
- dispatch((0, import_store.updateNextStep)());
92
- dispatch(
93
- (0, import_store.updateCustom)({
94
- card_reader_surcharge: cardSurcharge || 0,
95
- receipt: receipts
96
- })
97
- );
98
- } else if (eftposRef.current === import_const.EftposEnum.Windcave) {
99
- dispatch(
100
- (0, import_store.updateCustom)({
101
- list: listRef.current.map((item) => ({
102
- ...item,
103
- status: "resolve"
104
- })),
105
- card_reader_surcharge: cardSurcharge || 0,
106
- receipt: receipts
107
- })
108
- );
109
- }
110
- const params = (0, import_helper.getPayParams)(
111
- {
112
- mode: modeRef.current,
113
- amount: amountRef.current,
114
- order_id: orderIdRef.current,
115
- number: numRef.current,
116
- device: deviceRef.current,
117
- pay: payRef.current,
118
- custom: {
119
- card_reader_surcharge: cardSurcharge,
120
- receipt: receipts
121
- }
122
- },
123
- "success"
124
- );
125
- ref.current = params;
126
- setAmount(`${(params == null ? void 0 : params.amount) || ""}`);
127
- setSurcharge(`${(params == null ? void 0 : params.surcharge) || ""}`);
128
- setSurMoney(`${(params == null ? void 0 : params.surMoney) || ""}`);
129
- setRate(`${(params == null ? void 0 : params.surRate) || ""}`);
130
- setTotal(`${(params == null ? void 0 : params.total) || ""}`);
131
- setTime(formatDateUtils(successTime));
132
- setDisabled(false);
133
- dispatch(
134
- (0, import_store.updateState)({
135
- status: "success",
136
- title: import_utils.locales.getText("page.eftpos-pay.text.successful")(
137
- modeRef.current
138
- )
139
- })
140
- );
141
- }, []);
142
- (0, import_react.useEffect)(() => {
143
- onChangeParams && onChangeParams({
144
- ...data,
145
- form: import_const.RestoreEumn.Restore
146
- });
147
- }, [data, onChangeParams]);
148
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, import_utils.locales.getText("page.eftpos-pay.text.latest.success")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-body pisell-lowcode__eft-pay-tip-body" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-tip-text" }, import_utils.locales.getText("page.eftpos-pay.text.latest.amount"), ":", " ", formatAmount(`${amount}`, 2, symbol)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-tip-text" }, import_utils.locales.getText("page.eftpos-pay.text.latest.surcharge"), ":", " ", formatAmount(`${surcharge}`, 2, symbol), " (", rate, "% +", " ", formatAmount(`${surMoney}`, 2, symbol), ")"), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-tip-text" }, import_utils.locales.getText("page.eftpos-pay.text.surcharge.edit.actual.pay"), ":", " ", formatAmount(`${total}`, 2, symbol)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-tip-text" }, import_utils.locales.getText("page.eftpos-pay.text.latest.time"), ": ", time)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
149
- import_antd.Button,
150
- {
151
- disabled,
152
- block: true,
153
- className: "pisell-lowcode__eft-pay-step-item-btn",
154
- type: "primary",
155
- onClick: onConfirm
156
- },
157
- import_utils.locales.getText("page.eftpos-pay.text.latest.confirm")
158
- )));
159
- };
@@ -1,9 +0,0 @@
1
- .pisell-lowcode__eft-pay-tip-body{
2
- display: flex;
3
- flex-direction: column;
4
- gap: 16px;
5
- margin: 20px 0 0 0;
6
- }
7
- .pisell-lowcode__eft-pay-tip-text{
8
- color: var(--Gray-700, #344054);
9
- }