@pisell/private-materials 3.2.21 → 3.2.23
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 +13 -13
- 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/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +36 -17
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +238 -0
- package/es/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +46 -9
- package/es/components/appointmentBooking/hooks.js +162 -121
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +57 -0
- package/es/components/appointmentBooking/locales.js +60 -3
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +71 -2
- package/es/components/booking/addons/index.js +1 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +5 -1
- package/es/components/booking/components/footer/utils.js +18 -2
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +238 -0
- package/es/components/booking/components/voucher/index.less +88 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +115 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +9 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/locales.d.ts +18 -0
- package/es/components/booking/locales.js +21 -3
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/payments/index.js +1 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/wallet/Detail/index.js +20 -14
- package/es/components/wallet/Voucher/index.js +1 -0
- package/es/components/wallet/index.js +15 -1
- package/es/components/wallet/locales.d.ts +3 -0
- package/es/components/wallet/locales.js +3 -0
- package/es/components/wallet/model.d.ts +1 -1
- package/es/components/wallet/utils/formatUtils.js +1 -1
- package/es/components/walletList/index.js +5 -1
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +24 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +221 -0
- package/lib/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +46 -9
- package/lib/components/appointmentBooking/hooks.js +36 -43
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +57 -0
- package/lib/components/appointmentBooking/locales.js +60 -3
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +42 -2
- package/lib/components/booking/addons/index.js +1 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +2 -1
- package/lib/components/booking/components/footer/utils.js +4 -1
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +222 -0
- package/lib/components/booking/components/voucher/index.less +88 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +109 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +8 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/locales.d.ts +18 -0
- package/lib/components/booking/locales.js +21 -3
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/wallet/Detail/index.js +6 -1
- package/lib/components/wallet/Voucher/index.js +1 -0
- package/lib/components/wallet/index.js +15 -1
- package/lib/components/wallet/locales.d.ts +3 -0
- package/lib/components/wallet/locales.js +3 -0
- package/lib/components/wallet/model.d.ts +1 -1
- package/lib/components/wallet/utils/formatUtils.js +1 -1
- package/lib/components/walletList/index.js +6 -2
- package/package.json +3 -3
|
@@ -0,0 +1,238 @@
|
|
|
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 _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; }
|
|
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); } }
|
|
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); }); }; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
17
|
+
import ChevronDown from '@pisell/icon/es/ChevronDown';
|
|
18
|
+
import UserCircle from '@pisell/icon/es/UserCircle';
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import { Button } from 'antd';
|
|
21
|
+
import { locales } from '@pisell/utils';
|
|
22
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
23
|
+
import { PisellInput, PisellTooltip, PisellGoodPassCard, PisellText, PisellToast } from '@pisell/materials';
|
|
24
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
25
|
+
import { useAppointmentBooking, useShopDiscount, useAppointmentBookingLogin, useAppointmentBookingAccount } from "../../hooks";
|
|
26
|
+
import { formatCustomer } from "../../utils";
|
|
27
|
+
import "../../../booking/components/voucher/index.less";
|
|
28
|
+
import "./index.less";
|
|
29
|
+
var ShopDiscountHooks = {
|
|
30
|
+
onInited: 'shopDiscount:onInited',
|
|
31
|
+
onDestroy: 'shopDiscount:onDestroy',
|
|
32
|
+
onLoadDiscountList: 'shopDiscount:onLoadDiscountList',
|
|
33
|
+
onCustomerChange: 'shopDiscount:onCustomerChange',
|
|
34
|
+
onDiscountListChange: 'shopDiscount:onDiscountListChange',
|
|
35
|
+
onRulesListChange: 'shopDiscount:onRulesListChange',
|
|
36
|
+
onLoadPrepareCalcResult: 'shopDiscount:onLoadPrepareCalcResult'
|
|
37
|
+
};
|
|
38
|
+
var VoucherCard = function VoucherCard(props) {
|
|
39
|
+
var _context$appHelper, _appointmentBooking$s;
|
|
40
|
+
var products = props.products,
|
|
41
|
+
currentUser = props.currentUser;
|
|
42
|
+
var context = useEngineContext();
|
|
43
|
+
var appointmentBooking = useAppointmentBooking();
|
|
44
|
+
var shopDiscount = useShopDiscount();
|
|
45
|
+
var _useState = useState(true),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
showDetail = _useState2[0],
|
|
48
|
+
setShowDetail = _useState2[1];
|
|
49
|
+
// const { state, dispatch } = props;
|
|
50
|
+
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
51
|
+
pisellos = _context$appHelper$ut.pisellos,
|
|
52
|
+
action = _context$appHelper$ut.action,
|
|
53
|
+
token = _context$appHelper$ut.token,
|
|
54
|
+
store = _context$appHelper$ut.store;
|
|
55
|
+
var _ref = context.appHelper || {},
|
|
56
|
+
utils = _ref.utils;
|
|
57
|
+
var _useState3 = useState(''),
|
|
58
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
|
+
code = _useState4[0],
|
|
60
|
+
setCode = _useState4[1];
|
|
61
|
+
var _useState5 = useState([]),
|
|
62
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
63
|
+
discountList = _useState6[0],
|
|
64
|
+
setDisCountList = _useState6[1];
|
|
65
|
+
var productRef = useRef(products);
|
|
66
|
+
var _useAppointmentBookin = useAppointmentBookingLogin(),
|
|
67
|
+
openLoginModal = _useAppointmentBookin.openLoginModal;
|
|
68
|
+
var _useAppointmentBookin2 = useAppointmentBookingAccount(),
|
|
69
|
+
accountLists = _useAppointmentBookin2.accountLists;
|
|
70
|
+
var cart = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.cart;
|
|
71
|
+
var isUserLoggedIn = useMemo(function () {
|
|
72
|
+
var _utils$token, _utils$token$get;
|
|
73
|
+
return !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token)) || false;
|
|
74
|
+
}, [store]);
|
|
75
|
+
var availableData = useMemo(function () {
|
|
76
|
+
return discountList.filter(function (item) {
|
|
77
|
+
return !!item.isAvailable;
|
|
78
|
+
}).map(function (discount) {
|
|
79
|
+
return _objectSpread(_objectSpread({}, discount), {}, {
|
|
80
|
+
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}, [discountList]);
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
if (isUserLoggedIn) {
|
|
86
|
+
var _shopDiscount = pisellos.getModule('shopDiscount');
|
|
87
|
+
_shopDiscount.setCustomer(currentUser);
|
|
88
|
+
}
|
|
89
|
+
}, [currentUser.id, isUserLoggedIn]);
|
|
90
|
+
|
|
91
|
+
// // 设置productList
|
|
92
|
+
useEffect(function () {
|
|
93
|
+
shopDiscount.setProductList(products);
|
|
94
|
+
}, [products]);
|
|
95
|
+
var onCartChange = function onCartChange() {
|
|
96
|
+
var products = cart === null || cart === void 0 ? void 0 : cart.getItems();
|
|
97
|
+
var val = shopDiscount.calcDiscount(products);
|
|
98
|
+
cart === null || cart === void 0 || cart.batchSetItems(val.productList);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// // 监听customer变化
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
var val = shopDiscount.getDiscountList();
|
|
104
|
+
setDisCountList(val);
|
|
105
|
+
pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, function (result) {
|
|
106
|
+
cart === null || cart === void 0 || cart.batchSetItems(result.productList);
|
|
107
|
+
});
|
|
108
|
+
pisellos.effects.on('appointmentBooking_cart:onAddItem', onCartChange);
|
|
109
|
+
pisellos.effects.on('appointmentBooking_cart:onRemoveItem', onCartChange);
|
|
110
|
+
pisellos.effects.on(ShopDiscountHooks.onDiscountListChange, function (discount) {
|
|
111
|
+
console.log(discount, 'discountChange');
|
|
112
|
+
setDisCountList(discount);
|
|
113
|
+
});
|
|
114
|
+
}, []);
|
|
115
|
+
|
|
116
|
+
// // apply code
|
|
117
|
+
var onScanCode = /*#__PURE__*/function () {
|
|
118
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
119
|
+
var val;
|
|
120
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
121
|
+
while (1) switch (_context.prev = _context.next) {
|
|
122
|
+
case 0:
|
|
123
|
+
_context.next = 2;
|
|
124
|
+
return shopDiscount.scanCode(code);
|
|
125
|
+
case 2:
|
|
126
|
+
val = _context.sent;
|
|
127
|
+
if (val !== null && val !== void 0 && val.isAvailable) {
|
|
128
|
+
cart === null || cart === void 0 || cart.batchSetItems(val.productList);
|
|
129
|
+
} else {
|
|
130
|
+
PisellToast({
|
|
131
|
+
content: locales.getText('pisell2.text.goodpass.code-invalid')
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
case 4:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
137
|
+
}
|
|
138
|
+
}, _callee);
|
|
139
|
+
}));
|
|
140
|
+
return function onScanCode() {
|
|
141
|
+
return _ref2.apply(this, arguments);
|
|
142
|
+
};
|
|
143
|
+
}();
|
|
144
|
+
var renderLoginCard = function renderLoginCard() {
|
|
145
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
className: "login-card"
|
|
147
|
+
}, /*#__PURE__*/React.createElement(UserCircle, {
|
|
148
|
+
style: {
|
|
149
|
+
fontSize: 28
|
|
150
|
+
}
|
|
151
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
className: "text-wrapper"
|
|
153
|
+
}, /*#__PURE__*/React.createElement(PisellText, {
|
|
154
|
+
className: "login-btn",
|
|
155
|
+
onClick: function onClick() {
|
|
156
|
+
if (!action) return;
|
|
157
|
+
openLoginModal({
|
|
158
|
+
callback: function callback(status) {
|
|
159
|
+
var _utils$store;
|
|
160
|
+
var user = (_utils$store = utils.store) === null || _utils$store === void 0 || (_utils$store = _utils$store.getState()) === null || _utils$store === void 0 || (_utils$store = _utils$store.global) === null || _utils$store === void 0 ? void 0 : _utils$store.userInfo;
|
|
161
|
+
var currentUser = formatCustomer(user);
|
|
162
|
+
var meAccount = accountLists === null || accountLists === void 0 ? void 0 : accountLists.find(function (d) {
|
|
163
|
+
return !(d !== null && d !== void 0 && d.isGuest);
|
|
164
|
+
});
|
|
165
|
+
if (status === 'success') {
|
|
166
|
+
appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}, locales.getText('pisell2.text.goodpass.login')), /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.goodpass.login-tip'))));
|
|
172
|
+
};
|
|
173
|
+
var renderVoucherInfo = function renderVoucherInfo() {
|
|
174
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
175
|
+
className: "voucher-title"
|
|
176
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
177
|
+
className: "voucher-title-left"
|
|
178
|
+
}, locales.getText('pisell2.text.goodpass')), /*#__PURE__*/React.createElement("span", {
|
|
179
|
+
className: "voucher-title-right",
|
|
180
|
+
onClick: function onClick() {
|
|
181
|
+
console.log('showDetail: ', showDetail);
|
|
182
|
+
setShowDetail(!showDetail);
|
|
183
|
+
}
|
|
184
|
+
}, locales.getText('pisell2.text.details'), ' ', /*#__PURE__*/React.createElement(ChevronDown, {
|
|
185
|
+
className: classNames('voucher-right-icon', {
|
|
186
|
+
show: showDetail
|
|
187
|
+
})
|
|
188
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
189
|
+
className: classNames('voucher-detail', {
|
|
190
|
+
show: showDetail
|
|
191
|
+
})
|
|
192
|
+
}, (availableData === null || availableData === void 0 ? void 0 : availableData.length) > 0 ? /*#__PURE__*/React.createElement(PisellGoodPassCard, {
|
|
193
|
+
style: {
|
|
194
|
+
width: '100%'
|
|
195
|
+
},
|
|
196
|
+
dataSource: availableData,
|
|
197
|
+
onChange: function onChange(val) {
|
|
198
|
+
var _appointmentBooking$s2;
|
|
199
|
+
var detail = shopDiscount.setDiscountSelected({
|
|
200
|
+
discountId: val.id,
|
|
201
|
+
isSelected: val.isSelected
|
|
202
|
+
});
|
|
203
|
+
appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.cart) === null || _appointmentBooking$s2 === void 0 || _appointmentBooking$s2.batchSetItems(detail.productList);
|
|
204
|
+
}
|
|
205
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
206
|
+
className: "voucher-code-input-wrapper"
|
|
207
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
208
|
+
className: "voucher-code-input"
|
|
209
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
style: {
|
|
211
|
+
whiteSpace: 'nowrap'
|
|
212
|
+
}
|
|
213
|
+
}, locales.getText('pisell2.text.goodpass.code'), ":"), /*#__PURE__*/React.createElement(PisellInput, {
|
|
214
|
+
value: code,
|
|
215
|
+
onChange: function onChange(e) {
|
|
216
|
+
var _e$target;
|
|
217
|
+
setCode((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
218
|
+
},
|
|
219
|
+
size: "small",
|
|
220
|
+
placeholder: locales.getText('pisell2.text.goodpass.enter-code'),
|
|
221
|
+
suffix: /*#__PURE__*/React.createElement(PisellTooltip, {
|
|
222
|
+
title: ""
|
|
223
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
224
|
+
style: {
|
|
225
|
+
color: 'rgba(0,0,0,.45)'
|
|
226
|
+
}
|
|
227
|
+
}))
|
|
228
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
229
|
+
size: "small",
|
|
230
|
+
onClick: onScanCode,
|
|
231
|
+
disabled: !code
|
|
232
|
+
}, locales.getText('pisell2.text.apply')))));
|
|
233
|
+
};
|
|
234
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
className: "pisell-lowcode__booking-footer-voucher-container"
|
|
236
|
+
}, isUserLoggedIn ? renderVoucherInfo() : renderLoginCard());
|
|
237
|
+
};
|
|
238
|
+
export default VoucherCard;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.pisell-lowcode__booking-footer-voucher-container {
|
|
2
|
+
.login-card {
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
5
|
+
background: #fff;
|
|
6
|
+
display: flex;
|
|
7
|
+
padding: 12px;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 10px;
|
|
11
|
+
color: var(--Gray-500, #667085);
|
|
12
|
+
font-family: Inter;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
|
|
17
|
+
.text-wrapper {
|
|
18
|
+
max-width: 200px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.login-btn {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
color: #8157d5;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -19,6 +19,8 @@ interface AppointmentBookingContextType {
|
|
|
19
19
|
symbolic?: any;
|
|
20
20
|
resourceOtherParams?: any;
|
|
21
21
|
setResourceOtherParams: (val: any) => void;
|
|
22
|
+
selectedTime: any;
|
|
23
|
+
setSelectedTime: (val: any) => void;
|
|
22
24
|
}
|
|
23
25
|
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
24
26
|
children: ReactNode;
|
|
@@ -46,6 +46,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
46
46
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
47
47
|
resourceOtherParams = _useState16[0],
|
|
48
48
|
setResourceOtherParams = _useState16[1];
|
|
49
|
+
var _useState17 = useState(null),
|
|
50
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
51
|
+
selectedTime = _useState18[0],
|
|
52
|
+
setSelectedTime = _useState18[1];
|
|
49
53
|
var _useEngineContext = useEngineContext(),
|
|
50
54
|
appHelper = _useEngineContext.appHelper;
|
|
51
55
|
var symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
|
|
@@ -69,7 +73,9 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
69
73
|
appHelper: appHelper,
|
|
70
74
|
symbolic: symbolic,
|
|
71
75
|
resourceOtherParams: resourceOtherParams,
|
|
72
|
-
setResourceOtherParams: setResourceOtherParams
|
|
76
|
+
setResourceOtherParams: setResourceOtherParams,
|
|
77
|
+
selectedTime: selectedTime,
|
|
78
|
+
setSelectedTime: setSelectedTime
|
|
73
79
|
};
|
|
74
80
|
return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
|
|
75
81
|
value: value
|
|
@@ -1,24 +1,61 @@
|
|
|
1
1
|
export declare const useAppointmentBooking: () => any;
|
|
2
|
+
export declare const useShopDiscount: () => any;
|
|
3
|
+
/**
|
|
4
|
+
* @title: 监听步骤发生变化
|
|
5
|
+
* @description:
|
|
6
|
+
* @return {*}
|
|
7
|
+
* @Author: WangHan
|
|
8
|
+
* @Date: 2025-04-15 11:11
|
|
9
|
+
*/
|
|
2
10
|
export declare const useAppointmentBookingStep: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* @title: 获取商品数据
|
|
13
|
+
* @description:
|
|
14
|
+
* @return {*}
|
|
15
|
+
* @Author: WangHan
|
|
16
|
+
* @Date: 2025-04-15 11:12
|
|
17
|
+
*/
|
|
3
18
|
export declare const useAppointmentBookingProduct: () => void;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @title: 更新购物车数据
|
|
21
|
+
* @description:
|
|
22
|
+
* @return {*}
|
|
23
|
+
* @Author: WangHan
|
|
24
|
+
* @Date: 2025-04-15 11:12
|
|
25
|
+
*/
|
|
26
|
+
export declare const useAppointmentBookingCart: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @title: 获取登录状态
|
|
29
|
+
* @description:
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: WangHan
|
|
32
|
+
* @Date: 2025-04-15 11:14
|
|
33
|
+
*/
|
|
7
34
|
export declare const useAppointmentBookingLogin: () => {
|
|
8
35
|
isLogin: boolean;
|
|
9
36
|
openLoginModal: (params: {
|
|
10
37
|
callback: any;
|
|
11
38
|
}) => void;
|
|
12
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* @title: 获取账户
|
|
42
|
+
* @description:
|
|
43
|
+
* @return {*}
|
|
44
|
+
* @Author: WangHan
|
|
45
|
+
* @Date: 2025-04-15 11:15
|
|
46
|
+
*/
|
|
13
47
|
export declare const useAppointmentBookingAccount: () => {
|
|
14
|
-
currentUser: {
|
|
15
|
-
id: any;
|
|
16
|
-
username: string;
|
|
17
|
-
};
|
|
18
48
|
accountLists: any;
|
|
19
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* @title: 获取资源数据
|
|
52
|
+
* @description:
|
|
53
|
+
* @return {*}
|
|
54
|
+
* @Author: WangHan
|
|
55
|
+
* @Date: 2025-04-15 11:29
|
|
56
|
+
*/
|
|
20
57
|
export declare const useAppointmentBookingResource: () => {
|
|
21
58
|
getResourceTimeSlot: (params: any) => Promise<void>;
|
|
22
|
-
getResourceList: () =>
|
|
23
|
-
autoSelectAllProductResources: (code: string) => Promise<
|
|
59
|
+
getResourceList: () => any;
|
|
60
|
+
autoSelectAllProductResources: (code: string) => Promise<any>;
|
|
24
61
|
};
|