@pisell/private-materials 6.4.41 → 6.4.43
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 +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/actionButtons/index.js +37 -42
- package/es/components/booking/components/actionButtons/index.less +0 -28
- package/es/components/booking/components/footer/amount.d.ts +3 -3
- package/es/components/booking/components/footer/amount.js +13 -2
- package/es/components/booking/components/footer/index.js +168 -68
- package/es/components/booking/components/footer/utils.js +62 -33
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/index.js +2 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/index.js +42 -2
- package/es/components/booking/info2/service/addService/index.js +2 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +12 -4
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.d.ts +2 -0
- package/es/components/checkout/PaymentModal.js +395 -240
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +161 -54
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/es/components/checkout/components/CashPaymentModule/index.js +114 -137
- package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +210 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
- package/es/components/checkout/components/PaymentOptionsModule/index.less +29 -0
- package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
- package/es/components/checkout/components/WalletPassModule/index.js +3 -2
- package/es/components/checkout/components/WalletPassModule/utils.js +6 -1
- package/es/components/checkout/hooks/useWalletPass.js +2 -0
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +33 -0
- package/es/components/checkout/locales.js +39 -3
- package/es/components/checkout/types.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/shoppingCart/components/Cart/Product.js +143 -71
- package/es/components/shoppingCart/components/Cart/index.js +1 -1
- package/es/components/shoppingCart/components/Cart/index.less +31 -0
- package/es/components/shoppingCart/locales.d.ts +3 -0
- package/es/components/shoppingCart/locales.js +12 -3
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +310 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +442 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
- package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
- package/es/pro/priceKeyboard/index.d.ts +3 -0
- package/es/pro/priceKeyboard/index.js +3 -0
- package/es/pro/priceKeyboard/index.less +215 -0
- package/es/pro/priceKeyboard/utils.d.ts +31 -0
- package/es/pro/priceKeyboard/utils.js +51 -0
- package/es/pro/skuDetailModal/index.js +19 -16
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/actionButtons/index.js +31 -28
- package/lib/components/booking/components/actionButtons/index.less +0 -28
- package/lib/components/booking/components/footer/amount.d.ts +3 -3
- package/lib/components/booking/components/footer/amount.js +10 -4
- package/lib/components/booking/components/footer/index.js +107 -40
- package/lib/components/booking/components/footer/utils.js +35 -7
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/addService/index.js +2 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/index.js +18 -1
- package/lib/components/booking/info2/service/addService/index.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +12 -4
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.d.ts +2 -0
- package/lib/components/checkout/PaymentModal.js +152 -73
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +114 -40
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/lib/components/checkout/components/CashPaymentModule/index.js +103 -140
- package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +172 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +29 -0
- package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
- package/lib/components/checkout/components/WalletPassModule/index.js +3 -2
- package/lib/components/checkout/components/WalletPassModule/utils.js +4 -1
- package/lib/components/checkout/hooks/useWalletPass.js +2 -0
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +33 -0
- package/lib/components/checkout/locales.js +39 -3
- package/lib/components/checkout/types.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +111 -51
- package/lib/components/shoppingCart/components/Cart/index.js +1 -1
- package/lib/components/shoppingCart/components/Cart/index.less +31 -0
- package/lib/components/shoppingCart/locales.d.ts +3 -0
- package/lib/components/shoppingCart/locales.js +6 -3
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/lib/components/ticketBooking/index.js +5 -1
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +332 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +485 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
- package/lib/pro/priceKeyboard/index.d.ts +3 -0
- package/lib/pro/priceKeyboard/index.js +45 -0
- package/lib/pro/priceKeyboard/index.less +215 -0
- package/lib/pro/priceKeyboard/utils.d.ts +31 -0
- package/lib/pro/priceKeyboard/utils.js +75 -0
- package/lib/pro/skuDetailModal/index.js +18 -22
- package/package.json +3 -3
@@ -1,4 +1,3 @@
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
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); }
|
3
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; }
|
4
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); } }
|
@@ -10,16 +9,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
10
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
11
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
11
|
import React, { useState, useEffect } from 'react';
|
13
|
-
import "./index.less";
|
14
|
-
import classNames from 'classnames';
|
15
|
-
import { Edit05 } from '@pisell/icon';
|
16
|
-
import PisellPriceKeyboardPopover from "../../../../pro/pisellPriceKeyboardPopover";
|
17
|
-
// import pisellos from "@/utils/pisellos"; // 暂时注释,使用 context 中的 pisellos
|
18
|
-
|
19
12
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
13
|
+
// @ts-ignore
|
20
14
|
import { locales, formatAmount } from '@pisell/utils';
|
21
15
|
import checkoutLocales from "../../locales";
|
22
16
|
import useToast from "../../../../hooks/useToast";
|
17
|
+
import { CashKeyboard } from "../../../../pro/priceKeyboard";
|
18
|
+
import { useDebounceFn } from 'ahooks';
|
19
|
+
import "./index.less";
|
23
20
|
export function CashPaymentModule(_ref) {
|
24
21
|
var amountSymbol = _ref.amountSymbol,
|
25
22
|
orderInfo = _ref.orderInfo,
|
@@ -31,7 +28,9 @@ export function CashPaymentModule(_ref) {
|
|
31
28
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
32
29
|
roundingFunction = _ref.roundingFunction,
|
33
30
|
_ref$balanceDueAmount = _ref.balanceDueAmount,
|
34
|
-
balanceDueAmount = _ref$balanceDueAmount === void 0 ? '0' : _ref$balanceDueAmount
|
31
|
+
balanceDueAmount = _ref$balanceDueAmount === void 0 ? '0' : _ref$balanceDueAmount,
|
32
|
+
_ref$syncingLock = _ref.syncingLock,
|
33
|
+
syncingLock = _ref$syncingLock === void 0 ? false : _ref$syncingLock;
|
35
34
|
var _useState = useState(customAmount || ''),
|
36
35
|
_useState2 = _slicedToArray(_useState, 2),
|
37
36
|
amount = _useState2[0],
|
@@ -40,21 +39,13 @@ export function CashPaymentModule(_ref) {
|
|
40
39
|
_useState4 = _slicedToArray(_useState3, 2),
|
41
40
|
roundingAmount = _useState4[0],
|
42
41
|
setRoundingAmount = _useState4[1];
|
43
|
-
var _useState5 = useState(amountButtons.length ? amountButtons : new Array(6).fill(0)),
|
44
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
45
|
-
amountList = _useState6[0],
|
46
|
-
setAmountList = _useState6[1];
|
47
|
-
useEffect(function () {
|
48
|
-
setAmountList(amountButtons.length ? amountButtons : new Array(6).fill(0));
|
49
|
-
}, [amountButtons]);
|
50
42
|
var context = useEngineContext();
|
51
|
-
// const { pisellos, action, token, store, getApp } = context.appHelper?.utils;
|
52
43
|
var Toast = useToast();
|
53
44
|
|
54
45
|
// 创建本地翻译函数,优先使用 checkout 语言包
|
55
46
|
var getText = function getText(key, fallback) {
|
56
|
-
var _context$appHelper
|
57
|
-
var currentLang = ((_context$appHelper
|
47
|
+
var _context$appHelper, _context$appHelper$ge, _context$appHelper$ge2, _context$appHelper$ut, _checkoutLocales;
|
48
|
+
var currentLang = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getApp) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.call(_context$appHelper)) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.locales) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge2 = _context$appHelper$ge.getLocale) === null || _context$appHelper$ge2 === void 0 ? void 0 : _context$appHelper$ge2.call(_context$appHelper$ge)) || ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en';
|
58
49
|
var checkoutText = (_checkoutLocales = checkoutLocales[currentLang]) === null || _checkoutLocales === void 0 ? void 0 : _checkoutLocales[key];
|
59
50
|
if (checkoutText) {
|
60
51
|
return checkoutText;
|
@@ -65,7 +56,6 @@ export function CashPaymentModule(_ref) {
|
|
65
56
|
};
|
66
57
|
useEffect(function () {
|
67
58
|
handleKeyboardConfirm(customAmount || '');
|
68
|
-
// setAmount(customAmount || '');
|
69
59
|
}, [customAmount, balanceDueAmount]);
|
70
60
|
|
71
61
|
// 检查是否应该禁用按钮:原本disabled为true 或者 订单金额为0
|
@@ -73,17 +63,11 @@ export function CashPaymentModule(_ref) {
|
|
73
63
|
|
74
64
|
// 检查是否应该禁用输入框:原本disabled为true 或者 订单金额为0
|
75
65
|
var isInputDisabled = disabled || Number(customAmount || 0) === 0;
|
76
|
-
var
|
77
|
-
if (isAmountButtonsDisabled) return;
|
78
|
-
var amountStr = clickedAmount.toString();
|
79
|
-
setAmount(amountStr);
|
80
|
-
setRoundingAmount(0);
|
81
|
-
};
|
82
|
-
var handleCashPay = function handleCashPay() {
|
66
|
+
var handleCashPayInternal = function handleCashPayInternal() {
|
83
67
|
if (isAmountButtonsDisabled) return;
|
84
68
|
if (onPaymentComplete) {
|
85
69
|
if (Number(amount) === 0 && Math.abs(roundingAmount) === 0) {
|
86
|
-
Toast.fail(getText('
|
70
|
+
Toast.fail(getText('cash-payment-amount-cannot-be-zero', 'The amount cannot be 0'));
|
87
71
|
return;
|
88
72
|
}
|
89
73
|
var finalAmount = typeof amount === 'number' ? amount : Number(amount) || 0;
|
@@ -97,6 +81,12 @@ export function CashPaymentModule(_ref) {
|
|
97
81
|
}
|
98
82
|
};
|
99
83
|
|
84
|
+
// 使用防抖,1000毫秒内不重复执行
|
85
|
+
var _useDebounceFn = useDebounceFn(handleCashPayInternal, {
|
86
|
+
wait: 500
|
87
|
+
}),
|
88
|
+
handleCashPay = _useDebounceFn.run;
|
89
|
+
|
100
90
|
// 处理键盘确认
|
101
91
|
var handleKeyboardConfirm = /*#__PURE__*/function () {
|
102
92
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
@@ -113,24 +103,23 @@ export function CashPaymentModule(_ref) {
|
|
113
103
|
setRoundingAmount(0);
|
114
104
|
return _context.abrupt("return");
|
115
105
|
case 4:
|
116
|
-
;
|
117
106
|
finalValue = String(value);
|
118
107
|
console.log('键盘确认:', finalValue);
|
119
108
|
if (!(Number(finalValue) === 0)) {
|
120
|
-
_context.next =
|
109
|
+
_context.next = 9;
|
121
110
|
break;
|
122
111
|
}
|
123
|
-
Toast.fail(getText('
|
112
|
+
Toast.fail(getText('cash-payment-amount-cannot-be-zero', 'The amount cannot be 0'));
|
124
113
|
return _context.abrupt("return");
|
125
|
-
case
|
114
|
+
case 9:
|
126
115
|
if (!(finalValue === '' || finalValue === null || finalValue === undefined)) {
|
127
|
-
_context.next =
|
116
|
+
_context.next = 13;
|
128
117
|
break;
|
129
118
|
}
|
130
119
|
setAmount('');
|
131
|
-
_context.next =
|
120
|
+
_context.next = 32;
|
132
121
|
break;
|
133
|
-
case
|
122
|
+
case 13:
|
134
123
|
// 移除可能的货币符号和多余空格
|
135
124
|
cleanValue = finalValue.replace(/[$\s]/g, '');
|
136
125
|
numValue = parseFloat(cleanValue); // 检查当前金额是否等于剩余支付金额
|
@@ -139,22 +128,22 @@ export function CashPaymentModule(_ref) {
|
|
139
128
|
finalAmount = numValue;
|
140
129
|
roundingDiff = 0;
|
141
130
|
if (!(shouldApplyRounding && roundingFunction)) {
|
142
|
-
_context.next =
|
131
|
+
_context.next = 29;
|
143
132
|
break;
|
144
133
|
}
|
145
|
-
_context.next =
|
134
|
+
_context.next = 22;
|
146
135
|
return roundingFunction(numValue);
|
147
|
-
case
|
136
|
+
case 22:
|
148
137
|
_result = _context.sent;
|
149
138
|
_ref3 = _result || {}, _ref3$roundedAmount = _ref3.roundedAmount, roundedAmount = _ref3$roundedAmount === void 0 ? numValue : _ref3$roundedAmount, _ref3$roundingDiffere = _ref3.roundingDifference, roundingDifference = _ref3$roundingDiffere === void 0 ? 0 : _ref3$roundingDiffere;
|
150
139
|
finalAmount = roundedAmount;
|
151
140
|
roundingDiff = roundingDifference;
|
152
141
|
console.log('应用抹零:', numValue, '->', roundedAmount, '差额:', roundingDifference);
|
153
|
-
_context.next =
|
142
|
+
_context.next = 30;
|
154
143
|
break;
|
155
|
-
case
|
144
|
+
case 29:
|
156
145
|
console.log('不应用抹零,用户输入金额:', numValue, '剩余支付金额:', balanceDue);
|
157
|
-
case
|
146
|
+
case 30:
|
158
147
|
setRoundingAmount(roundingDiff);
|
159
148
|
if (isNaN(numValue)) {
|
160
149
|
setAmount('');
|
@@ -162,7 +151,7 @@ export function CashPaymentModule(_ref) {
|
|
162
151
|
setAmount(finalAmount.toString());
|
163
152
|
console.log('设置金额为:', finalAmount);
|
164
153
|
}
|
165
|
-
case
|
154
|
+
case 32:
|
166
155
|
case "end":
|
167
156
|
return _context.stop();
|
168
157
|
}
|
@@ -173,103 +162,91 @@ export function CashPaymentModule(_ref) {
|
|
173
162
|
};
|
174
163
|
}();
|
175
164
|
|
176
|
-
//
|
177
|
-
var
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
165
|
+
// 重置功能 - 重置为待支付金额,保留抹零
|
166
|
+
var handleReset = /*#__PURE__*/function () {
|
167
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
168
|
+
var resetAmount, cleanValue, numValue, balanceDue, shouldApplyRounding, finalAmount, roundingDiff, _result2, _ref5, _ref5$roundedAmount, roundedAmount, _ref5$roundingDiffere, roundingDifference;
|
169
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
170
|
+
while (1) switch (_context2.prev = _context2.next) {
|
171
|
+
case 0:
|
172
|
+
if (!isAmountButtonsDisabled) {
|
173
|
+
_context2.next = 2;
|
174
|
+
break;
|
175
|
+
}
|
176
|
+
return _context2.abrupt("return");
|
177
|
+
case 2:
|
178
|
+
resetAmount = balanceDueAmount || '0'; // 移除可能的货币符号和多余空格
|
179
|
+
cleanValue = resetAmount.replace(/[$\s]/g, '');
|
180
|
+
numValue = parseFloat(cleanValue); // 检查当前金额是否等于剩余支付金额
|
181
|
+
balanceDue = parseFloat(balanceDueAmount);
|
182
|
+
shouldApplyRounding = Math.abs(numValue - balanceDue) < 0.01; // 使用小数精度比较
|
183
|
+
finalAmount = numValue;
|
184
|
+
roundingDiff = 0;
|
185
|
+
if (!(shouldApplyRounding && roundingFunction)) {
|
186
|
+
_context2.next = 19;
|
187
|
+
break;
|
188
|
+
}
|
189
|
+
_context2.next = 12;
|
190
|
+
return roundingFunction(finalAmount);
|
191
|
+
case 12:
|
192
|
+
_result2 = _context2.sent;
|
193
|
+
_ref5 = _result2 || {}, _ref5$roundedAmount = _ref5.roundedAmount, roundedAmount = _ref5$roundedAmount === void 0 ? numValue : _ref5$roundedAmount, _ref5$roundingDiffere = _ref5.roundingDifference, roundingDifference = _ref5$roundingDiffere === void 0 ? 0 : _ref5$roundingDiffere;
|
194
|
+
finalAmount = roundedAmount;
|
195
|
+
roundingDiff = roundingDifference;
|
196
|
+
console.log('应用抹零:', numValue, '->', roundedAmount, '差额:', roundingDifference);
|
197
|
+
_context2.next = 20;
|
198
|
+
break;
|
199
|
+
case 19:
|
200
|
+
console.log('不应用抹零,用户输入金额:', numValue, '剩余支付金额:', balanceDue);
|
201
|
+
case 20:
|
202
|
+
setAmount(finalAmount.toString());
|
203
|
+
setRoundingAmount(roundingDiff);
|
204
|
+
case 22:
|
205
|
+
case "end":
|
206
|
+
return _context2.stop();
|
207
|
+
}
|
208
|
+
}, _callee2);
|
209
|
+
}));
|
210
|
+
return function handleReset() {
|
211
|
+
return _ref4.apply(this, arguments);
|
212
|
+
};
|
213
|
+
}();
|
214
|
+
return /*#__PURE__*/React.createElement(CashKeyboard, {
|
215
|
+
variant: "intact"
|
216
|
+
// 原价格:订单的待支付金额
|
208
217
|
,
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
})
|
228
|
-
}, /*#__PURE__*/React.createElement("span", {
|
229
|
-
className: classNames('cash-pay-currency-symbol', {
|
230
|
-
'cash-pay-currency-symbol--disabled': isInputDisabled
|
231
|
-
})
|
232
|
-
}, amountSymbol), /*#__PURE__*/React.createElement("div", {
|
233
|
-
className: classNames('cash-pay-amount-display', {
|
234
|
-
'cash-pay-amount-display--disabled': isInputDisabled
|
235
|
-
})
|
236
|
-
}, amount || '0.00')))), /*#__PURE__*/React.createElement("div", _extends({
|
237
|
-
className: classNames('cash-pay-button', {
|
238
|
-
'cash-pay-button--disabled': isAmountButtonsDisabled
|
239
|
-
})
|
240
|
-
}, isAmountButtonsDisabled ? {} : {
|
241
|
-
onClick: handleCashPay
|
242
|
-
}, {
|
243
|
-
style: {
|
244
|
-
cursor: isAmountButtonsDisabled ? 'not-allowed' : 'pointer'
|
245
|
-
}
|
246
|
-
}), /*#__PURE__*/React.createElement("div", {
|
247
|
-
className: classNames('cash-pay-button-text', {
|
248
|
-
'cash-pay-button-text--disabled': isAmountButtonsDisabled
|
249
|
-
})
|
250
|
-
}, getText('cash.payment') || 'Cash Pay'))), /*#__PURE__*/React.createElement("div", {
|
251
|
-
className: classNames('cash-pay-amount-button-grid', {
|
252
|
-
'cash-pay-amount-button-grid--disabled': isAmountButtonsDisabled
|
253
|
-
})
|
254
|
-
}, amountList.slice(0, 6).map(function (amount, index) {
|
255
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
256
|
-
key: index,
|
257
|
-
className: classNames('cash-pay-amount-button', {
|
258
|
-
'cash-pay-amount-button--disabled': isAmountButtonsDisabled
|
259
|
-
})
|
260
|
-
}, isAmountButtonsDisabled ? {} : {
|
261
|
-
onClick: function onClick() {
|
262
|
-
return handleAmountClick(amount);
|
263
|
-
}
|
264
|
-
}, {
|
265
|
-
style: {
|
266
|
-
cursor: isAmountButtonsDisabled ? 'not-allowed' : 'pointer'
|
218
|
+
originalValue: customAmount
|
219
|
+
// 当前值:实收现金(cash recevie)
|
220
|
+
,
|
221
|
+
value: amount,
|
222
|
+
disabled: disabled,
|
223
|
+
hiddenChangeDue: roundingAmount > 0,
|
224
|
+
onChange: function onChange(value) {
|
225
|
+
setAmount(value);
|
226
|
+
setRoundingAmount(0);
|
227
|
+
},
|
228
|
+
titleArea: {
|
229
|
+
visible: true,
|
230
|
+
title: {
|
231
|
+
text: getText('cash-payment-title', 'Cash Payment')
|
232
|
+
},
|
233
|
+
subtitle: {
|
234
|
+
visible: Math.abs(roundingAmount) > 0,
|
235
|
+
text: "".concat(getText('cash-payment-rounding', 'Rounding'), ": ").concat(formatAmount(roundingAmount, 2, amountSymbol))
|
267
236
|
}
|
268
|
-
}
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
},
|
273
|
-
|
237
|
+
},
|
238
|
+
style: {
|
239
|
+
width: '100%',
|
240
|
+
backgroundColor: 'transparent'
|
241
|
+
},
|
242
|
+
presets: amountButtons.slice(0, 5).map(function (buttonAmount) {
|
243
|
+
return {
|
244
|
+
label: formatAmount(buttonAmount, 2, amountSymbol),
|
245
|
+
value: buttonAmount
|
246
|
+
};
|
247
|
+
}),
|
248
|
+
onReset: handleReset,
|
249
|
+
onEnter: syncingLock ? undefined : handleCashPay
|
250
|
+
});
|
274
251
|
}
|
275
252
|
export default CashPaymentModule;
|