@pisell/private-materials 6.6.47 → 6.6.49
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Voucher/index.js +7 -22
- package/es/components/booking/addons/index.js +2 -3
- package/es/components/booking/components/footer/amount.js +6 -1
- package/es/components/booking/components/footer/index.js +0 -7
- package/es/components/booking/components/footer/utils.d.ts +1 -1
- package/es/components/booking/components/footer/utils.js +5 -7
- package/es/components/booking/components/voucher/index.js +0 -6
- package/es/components/booking/components/voucher/index.less +1 -4
- package/es/components/booking/components/voucherModal/index.less +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +1 -1
- package/es/components/booking/hooks/useClearCart.js +39 -9
- package/es/components/booking/info/service/index.less +4 -2
- package/es/components/booking/info2/cartClientCard/index.js +82 -2
- package/es/components/booking/info2/serve.d.ts +8 -0
- package/es/components/booking/info2/serve.js +52 -0
- package/es/components/booking/info2/service/editService/index.js +3 -9
- package/es/components/booking/info2/service/index.js +4 -5
- package/es/components/booking/locales.d.ts +20 -0
- package/es/components/booking/locales.js +20 -0
- package/es/components/checkout/components/WalletPassModule/index.js +0 -1
- package/es/components/checkout/components/WalletPassModule/utils.d.ts +0 -1
- package/es/components/checkout/components/WalletPassModule/utils.js +3 -17
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +192 -316
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +145 -166
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
- package/es/components/pay/toC/WalletPassBlock/index.js +1 -3
- package/es/components/pay/toC/index.js +27 -66
- package/es/components/pay/toC/model.d.ts +0 -1
- package/es/components/pay/toC/serve.d.ts +0 -18
- package/es/components/pay/toC/serve.js +1 -29
- package/es/components/pay/toC/utils.d.ts +2 -2
- package/es/components/pay/toC/utils.js +0 -4
- package/es/components/shoppingCart/components/Cart/index.less +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -1
- package/es/components/shoppingCart/hooks/useClearCart.js +41 -11
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -7
- package/es/components/ticketBooking/index.js +5 -2
- package/es/plus/clinetSearch/index.d.ts +1 -0
- package/es/plus/clinetSearch/index.js +9 -3
- package/es/plus/clinetSearch/index.less +13 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -10
- package/lib/components/booking/addons/index.js +2 -3
- package/lib/components/booking/components/footer/amount.js +6 -1
- package/lib/components/booking/components/footer/index.js +0 -9
- package/lib/components/booking/components/footer/utils.d.ts +1 -1
- package/lib/components/booking/components/footer/utils.js +3 -5
- package/lib/components/booking/components/voucher/index.js +0 -6
- package/lib/components/booking/components/voucher/index.less +1 -4
- package/lib/components/booking/components/voucherModal/index.less +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -1
- package/lib/components/booking/hooks/useClearCart.js +28 -6
- package/lib/components/booking/info/service/index.less +4 -2
- package/lib/components/booking/info2/cartClientCard/index.js +46 -2
- package/lib/components/booking/info2/serve.d.ts +8 -0
- package/lib/components/booking/info2/serve.js +12 -0
- package/lib/components/booking/info2/service/editService/index.js +19 -25
- package/lib/components/booking/info2/service/index.js +4 -2
- package/lib/components/booking/locales.d.ts +20 -0
- package/lib/components/booking/locales.js +20 -0
- package/lib/components/checkout/components/WalletPassModule/index.js +0 -1
- package/lib/components/checkout/components/WalletPassModule/utils.d.ts +0 -1
- package/lib/components/checkout/components/WalletPassModule/utils.js +2 -18
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +108 -157
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +103 -90
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
- package/lib/components/pay/toC/WalletPassBlock/index.js +1 -3
- package/lib/components/pay/toC/index.js +11 -52
- package/lib/components/pay/toC/model.d.ts +0 -1
- package/lib/components/pay/toC/serve.d.ts +0 -18
- package/lib/components/pay/toC/serve.js +0 -6
- package/lib/components/pay/toC/utils.d.ts +2 -2
- package/lib/components/pay/toC/utils.js +0 -4
- package/lib/components/shoppingCart/components/Cart/index.less +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -1
- package/lib/components/shoppingCart/hooks/useClearCart.js +42 -11
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -11
- package/lib/components/ticketBooking/index.js +4 -2
- package/lib/plus/clinetSearch/index.d.ts +1 -0
- package/lib/plus/clinetSearch/index.js +10 -0
- package/lib/plus/clinetSearch/index.less +13 -0
- package/package.json +2 -2
- package/lowcode/eco-cup-list/meta.ts +0 -63
- package/lowcode/eco-customer-list/meta.ts +0 -63
|
@@ -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<"stripe" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly" | "huifu">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -301,8 +301,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
301
301
|
amount?: string | number | undefined;
|
|
302
302
|
mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
|
|
303
303
|
order_id?: string | number | undefined;
|
|
304
|
-
eftpos?: "stripe" | "
|
|
305
|
-
action?: "
|
|
304
|
+
eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | "huifu" | undefined;
|
|
305
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
306
306
|
key?: number | undefined;
|
|
307
307
|
step?: number | undefined;
|
|
308
308
|
title?: string | undefined;
|
|
@@ -15,16 +15,11 @@ export interface WalletPassProps {
|
|
|
15
15
|
walletPass: {
|
|
16
16
|
cards: WalletPassDataType[];
|
|
17
17
|
amount: number;
|
|
18
|
-
recommended?: WalletPassDataType[];
|
|
19
|
-
transformList?: WalletPassDataType[];
|
|
20
|
-
noApplicableVoucher?: WalletPassDataType[];
|
|
21
18
|
};
|
|
22
19
|
walletSetting: {
|
|
23
20
|
name: string;
|
|
24
21
|
popup_status: 0 | 1;
|
|
25
22
|
};
|
|
26
|
-
orderDetail: any;
|
|
27
|
-
total_amount: number;
|
|
28
23
|
}
|
|
29
24
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WalletPassProps & React.RefAttributes<WalletPassRef>>>;
|
|
30
25
|
export default _default;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
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; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
3
|
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); } }
|
|
9
4
|
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); }); }; }
|
|
@@ -11,6 +6,11 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
11
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13
8
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -19,7 +19,6 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
import React, { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
21
21
|
import { PisellModal, PisellText, PisellToast } from '@pisell/materials';
|
|
22
|
-
// @ts-ignore
|
|
23
22
|
import { locales, uniqueByKey } from '@pisell/utils';
|
|
24
23
|
import { useMemoizedFn } from 'ahooks';
|
|
25
24
|
import { InfoCircleOutlined } from '@ant-design/icons';
|
|
@@ -28,168 +27,149 @@ import MultiModeSearch from "./MultiModeSearch";
|
|
|
28
27
|
import List from "./List";
|
|
29
28
|
import { searchMachineCodeList, searchWalletCode } from "./serve";
|
|
30
29
|
import { formatMachineCodeServer2CardList, getIsWalletCode } from "./utils";
|
|
31
|
-
import { formatWalletPassList2PreparePayments } from "../../utils";
|
|
30
|
+
import { calcWalletPassListAmount, formatWalletPassList2PreparePayments } from "../../utils";
|
|
32
31
|
import "./index.less";
|
|
33
32
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
34
33
|
var Amount = PisellText.Amount;
|
|
35
34
|
var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
|
-
var _context$appHelper, _context$
|
|
35
|
+
var _context$appHelper, _context$appHelper$ge, _searchSelectData$ids;
|
|
37
36
|
var onWalletPassChange = props.onWalletPassChange,
|
|
38
37
|
walletPass = props.walletPass,
|
|
39
|
-
walletSetting = props.walletSetting
|
|
40
|
-
orderDetail = props.orderDetail,
|
|
41
|
-
total_amount = props.total_amount;
|
|
38
|
+
walletSetting = props.walletSetting;
|
|
42
39
|
var context = useEngineContext();
|
|
43
|
-
var
|
|
44
|
-
walletPassEvaluator = _ref.walletPassEvaluator;
|
|
45
|
-
|
|
46
|
-
// detail是product的列表
|
|
47
|
-
var detail = orderDetail.detail;
|
|
48
|
-
var isWalletCode = context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.businessUtils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getAppByModal) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.call(_context$appHelper2, 'wallet');
|
|
49
|
-
var recommended = walletPass.cards,
|
|
50
|
-
transformList = walletPass.transformList,
|
|
51
|
-
noApplicableVoucher = walletPass.noApplicableVoucher;
|
|
52
|
-
|
|
53
|
-
/** 当前选中的券ID列表(按选中顺序) */
|
|
54
|
-
var _useState = useState([]),
|
|
55
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
-
selectedVoucherIds = _useState2[0],
|
|
57
|
-
setSelectedVoucherIds = _useState2[1];
|
|
40
|
+
var isWalletCode = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.businessUtils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getAppByModal) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, 'wallet');
|
|
58
41
|
|
|
59
42
|
/** 当前 walletPass信息 弹窗操作时都在内部进行,点击 redeem时同步到外层 */
|
|
60
|
-
var
|
|
43
|
+
var _useState = useState(walletPass),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
currentWalletPass = _useState2[0],
|
|
46
|
+
setCurrentWalletPass = _useState2[1];
|
|
47
|
+
var _useState3 = useState(false),
|
|
61
48
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
loading = _useState4[0],
|
|
50
|
+
setLoading = _useState4[1];
|
|
64
51
|
var _useState5 = useState(false),
|
|
65
52
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _useState7 = useState(false),
|
|
69
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
70
|
-
open = _useState8[0],
|
|
71
|
-
setOpen = _useState8[1];
|
|
53
|
+
open = _useState6[0],
|
|
54
|
+
setOpen = _useState6[1];
|
|
72
55
|
|
|
73
56
|
/** 搜索 modal */
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
searchOpen =
|
|
77
|
-
setSearchOpen =
|
|
57
|
+
var _useState7 = useState(false),
|
|
58
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
59
|
+
searchOpen = _useState8[0],
|
|
60
|
+
setSearchOpen = _useState8[1];
|
|
78
61
|
|
|
79
62
|
/** 搜索后添加的walletPass */
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
addList =
|
|
83
|
-
setAddList =
|
|
63
|
+
var _useState9 = useState([]),
|
|
64
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
65
|
+
addList = _useState10[0],
|
|
66
|
+
setAddList = _useState10[1];
|
|
84
67
|
|
|
85
68
|
/** 当前order信息 */
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
order =
|
|
89
|
-
setOrder =
|
|
69
|
+
var _useState11 = useState(null),
|
|
70
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
71
|
+
order = _useState12[0],
|
|
72
|
+
setOrder = _useState12[1];
|
|
90
73
|
|
|
91
74
|
/** 当前搜索modal内list数据 */
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
searchData =
|
|
95
|
-
setSearchData =
|
|
75
|
+
var _useState13 = useState([]),
|
|
76
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
77
|
+
searchData = _useState14[0],
|
|
78
|
+
setSearchData = _useState14[1];
|
|
96
79
|
|
|
97
80
|
/** 当前搜索modal内选中数据 */
|
|
98
|
-
var
|
|
81
|
+
var _useState15 = useState({
|
|
99
82
|
ids: [],
|
|
100
83
|
details: []
|
|
101
84
|
}),
|
|
102
|
-
|
|
103
|
-
searchSelectData =
|
|
104
|
-
setSearchSelectData =
|
|
85
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
86
|
+
searchSelectData = _useState16[0],
|
|
87
|
+
setSearchSelectData = _useState16[1];
|
|
105
88
|
|
|
106
89
|
/** 是否默认选中 搜索时默认选中 列表select变更更新列表时不默认选中 */
|
|
107
90
|
var isAutoSelect = useRef(false);
|
|
91
|
+
var listRef = useRef(null);
|
|
108
92
|
|
|
109
93
|
/** 当前搜索框搜索值 */
|
|
110
94
|
var searchValRef = useRef(null);
|
|
111
95
|
var pinVerifyModalRef = useRef(null);
|
|
96
|
+
var _ref = currentWalletPass || {},
|
|
97
|
+
walletPassSelectCards = _ref.cards,
|
|
98
|
+
amount = _ref.amount;
|
|
112
99
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// 根据选中的券ID获取选中的券对象列表(保持选中顺序)
|
|
119
|
-
var selectedVouchers = useMemo(function () {
|
|
120
|
-
return selectedVoucherIds.map(function (id) {
|
|
121
|
-
return allVouchersForCalculation.find(function (v) {
|
|
122
|
-
return v.id === id;
|
|
123
|
-
});
|
|
124
|
-
}).filter(Boolean);
|
|
125
|
-
}, [selectedVoucherIds, allVouchersForCalculation]);
|
|
126
|
-
|
|
127
|
-
// 计算展示列表和当前券的详细信息
|
|
100
|
+
/**
|
|
101
|
+
* currentCustomerWalletPass 当前用户walletPass
|
|
102
|
+
* otherCustomerWalletPass 手动搜索添加的walletPass
|
|
103
|
+
*/
|
|
128
104
|
var _useMemo = useMemo(function () {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
totalDeduction: 0
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 如果没有选中任何券,返回初始状态
|
|
139
|
-
if (selectedVouchers.length === 0) {
|
|
140
|
-
return {
|
|
141
|
-
displayVouchers: [].concat(_toConsumableArray(transformList || []), _toConsumableArray(noApplicableVoucher || [])),
|
|
142
|
-
displayOtherVouchers: addList || [],
|
|
143
|
-
selectedWithDetails: [],
|
|
144
|
-
totalDeduction: 0
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// 有选中的券,重新计算(基于 transformList + addList)
|
|
149
|
-
var result = walletPassEvaluator.recalculateVouchers(allVouchersForCalculation, selectedVouchers, order.total_amount, detail || []);
|
|
150
|
-
|
|
151
|
-
// 分离当前客户的券和其他客户的券
|
|
152
|
-
var currentCustomerVouchers = [];
|
|
153
|
-
var otherCustomerVouchers = [];
|
|
154
|
-
result.allWithUpdatedStatus.forEach(function (voucher) {
|
|
155
|
-
if (voucher.customer_id === (order === null || order === void 0 ? void 0 : order.customer_id)) {
|
|
156
|
-
currentCustomerVouchers.push(voucher);
|
|
105
|
+
var current = [];
|
|
106
|
+
var other = [];
|
|
107
|
+
(walletPassSelectCards || []).forEach(function (item) {
|
|
108
|
+
if (item.customer_id === (order === null || order === void 0 ? void 0 : order.customer_id)) {
|
|
109
|
+
current.push(item);
|
|
157
110
|
} else {
|
|
158
|
-
|
|
111
|
+
other.push(item);
|
|
159
112
|
}
|
|
160
113
|
});
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return sum + (v.actualDeduction || 0);
|
|
167
|
-
}, 0)
|
|
168
|
-
};
|
|
169
|
-
}, [selectedVouchers, allVouchersForCalculation, transformList, addList, noApplicableVoucher, order === null || order === void 0 ? void 0 : order.total_amount, order === null || order === void 0 ? void 0 : order.customer_id, detail, walletPassEvaluator]),
|
|
170
|
-
displayVouchers = _useMemo.displayVouchers,
|
|
171
|
-
displayOtherVouchers = _useMemo.displayOtherVouchers,
|
|
172
|
-
selectedWithDetails = _useMemo.selectedWithDetails,
|
|
173
|
-
totalDeduction = _useMemo.totalDeduction;
|
|
114
|
+
return [current, other];
|
|
115
|
+
}, [walletPassSelectCards, order === null || order === void 0 ? void 0 : order.customer_id]),
|
|
116
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
117
|
+
currentCustomerWalletPass = _useMemo2[0],
|
|
118
|
+
otherCustomerWalletPass = _useMemo2[1];
|
|
174
119
|
|
|
175
120
|
// 基于选择的 walletPassCard转换接口所需prepare_payments参数
|
|
176
121
|
var prepare_payments = useMemo(function () {
|
|
177
|
-
return formatWalletPassList2PreparePayments(uniqueByKey((
|
|
178
|
-
}, [
|
|
122
|
+
return formatWalletPassList2PreparePayments(uniqueByKey((walletPassSelectCards || []).concat(searchSelectData.details), 'id'));
|
|
123
|
+
}, [walletPassSelectCards, searchSelectData]);
|
|
179
124
|
|
|
180
125
|
// 当前列表选中id
|
|
181
126
|
var selectValue = useMemo(function () {
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
127
|
+
return (walletPassSelectCards === null || walletPassSelectCards === void 0 ? void 0 : walletPassSelectCards.map(function (item) {
|
|
128
|
+
return item.id;
|
|
129
|
+
})) || [];
|
|
130
|
+
}, [walletPassSelectCards]);
|
|
131
|
+
var otherCustomerWalletPassList = useMemo(function () {
|
|
132
|
+
return formatMachineCodeServer2CardList(addList, selectValue);
|
|
133
|
+
}, [addList, selectValue]);
|
|
134
|
+
var other_exact_codes = useMemo(function () {
|
|
135
|
+
var codes = [];
|
|
136
|
+
addList.forEach(function (item) {
|
|
137
|
+
if (!selectValue.includes(item.id)) {
|
|
138
|
+
codes.push(item.code);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return codes;
|
|
142
|
+
}, [addList, selectValue]);
|
|
143
|
+
var refreshList = useMemoizedFn(function () {
|
|
144
|
+
if (order !== null && order !== void 0 && order.order_id && order !== null && order !== void 0 && order.customer_id) {
|
|
145
|
+
var _listRef$current, _order$_order;
|
|
146
|
+
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.init({
|
|
147
|
+
order_id: order.order_id,
|
|
148
|
+
available: 2,
|
|
149
|
+
prepare_payments: prepare_payments,
|
|
150
|
+
filter_prepare_wallet_pass: 1,
|
|
151
|
+
sale_channel: ((_order$_order = order._order) === null || _order$_order === void 0 ? void 0 : _order$_order.sale_channel) || 'online-store',
|
|
152
|
+
other_exact_codes: other_exact_codes
|
|
153
|
+
},
|
|
154
|
+
// 已选择的卡片接口中不会返回,所以追加进入列表
|
|
155
|
+
function (val) {
|
|
156
|
+
var idMap = val.reduce(function (pre, cur) {
|
|
157
|
+
return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, cur.id, cur));
|
|
158
|
+
}, {});
|
|
159
|
+
setAddList(function (prevState) {
|
|
160
|
+
return prevState.map(function (item) {
|
|
161
|
+
if (idMap[item.id]) {
|
|
162
|
+
return idMap[item.id];
|
|
163
|
+
}
|
|
164
|
+
return item;
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
return [].concat(_toConsumableArray(currentCustomerWalletPass || []), _toConsumableArray(val)).filter(function (item) {
|
|
168
|
+
return !(order !== null && order !== void 0 && order.customer_id) || item.customer_id === (order === null || order === void 0 ? void 0 : order.customer_id);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
191
171
|
}
|
|
192
|
-
}
|
|
172
|
+
});
|
|
193
173
|
|
|
194
174
|
/**
|
|
195
175
|
* 搜索结果list弹窗列表选中发生变更时 重新获取接口
|
|
@@ -213,12 +193,9 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
213
193
|
setOrder(res);
|
|
214
194
|
setOpen(true);
|
|
215
195
|
setCurrentWalletPass(walletPass);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return v.id;
|
|
220
|
-
}));
|
|
221
|
-
}
|
|
196
|
+
setTimeout(function () {
|
|
197
|
+
refreshList();
|
|
198
|
+
});
|
|
222
199
|
case 6:
|
|
223
200
|
case "end":
|
|
224
201
|
return _context.stop();
|
|
@@ -236,7 +213,7 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
236
213
|
*/
|
|
237
214
|
var searchList = /*#__PURE__*/function () {
|
|
238
215
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3, isSelectChange) {
|
|
239
|
-
var code, customer_pin_key, _order$
|
|
216
|
+
var code, customer_pin_key, _order$_order2, result;
|
|
240
217
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
241
218
|
while (1) switch (_context2.prev = _context2.next) {
|
|
242
219
|
case 0:
|
|
@@ -255,12 +232,12 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
255
232
|
code: code,
|
|
256
233
|
prepare_payments: prepare_payments,
|
|
257
234
|
// filter_prepare_wallet_pass: 1,
|
|
258
|
-
sale_channel: ((_order$
|
|
235
|
+
sale_channel: ((_order$_order2 = order._order) === null || _order$_order2 === void 0 ? void 0 : _order$_order2.sale_channel) || 'online-store',
|
|
259
236
|
customer_pin_key: customer_pin_key
|
|
260
237
|
});
|
|
261
238
|
case 7:
|
|
262
|
-
|
|
263
|
-
if (
|
|
239
|
+
result = _context2.sent;
|
|
240
|
+
if (result) {
|
|
264
241
|
_context2.next = 11;
|
|
265
242
|
break;
|
|
266
243
|
}
|
|
@@ -277,11 +254,6 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
277
254
|
}
|
|
278
255
|
return _context2.abrupt("return");
|
|
279
256
|
case 13:
|
|
280
|
-
result = walletPassEvaluator.searchVoucherFormat({
|
|
281
|
-
vouchers: baseResult,
|
|
282
|
-
orderTotalAmount: order.total_amount,
|
|
283
|
-
products: detail
|
|
284
|
-
});
|
|
285
257
|
setSearchData(formatMachineCodeServer2CardList([].concat(_toConsumableArray(searchSelectData.details), _toConsumableArray(result)), searchSelectData.ids));
|
|
286
258
|
if (result.length) {
|
|
287
259
|
// 如果搜索结果只有一个并且可用,则直接选中
|
|
@@ -297,15 +269,15 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
297
269
|
customer_pin_key: customer_pin_key
|
|
298
270
|
};
|
|
299
271
|
}
|
|
300
|
-
case
|
|
301
|
-
_context2.prev =
|
|
272
|
+
case 15:
|
|
273
|
+
_context2.prev = 15;
|
|
302
274
|
setLoading(false);
|
|
303
|
-
return _context2.finish(
|
|
304
|
-
case
|
|
275
|
+
return _context2.finish(15);
|
|
276
|
+
case 18:
|
|
305
277
|
case "end":
|
|
306
278
|
return _context2.stop();
|
|
307
279
|
}
|
|
308
|
-
}, _callee2, null, [[4,,
|
|
280
|
+
}, _callee2, null, [[4,, 15, 18]]);
|
|
309
281
|
}));
|
|
310
282
|
return function searchList(_x2, _x3) {
|
|
311
283
|
return _ref4.apply(this, arguments);
|
|
@@ -389,19 +361,12 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
389
361
|
});
|
|
390
362
|
};
|
|
391
363
|
var handleSelectOk = function handleSelectOk() {
|
|
392
|
-
|
|
393
|
-
var otherCustomerSearchVouchers = searchSelectData.details.filter(function (item) {
|
|
394
|
-
return item.customer_id !== (order === null || order === void 0 ? void 0 : order.customer_id);
|
|
395
|
-
});
|
|
364
|
+
changeWalletPass(uniqueByKey([].concat(_toConsumableArray(walletPassSelectCards || []), _toConsumableArray(searchSelectData.details)), 'id'));
|
|
396
365
|
setAddList(function (prevState) {
|
|
397
|
-
return uniqueByKey([].concat(_toConsumableArray(prevState), _toConsumableArray(
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
// 更新选中的券ID列表(包括所有搜索选中的券)
|
|
401
|
-
var newSelectedIds = uniqueByKey([].concat(_toConsumableArray(selectedWithDetails || []), _toConsumableArray(searchSelectData.details)), 'id').map(function (v) {
|
|
402
|
-
return v.id;
|
|
366
|
+
return uniqueByKey([].concat(_toConsumableArray(prevState), _toConsumableArray(searchSelectData.details)), 'id').filter(function (item) {
|
|
367
|
+
return !(order !== null && order !== void 0 && order.customer_id) || item.customer_id !== (order === null || order === void 0 ? void 0 : order.customer_id);
|
|
368
|
+
});
|
|
403
369
|
});
|
|
404
|
-
setSelectedVoucherIds(newSelectedIds);
|
|
405
370
|
handleSearchModalClose();
|
|
406
371
|
};
|
|
407
372
|
var handleAddChange = useMemoizedFn(function (val, details) {
|
|
@@ -413,15 +378,29 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
413
378
|
})
|
|
414
379
|
});
|
|
415
380
|
});
|
|
381
|
+
var changeWalletPass = function changeWalletPass(cards) {
|
|
382
|
+
setCurrentWalletPass === null || setCurrentWalletPass === void 0 || setCurrentWalletPass({
|
|
383
|
+
cards: cards,
|
|
384
|
+
amount: calcWalletPassListAmount(cards)
|
|
385
|
+
});
|
|
386
|
+
setTimeout(function () {
|
|
387
|
+
refreshList();
|
|
388
|
+
});
|
|
389
|
+
};
|
|
416
390
|
var handleSelectChange = function handleSelectChange(val, details, type) {
|
|
417
|
-
|
|
418
|
-
|
|
391
|
+
var cards = details.map(function (item) {
|
|
392
|
+
return item.originData;
|
|
393
|
+
});
|
|
394
|
+
// 更新时 把当前客户value和其他客户value合并
|
|
395
|
+
if (type === 'other') {
|
|
396
|
+
cards = currentCustomerWalletPass.concat(cards);
|
|
397
|
+
} else if (type === 'current') {
|
|
398
|
+
cards = otherCustomerWalletPass.concat(cards);
|
|
399
|
+
}
|
|
400
|
+
changeWalletPass(cards);
|
|
419
401
|
};
|
|
420
402
|
var handleRedeem = function handleRedeem() {
|
|
421
|
-
onWalletPassChange === null || onWalletPassChange === void 0 || onWalletPassChange(
|
|
422
|
-
cards: selectedWithDetails,
|
|
423
|
-
amount: totalDeduction
|
|
424
|
-
}));
|
|
403
|
+
onWalletPassChange === null || onWalletPassChange === void 0 || onWalletPassChange(currentWalletPass);
|
|
425
404
|
setOpen(false);
|
|
426
405
|
};
|
|
427
406
|
var handleWalletClose = function handleWalletClose() {
|
|
@@ -443,7 +422,7 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
443
422
|
cancelVisible: false,
|
|
444
423
|
destroyOnClose: true,
|
|
445
424
|
okText: /*#__PURE__*/React.createElement("div", null, locales.getText('tocPay.text.redeem'), " ", /*#__PURE__*/React.createElement(Amount, {
|
|
446
|
-
value:
|
|
425
|
+
value: amount
|
|
447
426
|
})),
|
|
448
427
|
onOk: handleRedeem
|
|
449
428
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -461,9 +440,9 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
461
440
|
className: "wallet-pass-modal-multi-selection-available-title-icon"
|
|
462
441
|
}), locales.getText('tocPay.text.multipleSelectionAvailable')), /*#__PURE__*/React.createElement("div", {
|
|
463
442
|
className: "wallet-pass-modal-multi-selection-available-desc"
|
|
464
|
-
}, locales.getText('tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment')(walletSetting.name))),
|
|
443
|
+
}, locales.getText('tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment')(walletSetting.name))), otherCustomerWalletPassList.length > 0 && /*#__PURE__*/React.createElement(List, {
|
|
465
444
|
walletSetting: walletSetting,
|
|
466
|
-
data:
|
|
445
|
+
data: otherCustomerWalletPassList,
|
|
467
446
|
title: locales.getText('tocPay.text.couponCodesAdded'),
|
|
468
447
|
onChange: handleOtherChange,
|
|
469
448
|
value: selectValue,
|
|
@@ -473,9 +452,9 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
473
452
|
walletSetting: walletSetting,
|
|
474
453
|
title: walletSetting.name,
|
|
475
454
|
onChange: handleCurrentChange,
|
|
476
|
-
|
|
455
|
+
ref: listRef,
|
|
477
456
|
value: selectValue,
|
|
478
|
-
|
|
457
|
+
onLoadingChange: setLoading
|
|
479
458
|
}))), /*#__PURE__*/React.createElement(PisellModal, {
|
|
480
459
|
title: /*#__PURE__*/React.createElement("div", null, locales.getText('tocPay.text.searchResult')),
|
|
481
460
|
mobileModalHeight: '90%',
|
|
@@ -56,12 +56,6 @@ export declare type WalletPassDataType = {
|
|
|
56
56
|
metadata?: {
|
|
57
57
|
validity_type: string;
|
|
58
58
|
};
|
|
59
|
-
/** 前端计算 可用最大金额 */
|
|
60
|
-
_available_max_amount?: number;
|
|
61
|
-
/** 前端计算 统一可用状态 */
|
|
62
|
-
_unified_available_status?: 0 | 1;
|
|
63
|
-
/** 前端计算 禁用原因 */
|
|
64
|
-
reason?: string;
|
|
65
59
|
};
|
|
66
60
|
declare type Shop = {
|
|
67
61
|
id: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatDate,
|
|
1
|
+
import { formatDate, locales } from '@pisell/utils';
|
|
2
2
|
import { globalConfig } from '@pisell/materials';
|
|
3
3
|
import { getAvailableMaxAmount } from "../../utils";
|
|
4
4
|
var voucherTime = function voucherTime(data) {
|
|
@@ -25,8 +25,8 @@ export var formatMachineCodeServer2CardList = function formatMachineCodeServer2C
|
|
|
25
25
|
showDetail: false,
|
|
26
26
|
showQrCode: false,
|
|
27
27
|
code: item.code,
|
|
28
|
-
disabled:
|
|
29
|
-
disabledReason:
|
|
28
|
+
disabled: !item.unified_available_status,
|
|
29
|
+
disabledReason: (_item$unified_message = item.unified_messages) === null || _item$unified_message === void 0 ? void 0 : _item$unified_message.title,
|
|
30
30
|
cover: (_item$product = item.product) === null || _item$product === void 0 ? void 0 : _item$product.cover,
|
|
31
31
|
qrCode: item.code,
|
|
32
32
|
validDate: voucherTime(item),
|
|
@@ -163,9 +163,7 @@ var WalletPassBlock = function WalletPassBlock(props, ref) {
|
|
|
163
163
|
ref: walletPassRef,
|
|
164
164
|
walletSetting: walletSetting,
|
|
165
165
|
onWalletPassChange: onWalletPassChange,
|
|
166
|
-
walletPass: payGroup === null || payGroup === void 0 ? void 0 : payGroup.walletPass
|
|
167
|
-
orderDetail: payGroup === null || payGroup === void 0 ? void 0 : payGroup.orderDetail,
|
|
168
|
-
total_amount: payGroup === null || payGroup === void 0 ? void 0 : payGroup.total_amount
|
|
166
|
+
walletPass: payGroup === null || payGroup === void 0 ? void 0 : payGroup.walletPass
|
|
169
167
|
}), /*#__PURE__*/React.createElement(WalletAvailable, {
|
|
170
168
|
ref: walletAvailableRef,
|
|
171
169
|
walletSetting: walletSetting,
|