@pisell/private-materials 3.0.136 → 3.0.138
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.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/forms/single/index.js +3 -0
- package/es/components/eftpos/const.d.ts +26 -0
- package/es/components/eftpos/const.js +40 -8
- package/es/components/eftpos/device.d.ts +3 -2
- package/es/components/eftpos/device.js +6 -5
- package/es/components/eftpos/form/index.d.ts +5 -0
- package/es/components/eftpos/form/index.js +8 -0
- package/es/components/eftpos/hooks.d.ts +34 -0
- package/es/components/{eftposPay/windcave/hook.js → eftpos/hooks.js} +96 -122
- package/es/components/eftpos/icon/apiKey.d.ts +5 -0
- package/es/components/eftpos/icon/apiKey.js +17 -0
- package/es/components/eftpos/icon/device.d.ts +5 -0
- package/es/components/eftpos/icon/device.js +19 -0
- package/es/components/eftpos/index.d.ts +10 -0
- package/es/components/eftpos/index.js +329 -46
- package/es/components/eftpos/index.less +38 -1
- package/es/components/eftpos/locales.d.ts +12 -0
- package/es/components/eftpos/locales.js +15 -3
- package/es/components/eftpos/log.d.ts +8 -0
- package/es/components/eftpos/log.js +85 -0
- package/es/components/eftpos/pos.d.ts +1 -1
- package/es/components/eftpos/pos.js +8 -5
- package/es/components/eftpos/surcharge/index.d.ts +25 -2
- package/es/components/eftpos/surcharge/index.js +100 -16
- package/es/components/eftpos/table.d.ts +4 -0
- package/es/components/eftpos/table.js +102 -10
- package/es/components/eftposPay/amount.d.ts +7 -1
- package/es/components/eftposPay/amount.js +65 -38
- package/es/components/eftposPay/component/fail/failCustom.js +65 -20
- package/es/components/eftposPay/component/fail/index.js +60 -30
- package/es/components/eftposPay/component/fail/network.d.ts +5 -0
- package/es/components/eftposPay/component/fail/network.js +13 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +6 -0
- package/es/components/eftposPay/component/fail/unknow.js +18 -3
- package/es/components/eftposPay/component/header/index.d.ts +2 -1
- package/es/components/eftposPay/component/header/index.js +4 -1
- package/es/components/eftposPay/component/header/index.less +1 -10
- package/es/components/eftposPay/component/manual/index.d.ts +6 -1
- package/es/components/eftposPay/component/manual/index.js +174 -23
- package/es/components/eftposPay/component/manual/index.less +42 -14
- package/es/components/eftposPay/component/signature/index.d.ts +5 -0
- package/es/components/eftposPay/component/signature/index.js +20 -2
- package/es/components/eftposPay/component/step/index.d.ts +7 -7
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +19 -4
- package/es/components/eftposPay/const.js +4 -2
- package/es/components/eftposPay/device.d.ts +7 -0
- package/es/components/eftposPay/device.js +22 -0
- package/es/components/eftposPay/helper.d.ts +54 -0
- package/es/components/eftposPay/helper.js +93 -1
- package/es/components/eftposPay/hooks.d.ts +30 -1
- package/es/components/eftposPay/hooks.js +181 -26
- package/es/components/eftposPay/index.d.ts +2 -4
- package/es/components/eftposPay/index.js +119 -31
- package/es/components/eftposPay/index.less +27 -19
- package/es/components/eftposPay/locales.d.ts +45 -0
- package/es/components/eftposPay/locales.js +348 -3
- package/es/components/eftposPay/manufacturer.d.ts +2 -2
- package/es/components/eftposPay/manufacturer.js +9 -10
- package/es/components/eftposPay/pay.d.ts +10 -1
- package/es/components/eftposPay/pay.js +112 -34
- package/es/components/eftposPay/payo/config.js +137 -270
- package/es/components/eftposPay/payo/const.d.ts +22 -2
- package/es/components/eftposPay/payo/const.js +83 -33
- package/es/components/eftposPay/payo/hooks.d.ts +5 -0
- package/es/components/eftposPay/payo/hooks.js +19 -2
- package/es/components/eftposPay/store/index.d.ts +154 -53
- package/es/components/eftposPay/store/index.js +112 -60
- package/es/components/eftposPay/tyro/const.d.ts +17 -0
- package/es/components/eftposPay/{eftpos → tyro}/const.js +71 -90
- package/es/components/eftposPay/tyro/hooks.d.ts +14 -0
- package/es/components/eftposPay/tyro/hooks.js +40 -0
- package/es/components/eftposPay/tyro/index.d.ts +9 -0
- package/es/components/eftposPay/tyro/index.js +575 -0
- package/es/components/eftposPay/windcave/const.d.ts +24 -9
- package/es/components/eftposPay/windcave/const.js +90 -81
- package/es/components/eftposPay/windcave/helper.d.ts +16 -2
- package/es/components/eftposPay/windcave/helper.js +175 -42
- package/es/components/eftposPay/windcave/receiptAction.d.ts +12 -0
- package/es/components/eftposPay/windcave/receiptAction.js +91 -43
- package/es/components/eftposPay/windcave/timer.d.ts +13 -1
- package/es/components/eftposPay/windcave/timer.js +18 -1
- package/es/components/eftposPay/windcave/windcave.d.ts +2 -1
- package/es/components/eftposPay/windcave/windcave.js +155 -139
- package/es/utils/load.d.ts +11 -0
- package/es/utils/load.js +85 -0
- package/lib/components/booking/forms/single/index.js +1 -0
- package/lib/components/eftpos/const.d.ts +26 -0
- package/lib/components/eftpos/const.js +13 -1
- package/lib/components/eftpos/device.d.ts +3 -2
- package/lib/components/eftpos/device.js +2 -2
- package/lib/components/eftpos/form/index.d.ts +5 -0
- package/lib/components/eftpos/hooks.d.ts +34 -0
- package/lib/components/eftpos/hooks.js +106 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +5 -0
- package/lib/components/eftpos/icon/apiKey.js +57 -0
- package/lib/components/eftpos/icon/device.d.ts +5 -0
- package/lib/components/eftpos/icon/device.js +57 -0
- package/lib/components/eftpos/index.d.ts +10 -0
- package/lib/components/eftpos/index.js +262 -97
- package/lib/components/eftpos/index.less +38 -1
- package/lib/components/eftpos/locales.d.ts +12 -0
- package/lib/components/eftpos/locales.js +15 -3
- package/lib/components/eftpos/log.d.ts +8 -0
- package/lib/components/eftpos/log.js +87 -0
- package/lib/components/eftpos/pos.d.ts +1 -1
- package/lib/components/eftpos/pos.js +5 -4
- package/lib/components/eftpos/surcharge/index.d.ts +25 -2
- package/lib/components/eftpos/surcharge/index.js +36 -6
- package/lib/components/eftpos/table.d.ts +4 -0
- package/lib/components/eftpos/table.js +40 -8
- package/lib/components/eftposPay/amount.d.ts +7 -1
- package/lib/components/eftposPay/amount.js +10 -33
- package/lib/components/eftposPay/component/fail/failCustom.js +27 -6
- package/lib/components/eftposPay/component/fail/index.js +39 -18
- package/lib/components/eftposPay/component/fail/network.d.ts +5 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +6 -0
- package/lib/components/eftposPay/component/fail/unknow.js +3 -3
- package/lib/components/eftposPay/component/header/index.d.ts +2 -1
- package/lib/components/eftposPay/component/header/index.js +2 -1
- package/lib/components/eftposPay/component/header/index.less +1 -10
- package/lib/components/eftposPay/component/manual/index.d.ts +6 -1
- package/lib/components/eftposPay/component/manual/index.js +122 -31
- package/lib/components/eftposPay/component/manual/index.less +42 -14
- package/lib/components/eftposPay/component/signature/index.d.ts +5 -0
- package/lib/components/eftposPay/component/signature/index.js +2 -2
- package/lib/components/eftposPay/component/step/index.d.ts +7 -7
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +19 -4
- package/lib/components/eftposPay/const.js +3 -1
- package/lib/components/eftposPay/device.d.ts +7 -0
- package/lib/components/eftposPay/helper.d.ts +54 -0
- package/lib/components/eftposPay/helper.js +64 -0
- package/lib/components/eftposPay/hooks.d.ts +30 -1
- package/lib/components/eftposPay/hooks.js +182 -44
- package/lib/components/eftposPay/index.d.ts +2 -4
- package/lib/components/eftposPay/index.js +74 -27
- package/lib/components/eftposPay/index.less +27 -19
- package/lib/components/eftposPay/locales.d.ts +45 -0
- package/lib/components/eftposPay/locales.js +352 -3
- package/lib/components/eftposPay/manufacturer.d.ts +2 -2
- package/lib/components/eftposPay/manufacturer.js +13 -13
- package/lib/components/eftposPay/pay.d.ts +10 -1
- package/lib/components/eftposPay/pay.js +86 -25
- package/lib/components/eftposPay/payo/config.js +121 -268
- package/lib/components/eftposPay/payo/const.d.ts +22 -2
- package/lib/components/eftposPay/payo/const.js +55 -36
- package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
- package/lib/components/eftposPay/payo/hooks.js +1 -1
- package/lib/components/eftposPay/store/index.d.ts +154 -53
- package/lib/components/eftposPay/store/index.js +7 -66
- package/lib/components/eftposPay/tyro/const.d.ts +17 -0
- package/lib/components/eftposPay/tyro/const.js +114 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +14 -0
- package/lib/components/eftposPay/{eftpos/index.js → tyro/hooks.js} +31 -36
- package/lib/components/eftposPay/tyro/index.d.ts +9 -0
- package/lib/components/eftposPay/tyro/index.js +558 -0
- package/lib/components/eftposPay/windcave/const.d.ts +24 -9
- package/lib/components/eftposPay/windcave/const.js +53 -104
- package/lib/components/eftposPay/windcave/helper.d.ts +16 -2
- package/lib/components/eftposPay/windcave/helper.js +163 -48
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +12 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +15 -47
- package/lib/components/eftposPay/windcave/timer.d.ts +13 -1
- package/lib/components/eftposPay/windcave/timer.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +2 -1
- package/lib/components/eftposPay/windcave/windcave.js +130 -130
- package/lib/utils/load.d.ts +11 -0
- package/lib/utils/load.js +100 -0
- package/lowcode/eftpos/meta.ts +202 -160
- package/lowcode/eftpos-pay/meta.ts +45 -12
- package/package.json +4 -4
- package/es/components/eftposPay/eftpos/config.d.ts +0 -11
- package/es/components/eftposPay/eftpos/config.js +0 -178
- package/es/components/eftposPay/eftpos/const.d.ts +0 -10
- package/es/components/eftposPay/eftpos/index.d.ts +0 -7
- package/es/components/eftposPay/eftpos/index.js +0 -35
- package/es/components/eftposPay/windcave/action.d.ts +0 -8
- package/es/components/eftposPay/windcave/action.js +0 -104
- package/es/components/eftposPay/windcave/hook.d.ts +0 -14
- package/es/components/eftposPay/windcave/index.d.ts +0 -8
- package/es/components/eftposPay/windcave/index.js +0 -49
- package/es/components/eftposPay/windcave/pos.d.ts +0 -8
- package/es/components/eftposPay/windcave/pos.js +0 -180
- package/es/components/eftposPay/windcave/pwd.d.ts +0 -8
- package/es/components/eftposPay/windcave/pwd.js +0 -124
- package/es/components/eftposPay/windcave/receipet.d.ts +0 -6
- package/es/components/eftposPay/windcave/receipet.js +0 -67
- package/es/components/eftposPay/windcave/wait.d.ts +0 -12
- package/es/components/eftposPay/windcave/wait.js +0 -139
- package/lib/components/eftposPay/eftpos/config.d.ts +0 -11
- package/lib/components/eftposPay/eftpos/config.js +0 -199
- package/lib/components/eftposPay/eftpos/const.d.ts +0 -10
- package/lib/components/eftposPay/eftpos/const.js +0 -165
- package/lib/components/eftposPay/eftpos/index.d.ts +0 -7
- package/lib/components/eftposPay/windcave/action.d.ts +0 -8
- package/lib/components/eftposPay/windcave/action.js +0 -143
- package/lib/components/eftposPay/windcave/hook.d.ts +0 -14
- package/lib/components/eftposPay/windcave/hook.js +0 -139
- package/lib/components/eftposPay/windcave/index.d.ts +0 -8
- package/lib/components/eftposPay/windcave/index.js +0 -78
- package/lib/components/eftposPay/windcave/pos.d.ts +0 -8
- package/lib/components/eftposPay/windcave/pos.js +0 -197
- package/lib/components/eftposPay/windcave/pwd.d.ts +0 -8
- package/lib/components/eftposPay/windcave/pwd.js +0 -143
- package/lib/components/eftposPay/windcave/receipet.d.ts +0 -6
- package/lib/components/eftposPay/windcave/receipet.js +0 -93
- package/lib/components/eftposPay/windcave/wait.d.ts +0 -12
- package/lib/components/eftposPay/windcave/wait.js +0 -163
|
@@ -1,93 +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/windcave/receipet.tsx
|
|
30
|
-
var receipet_exports = {};
|
|
31
|
-
__export(receipet_exports, {
|
|
32
|
-
ReceipetAgain: () => ReceipetAgain,
|
|
33
|
-
default: () => receipet_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(receipet_exports);
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_step = __toESM(require("../component/step"));
|
|
38
|
-
var import_const = require("../const");
|
|
39
|
-
var import_store = require("../store");
|
|
40
|
-
var Receipet = ({ hasBackup }) => {
|
|
41
|
-
const dispatch = (0, import_store.useDispatch)();
|
|
42
|
-
const { steps, status } = (0, import_store.useContextData)();
|
|
43
|
-
const { key, ...props } = steps[2];
|
|
44
|
-
const statusRef = (0, import_react.useRef)(status);
|
|
45
|
-
const stepStatusRef = (0, import_react.useRef)(props.status);
|
|
46
|
-
const backupRef = (0, import_react.useRef)(hasBackup);
|
|
47
|
-
const initRef = (0, import_react.useRef)(false);
|
|
48
|
-
const clearRef = (0, import_react.useRef)();
|
|
49
|
-
(0, import_react.useEffect)(() => {
|
|
50
|
-
backupRef.current = hasBackup;
|
|
51
|
-
}, [hasBackup]);
|
|
52
|
-
(0, import_react.useEffect)(() => {
|
|
53
|
-
stepStatusRef.current = props.status;
|
|
54
|
-
}, [props.status]);
|
|
55
|
-
(0, import_react.useEffect)(() => {
|
|
56
|
-
if (initRef.current) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
initRef.current = true;
|
|
60
|
-
if (statusRef.current !== import_const.StatusEnum.Loading) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (stepStatusRef.current !== import_const.StatusEnum.Loading) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
clearRef.current = setTimeout(() => {
|
|
67
|
-
if (!backupRef.current) {
|
|
68
|
-
dispatch((0, import_store.updateNextStep)());
|
|
69
|
-
dispatch((0, import_store.updateSteps)(steps));
|
|
70
|
-
dispatch((0, import_store.updateStatus)(import_const.StatusEnum.Warn));
|
|
71
|
-
}
|
|
72
|
-
}, 1e3);
|
|
73
|
-
}, [dispatch, steps]);
|
|
74
|
-
(0, import_react.useEffect)(
|
|
75
|
-
() => () => {
|
|
76
|
-
if (clearRef.current) {
|
|
77
|
-
clearTimeout(clearRef.current);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
[]
|
|
81
|
-
);
|
|
82
|
-
return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
|
|
83
|
-
};
|
|
84
|
-
var ReceipetAgain = () => {
|
|
85
|
-
const { steps } = (0, import_store.useContextData)();
|
|
86
|
-
const { key, ...props } = steps[3];
|
|
87
|
-
return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
|
|
88
|
-
};
|
|
89
|
-
var receipet_default = Receipet;
|
|
90
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
-
0 && (module.exports = {
|
|
92
|
-
ReceipetAgain
|
|
93
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StatusEnum } from '../const';
|
|
3
|
-
declare const Wait: ({ api, onChange, hasBackup, }: {
|
|
4
|
-
api: {
|
|
5
|
-
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
6
|
-
};
|
|
7
|
-
onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}`, params?: {
|
|
8
|
-
[keys: string]: unknown;
|
|
9
|
-
} | undefined) => void;
|
|
10
|
-
hasBackup: boolean;
|
|
11
|
-
}) => React.JSX.Element;
|
|
12
|
-
export default Wait;
|
|
@@ -1,163 +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/windcave/wait.tsx
|
|
30
|
-
var wait_exports = {};
|
|
31
|
-
__export(wait_exports, {
|
|
32
|
-
default: () => wait_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(wait_exports);
|
|
35
|
-
var import_utils = require("@pisell/utils");
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_step = __toESM(require("../component/step"));
|
|
38
|
-
var import_const = require("../const");
|
|
39
|
-
var import_hooks = require("../hooks");
|
|
40
|
-
var import_store = require("../store");
|
|
41
|
-
var import_hook = require("./hook");
|
|
42
|
-
var Wait = ({
|
|
43
|
-
api,
|
|
44
|
-
onChange,
|
|
45
|
-
hasBackup
|
|
46
|
-
}) => {
|
|
47
|
-
const dispatch = (0, import_store.useDispatch)();
|
|
48
|
-
const { steps, status, custom, mode } = (0, import_store.useContextData)();
|
|
49
|
-
const { key, ...props } = steps[4];
|
|
50
|
-
const [check] = (0, import_hook.useValidate)(1e3 * 60);
|
|
51
|
-
const fail = (0, import_hooks.useFail)(4, true);
|
|
52
|
-
const success = (0, import_hook.useSuccess)(4);
|
|
53
|
-
const failRef = (0, import_react.useRef)(fail);
|
|
54
|
-
const successRef = (0, import_react.useRef)(success);
|
|
55
|
-
const ref = (0, import_react.useRef)(custom == null ? void 0 : custom.number);
|
|
56
|
-
const statusRef = (0, import_react.useRef)(status);
|
|
57
|
-
const backupRef = (0, import_react.useRef)(hasBackup);
|
|
58
|
-
const customRef = (0, import_react.useRef)(custom);
|
|
59
|
-
const stepStatusRef = (0, import_react.useRef)(props.status);
|
|
60
|
-
const clearRef = (0, import_react.useRef)();
|
|
61
|
-
const initRef = (0, import_react.useRef)(false);
|
|
62
|
-
const unloadRef = (0, import_react.useRef)(false);
|
|
63
|
-
(0, import_react.useEffect)(() => {
|
|
64
|
-
customRef.current = custom;
|
|
65
|
-
}, [custom]);
|
|
66
|
-
(0, import_react.useEffect)(() => {
|
|
67
|
-
backupRef.current = hasBackup;
|
|
68
|
-
}, [hasBackup]);
|
|
69
|
-
(0, import_react.useEffect)(() => {
|
|
70
|
-
stepStatusRef.current = props.status;
|
|
71
|
-
}, [props.status]);
|
|
72
|
-
(0, import_react.useEffect)(() => {
|
|
73
|
-
ref.current = custom == null ? void 0 : custom.number;
|
|
74
|
-
}, [custom == null ? void 0 : custom.number]);
|
|
75
|
-
(0, import_react.useEffect)(() => {
|
|
76
|
-
statusRef.current = status;
|
|
77
|
-
}, [status]);
|
|
78
|
-
(0, import_react.useEffect)(() => {
|
|
79
|
-
failRef.current = fail;
|
|
80
|
-
}, [fail]);
|
|
81
|
-
(0, import_react.useEffect)(() => {
|
|
82
|
-
successRef.current = success;
|
|
83
|
-
}, [success]);
|
|
84
|
-
(0, import_react.useEffect)(() => {
|
|
85
|
-
if (initRef.current) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
initRef.current = true;
|
|
89
|
-
if (statusRef.current === import_const.StatusEnum.Success && stepStatusRef.current === import_const.StatusEnum.Success) {
|
|
90
|
-
clearRef.current = setTimeout(() => {
|
|
91
|
-
var _a;
|
|
92
|
-
onChange(
|
|
93
|
-
"success",
|
|
94
|
-
(_a = customRef.current) == null ? void 0 : _a.pay
|
|
95
|
-
);
|
|
96
|
-
}, 1e3);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (statusRef.current !== import_const.StatusEnum.Loading) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (stepStatusRef.current !== import_const.StatusEnum.Loading) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
console.log("wait 开始查询 ", ref.current);
|
|
106
|
-
check({
|
|
107
|
-
check: api.check,
|
|
108
|
-
number: ref.current,
|
|
109
|
-
txn_status_id: "8",
|
|
110
|
-
__start__: "7",
|
|
111
|
-
checkCondition: (r) => `${r.txn_status_id}` !== "8" || `${r.status_id}` !== "6"
|
|
112
|
-
}).then(
|
|
113
|
-
(res) => {
|
|
114
|
-
if (unloadRef.current) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
successRef.current(res, backupRef.current);
|
|
118
|
-
clearRef.current = setTimeout(() => {
|
|
119
|
-
var _a;
|
|
120
|
-
onChange(
|
|
121
|
-
"success",
|
|
122
|
-
(_a = customRef.current) == null ? void 0 : _a.pay
|
|
123
|
-
);
|
|
124
|
-
}, 1e3);
|
|
125
|
-
},
|
|
126
|
-
(res) => {
|
|
127
|
-
if (unloadRef.current) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (backupRef.current) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (res && typeof res === "object" && typeof res.txn_status_id !== "undefined" && typeof res.status_id !== "undefined") {
|
|
134
|
-
dispatch((0, import_store.updateCurrentStemItem)({ status: "fail" }));
|
|
135
|
-
dispatch(
|
|
136
|
-
(0, import_store.updateState)({
|
|
137
|
-
manual: {
|
|
138
|
-
title: import_utils.locales.getText("page.eftpos-pay.text.timedout.title"),
|
|
139
|
-
text: import_utils.locales.getText("page.eftpos-pay.text.timedout.text")(
|
|
140
|
-
mode
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
})
|
|
144
|
-
);
|
|
145
|
-
dispatch((0, import_store.updateComponent)("Manual"));
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
failRef.current(res);
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
}, [api.check, check, dispatch, onChange]);
|
|
152
|
-
(0, import_react.useEffect)(
|
|
153
|
-
() => () => {
|
|
154
|
-
unloadRef.current = true;
|
|
155
|
-
if (clearRef.current) {
|
|
156
|
-
clearTimeout(clearRef.current);
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
[]
|
|
160
|
-
);
|
|
161
|
-
return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
|
|
162
|
-
};
|
|
163
|
-
var wait_default = Wait;
|