@pisell/private-materials 3.3.33 → 3.3.34
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 +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +25 -4
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +25 -45
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +36 -53
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Form/index.js +161 -61
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +50 -64
- package/es/components/appointmentBooking/components/Resource/index.js +102 -119
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +12 -5
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/context.js +3 -43
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/hooks.d.ts +3 -2
- package/es/components/appointmentBooking/hooks.js +209 -293
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.d.ts +2 -88
- package/es/components/appointmentBooking/utils.js +63 -325
- package/es/components/booking/addons/model.js +5 -5
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- 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 +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/es/hooks/useComponents.js +1 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +5 -0
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +9 -33
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +21 -35
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Form/index.js +98 -54
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +20 -39
- package/lib/components/appointmentBooking/components/Resource/index.js +59 -41
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -1
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/context.js +4 -48
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/hooks.d.ts +3 -2
- package/lib/components/appointmentBooking/hooks.js +57 -143
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.d.ts +2 -88
- package/lib/components/appointmentBooking/utils.js +51 -191
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- 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 +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +0 -77
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +0 -69
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
|
@@ -1,40 +1,34 @@
|
|
|
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
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 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; }
|
|
4
|
-
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; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
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); }
|
|
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); }); }; }
|
|
10
5
|
import React, { useMemo } from 'react';
|
|
11
6
|
import { locales } from '@pisell/utils';
|
|
12
7
|
import ProgressBar from "../../../eventBooking/components/progressBar";
|
|
13
8
|
import { useAppointmentBookingContext } from "../../context";
|
|
14
|
-
import { useShopDiscount, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct
|
|
9
|
+
import { useShopDiscount, useIsSkipResourceStep, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct } from "../../hooks";
|
|
15
10
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
16
|
-
import { getResourceTitle } from "../../utils";
|
|
17
11
|
import "./index.less";
|
|
18
12
|
var Header = function Header() {
|
|
19
13
|
var _currentStep$step3;
|
|
20
|
-
var
|
|
21
|
-
currentStep =
|
|
22
|
-
appointmentBooking =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
currentSelectedResourcesRef = _ref.currentSelectedResourcesRef;
|
|
14
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
15
|
+
currentStep = _useAppointmentBookin.currentStep,
|
|
16
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
17
|
+
resources = _useAppointmentBookin.resources,
|
|
18
|
+
setTimes = _useAppointmentBookin.setTimes,
|
|
19
|
+
carts = _useAppointmentBookin.carts;
|
|
27
20
|
var shopDiscount = useShopDiscount();
|
|
28
21
|
var context = useEngineContext();
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var _useAppointmentBookin3 =
|
|
36
|
-
|
|
37
|
-
var
|
|
22
|
+
var _useIsSkipResourceSte = useIsSkipResourceStep(),
|
|
23
|
+
checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
|
|
24
|
+
var _useAppointmentBookin2 = useAppointmentBookingStep(),
|
|
25
|
+
getStepIndex = _useAppointmentBookin2.getStepIndex,
|
|
26
|
+
stepList = _useAppointmentBookin2.stepList,
|
|
27
|
+
updateStep = _useAppointmentBookin2.updateStep;
|
|
28
|
+
var _useAppointmentBookin3 = useAppointmentBookingSetting(),
|
|
29
|
+
setOtherData = _useAppointmentBookin3.setOtherData;
|
|
30
|
+
var _useAppointmentBookin4 = useAppointmentBookingProduct(),
|
|
31
|
+
checkProductType = _useAppointmentBookin4.checkProductType;
|
|
38
32
|
|
|
39
33
|
/**
|
|
40
34
|
* @title: 获取资源名称
|
|
@@ -50,15 +44,13 @@ var Header = function Header() {
|
|
|
50
44
|
if (!key) return '';
|
|
51
45
|
|
|
52
46
|
// 选择资源则获取资源列表的第一个名称
|
|
53
|
-
if (key
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var resourceItem = (currentResource === null || currentResource === void 0 ? void 0 : currentResource.resourceItem) || {};
|
|
57
|
-
var name = getResourceTitle(appointmentBooking, resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.code, utils, resourceItem);
|
|
47
|
+
if (key === 'select-resource') {
|
|
48
|
+
var _resources$;
|
|
49
|
+
var name = (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.title) || '';
|
|
58
50
|
return locales.getText('pisell2.event.select.category')(name);
|
|
59
51
|
}
|
|
60
52
|
return (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description) || '';
|
|
61
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key,
|
|
53
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, resources]);
|
|
62
54
|
|
|
63
55
|
/**
|
|
64
56
|
* @title: 返回
|
|
@@ -68,9 +60,9 @@ var Header = function Header() {
|
|
|
68
60
|
* @Date: 2025-01-18 22:28
|
|
69
61
|
*/
|
|
70
62
|
var handleBack = /*#__PURE__*/function () {
|
|
71
|
-
var
|
|
63
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
72
64
|
var _currentStep$step4;
|
|
73
|
-
var key, types, _carts$, type,
|
|
65
|
+
var key, types, _carts$, type, resourceStep;
|
|
74
66
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
75
67
|
while (1) switch (_context.prev = _context.next) {
|
|
76
68
|
case 0:
|
|
@@ -107,54 +99,48 @@ var Header = function Header() {
|
|
|
107
99
|
if (key === 'select-time') {
|
|
108
100
|
setTimes([]);
|
|
109
101
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (key.startsWith('fill-form')) {
|
|
113
|
-
form_key = 'booking_form';
|
|
114
|
-
booking_form = getOtherData(form_key);
|
|
115
|
-
setOtherData(form_key, _objectSpread(_objectSpread({}, booking_form), {}, _defineProperty({}, key, {})));
|
|
102
|
+
if (key === 'fill-form') {
|
|
103
|
+
setOtherData('booking_form', {});
|
|
116
104
|
}
|
|
117
105
|
|
|
118
|
-
//
|
|
119
|
-
// const
|
|
120
|
-
//
|
|
121
|
-
//
|
|
106
|
+
// // 5. 判断是否需要跳过资源步骤
|
|
107
|
+
// const isHasForm = stepList?.some((item: any) => item.key === 'fill-form');
|
|
108
|
+
// const shouldCheckSkip =
|
|
109
|
+
// (isHasForm && key === 'fill-form') || key === 'select-time';
|
|
110
|
+
|
|
111
|
+
// if (shouldCheckSkip) {
|
|
112
|
+
// const skipResourceStep = await checkSkipResourceStep(true);
|
|
113
|
+
// if (skipResourceStep) {
|
|
114
|
+
// appointmentBooking.deleteCartItemInfo('resource');
|
|
115
|
+
// const targetIndex = getStepIndex('prev', 2);
|
|
116
|
+
// return appointmentBooking.gotoStep(targetIndex);
|
|
117
|
+
// }
|
|
122
118
|
// }
|
|
123
119
|
|
|
120
|
+
// 如果前一步是资源步骤,并且被跳过了,则清空资源
|
|
121
|
+
resourceStep = stepList[(currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) - 1];
|
|
122
|
+
if (resourceStep !== null && resourceStep !== void 0 && resourceStep.isSkip && (resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-resource') {
|
|
123
|
+
appointmentBooking.deleteCartItemInfo('resource');
|
|
124
|
+
}
|
|
125
|
+
|
|
124
126
|
// 6. 默认回退一步
|
|
125
127
|
appointmentBooking.back();
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (_key === 'select-resource') {
|
|
132
|
-
appointmentBooking.deleteCartItemInfo('resource');
|
|
133
|
-
}
|
|
134
|
-
updateStep(_key, {
|
|
128
|
+
|
|
129
|
+
// 再次将步骤更新为false, 增加这个判断为了跳过那一步没有设置holder,但是直接后退了
|
|
130
|
+
if (resourceStep !== null && resourceStep !== void 0 && resourceStep.isSkip && ((resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-resource' || (resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-service')) {
|
|
131
|
+
updateStep(resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key, {
|
|
132
|
+
index: currentStep === null || currentStep === void 0 ? void 0 : currentStep.index,
|
|
135
133
|
isSkip: false
|
|
136
134
|
});
|
|
137
135
|
}
|
|
138
|
-
|
|
139
|
-
// 再次将步骤更新为false, 增加这个判断为了跳过那一步没有设置holder,但是直接后退了
|
|
140
|
-
// if (
|
|
141
|
-
// resourceStep?.isSkip &&
|
|
142
|
-
// (resourceStep?.key === 'select-resource' ||
|
|
143
|
-
// resourceStep?.key === 'select-service')
|
|
144
|
-
// ) {
|
|
145
|
-
// updateStep(resourceStep?.key, {
|
|
146
|
-
// index: currentStep?.index,
|
|
147
|
-
// isSkip: false,
|
|
148
|
-
// });
|
|
149
|
-
// }
|
|
150
|
-
case 17:
|
|
136
|
+
case 16:
|
|
151
137
|
case "end":
|
|
152
138
|
return _context.stop();
|
|
153
139
|
}
|
|
154
140
|
}, _callee);
|
|
155
141
|
}));
|
|
156
142
|
return function handleBack() {
|
|
157
|
-
return
|
|
143
|
+
return _ref.apply(this, arguments);
|
|
158
144
|
};
|
|
159
145
|
}();
|
|
160
146
|
|
|
@@ -19,7 +19,9 @@ import ResourceDisplay from "../../../eventBooking/components/resourceDisplay";
|
|
|
19
19
|
import { PisellCustomCheckboxGroup } from '@pisell/materials';
|
|
20
20
|
import { useAppointmentBookingResource, useIsSkipResourceStep, useAppointmentBookingStep, useAppointmentBookingLogin, contextUtils, useAppointmentBookingAccount, useAppointmentBookingSetting } from "../../hooks";
|
|
21
21
|
import { useAppointmentBookingContext } from "../../context";
|
|
22
|
-
import {
|
|
22
|
+
import { checkHasFormStep, formatCartsResources } from "../../utils";
|
|
23
|
+
import { checkResource, checkHolder } from "../../components/Cart/utils";
|
|
24
|
+
import { scrollToFirstErrorCard } from "./utils";
|
|
23
25
|
import guestsImg from "../../assets/guests.svg";
|
|
24
26
|
import { isMobile, locales } from '@pisell/utils';
|
|
25
27
|
import "./index.less";
|
|
@@ -28,87 +30,98 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
28
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
31
|
selectedResource = _useState2[0],
|
|
30
32
|
setSelectedResource = _useState2[1];
|
|
31
|
-
var
|
|
32
|
-
appointmentBooking =
|
|
33
|
-
carts =
|
|
34
|
-
resourceOtherParams =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
34
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
35
|
+
carts = _useAppointmentBookin.carts,
|
|
36
|
+
resourceOtherParams = _useAppointmentBookin.resourceOtherParams,
|
|
37
|
+
setCarts = _useAppointmentBookin.setCarts,
|
|
38
|
+
currentStep = _useAppointmentBookin.currentStep,
|
|
39
|
+
setResourceOtherParams = _useAppointmentBookin.setResourceOtherParams,
|
|
40
|
+
setIsErrorHolder = _useAppointmentBookin.setIsErrorHolder,
|
|
41
|
+
setPolicyIds = _useAppointmentBookin.setPolicyIds;
|
|
42
|
+
var _useAppointmentBookin2 = useAppointmentBookingResource(),
|
|
43
|
+
getResourceList = _useAppointmentBookin2.getResourceList,
|
|
44
|
+
autoSelectAllProductResources = _useAppointmentBookin2.autoSelectAllProductResources,
|
|
45
|
+
getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot;
|
|
42
46
|
var _useIsSkipResourceSte = useIsSkipResourceStep(),
|
|
43
47
|
checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
|
|
44
|
-
var
|
|
45
|
-
updateStep =
|
|
46
|
-
nextStep =
|
|
47
|
-
var
|
|
48
|
-
openLoginModal =
|
|
49
|
-
isLogin =
|
|
50
|
-
var
|
|
51
|
-
getHolders =
|
|
52
|
-
checkAccount =
|
|
53
|
-
var
|
|
54
|
-
isFormSubject =
|
|
48
|
+
var _useAppointmentBookin3 = useAppointmentBookingStep(),
|
|
49
|
+
updateStep = _useAppointmentBookin3.updateStep,
|
|
50
|
+
nextStep = _useAppointmentBookin3.nextStep;
|
|
51
|
+
var _useAppointmentBookin4 = useAppointmentBookingLogin(),
|
|
52
|
+
openLoginModal = _useAppointmentBookin4.openLoginModal,
|
|
53
|
+
isLogin = _useAppointmentBookin4.isLogin;
|
|
54
|
+
var _useAppointmentBookin5 = useAppointmentBookingAccount(),
|
|
55
|
+
getHolders = _useAppointmentBookin5.getHolders,
|
|
56
|
+
checkAccount = _useAppointmentBookin5.checkAccount;
|
|
57
|
+
var _useAppointmentBookin6 = useAppointmentBookingSetting(),
|
|
58
|
+
isFormSubject = _useAppointmentBookin6.isFormSubject;
|
|
55
59
|
var utils = contextUtils();
|
|
56
60
|
useImperativeHandle(ref, function () {
|
|
57
61
|
return {
|
|
58
62
|
next: function () {
|
|
59
63
|
var _next2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
60
64
|
var _appointmentBooking$s;
|
|
61
|
-
var resultCarts, stepList, accountLists;
|
|
65
|
+
var result, resultCarts, stepList, accountLists, checkResult;
|
|
62
66
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
63
67
|
while (1) switch (_context.prev = _context.next) {
|
|
64
68
|
case 0:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
result = checkResource({
|
|
70
|
+
carts: carts,
|
|
71
|
+
resources: resources
|
|
72
|
+
});
|
|
73
|
+
if (result) {
|
|
74
|
+
setCarts(result);
|
|
75
|
+
}
|
|
76
|
+
setIsErrorHolder(!!result);
|
|
77
|
+
|
|
70
78
|
// 验证购物车是否有资源
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
if (!result) {
|
|
80
|
+
_context.next = 6;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
scrollToFirstErrorCard();
|
|
84
|
+
return _context.abrupt("return");
|
|
85
|
+
case 6:
|
|
75
86
|
resultCarts = formatCartsResources(carts, resources, setPolicyIds);
|
|
76
87
|
stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
77
|
-
_context.next =
|
|
88
|
+
_context.next = 10;
|
|
78
89
|
return appointmentBooking.getAccounts();
|
|
79
|
-
case
|
|
90
|
+
case 10:
|
|
80
91
|
accountLists = _context.sent;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
checkResult = checkHasFormStep({
|
|
93
|
+
nextStep: nextStep,
|
|
94
|
+
hasResourceFormId: (resultCarts === null || resultCarts === void 0 ? void 0 : resultCarts.length) > 0,
|
|
95
|
+
currentStep: currentStep,
|
|
96
|
+
stepList: stepList,
|
|
97
|
+
appointmentBooking: appointmentBooking,
|
|
98
|
+
locales: locales,
|
|
99
|
+
openLoginModal: openLoginModal,
|
|
100
|
+
utils: utils,
|
|
101
|
+
accountLists: accountLists,
|
|
102
|
+
getHolders: getHolders,
|
|
103
|
+
checkHolder: checkHolder,
|
|
104
|
+
checkAccount: checkAccount,
|
|
105
|
+
setCarts: setCarts,
|
|
106
|
+
carts: carts,
|
|
107
|
+
isFormSubject: isFormSubject,
|
|
108
|
+
isLogin: isLogin
|
|
109
|
+
});
|
|
110
|
+
if (!checkResult) {
|
|
111
|
+
_context.next = 14;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
return _context.abrupt("return");
|
|
115
|
+
case 14:
|
|
102
116
|
// 清空资源分配失败数据
|
|
103
117
|
setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), {}, {
|
|
104
118
|
errorList: null
|
|
105
119
|
}));
|
|
106
120
|
|
|
107
121
|
// 获取时间切片
|
|
108
|
-
|
|
109
|
-
|
|
122
|
+
getResourceTimeSlot();
|
|
110
123
|
nextStep();
|
|
111
|
-
case
|
|
124
|
+
case 17:
|
|
112
125
|
case "end":
|
|
113
126
|
return _context.stop();
|
|
114
127
|
}
|
|
@@ -129,7 +142,7 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
129
142
|
useEffect(function () {
|
|
130
143
|
// 检查是否可以跳过资源选择步骤
|
|
131
144
|
var checkAndSkipResourceStep = /*#__PURE__*/function () {
|
|
132
|
-
var
|
|
145
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
133
146
|
var _currentStep$step, _resources, skipResourceStep, key;
|
|
134
147
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
135
148
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -137,13 +150,16 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
137
150
|
_context2.prev = 0;
|
|
138
151
|
// 获取资源列表数据
|
|
139
152
|
_resources = getResourceList(); // 获取自动分配资源
|
|
140
|
-
|
|
153
|
+
_context2.next = 4;
|
|
154
|
+
return autoSelectAllProductResources();
|
|
155
|
+
case 4:
|
|
141
156
|
// 根据自动分配之后的资源重新拉取资源列表
|
|
142
|
-
|
|
157
|
+
getResourceList();
|
|
158
|
+
|
|
143
159
|
// 检测资源步骤是否跳过
|
|
144
|
-
_context2.next =
|
|
160
|
+
_context2.next = 7;
|
|
145
161
|
return checkSkipResourceStep();
|
|
146
|
-
case
|
|
162
|
+
case 7:
|
|
147
163
|
skipResourceStep = _context2.sent;
|
|
148
164
|
// 更新步骤是否有跳过标识
|
|
149
165
|
key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
@@ -152,23 +168,23 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
152
168
|
isSkip: skipResourceStep
|
|
153
169
|
});
|
|
154
170
|
if (!skipResourceStep) {
|
|
155
|
-
_context2.next =
|
|
171
|
+
_context2.next = 12;
|
|
156
172
|
break;
|
|
157
173
|
}
|
|
158
174
|
return _context2.abrupt("return", true);
|
|
159
|
-
case 9:
|
|
160
|
-
return _context2.abrupt("return", false);
|
|
161
175
|
case 12:
|
|
162
|
-
_context2.
|
|
176
|
+
return _context2.abrupt("return", false);
|
|
177
|
+
case 15:
|
|
178
|
+
_context2.prev = 15;
|
|
163
179
|
_context2.t0 = _context2["catch"](0);
|
|
164
|
-
case
|
|
180
|
+
case 17:
|
|
165
181
|
case "end":
|
|
166
182
|
return _context2.stop();
|
|
167
183
|
}
|
|
168
|
-
}, _callee2, null, [[0,
|
|
184
|
+
}, _callee2, null, [[0, 15]]);
|
|
169
185
|
}));
|
|
170
186
|
return function checkAndSkipResourceStep() {
|
|
171
|
-
return
|
|
187
|
+
return _ref.apply(this, arguments);
|
|
172
188
|
};
|
|
173
189
|
}();
|
|
174
190
|
checkAndSkipResourceStep();
|
|
@@ -179,61 +195,28 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
179
195
|
title: locales.getText('pisell2.appointment.any.professional'),
|
|
180
196
|
subtitle: locales.getText('pisell2.appointment.for.maximum.availability')
|
|
181
197
|
}];
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
case 0:
|
|
195
|
-
if (!(appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.isRequired || !(appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.form_code))) {
|
|
196
|
-
_context3.next = 2;
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
return _context3.abrupt("return");
|
|
200
|
-
case 2:
|
|
201
|
-
_context3.next = 4;
|
|
202
|
-
return appointmentBooking.autoSelectAllProductResources(appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
|
|
203
|
-
case 4:
|
|
204
|
-
res = _context3.sent;
|
|
205
|
-
setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), res));
|
|
206
|
-
|
|
207
|
-
// 自动分派之后获取重新获取资源列表数据;
|
|
208
|
-
getResourceList();
|
|
209
|
-
cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
|
|
210
|
-
appointmentBooking.updateCart(_objectSpread({
|
|
211
|
-
_id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
|
|
212
|
-
}, cartItem));
|
|
213
|
-
case 9:
|
|
214
|
-
case "end":
|
|
215
|
-
return _context3.stop();
|
|
216
|
-
}
|
|
217
|
-
}, _callee3);
|
|
218
|
-
}));
|
|
219
|
-
return function autoSelectResources() {
|
|
220
|
-
return _ref3.apply(this, arguments);
|
|
221
|
-
};
|
|
222
|
-
}();
|
|
223
|
-
autoSelectResources();
|
|
224
|
-
}, [appointmentBoard]);
|
|
198
|
+
var currentResource = useMemo(function () {
|
|
199
|
+
if (resources.length && carts.length) {
|
|
200
|
+
if (carts.length === 1) {
|
|
201
|
+
var _resources$;
|
|
202
|
+
return (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 ? void 0 : _resources$[0];
|
|
203
|
+
} else {
|
|
204
|
+
return {
|
|
205
|
+
renderList: []
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}, [resources, carts]);
|
|
225
210
|
var resourcesResult = useMemo(function () {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return _anyResource.concat(renderLists || []);
|
|
229
|
-
}, [renderLists, appointmentBoard]);
|
|
211
|
+
return anyResource.concat((currentResource === null || currentResource === void 0 ? void 0 : currentResource.renderList) || []);
|
|
212
|
+
}, [currentResource]);
|
|
230
213
|
var _onClick = function onClick(e) {
|
|
231
214
|
setSelectedResource(e.id);
|
|
232
215
|
if (e.id) {
|
|
233
216
|
var _carts$;
|
|
234
217
|
return appointmentBooking.updateCart({
|
|
235
218
|
_id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
|
|
236
|
-
resources:
|
|
219
|
+
resources: [e]
|
|
237
220
|
});
|
|
238
221
|
}
|
|
239
222
|
};
|
|
@@ -48,16 +48,23 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
48
48
|
}, []);
|
|
49
49
|
var getAutoSelect = /*#__PURE__*/function () {
|
|
50
50
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
|
|
51
|
-
var result;
|
|
51
|
+
var _getResourceList, resourceCodes, _yield$appointmentBoo, errorList, result;
|
|
52
52
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
53
|
while (1) switch (_context.prev = _context.next) {
|
|
54
54
|
case 0:
|
|
55
55
|
setSelectedTime(val);
|
|
56
|
-
|
|
56
|
+
_getResourceList = getResourceList(), resourceCodes = _getResourceList.resourceCodes;
|
|
57
|
+
_context.next = 4;
|
|
58
|
+
return appointmentBooking.autoSelectAllProductResources(resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[1], val);
|
|
59
|
+
case 4:
|
|
60
|
+
_yield$appointmentBoo = _context.sent;
|
|
61
|
+
errorList = _yield$appointmentBoo.errorList;
|
|
62
|
+
_context.next = 8;
|
|
57
63
|
return appointmentBooking.submitTimeSlot(val);
|
|
58
|
-
case
|
|
64
|
+
case 8:
|
|
59
65
|
result = _context.sent;
|
|
60
|
-
|
|
66
|
+
console.log(errorList, result, 'wh9896788');
|
|
67
|
+
case 10:
|
|
61
68
|
case "end":
|
|
62
69
|
return _context.stop();
|
|
63
70
|
}
|
|
@@ -77,7 +84,7 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
77
84
|
// 如果没有选择时间,则默认选中第一个时间
|
|
78
85
|
getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
|
|
79
86
|
}
|
|
80
|
-
}, [times
|
|
87
|
+
}, [times]);
|
|
81
88
|
var _onClick = /*#__PURE__*/function () {
|
|
82
89
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
83
90
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -8,12 +8,10 @@ import React, { createContext, useContext, useState, useEffect, useMemo, useRef
|
|
|
8
8
|
import { useAppointmentBooking } from "./hooks";
|
|
9
9
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
10
10
|
import { TasksManager } from "../../utils/tasks";
|
|
11
|
-
import { getCartCurrentResourceData } from "./utils";
|
|
12
11
|
var AppointmentBookingContext = /*#__PURE__*/createContext(undefined);
|
|
13
12
|
export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref) {
|
|
14
|
-
var _appHelper$utils,
|
|
13
|
+
var _appHelper$utils, _currentStep$step2, _appointmentBooking$s;
|
|
15
14
|
var children = _ref.children;
|
|
16
|
-
var currentSelectedResourcesRef = useRef(null);
|
|
17
15
|
var policyIdsRef = useRef([]);
|
|
18
16
|
var appointmentBooking = useAppointmentBooking();
|
|
19
17
|
// 总计计算
|
|
@@ -126,10 +124,6 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
126
124
|
policyParams.callback();
|
|
127
125
|
}
|
|
128
126
|
};
|
|
129
|
-
var stepLists = useMemo(function () {
|
|
130
|
-
var _appointmentBooking$s;
|
|
131
|
-
return (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
132
|
-
}, [appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList]);
|
|
133
127
|
|
|
134
128
|
/**
|
|
135
129
|
* @title: 是否是最后一步
|
|
@@ -143,39 +137,7 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
143
137
|
var _currentStep$step;
|
|
144
138
|
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
145
139
|
return key === 'confirm-information';
|
|
146
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$
|
|
147
|
-
var currentStepParams = useMemo(function () {
|
|
148
|
-
var _currentStep$step3;
|
|
149
|
-
var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
|
|
150
|
-
var index = stepLists.findIndex(function (item) {
|
|
151
|
-
return item.key === key;
|
|
152
|
-
});
|
|
153
|
-
return {
|
|
154
|
-
key: key,
|
|
155
|
-
index: index,
|
|
156
|
-
stepLists: stepLists
|
|
157
|
-
};
|
|
158
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key, stepLists]);
|
|
159
|
-
useEffect(function () {
|
|
160
|
-
var _currentStepParams$ke;
|
|
161
|
-
// 如果当前步骤是选择资源,则更新当前资源的数据
|
|
162
|
-
if (currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke = currentStepParams.key) !== null && _currentStepParams$ke !== void 0 && _currentStepParams$ke.startsWith('select-resource')) {
|
|
163
|
-
var currentSelectedResources = carts.map(function (item) {
|
|
164
|
-
return {
|
|
165
|
-
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
166
|
-
currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
|
|
167
|
-
};
|
|
168
|
-
});
|
|
169
|
-
currentSelectedResourcesRef.current = currentSelectedResources;
|
|
170
|
-
|
|
171
|
-
// 并且将当前资源的数据设置到本地
|
|
172
|
-
appointmentBooking.setOtherData('current_selected_resources', currentSelectedResources);
|
|
173
|
-
}
|
|
174
|
-
}, [currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources, carts]);
|
|
175
|
-
useEffect(function () {
|
|
176
|
-
var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
|
|
177
|
-
currentSelectedResourcesRef.current = currentSelectedResources || [];
|
|
178
|
-
}, []);
|
|
140
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList]);
|
|
179
141
|
var value = {
|
|
180
142
|
appointmentBooking: appointmentBooking,
|
|
181
143
|
times: times,
|
|
@@ -209,9 +171,7 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
209
171
|
policyIdsRef: policyIdsRef,
|
|
210
172
|
setPolicyIds: setPolicyIds,
|
|
211
173
|
openPolicy: openPolicy,
|
|
212
|
-
closePolicy: closePolicy
|
|
213
|
-
currentStepParams: currentStepParams,
|
|
214
|
-
currentSelectedResourcesRef: currentSelectedResourcesRef
|
|
174
|
+
closePolicy: closePolicy
|
|
215
175
|
};
|
|
216
176
|
return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
|
|
217
177
|
value: value
|