@pisell/private-materials 3.0.96 → 3.0.97
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 +30 -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 +153 -0
- package/es/components/eftpos/locales.d.ts +75 -0
- package/es/components/eftpos/locales.js +98 -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 +236 -0
- package/es/components/eftposPay/amount.d.ts +14 -0
- package/es/components/eftposPay/amount.js +253 -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 +95 -0
- package/es/components/eftposPay/component/fail/index.d.ts +4 -0
- package/es/components/eftposPay/component/fail/index.js +105 -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 +91 -0
- package/es/components/eftposPay/component/manual/index.less +96 -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 +131 -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 +188 -0
- package/es/components/eftposPay/index.less +273 -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 +10 -0
- package/es/components/eftposPay/pay.js +108 -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/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 +153 -0
- package/lib/components/eftpos/locales.d.ts +75 -0
- package/lib/components/eftpos/locales.js +116 -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 +235 -0
- package/lib/components/eftposPay/amount.d.ts +14 -0
- package/lib/components/eftposPay/amount.js +239 -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 +117 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/index.js +121 -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 +101 -0
- package/lib/components/eftposPay/component/manual/index.less +96 -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 +131 -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 +189 -0
- package/lib/components/eftposPay/index.less +273 -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 +10 -0
- package/lib/components/eftposPay/pay.js +120 -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/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,197 @@
|
|
|
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/pos.tsx
|
|
30
|
+
var pos_exports = {};
|
|
31
|
+
__export(pos_exports, {
|
|
32
|
+
default: () => pos_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pos_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_step = __toESM(require("../component/step"));
|
|
37
|
+
var import_const = require("../const");
|
|
38
|
+
var import_helper = require("../helper");
|
|
39
|
+
var import_hooks = require("../hooks");
|
|
40
|
+
var import_store = require("../store");
|
|
41
|
+
var import_hook = require("./hook");
|
|
42
|
+
var POS = ({
|
|
43
|
+
api,
|
|
44
|
+
hasBackup
|
|
45
|
+
}) => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
const { steps, eftpos, device, custom, status } = (0, import_store.useContextData)();
|
|
48
|
+
const statusRef = (0, import_react.useRef)(status);
|
|
49
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
50
|
+
const { key, ...props } = steps[0];
|
|
51
|
+
const ref = (0, import_react.useRef)(custom == null ? void 0 : custom.number);
|
|
52
|
+
const stepStatusRef = (0, import_react.useRef)((_a = props == null ? void 0 : props.custom) == null ? void 0 : _a.status);
|
|
53
|
+
const [check] = (0, import_hook.useValidate)(1e3 * 60);
|
|
54
|
+
const backupRef = (0, import_react.useRef)(hasBackup);
|
|
55
|
+
const fail = (0, import_hooks.useFail)(0);
|
|
56
|
+
const success = (0, import_hook.useSuccess)(0);
|
|
57
|
+
const failRef = (0, import_react.useRef)(fail);
|
|
58
|
+
const successRef = (0, import_react.useRef)(success);
|
|
59
|
+
const controllerRef = (0, import_react.useRef)();
|
|
60
|
+
const customRef = (0, import_react.useRef)(custom);
|
|
61
|
+
const deviceRef = (0, import_react.useRef)(device);
|
|
62
|
+
const initRef = (0, import_react.useRef)(false);
|
|
63
|
+
const unloadRef = (0, import_react.useRef)(false);
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
statusRef.current = status;
|
|
66
|
+
}, [status]);
|
|
67
|
+
(0, import_react.useEffect)(() => {
|
|
68
|
+
customRef.current = custom;
|
|
69
|
+
}, [custom]);
|
|
70
|
+
(0, import_react.useEffect)(() => {
|
|
71
|
+
deviceRef.current = device;
|
|
72
|
+
}, [device]);
|
|
73
|
+
(0, import_react.useEffect)(() => {
|
|
74
|
+
var _a2;
|
|
75
|
+
stepStatusRef.current = (_a2 = props == null ? void 0 : props.custom) == null ? void 0 : _a2.status;
|
|
76
|
+
}, [(_b = props == null ? void 0 : props.custom) == null ? void 0 : _b.status]);
|
|
77
|
+
(0, import_react.useEffect)(() => {
|
|
78
|
+
backupRef.current = hasBackup;
|
|
79
|
+
}, [hasBackup]);
|
|
80
|
+
(0, import_react.useEffect)(() => {
|
|
81
|
+
failRef.current = fail;
|
|
82
|
+
}, [fail]);
|
|
83
|
+
(0, import_react.useEffect)(() => {
|
|
84
|
+
successRef.current = success;
|
|
85
|
+
}, [success]);
|
|
86
|
+
(0, import_react.useEffect)(() => {
|
|
87
|
+
var _a2;
|
|
88
|
+
if (initRef.current) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
initRef.current = true;
|
|
92
|
+
if (statusRef.current !== import_const.StatusEnum.Loading) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!stepStatusRef.current) {
|
|
96
|
+
ref.current = (0, import_helper.getUuid)();
|
|
97
|
+
const { pay, order_id } = customRef.current;
|
|
98
|
+
dispatch(
|
|
99
|
+
(0, import_store.updateState)({
|
|
100
|
+
custom: { ...customRef.current, number: ref.current }
|
|
101
|
+
})
|
|
102
|
+
);
|
|
103
|
+
controllerRef.current = new AbortController();
|
|
104
|
+
api.pay(
|
|
105
|
+
{
|
|
106
|
+
order_id,
|
|
107
|
+
amount: pay.total,
|
|
108
|
+
card_reader_type: eftpos,
|
|
109
|
+
card_reader_id: (_a2 = deviceRef.current) == null ? void 0 : _a2.id,
|
|
110
|
+
number: ref.current
|
|
111
|
+
},
|
|
112
|
+
{ signal: controllerRef.current.signal }
|
|
113
|
+
).then(
|
|
114
|
+
(res) => {
|
|
115
|
+
if (unloadRef.current) {
|
|
116
|
+
return Promise.reject(res);
|
|
117
|
+
}
|
|
118
|
+
console.log("unloadRef.current = ", unloadRef.current);
|
|
119
|
+
if (res && (res.code === 200 || res.code === "200")) {
|
|
120
|
+
stepStatusRef.current = "pay";
|
|
121
|
+
dispatch(
|
|
122
|
+
(0, import_store.updateCurrentCustomStemItem)({
|
|
123
|
+
status: "pay"
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
return check({
|
|
127
|
+
check: api.check,
|
|
128
|
+
number: ref.current,
|
|
129
|
+
txn_status_id: "5",
|
|
130
|
+
__start__: "2",
|
|
131
|
+
checkCondition: (r) => Number(r.txn_status_id) < 5
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return Promise.reject(res);
|
|
135
|
+
},
|
|
136
|
+
(res) => Promise.reject(res)
|
|
137
|
+
).then(
|
|
138
|
+
(res) => {
|
|
139
|
+
if (unloadRef.current) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
console.log("unloadRef.current = ", unloadRef.current);
|
|
143
|
+
dispatch(
|
|
144
|
+
(0, import_store.updateCurrentCustomStemItem)({
|
|
145
|
+
status: "check"
|
|
146
|
+
})
|
|
147
|
+
);
|
|
148
|
+
successRef.current(res, backupRef.current);
|
|
149
|
+
},
|
|
150
|
+
(res) => {
|
|
151
|
+
if (unloadRef.current) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
failRef.current(res, backupRef.current);
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (stepStatusRef.current === "pay") {
|
|
160
|
+
check({
|
|
161
|
+
check: api.check,
|
|
162
|
+
number: ref.current,
|
|
163
|
+
txn_status_id: "5",
|
|
164
|
+
__start__: "2",
|
|
165
|
+
checkCondition: (r) => Number(r.txn_status_id) < 5
|
|
166
|
+
}).then(
|
|
167
|
+
(res) => {
|
|
168
|
+
if (unloadRef.current) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
dispatch(
|
|
172
|
+
(0, import_store.updateCurrentCustomStemItem)({
|
|
173
|
+
status: "check"
|
|
174
|
+
})
|
|
175
|
+
);
|
|
176
|
+
successRef.current(res, backupRef.current);
|
|
177
|
+
},
|
|
178
|
+
(res) => {
|
|
179
|
+
if (unloadRef.current) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
failRef.current(res, backupRef.current);
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
}, [api, check, dispatch, eftpos]);
|
|
187
|
+
(0, import_react.useEffect)(
|
|
188
|
+
() => () => {
|
|
189
|
+
var _a2, _b2;
|
|
190
|
+
unloadRef.current = true;
|
|
191
|
+
(_b2 = (_a2 = controllerRef.current) == null ? void 0 : _a2.abort) == null ? void 0 : _b2.call(_a2);
|
|
192
|
+
},
|
|
193
|
+
[]
|
|
194
|
+
);
|
|
195
|
+
return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
|
|
196
|
+
};
|
|
197
|
+
var pos_default = POS;
|
|
@@ -0,0 +1,143 @@
|
|
|
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/pwd.tsx
|
|
30
|
+
var pwd_exports = {};
|
|
31
|
+
__export(pwd_exports, {
|
|
32
|
+
default: () => pwd_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pwd_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 Pwd = ({
|
|
43
|
+
api,
|
|
44
|
+
hasBackup
|
|
45
|
+
}) => {
|
|
46
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
47
|
+
const [check] = (0, import_hook.useValidate)(1e3 * 60);
|
|
48
|
+
const { custom, steps, status, mode } = (0, import_store.useContextData)();
|
|
49
|
+
console.log(steps);
|
|
50
|
+
const statusRef = (0, import_react.useRef)(status);
|
|
51
|
+
const ref = (0, import_react.useRef)(custom == null ? void 0 : custom.number);
|
|
52
|
+
const backupRef = (0, import_react.useRef)(hasBackup);
|
|
53
|
+
const initRef = (0, import_react.useRef)(false);
|
|
54
|
+
const fail = (0, import_hooks.useFail)(1, true);
|
|
55
|
+
const success = (0, import_hook.useSuccess)(1);
|
|
56
|
+
const failRef = (0, import_react.useRef)(fail);
|
|
57
|
+
const successRef = (0, import_react.useRef)(success);
|
|
58
|
+
const unloadRef = (0, import_react.useRef)(false);
|
|
59
|
+
(0, import_react.useEffect)(() => {
|
|
60
|
+
failRef.current = fail;
|
|
61
|
+
}, [fail]);
|
|
62
|
+
(0, import_react.useEffect)(() => {
|
|
63
|
+
successRef.current = success;
|
|
64
|
+
}, [success]);
|
|
65
|
+
(0, import_react.useEffect)(() => {
|
|
66
|
+
statusRef.current = status;
|
|
67
|
+
}, [status]);
|
|
68
|
+
const { key, ...props } = steps[1];
|
|
69
|
+
const stepStatusRef = (0, import_react.useRef)(props.status);
|
|
70
|
+
(0, import_react.useEffect)(() => {
|
|
71
|
+
stepStatusRef.current = props.status;
|
|
72
|
+
}, [props.status]);
|
|
73
|
+
(0, import_react.useEffect)(() => {
|
|
74
|
+
ref.current = custom == null ? void 0 : custom.number;
|
|
75
|
+
}, [custom == null ? void 0 : custom.number]);
|
|
76
|
+
(0, import_react.useEffect)(() => {
|
|
77
|
+
statusRef.current = status;
|
|
78
|
+
}, [status]);
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
80
|
+
backupRef.current = hasBackup;
|
|
81
|
+
}, [hasBackup]);
|
|
82
|
+
(0, import_react.useEffect)(() => {
|
|
83
|
+
if (initRef.current) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
initRef.current = true;
|
|
87
|
+
if (statusRef.current !== import_const.StatusEnum.Loading) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (stepStatusRef.current !== import_const.StatusEnum.Loading) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (ref.current) {
|
|
94
|
+
console.log(" pwd 开始查询 ", ref.current, statusRef.current);
|
|
95
|
+
check({
|
|
96
|
+
check: api.check,
|
|
97
|
+
number: ref.current,
|
|
98
|
+
txn_status_id: "7",
|
|
99
|
+
__start__: "5",
|
|
100
|
+
checkCondition: (r) => Number(r.txn_status_id) < 7
|
|
101
|
+
}).then(
|
|
102
|
+
(res) => {
|
|
103
|
+
if (unloadRef.current) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
successRef.current(res, backupRef.current);
|
|
107
|
+
},
|
|
108
|
+
(res) => {
|
|
109
|
+
if (unloadRef.current) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (backupRef.current) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (res && typeof res === "object" && typeof res.txn_status_id !== "undefined" && typeof res.status_id !== "undefined") {
|
|
116
|
+
dispatch((0, import_store.updateCurrentStemItem)({ status: "fail" }));
|
|
117
|
+
dispatch(
|
|
118
|
+
(0, import_store.updateState)({
|
|
119
|
+
manual: {
|
|
120
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.timedout.title"),
|
|
121
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.timedout.text")(
|
|
122
|
+
mode
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
dispatch((0, import_store.updateComponent)("Manual"));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
failRef.current(res, backupRef.current);
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}, [api.check, check, dispatch]);
|
|
135
|
+
(0, import_react.useEffect)(
|
|
136
|
+
() => () => {
|
|
137
|
+
unloadRef.current = true;
|
|
138
|
+
},
|
|
139
|
+
[]
|
|
140
|
+
);
|
|
141
|
+
return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
|
|
142
|
+
};
|
|
143
|
+
var pwd_default = Pwd;
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ReceiptAction: ({ api, onChange, }: {
|
|
3
|
+
api: any;
|
|
4
|
+
onChange: (status: boolean) => void;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
declare const Action: ({ index, onCancel, disabled, }: {
|
|
7
|
+
index: number;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}) => React.JSX.Element | null;
|
|
11
|
+
export default Action;
|