@pisell/private-materials 3.0.138 → 3.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +7 -7
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/info/header/index.js +2 -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/model.d.ts +1 -2
- package/es/components/eftpos/deviceList/index.d.ts +3 -0
- package/es/components/eftpos/deviceList/index.js +52 -0
- package/es/components/eftpos/form/index.js +21 -74
- package/es/components/eftpos/group/index.d.ts +7 -0
- package/es/components/eftpos/group/index.js +65 -0
- package/es/components/eftposPay/component/manual/index.js +15 -15
- package/es/components/eftposPay/helper.d.ts +9 -0
- package/es/components/eftposPay/helper.js +69 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/manufacturer.d.ts +1 -1
- package/es/components/eftposPay/manufacturer.js +17 -15
- package/es/components/eftposPay/payo/const.js +6 -3
- package/es/components/eftposPay/payo/hooks.js +31 -2
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/const.js +3 -1
- package/es/components/eftposPay/windcave/const.js +2 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/info/header/index.js +1 -1
- 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/model.d.ts +1 -2
- package/lib/components/eftpos/deviceList/index.d.ts +3 -0
- package/lib/components/eftpos/deviceList/index.js +70 -0
- package/lib/components/eftpos/form/index.js +6 -33
- package/lib/components/eftpos/group/index.d.ts +7 -0
- package/lib/components/eftpos/group/index.js +75 -0
- package/lib/components/eftposPay/component/manual/index.js +4 -15
- package/lib/components/eftposPay/helper.d.ts +9 -0
- package/lib/components/eftposPay/helper.js +49 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/manufacturer.d.ts +1 -1
- package/lib/components/eftposPay/manufacturer.js +2 -13
- package/lib/components/eftposPay/payo/const.js +3 -3
- package/lib/components/eftposPay/payo/hooks.js +17 -0
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +3 -3
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
10
|
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
@@ -16,10 +21,11 @@ import { sleep } from "../helper";
|
|
|
16
21
|
export var useValidate = function useValidate(timeout) {
|
|
17
22
|
var controllerRef = useRef();
|
|
18
23
|
var ref = useRef(true);
|
|
24
|
+
var isTimeoutCloseRef = useRef(false);
|
|
19
25
|
var TimeoutRef = useRef();
|
|
20
26
|
var checkApi = useCallback( /*#__PURE__*/function () {
|
|
21
27
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(check, number, time) {
|
|
22
|
-
var res, start, diff;
|
|
28
|
+
var res, start, diff, _ref2, code;
|
|
23
29
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
24
30
|
while (1) switch (_context.prev = _context.next) {
|
|
25
31
|
case 0:
|
|
@@ -61,8 +67,29 @@ export var useValidate = function useValidate(timeout) {
|
|
|
61
67
|
_context.next = 4;
|
|
62
68
|
break;
|
|
63
69
|
case 16:
|
|
70
|
+
if (!isTimeoutCloseRef.current) {
|
|
71
|
+
_context.next = 22;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
if (res) {
|
|
75
|
+
_context.next = 19;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
return _context.abrupt("return", {
|
|
79
|
+
code: PayStatus.Timeout
|
|
80
|
+
});
|
|
81
|
+
case 19:
|
|
82
|
+
_ref2 = res, code = _ref2.code;
|
|
83
|
+
if (!("".concat(code) === "200")) {
|
|
84
|
+
_context.next = 22;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
return _context.abrupt("return", _objectSpread(_objectSpread({}, res), {}, {
|
|
88
|
+
code: PayStatus.Timeout
|
|
89
|
+
}));
|
|
90
|
+
case 22:
|
|
64
91
|
return _context.abrupt("return", res);
|
|
65
|
-
case
|
|
92
|
+
case 23:
|
|
66
93
|
case "end":
|
|
67
94
|
return _context.stop();
|
|
68
95
|
}
|
|
@@ -84,9 +111,11 @@ export var useValidate = function useValidate(timeout) {
|
|
|
84
111
|
(_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 ? void 0 : _controllerRef$curren.abort();
|
|
85
112
|
}, []);
|
|
86
113
|
var run = function run() {
|
|
114
|
+
isTimeoutCloseRef.current = false;
|
|
87
115
|
TimeoutRef.current && clearTimeout(TimeoutRef.current);
|
|
88
116
|
// 开启计时
|
|
89
117
|
TimeoutRef.current = setTimeout(function () {
|
|
118
|
+
isTimeoutCloseRef.current = true;
|
|
90
119
|
close();
|
|
91
120
|
}, timeout);
|
|
92
121
|
return checkApi.apply(void 0, arguments);
|
|
@@ -283,7 +283,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
283
283
|
amount?: string | number | undefined;
|
|
284
284
|
mode?: "refund" | "pay" | "query" | undefined;
|
|
285
285
|
order_id?: string | number | undefined;
|
|
286
|
-
eftpos?: "
|
|
286
|
+
eftpos?: "tyro" | "windcave" | "payo" | "stripe" | undefined;
|
|
287
287
|
action?: "amount" | "deviceList" | "pay" | undefined;
|
|
288
288
|
key?: number | undefined;
|
|
289
289
|
step?: number | undefined;
|
|
@@ -102,11 +102,13 @@ export function getAmonunt(store) {
|
|
|
102
102
|
useOriginSurcharge: false
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
var useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
106
|
+
|
|
105
107
|
// 直接设备中手续费金额
|
|
108
|
+
|
|
106
109
|
var surRate = setting.constant_rate || 0;
|
|
107
110
|
var surMoney = setting.constant_money || 0;
|
|
108
111
|
var surcharge = setting.surcharge;
|
|
109
|
-
var useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
110
112
|
return {
|
|
111
113
|
name: name,
|
|
112
114
|
symbol: symbol,
|
|
@@ -111,11 +111,12 @@ export function getAmonunt(store) {
|
|
|
111
111
|
useOriginSurcharge: false
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
+
var useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
115
|
+
|
|
114
116
|
// 直接设备中手续费金额 + 原始支付总额
|
|
115
117
|
var surRate = setting.constant_rate || 0;
|
|
116
118
|
var surMoney = setting.constant_money || 0;
|
|
117
119
|
var surcharge = setting.surcharge;
|
|
118
|
-
var useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
119
120
|
return {
|
|
120
121
|
name: name,
|
|
121
122
|
symbol: symbol,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,7 +68,7 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
71
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
73
72
|
state: FormState;
|
|
74
73
|
} & {
|
|
75
74
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -218,7 +218,7 @@ var header = ({ state, dispatch }) => {
|
|
|
218
218
|
setModalContentState({ open: false });
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
|
-
import_utils.locales.getText("
|
|
221
|
+
import_utils.locales.getText("page.booking.text.go-back")
|
|
222
222
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
223
223
|
import_antd.Button,
|
|
224
224
|
{
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftpos/deviceList/index.tsx
|
|
30
|
+
var deviceList_exports = {};
|
|
31
|
+
__export(deviceList_exports, {
|
|
32
|
+
default: () => deviceList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(deviceList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_group = require("../group");
|
|
38
|
+
var DeviceList = (props) => {
|
|
39
|
+
const [form] = import_antd.Form.useForm();
|
|
40
|
+
const { list, onChange } = props;
|
|
41
|
+
console.log(list);
|
|
42
|
+
const onValuesChange = () => {
|
|
43
|
+
const val = Object.values(form.getFieldsValue()).flat();
|
|
44
|
+
onChange(val);
|
|
45
|
+
};
|
|
46
|
+
const initialValues = (0, import_react.useMemo)(() => {
|
|
47
|
+
return list.reduce((target, item) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return {
|
|
50
|
+
...target,
|
|
51
|
+
[item.name]: ((_a = item == null ? void 0 : item.input) == null ? void 0 : _a.value) || ((_b = item == null ? void 0 : item.input) == null ? void 0 : _b.defaultValue)
|
|
52
|
+
};
|
|
53
|
+
}, {});
|
|
54
|
+
}, [list]);
|
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
56
|
+
import_antd.Form,
|
|
57
|
+
{
|
|
58
|
+
layout: "vertical",
|
|
59
|
+
onValuesChange,
|
|
60
|
+
form,
|
|
61
|
+
initialValues
|
|
62
|
+
},
|
|
63
|
+
list.map(({ input, ...formItemProps }) => {
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps }, /* @__PURE__ */ import_react.default.createElement(import_group.CheckboxGroup, { ...input }));
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
var deviceList_default = ({ input, ...formItemProps }) => {
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps }, /* @__PURE__ */ import_react.default.createElement(DeviceList, { ...input }));
|
|
70
|
+
};
|
|
@@ -35,44 +35,16 @@ __export(form_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(form_exports);
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_antd = require("antd");
|
|
38
|
+
var import_group = require("../group");
|
|
38
39
|
var import_surcharge = __toESM(require("../surcharge"));
|
|
40
|
+
var import_deviceList = __toESM(require("../deviceList"));
|
|
39
41
|
var Mapping = {
|
|
40
42
|
Input: import_antd.Input,
|
|
41
43
|
InputNumber: import_antd.InputNumber,
|
|
42
44
|
Checkbox: import_antd.Checkbox,
|
|
43
|
-
"Checkbox.Group":
|
|
44
|
-
direction,
|
|
45
|
-
options,
|
|
46
|
-
...props
|
|
47
|
-
}) => {
|
|
48
|
-
if (direction === "vertical") {
|
|
49
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction }, options == null ? void 0 : options.map((item) => {
|
|
50
|
-
if (typeof item === "object") {
|
|
51
|
-
const { label, value, ...other } = item;
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { ...other, value, key: `${item.value}` }, label);
|
|
53
|
-
}
|
|
54
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { value: item, key: `${item}` }, item);
|
|
55
|
-
})));
|
|
56
|
-
}
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props, options });
|
|
58
|
-
},
|
|
45
|
+
"Checkbox.Group": import_group.CheckboxGroup,
|
|
59
46
|
Radio: import_antd.Radio,
|
|
60
|
-
"Radio.Group":
|
|
61
|
-
direction,
|
|
62
|
-
options,
|
|
63
|
-
...props
|
|
64
|
-
}) => {
|
|
65
|
-
if (direction === "vertical") {
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction: "vertical" }, options == null ? void 0 : options.map((item) => {
|
|
67
|
-
if (typeof item === "object") {
|
|
68
|
-
const { label, value, ...other } = item;
|
|
69
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { ...other, value, key: `${item.value}` }, label);
|
|
70
|
-
}
|
|
71
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: item, key: `${item}` }, item);
|
|
72
|
-
})));
|
|
73
|
-
}
|
|
74
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props, options });
|
|
75
|
-
},
|
|
47
|
+
"Radio.Group": import_group.RadioGroup,
|
|
76
48
|
"Radio.Button": import_antd.Radio.Button,
|
|
77
49
|
Cascader: import_antd.Cascader,
|
|
78
50
|
DatePicker: import_antd.DatePicker,
|
|
@@ -85,7 +57,8 @@ var Mapping = {
|
|
|
85
57
|
Upload: import_antd.Upload
|
|
86
58
|
};
|
|
87
59
|
var CustomMapping = {
|
|
88
|
-
Surcharge: import_surcharge.default
|
|
60
|
+
Surcharge: import_surcharge.default,
|
|
61
|
+
DeviceList: import_deviceList.default
|
|
89
62
|
};
|
|
90
63
|
var CustomFormItem = ({
|
|
91
64
|
formItemList,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RadioGroupProps } from 'antd';
|
|
3
|
+
export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
|
|
4
|
+
export declare const RadioGroup: ({ direction, options, component, ...props }: RadioGroupProps & {
|
|
5
|
+
direction?: "vertical" | undefined;
|
|
6
|
+
component: string;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftpos/group/index.tsx
|
|
30
|
+
var group_exports = {};
|
|
31
|
+
__export(group_exports, {
|
|
32
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
33
|
+
RadioGroup: () => RadioGroup
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(group_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var CheckboxGroup = ({
|
|
39
|
+
direction,
|
|
40
|
+
options,
|
|
41
|
+
...props
|
|
42
|
+
}) => {
|
|
43
|
+
if (direction === "vertical") {
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction }, options == null ? void 0 : options.map((item) => {
|
|
45
|
+
if (typeof item === "object") {
|
|
46
|
+
const { label, value, ...other } = item;
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { ...other, value, key: `${item.value}` }, label);
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { value: item, key: `${item}` }, item);
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox.Group, { ...props, options });
|
|
53
|
+
};
|
|
54
|
+
var RadioGroup = ({
|
|
55
|
+
direction,
|
|
56
|
+
options,
|
|
57
|
+
component,
|
|
58
|
+
...props
|
|
59
|
+
}) => {
|
|
60
|
+
if (direction === "vertical") {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction: "vertical" }, options == null ? void 0 : options.map((item) => {
|
|
62
|
+
if (typeof item === "object") {
|
|
63
|
+
const { label, value, ...other } = item;
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { ...other, value, key: `${item.value}` }, label);
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: item, key: `${item}` }, item);
|
|
67
|
+
})));
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, { ...props, options });
|
|
70
|
+
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
CheckboxGroup,
|
|
74
|
+
RadioGroup
|
|
75
|
+
});
|
|
@@ -45,11 +45,11 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
|
|
|
45
45
|
const dispatch = (0, import_store.useDispatch)();
|
|
46
46
|
const { symbol, manual, order_id, mode, device, number, pay, amount } = (0, import_store.useContextData)();
|
|
47
47
|
const start = (0, import_react.useMemo)(() => {
|
|
48
|
-
if (typeof (manual == null ? void 0 : manual.money) === "number") {
|
|
49
|
-
return manual == null ? void 0 : manual.money;
|
|
48
|
+
if (typeof (manual == null ? void 0 : manual.money) === "number" || typeof (manual == null ? void 0 : manual.money) === "string") {
|
|
49
|
+
return Number(manual == null ? void 0 : manual.money);
|
|
50
50
|
}
|
|
51
|
-
if (typeof (pay == null ? void 0 : pay.total) === "number") {
|
|
52
|
-
return pay == null ? void 0 : pay.total;
|
|
51
|
+
if (typeof (pay == null ? void 0 : pay.total) === "number" || typeof (pay == null ? void 0 : pay.total) === "string") {
|
|
52
|
+
return Number(pay == null ? void 0 : pay.total);
|
|
53
53
|
}
|
|
54
54
|
return amount;
|
|
55
55
|
}, [manual == null ? void 0 : manual.money, pay == null ? void 0 : pay.total, amount]);
|
|
@@ -61,17 +61,6 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
|
|
|
61
61
|
if (disabled) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
if (mode === import_const.ModeEnum.Pay) {
|
|
65
|
-
setDisabled(true);
|
|
66
|
-
const obj = pay || {};
|
|
67
|
-
onChange("success", {
|
|
68
|
-
...obj,
|
|
69
|
-
number,
|
|
70
|
-
device,
|
|
71
|
-
order_id
|
|
72
|
-
});
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
64
|
if (mode === import_const.ModeEnum.Refund) {
|
|
76
65
|
setDisabled(true);
|
|
77
66
|
onChange("success", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { State } from './store';
|
|
2
|
+
import { Amount } from './const';
|
|
2
3
|
export declare function getUuid(): string;
|
|
3
4
|
/**
|
|
4
5
|
* @title: Promise化 setTimeout
|
|
@@ -54,4 +55,12 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
|
|
|
54
55
|
device?: undefined;
|
|
55
56
|
};
|
|
56
57
|
export declare const limitDecimals: (value: any) => any;
|
|
58
|
+
/**
|
|
59
|
+
* @title: 通用获取 金额信息
|
|
60
|
+
* @description: 在 amount 页面设置则使用 pay ,如果有 setting 则使用 setting 信息 ,都没有则设置0
|
|
61
|
+
* @param {State} store : 全局store数据管理
|
|
62
|
+
* @Author: hongbing.wang
|
|
63
|
+
* @Date: 2024-08-12 10:24
|
|
64
|
+
*/
|
|
65
|
+
export declare function getAmonunt(store: State): Amount;
|
|
57
66
|
export {};
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var helper_exports = {};
|
|
21
21
|
__export(helper_exports, {
|
|
22
22
|
cloneDeep: () => cloneDeep,
|
|
23
|
+
getAmonunt: () => getAmonunt,
|
|
23
24
|
getPayParams: () => getPayParams,
|
|
24
25
|
getUuid: () => getUuid,
|
|
25
26
|
limitDecimals: () => limitDecimals,
|
|
@@ -116,9 +117,57 @@ var limitDecimals = (value) => {
|
|
|
116
117
|
}
|
|
117
118
|
return "";
|
|
118
119
|
};
|
|
120
|
+
function getAmonunt(store) {
|
|
121
|
+
const { device, pay, custom, name, symbol, amount } = store;
|
|
122
|
+
if (!device || !custom) {
|
|
123
|
+
throw Error("device or custom is not defined");
|
|
124
|
+
}
|
|
125
|
+
const setting = device.setting;
|
|
126
|
+
if (pay) {
|
|
127
|
+
return {
|
|
128
|
+
name,
|
|
129
|
+
symbol,
|
|
130
|
+
// format,
|
|
131
|
+
money: Number(amount),
|
|
132
|
+
amount: Number(pay.amount),
|
|
133
|
+
surRate: Number(pay.surRate),
|
|
134
|
+
surMoney: Number(pay.surMoney),
|
|
135
|
+
surcharge: (setting == null ? void 0 : setting.surcharge) || false,
|
|
136
|
+
useOriginSurcharge: (pay == null ? void 0 : pay.useOriginSurcharge) || false
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (!setting) {
|
|
140
|
+
return {
|
|
141
|
+
name,
|
|
142
|
+
symbol,
|
|
143
|
+
// format,
|
|
144
|
+
money: Number(amount),
|
|
145
|
+
amount: Number(amount),
|
|
146
|
+
surRate: 0,
|
|
147
|
+
surMoney: 0,
|
|
148
|
+
surcharge: false,
|
|
149
|
+
useOriginSurcharge: false
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
153
|
+
const surRate = setting.constant_rate || 0;
|
|
154
|
+
const surMoney = setting.constant_money || 0;
|
|
155
|
+
const surcharge = setting.surcharge;
|
|
156
|
+
return {
|
|
157
|
+
name,
|
|
158
|
+
symbol,
|
|
159
|
+
money: Number(amount),
|
|
160
|
+
amount: Number(amount),
|
|
161
|
+
surRate: useOriginSurcharge ? 0 : surcharge ? surRate : 0,
|
|
162
|
+
surMoney: useOriginSurcharge ? 0 : surcharge ? surMoney : 0,
|
|
163
|
+
surcharge,
|
|
164
|
+
useOriginSurcharge
|
|
165
|
+
};
|
|
166
|
+
}
|
|
119
167
|
// Annotate the CommonJS export names for ESM import in node:
|
|
120
168
|
0 && (module.exports = {
|
|
121
169
|
cloneDeep,
|
|
170
|
+
getAmonunt,
|
|
122
171
|
getPayParams,
|
|
123
172
|
getUuid,
|
|
124
173
|
limitDecimals,
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "payo" | "stripe">;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* @title: 通用失败处理
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { State } from './store';
|
|
2
|
+
export { getAmonunt } from './helper';
|
|
2
3
|
export { default as Payo } from './payo';
|
|
3
4
|
export { default as Windcave } from './windcave/windcave';
|
|
4
5
|
export { default as Tyro } from './tyro';
|
|
5
6
|
export declare const getInitState: (type: string, params?: any) => State;
|
|
6
|
-
export declare const getAmonunt: (store: State) => import("./const").Amount;
|
|
@@ -32,7 +32,7 @@ __export(manufacturer_exports, {
|
|
|
32
32
|
Payo: () => import_payo.default,
|
|
33
33
|
Tyro: () => import_tyro.default,
|
|
34
34
|
Windcave: () => import_windcave.default,
|
|
35
|
-
getAmonunt: () => getAmonunt,
|
|
35
|
+
getAmonunt: () => import_helper.getAmonunt,
|
|
36
36
|
getInitState: () => getInitState
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(manufacturer_exports);
|
|
@@ -40,6 +40,7 @@ var import_const = require("./const");
|
|
|
40
40
|
var import_const2 = __toESM(require("./payo/const"));
|
|
41
41
|
var import_const3 = __toESM(require("./tyro/const"));
|
|
42
42
|
var import_const4 = __toESM(require("./windcave/const"));
|
|
43
|
+
var import_helper = require("./helper");
|
|
43
44
|
var import_payo = __toESM(require("./payo"));
|
|
44
45
|
var import_windcave = __toESM(require("./windcave/windcave"));
|
|
45
46
|
var import_tyro = __toESM(require("./tyro"));
|
|
@@ -55,18 +56,6 @@ var getInitState = (type, params) => {
|
|
|
55
56
|
throw new Error("未知的厂商类型");
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
var getAmonunt = (store) => {
|
|
59
|
-
if (store.eftpos === import_const.EftposEnum.Payo) {
|
|
60
|
-
return (0, import_const2.getAmonunt)(store);
|
|
61
|
-
}
|
|
62
|
-
if (store.eftpos === import_const.EftposEnum.Windcave) {
|
|
63
|
-
return (0, import_const4.getAmonunt)(store);
|
|
64
|
-
}
|
|
65
|
-
if (store.eftpos === import_const.EftposEnum.Tyro) {
|
|
66
|
-
return (0, import_const3.getAmonunt)(store);
|
|
67
|
-
}
|
|
68
|
-
throw new Error("未知的厂商类型");
|
|
69
|
-
};
|
|
70
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
60
|
0 && (module.exports = {
|
|
72
61
|
Payo,
|
|
@@ -109,10 +109,10 @@ function getAmonunt(store) {
|
|
|
109
109
|
useOriginSurcharge: false
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
const surRate = setting.useOriginSurcharge ? 0 : setting.constant_rate || 0;
|
|
113
|
-
const surMoney = setting.useOriginSurcharge ? 0 : setting.constant_money || 0;
|
|
114
|
-
const surcharge = setting.surcharge;
|
|
115
112
|
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
113
|
+
const surRate = setting.constant_rate || 0;
|
|
114
|
+
const surMoney = setting.constant_money || 0;
|
|
115
|
+
const surcharge = setting.surcharge;
|
|
116
116
|
return {
|
|
117
117
|
name,
|
|
118
118
|
symbol,
|