@pisell/private-materials 3.0.96 → 3.0.98
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 +16 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/eftpos/const.d.ts +38 -0
- package/es/components/eftpos/const.js +79 -0
- package/es/components/eftpos/device.d.ts +8 -0
- package/es/components/eftpos/device.js +33 -0
- package/es/components/eftpos/form/index.d.ts +16 -0
- package/es/components/eftpos/form/index.js +113 -0
- package/es/components/eftpos/index.d.ts +37 -0
- package/es/components/eftpos/index.js +274 -0
- package/es/components/eftpos/index.less +169 -0
- package/es/components/eftpos/locales.d.ts +87 -0
- package/es/components/eftpos/locales.js +110 -0
- package/es/components/eftpos/pos.d.ts +9 -0
- package/es/components/eftpos/pos.js +33 -0
- package/es/components/eftpos/surcharge/index.css +17 -0
- package/es/components/eftpos/surcharge/index.d.ts +8 -0
- package/es/components/eftpos/surcharge/index.js +111 -0
- package/es/components/eftpos/table.d.ts +17 -0
- package/es/components/eftpos/table.js +285 -0
- package/es/components/eftposPay/amount.d.ts +14 -0
- package/es/components/eftposPay/amount.js +252 -0
- package/es/components/eftposPay/component/alert/index.d.ts +6 -0
- package/es/components/eftposPay/component/alert/index.js +11 -0
- package/es/components/eftposPay/component/alert/index.less +29 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/es/components/eftposPay/component/alert/warn.js +45 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/es/components/eftposPay/component/fail/failCustom.js +99 -0
- package/es/components/eftposPay/component/fail/index.d.ts +4 -0
- package/es/components/eftposPay/component/fail/index.js +109 -0
- package/es/components/eftposPay/component/fail/network.d.ts +4 -0
- package/es/components/eftposPay/component/fail/network.js +48 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/es/components/eftposPay/component/fail/unknow.js +43 -0
- package/es/components/eftposPay/component/header/index.d.ts +9 -0
- package/es/components/eftposPay/component/header/index.js +66 -0
- package/es/components/eftposPay/component/header/index.less +44 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/es/components/eftposPay/component/header/titlebar.js +39 -0
- package/es/components/eftposPay/component/header/titlebar.less +17 -0
- package/es/components/eftposPay/component/manual/index.d.ts +5 -0
- package/es/components/eftposPay/component/manual/index.js +97 -0
- package/es/components/eftposPay/component/manual/index.less +109 -0
- package/es/components/eftposPay/component/signature/index.d.ts +4 -0
- package/es/components/eftposPay/component/signature/index.js +63 -0
- package/es/components/eftposPay/component/step/index.d.ts +12 -0
- package/es/components/eftposPay/component/step/index.js +31 -0
- package/es/components/eftposPay/component/step/step.d.ts +9 -0
- package/es/components/eftposPay/component/step/step.js +23 -0
- package/es/components/eftposPay/const.d.ts +132 -0
- package/es/components/eftposPay/const.js +48 -0
- package/es/components/eftposPay/device.d.ts +14 -0
- package/es/components/eftposPay/device.js +124 -0
- package/es/components/eftposPay/device.less +61 -0
- package/es/components/eftposPay/eftpos/config.d.ts +11 -0
- package/es/components/eftposPay/eftpos/config.js +178 -0
- package/es/components/eftposPay/eftpos/const.d.ts +10 -0
- package/es/components/eftposPay/eftpos/const.js +139 -0
- package/es/components/eftposPay/eftpos/index.d.ts +7 -0
- package/es/components/eftposPay/eftpos/index.js +35 -0
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +35 -0
- package/es/components/eftposPay/hooks.d.ts +4 -0
- package/es/components/eftposPay/hooks.js +153 -0
- package/es/components/eftposPay/index.d.ts +7 -0
- package/es/components/eftposPay/index.js +187 -0
- package/es/components/eftposPay/index.less +263 -0
- package/es/components/eftposPay/locales.d.ts +264 -0
- package/es/components/eftposPay/locales.js +384 -0
- package/es/components/eftposPay/manufacturer.d.ts +6 -0
- package/es/components/eftposPay/manufacturer.js +32 -0
- package/es/components/eftposPay/pay.d.ts +11 -0
- package/es/components/eftposPay/pay.js +110 -0
- package/es/components/eftposPay/payo/config.d.ts +11 -0
- package/es/components/eftposPay/payo/config.js +357 -0
- package/es/components/eftposPay/payo/const.d.ts +6 -0
- package/es/components/eftposPay/payo/const.js +93 -0
- package/es/components/eftposPay/payo/hooks.d.ts +5 -0
- package/es/components/eftposPay/payo/hooks.js +84 -0
- package/es/components/eftposPay/payo/index.d.ts +7 -0
- package/es/components/eftposPay/payo/index.js +35 -0
- package/es/components/eftposPay/store/index.d.ts +239 -0
- package/es/components/eftposPay/store/index.js +304 -0
- package/es/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/es/components/eftposPay/store/useThunkReducer.js +31 -0
- package/es/components/eftposPay/var.less +9 -0
- package/es/components/eftposPay/windcave/action.d.ts +8 -0
- package/es/components/eftposPay/windcave/action.js +104 -0
- package/es/components/eftposPay/windcave/const.d.ts +104 -0
- package/es/components/eftposPay/windcave/const.js +253 -0
- package/es/components/eftposPay/windcave/helper.d.ts +9 -0
- package/es/components/eftposPay/windcave/helper.js +314 -0
- package/es/components/eftposPay/windcave/hook.d.ts +14 -0
- package/es/components/eftposPay/windcave/hook.js +144 -0
- package/es/components/eftposPay/windcave/index.d.ts +8 -0
- package/es/components/eftposPay/windcave/index.js +49 -0
- package/es/components/eftposPay/windcave/pos.d.ts +8 -0
- package/es/components/eftposPay/windcave/pos.js +180 -0
- package/es/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/es/components/eftposPay/windcave/pwd.js +124 -0
- package/es/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/es/components/eftposPay/windcave/receipet.js +67 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/es/components/eftposPay/windcave/receiptAction.js +326 -0
- package/es/components/eftposPay/windcave/timer.d.ts +17 -0
- package/es/components/eftposPay/windcave/timer.js +181 -0
- package/es/components/eftposPay/windcave/wait.d.ts +12 -0
- package/es/components/eftposPay/windcave/wait.js +139 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/es/components/eftposPay/windcave/windcave.js +283 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/hooks/usePrefix.d.ts +1 -0
- package/es/hooks/usePrefix.js +10 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/eftpos/const.d.ts +38 -0
- package/lib/components/eftpos/const.js +108 -0
- package/lib/components/eftpos/device.d.ts +8 -0
- package/lib/components/eftpos/device.js +55 -0
- package/lib/components/eftpos/form/index.d.ts +16 -0
- package/lib/components/eftpos/form/index.js +124 -0
- package/lib/components/eftpos/index.d.ts +37 -0
- package/lib/components/eftpos/index.js +279 -0
- package/lib/components/eftpos/index.less +169 -0
- package/lib/components/eftpos/locales.d.ts +87 -0
- package/lib/components/eftpos/locales.js +128 -0
- package/lib/components/eftpos/pos.d.ts +9 -0
- package/lib/components/eftpos/pos.js +55 -0
- package/lib/components/eftpos/surcharge/index.css +17 -0
- package/lib/components/eftpos/surcharge/index.d.ts +8 -0
- package/lib/components/eftpos/surcharge/index.js +125 -0
- package/lib/components/eftpos/table.d.ts +17 -0
- package/lib/components/eftpos/table.js +260 -0
- package/lib/components/eftposPay/amount.d.ts +14 -0
- package/lib/components/eftposPay/amount.js +238 -0
- package/lib/components/eftposPay/component/alert/index.d.ts +6 -0
- package/lib/components/eftposPay/component/alert/index.js +38 -0
- package/lib/components/eftposPay/component/alert/index.less +29 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/lib/components/eftposPay/component/alert/warn.js +80 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +120 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/index.js +124 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/network.js +65 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/unknow.js +72 -0
- package/lib/components/eftposPay/component/header/index.d.ts +9 -0
- package/lib/components/eftposPay/component/header/index.js +92 -0
- package/lib/components/eftposPay/component/header/index.less +44 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/lib/components/eftposPay/component/header/titlebar.js +55 -0
- package/lib/components/eftposPay/component/header/titlebar.less +17 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +5 -0
- package/lib/components/eftposPay/component/manual/index.js +113 -0
- package/lib/components/eftposPay/component/manual/index.less +109 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +4 -0
- package/lib/components/eftposPay/component/signature/index.js +80 -0
- package/lib/components/eftposPay/component/step/index.d.ts +12 -0
- package/lib/components/eftposPay/component/step/index.js +71 -0
- package/lib/components/eftposPay/component/step/step.d.ts +9 -0
- package/lib/components/eftposPay/component/step/step.js +59 -0
- package/lib/components/eftposPay/const.d.ts +132 -0
- package/lib/components/eftposPay/const.js +86 -0
- package/lib/components/eftposPay/device.d.ts +14 -0
- package/lib/components/eftposPay/device.js +127 -0
- package/lib/components/eftposPay/device.less +61 -0
- package/lib/components/eftposPay/eftpos/config.d.ts +11 -0
- package/lib/components/eftposPay/eftpos/config.js +199 -0
- package/lib/components/eftposPay/eftpos/const.d.ts +10 -0
- package/lib/components/eftposPay/eftpos/const.js +165 -0
- package/lib/components/eftposPay/eftpos/index.d.ts +7 -0
- package/lib/components/eftposPay/eftpos/index.js +66 -0
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +62 -0
- package/lib/components/eftposPay/hooks.d.ts +4 -0
- package/lib/components/eftposPay/hooks.js +237 -0
- package/lib/components/eftposPay/index.d.ts +7 -0
- package/lib/components/eftposPay/index.js +193 -0
- package/lib/components/eftposPay/index.less +263 -0
- package/lib/components/eftposPay/locales.d.ts +264 -0
- package/lib/components/eftposPay/locales.js +304 -0
- package/lib/components/eftposPay/manufacturer.d.ts +6 -0
- package/lib/components/eftposPay/manufacturer.js +77 -0
- package/lib/components/eftposPay/pay.d.ts +11 -0
- package/lib/components/eftposPay/pay.js +122 -0
- package/lib/components/eftposPay/payo/config.d.ts +11 -0
- package/lib/components/eftposPay/payo/config.js +377 -0
- package/lib/components/eftposPay/payo/const.d.ts +6 -0
- package/lib/components/eftposPay/payo/const.js +112 -0
- package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
- package/lib/components/eftposPay/payo/hooks.js +80 -0
- package/lib/components/eftposPay/payo/index.d.ts +7 -0
- package/lib/components/eftposPay/payo/index.js +63 -0
- package/lib/components/eftposPay/store/index.d.ts +239 -0
- package/lib/components/eftposPay/store/index.js +371 -0
- package/lib/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/lib/components/eftposPay/store/useThunkReducer.js +53 -0
- package/lib/components/eftposPay/var.less +9 -0
- package/lib/components/eftposPay/windcave/action.d.ts +8 -0
- package/lib/components/eftposPay/windcave/action.js +143 -0
- package/lib/components/eftposPay/windcave/const.d.ts +104 -0
- package/lib/components/eftposPay/windcave/const.js +300 -0
- package/lib/components/eftposPay/windcave/helper.d.ts +9 -0
- package/lib/components/eftposPay/windcave/helper.js +378 -0
- package/lib/components/eftposPay/windcave/hook.d.ts +14 -0
- package/lib/components/eftposPay/windcave/hook.js +139 -0
- package/lib/components/eftposPay/windcave/index.d.ts +8 -0
- package/lib/components/eftposPay/windcave/index.js +78 -0
- package/lib/components/eftposPay/windcave/pos.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pos.js +197 -0
- package/lib/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pwd.js +143 -0
- package/lib/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/lib/components/eftposPay/windcave/receipet.js +93 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +386 -0
- package/lib/components/eftposPay/windcave/timer.d.ts +17 -0
- package/lib/components/eftposPay/windcave/timer.js +126 -0
- package/lib/components/eftposPay/windcave/wait.d.ts +12 -0
- package/lib/components/eftposPay/windcave/wait.js +163 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/lib/components/eftposPay/windcave/windcave.js +283 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/hooks/usePrefix.d.ts +1 -0
- package/lib/hooks/usePrefix.js +44 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/eftpos/meta.ts +187 -0
- package/lowcode/eftpos-pay/meta.ts +122 -0
- package/package.json +4 -3
|
@@ -0,0 +1,378 @@
|
|
|
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/helper.tsx
|
|
30
|
+
var helper_exports = {};
|
|
31
|
+
__export(helper_exports, {
|
|
32
|
+
useFail: () => useFail,
|
|
33
|
+
useValidate: () => useValidate
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(helper_exports);
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_const = require("../const");
|
|
39
|
+
var import_store = require("../store");
|
|
40
|
+
var import_const2 = require("./const");
|
|
41
|
+
var import_timer = __toESM(require("./timer"));
|
|
42
|
+
var Max4004 = 1;
|
|
43
|
+
var useFail = () => {
|
|
44
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
45
|
+
const { custom, mode } = (0, import_store.useContextData)();
|
|
46
|
+
const ref = (0, import_react.useRef)((custom == null ? void 0 : custom.retry) || 0);
|
|
47
|
+
(0, import_react.useEffect)(() => {
|
|
48
|
+
ref.current = (custom == null ? void 0 : custom.retry) || 0;
|
|
49
|
+
}, [custom == null ? void 0 : custom.retry]);
|
|
50
|
+
return (0, import_react.useCallback)(
|
|
51
|
+
(res, isMark = false) => {
|
|
52
|
+
if (!res || !res.code) {
|
|
53
|
+
dispatch(
|
|
54
|
+
(0, import_store.updateCustom)({
|
|
55
|
+
errorStatus: "unknow"
|
|
56
|
+
// unknow know
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
dispatch((0, import_store.updateComponent)("UnknowFail"));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const [code] = [`${res.code}`];
|
|
63
|
+
if (`${res.code}` === import_const.PayStatus.Unknown) {
|
|
64
|
+
dispatch(
|
|
65
|
+
(0, import_store.updateCustom)({
|
|
66
|
+
failCustom: {
|
|
67
|
+
isPosNetworkError: false,
|
|
68
|
+
status: "fail",
|
|
69
|
+
fail: import_utils.locales.getText("page.eftpos-pay.text.transaction.fail"),
|
|
70
|
+
warn: null,
|
|
71
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.failed")(mode)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
dispatch((0, import_store.updateComponent)("FailCustom"));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
console.log(code, ref.current, Max4004);
|
|
79
|
+
if (code === import_const.PayStatus.NoPay) {
|
|
80
|
+
if (ref.current > Max4004) {
|
|
81
|
+
dispatch(
|
|
82
|
+
(0, import_store.updateCustom)({
|
|
83
|
+
retry: 0,
|
|
84
|
+
failCustom: {
|
|
85
|
+
isPosNetworkError: false,
|
|
86
|
+
status: "fail",
|
|
87
|
+
fail: import_utils.locales.getText("page.eftpos-pay.text.transaction.fail"),
|
|
88
|
+
warn: null,
|
|
89
|
+
titl: import_utils.locales.getText("page.eftpos-pay.text.failed")(mode)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
dispatch((0, import_store.updateComponent)("FailCustom"));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
ref.current += 1;
|
|
97
|
+
dispatch(
|
|
98
|
+
(0, import_store.updateCustom)({
|
|
99
|
+
retry: ref.current,
|
|
100
|
+
number: void 0,
|
|
101
|
+
isPay: false,
|
|
102
|
+
list: []
|
|
103
|
+
})
|
|
104
|
+
);
|
|
105
|
+
dispatch((0, import_store.updateKey)(Date.now()));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (code === import_const.PayStatus.Timeout || code === import_const.PayStatus.PayTimeout) {
|
|
109
|
+
if (isMark) {
|
|
110
|
+
dispatch(
|
|
111
|
+
(0, import_store.updateState)({
|
|
112
|
+
manual: {
|
|
113
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.timedout.title"),
|
|
114
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.timedout.text")(
|
|
115
|
+
mode
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
dispatch((0, import_store.updateComponent)("Manual"));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
dispatch(
|
|
124
|
+
(0, import_store.updateCustom)({
|
|
125
|
+
failCustom: {
|
|
126
|
+
isPosNetworkError: false,
|
|
127
|
+
status: "fail",
|
|
128
|
+
fail: code === import_const.PayStatus.Timeout ? import_utils.locales.getText(
|
|
129
|
+
"page.eftpos-pay.text.transaction.pay.fail.timeout"
|
|
130
|
+
) : import_utils.locales.getText(
|
|
131
|
+
"page.eftpos-pay.text.transaction.fail.timeout"
|
|
132
|
+
),
|
|
133
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.failed")(mode),
|
|
134
|
+
warn: null
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
);
|
|
138
|
+
dispatch((0, import_store.updateComponent)("FailCustom"));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (code === import_const.PayStatus.PayOtherEftposFailed) {
|
|
142
|
+
dispatch(
|
|
143
|
+
(0, import_store.updateCustom)({
|
|
144
|
+
failCustom: {
|
|
145
|
+
isPosNetworkError: false,
|
|
146
|
+
status: "fail",
|
|
147
|
+
fail: import_utils.locales.getText(
|
|
148
|
+
"page.eftpos-pay.text.transaction.fail.terminal"
|
|
149
|
+
),
|
|
150
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.transaction.fail.terminal.title"),
|
|
151
|
+
warn: null
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
dispatch((0, import_store.updateComponent)("FailCustom"));
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (code === import_const.PayStatus.PayCardErrorFailed) {
|
|
159
|
+
dispatch(
|
|
160
|
+
(0, import_store.updateCustom)({
|
|
161
|
+
failCustom: {
|
|
162
|
+
isPosNetworkError: true,
|
|
163
|
+
status: "fail",
|
|
164
|
+
fail: import_utils.locales.getText(
|
|
165
|
+
"page.eftpos-pay.text.transaction.fail.cancel"
|
|
166
|
+
),
|
|
167
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.transaction.fail.cancel.title"),
|
|
168
|
+
warn: null
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
);
|
|
172
|
+
dispatch((0, import_store.updateComponent)("FailCustom"));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (code === import_const.PayStatus.NoNetWork || code === import_const.PayStatus.SocketError) {
|
|
176
|
+
dispatch(
|
|
177
|
+
(0, import_store.updateCustom)({
|
|
178
|
+
failCustom: {
|
|
179
|
+
isPosNetworkError: true,
|
|
180
|
+
status: "warn",
|
|
181
|
+
fail: null,
|
|
182
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.interrupted"),
|
|
183
|
+
warn: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, import_utils.locales.getText(
|
|
184
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.title"
|
|
185
|
+
), /* @__PURE__ */ import_react.default.createElement("br", null), import_utils.locales.getText(
|
|
186
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.power"
|
|
187
|
+
), ". ", /* @__PURE__ */ import_react.default.createElement("br", null), import_utils.locales.getText(
|
|
188
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.device"
|
|
189
|
+
), /* @__PURE__ */ import_react.default.createElement("br", null), import_utils.locales.getText(
|
|
190
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.network"
|
|
191
|
+
), /* @__PURE__ */ import_react.default.createElement("br", null), import_utils.locales.getText(
|
|
192
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.if"
|
|
193
|
+
)(mode))
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
dispatch((0, import_store.updateComponent)("FailCustom"));
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
dispatch(
|
|
201
|
+
(0, import_store.updateCustom)({
|
|
202
|
+
errorStatus: "unknow"
|
|
203
|
+
// unknow know
|
|
204
|
+
})
|
|
205
|
+
);
|
|
206
|
+
dispatch((0, import_store.updateComponent)("UnknowFail"));
|
|
207
|
+
},
|
|
208
|
+
[dispatch]
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
var useValidate = (check, num, onChange) => {
|
|
212
|
+
const unloadRef = (0, import_react.useRef)(false);
|
|
213
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
214
|
+
const fail = useFail();
|
|
215
|
+
const failRef = (0, import_react.useRef)(fail);
|
|
216
|
+
const ref = (0, import_react.useRef)();
|
|
217
|
+
const { custom, mode } = (0, import_store.useContextData)();
|
|
218
|
+
const stepRef = (0, import_react.useRef)(custom == null ? void 0 : custom.step);
|
|
219
|
+
const listRef = (0, import_react.useRef)(custom == null ? void 0 : custom.list);
|
|
220
|
+
const numberRef = (0, import_react.useRef)(custom == null ? void 0 : custom.number);
|
|
221
|
+
const payRef = (0, import_react.useRef)(custom == null ? void 0 : custom.pay);
|
|
222
|
+
const netRef = (0, import_react.useRef)(custom == null ? void 0 : custom.net);
|
|
223
|
+
const watchRef = (0, import_react.useRef)();
|
|
224
|
+
(0, import_react.useEffect)(() => {
|
|
225
|
+
listRef.current = custom == null ? void 0 : custom.list;
|
|
226
|
+
}, [custom == null ? void 0 : custom.list]);
|
|
227
|
+
(0, import_react.useEffect)(() => {
|
|
228
|
+
stepRef.current = custom == null ? void 0 : custom.step;
|
|
229
|
+
}, [custom == null ? void 0 : custom.step]);
|
|
230
|
+
(0, import_react.useEffect)(() => {
|
|
231
|
+
numberRef.current = custom == null ? void 0 : custom.number;
|
|
232
|
+
}, [custom == null ? void 0 : custom.number]);
|
|
233
|
+
(0, import_react.useEffect)(() => {
|
|
234
|
+
console.log("custom?.net = ", custom);
|
|
235
|
+
netRef.current = custom == null ? void 0 : custom.net;
|
|
236
|
+
}, [custom == null ? void 0 : custom.net]);
|
|
237
|
+
(0, import_react.useEffect)(() => {
|
|
238
|
+
payRef.current = custom == null ? void 0 : custom.pay;
|
|
239
|
+
}, [custom == null ? void 0 : custom.pay]);
|
|
240
|
+
const run = (0, import_react.useCallback)(
|
|
241
|
+
(timeout) => {
|
|
242
|
+
var _a, _b, _c;
|
|
243
|
+
if (unloadRef.current) {
|
|
244
|
+
(_a = ref.current) == null ? void 0 : _a.close();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (!watchRef.current) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (!netRef.current) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
(_b = ref.current) == null ? void 0 : _b.close();
|
|
254
|
+
ref.current = new import_timer.default({
|
|
255
|
+
xhr: check,
|
|
256
|
+
timeout: typeof timeout === "number" ? timeout : num,
|
|
257
|
+
callback: watchRef.current
|
|
258
|
+
});
|
|
259
|
+
(_c = ref.current) == null ? void 0 : _c.run({ number: numberRef.current }).then((res) => {
|
|
260
|
+
if (unloadRef.current) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (!netRef.current) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (!res || Number(res.code) !== 200) {
|
|
267
|
+
return Promise.reject(res);
|
|
268
|
+
}
|
|
269
|
+
}).catch((res) => {
|
|
270
|
+
var _a2;
|
|
271
|
+
if (unloadRef.current) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (!netRef.current) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (res && res.code === -1) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
(_a2 = failRef.current) == null ? void 0 : _a2.call(failRef, res, stepRef.current >= 3);
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
[check, num]
|
|
284
|
+
);
|
|
285
|
+
(0, import_react.useEffect)(() => {
|
|
286
|
+
watchRef.current = (res) => {
|
|
287
|
+
var _a, _b, _c, _d, _e, _f;
|
|
288
|
+
if (unloadRef.current) {
|
|
289
|
+
(_a = ref.current) == null ? void 0 : _a.close();
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (!res || !res.data || !res.data.txn_status_id) {
|
|
293
|
+
(_b = ref.current) == null ? void 0 : _b.close();
|
|
294
|
+
}
|
|
295
|
+
const [txn_status_id, status_id, complete] = [
|
|
296
|
+
Number(res.data.txn_status_id),
|
|
297
|
+
Number(res.data.status_id),
|
|
298
|
+
Number(res.data.complete)
|
|
299
|
+
];
|
|
300
|
+
if (txn_status_id === import_const2.StepStatusEnum.Wait && status_id === 6 && complete === 1) {
|
|
301
|
+
(_c = ref.current) == null ? void 0 : _c.close();
|
|
302
|
+
if (stepRef.current !== txn_status_id && listRef.current.every(({ index }) => txn_status_id !== index)) {
|
|
303
|
+
const current = listRef.current.map((item) => {
|
|
304
|
+
if (Number(item == null ? void 0 : item.index) < Number(stepRef.current)) {
|
|
305
|
+
return {
|
|
306
|
+
...item,
|
|
307
|
+
status: "resolve"
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
return item;
|
|
311
|
+
});
|
|
312
|
+
const nextStep = (0, import_const2.getStepMapping)(txn_status_id, {
|
|
313
|
+
money: (_d = payRef.current) == null ? void 0 : _d.totalUnit,
|
|
314
|
+
mode
|
|
315
|
+
});
|
|
316
|
+
current.push(nextStep);
|
|
317
|
+
dispatch((0, import_store.updateCustom)({ list: current, step: txn_status_id }));
|
|
318
|
+
}
|
|
319
|
+
onChange(res.data);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if (stepRef.current !== txn_status_id && listRef.current.every(({ index }) => txn_status_id !== index)) {
|
|
323
|
+
console.log(
|
|
324
|
+
"self.flag stepRef.current, txn_status_id ",
|
|
325
|
+
stepRef.current,
|
|
326
|
+
txn_status_id
|
|
327
|
+
);
|
|
328
|
+
stepRef.current = txn_status_id;
|
|
329
|
+
(_e = ref.current) == null ? void 0 : _e.close();
|
|
330
|
+
const current = listRef.current.map((item) => {
|
|
331
|
+
if (Number(item == null ? void 0 : item.index) < Number(stepRef.current)) {
|
|
332
|
+
return {
|
|
333
|
+
...item,
|
|
334
|
+
status: "resolve"
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
return item;
|
|
338
|
+
});
|
|
339
|
+
const nextStep = (0, import_const2.getStepMapping)(txn_status_id, {
|
|
340
|
+
money: (_f = payRef.current) == null ? void 0 : _f.totalUnit,
|
|
341
|
+
mode
|
|
342
|
+
});
|
|
343
|
+
if (nextStep) {
|
|
344
|
+
current.push(nextStep);
|
|
345
|
+
if (nextStep.type === import_const2.StemTypeEnum.Passive) {
|
|
346
|
+
dispatch((0, import_store.updateStatus)(import_const.StatusEnum.Question));
|
|
347
|
+
}
|
|
348
|
+
if (nextStep.index === import_const2.StepStatusEnum.Receipt) {
|
|
349
|
+
dispatch(
|
|
350
|
+
(0, import_store.updateState)({
|
|
351
|
+
title: import_utils.locales.getText(
|
|
352
|
+
"page.eftpos-pay.text.waiting.signature"
|
|
353
|
+
)
|
|
354
|
+
// 等待签名
|
|
355
|
+
})
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
dispatch((0, import_store.updateCustom)({ list: current, step: txn_status_id }));
|
|
360
|
+
txn_status_id === import_const2.StepStatusEnum.Receipt ? run(-1) : run();
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
}, [dispatch, onChange, run]);
|
|
364
|
+
(0, import_react.useEffect)(
|
|
365
|
+
() => () => {
|
|
366
|
+
var _a;
|
|
367
|
+
(_a = ref.current) == null ? void 0 : _a.close();
|
|
368
|
+
unloadRef.current = true;
|
|
369
|
+
},
|
|
370
|
+
[]
|
|
371
|
+
);
|
|
372
|
+
return [run, ref];
|
|
373
|
+
};
|
|
374
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
375
|
+
0 && (module.exports = {
|
|
376
|
+
useFail,
|
|
377
|
+
useValidate
|
|
378
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PayStatus } from '../const';
|
|
2
|
+
export declare const useValidate: (timeout: number, changeStatus?: ((status: PayStatus) => void) | undefined) => readonly [(params: {
|
|
3
|
+
check: (...agrn: unknown[]) => Promise<any>;
|
|
4
|
+
number: number;
|
|
5
|
+
txn_status_id: string;
|
|
6
|
+
time?: number | undefined;
|
|
7
|
+
__start__?: string | undefined;
|
|
8
|
+
checkCondition(...agrn: unknown[]): boolean;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}>, () => void];
|
|
12
|
+
export declare const useSuccess: (index: number) => (res: {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}, hasBackup?: boolean) => void;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/eftposPay/windcave/hook.tsx
|
|
20
|
+
var hook_exports = {};
|
|
21
|
+
__export(hook_exports, {
|
|
22
|
+
useSuccess: () => useSuccess,
|
|
23
|
+
useValidate: () => useValidate
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(hook_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_helper = require("../helper");
|
|
28
|
+
var import_hooks = require("../hooks");
|
|
29
|
+
var import_store = require("../store");
|
|
30
|
+
var useValidate = (timeout, changeStatus) => {
|
|
31
|
+
const controllerRef = (0, import_react.useRef)();
|
|
32
|
+
const ref = (0, import_react.useRef)(true);
|
|
33
|
+
const TimeoutRef = (0, import_react.useRef)();
|
|
34
|
+
const checkApi = (0, import_react.useCallback)(
|
|
35
|
+
async ({
|
|
36
|
+
check,
|
|
37
|
+
number,
|
|
38
|
+
txn_status_id,
|
|
39
|
+
time,
|
|
40
|
+
__start__,
|
|
41
|
+
checkCondition
|
|
42
|
+
}) => {
|
|
43
|
+
time = time || 5e3;
|
|
44
|
+
controllerRef.current = new AbortController();
|
|
45
|
+
let res = { txn_status_id: __start__ || "0" };
|
|
46
|
+
while (ref.current && checkCondition(res)) {
|
|
47
|
+
console.log(res.txn_status_id, txn_status_id);
|
|
48
|
+
const start = Date.now();
|
|
49
|
+
res = await check(
|
|
50
|
+
{ number, txn_status_id: res.txn_status_id },
|
|
51
|
+
{ signal: controllerRef.current.signal }
|
|
52
|
+
).then((r) => {
|
|
53
|
+
changeStatus == null ? void 0 : changeStatus(r);
|
|
54
|
+
console.log("原始数据 res = ", r);
|
|
55
|
+
if (r && r.data) {
|
|
56
|
+
return r.data;
|
|
57
|
+
}
|
|
58
|
+
return r;
|
|
59
|
+
}).catch((err) => {
|
|
60
|
+
console.log(res);
|
|
61
|
+
res = err;
|
|
62
|
+
});
|
|
63
|
+
const diff = Date.now() - start;
|
|
64
|
+
console.log(
|
|
65
|
+
"diff",
|
|
66
|
+
`${res && res.txn_status_id}` !== "8" && `${res && res.status_id}` !== "6",
|
|
67
|
+
res
|
|
68
|
+
);
|
|
69
|
+
if (diff < time) {
|
|
70
|
+
await (0, import_helper.sleep)(time - diff);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
console.log(" res 结束当前 流程 == ", res);
|
|
74
|
+
if (!res || checkCondition(res)) {
|
|
75
|
+
console.log("失败");
|
|
76
|
+
return Promise.reject(res);
|
|
77
|
+
}
|
|
78
|
+
return res;
|
|
79
|
+
},
|
|
80
|
+
[changeStatus]
|
|
81
|
+
);
|
|
82
|
+
const close = (0, import_react.useCallback)(() => {
|
|
83
|
+
var _a;
|
|
84
|
+
ref.current = false;
|
|
85
|
+
(_a = controllerRef.current) == null ? void 0 : _a.abort();
|
|
86
|
+
}, []);
|
|
87
|
+
const run = (params) => {
|
|
88
|
+
TimeoutRef.current && clearTimeout(TimeoutRef.current);
|
|
89
|
+
TimeoutRef.current = setTimeout(() => {
|
|
90
|
+
close();
|
|
91
|
+
}, timeout);
|
|
92
|
+
return checkApi(params);
|
|
93
|
+
};
|
|
94
|
+
(0, import_react.useEffect)(
|
|
95
|
+
() => () => {
|
|
96
|
+
clearTimeout(TimeoutRef.current);
|
|
97
|
+
close();
|
|
98
|
+
},
|
|
99
|
+
[close]
|
|
100
|
+
);
|
|
101
|
+
return [run, close];
|
|
102
|
+
};
|
|
103
|
+
var useSuccess = (index) => {
|
|
104
|
+
const fail = (0, import_hooks.useFail)(index);
|
|
105
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
106
|
+
return (0, import_react.useCallback)(
|
|
107
|
+
(res, hasBackup) => {
|
|
108
|
+
if (hasBackup) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (!res) {
|
|
112
|
+
console.log("success fail 报错 1 ", res);
|
|
113
|
+
fail(res);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const [txn_status_id] = [Number(res.txn_status_id)];
|
|
117
|
+
console.log("success txn_status_id = ", txn_status_id);
|
|
118
|
+
if (txn_status_id < 5) {
|
|
119
|
+
dispatch((0, import_store.updateStep)({ step: 0 }));
|
|
120
|
+
} else if (txn_status_id >= 5 && txn_status_id < 7) {
|
|
121
|
+
dispatch((0, import_store.updateStep)({ step: 1 }));
|
|
122
|
+
} else if (txn_status_id === 7) {
|
|
123
|
+
dispatch((0, import_store.updateStep)({ step: 2 }));
|
|
124
|
+
} else if (txn_status_id === 8) {
|
|
125
|
+
if (res.status_id === "6" || res.status_id === 6) {
|
|
126
|
+
dispatch((0, import_store.updateStep)({ step: 5 }));
|
|
127
|
+
} else {
|
|
128
|
+
fail(res);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
[fail, dispatch]
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
136
|
+
0 && (module.exports = {
|
|
137
|
+
useSuccess,
|
|
138
|
+
useValidate
|
|
139
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
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/index.tsx
|
|
30
|
+
var windcave_exports = {};
|
|
31
|
+
__export(windcave_exports, {
|
|
32
|
+
default: () => windcave_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(windcave_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_const = require("../const");
|
|
37
|
+
var import_store = require("../store");
|
|
38
|
+
var import_action = __toESM(require("./action"));
|
|
39
|
+
var import_pos = __toESM(require("./pos"));
|
|
40
|
+
var import_pwd = __toESM(require("./pwd"));
|
|
41
|
+
var import_receipet = __toESM(require("./receipet"));
|
|
42
|
+
var import_wait = __toESM(require("./wait"));
|
|
43
|
+
var windcave_default = ({
|
|
44
|
+
api,
|
|
45
|
+
onChange,
|
|
46
|
+
children,
|
|
47
|
+
hasBackup
|
|
48
|
+
}) => {
|
|
49
|
+
const { step, steps, ...data } = (0, import_store.useContextData)();
|
|
50
|
+
console.log("hasBackup = ", hasBackup);
|
|
51
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-body" }, steps.map((item, idx) => {
|
|
52
|
+
let Comm;
|
|
53
|
+
if (idx === 0)
|
|
54
|
+
Comm = import_pos.default;
|
|
55
|
+
if (idx === 1)
|
|
56
|
+
Comm = import_pwd.default;
|
|
57
|
+
if (idx === 2)
|
|
58
|
+
Comm = import_receipet.default;
|
|
59
|
+
if (idx === 3)
|
|
60
|
+
Comm = import_receipet.ReceipetAgain;
|
|
61
|
+
if (idx === 4)
|
|
62
|
+
Comm = import_wait.default;
|
|
63
|
+
if (!Comm) {
|
|
64
|
+
throw new Error("no comm");
|
|
65
|
+
}
|
|
66
|
+
if (step >= idx) {
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
Comm,
|
|
69
|
+
{
|
|
70
|
+
key: `${data.key}-${item.key}-${idx}`,
|
|
71
|
+
api,
|
|
72
|
+
hasBackup,
|
|
73
|
+
onChange
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}), children), data.status !== import_const.StatusEnum.Success ? /* @__PURE__ */ import_react.default.createElement(import_action.default, { index: step, api }) : null);
|
|
78
|
+
};
|