@pisell/pisellos 2.3.37 → 2.3.39
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/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +11 -28
- package/dist/modules/Order/index.js +513 -747
- package/dist/modules/Order/types.d.ts +10 -33
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +40 -11
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +49 -78
- package/dist/modules/Payment/types.d.ts +24 -26
- package/dist/modules/Payment/types.js +0 -2
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -14
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.js +48 -15
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +14 -16
- package/dist/server/index.js +1162 -1943
- package/dist/server/modules/order/index.d.ts +4 -49
- package/dist/server/modules/order/index.js +695 -1574
- package/dist/server/modules/order/types.d.ts +3 -11
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +10 -33
- package/dist/solution/BaseSales/index.js +385 -676
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.js +1 -2
- package/dist/solution/Sales/index.d.ts +0 -1
- package/dist/solution/Sales/index.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1140 -737
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +66 -25
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1177 -850
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +11 -28
- package/lib/modules/Order/index.js +83 -187
- package/lib/modules/Order/types.d.ts +10 -33
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +39 -10
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +12 -33
- package/lib/modules/Payment/types.d.ts +24 -26
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +40 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.js +34 -18
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +14 -16
- package/lib/server/index.js +88 -678
- package/lib/server/modules/order/index.d.ts +4 -49
- package/lib/server/modules/order/index.js +66 -657
- package/lib/server/modules/order/types.d.ts +3 -11
- package/lib/solution/BaseSales/index.d.ts +10 -33
- package/lib/solution/BaseSales/index.js +33 -201
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.js +1 -2
- package/lib/solution/Sales/index.d.ts +0 -1
- package/lib/solution/Sales/index.js +3 -5
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -182
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +31 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1076 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +328 -115
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
1
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
3
|
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."); }
|
|
3
4
|
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; } }
|
|
4
5
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
6
|
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; }
|
|
7
7
|
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); } }
|
|
8
8
|
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); }); }; }
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
10
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
13
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
12
14
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
15
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -28,7 +30,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
28
30
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
29
31
|
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); }
|
|
30
32
|
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); }
|
|
31
|
-
import {
|
|
33
|
+
import { BaseSalesImpl } from "../BaseSales";
|
|
32
34
|
import { DEFAULT_SLOT_CONFIG, VenueBookingHooks } from "./types";
|
|
33
35
|
import { attachItemRuleLimitsToTopLevelProducts, buildProductKey, buildItemRuleBusinessData, createEmptySummary, getProductIdentityIndex, getSafeProductNum, normalizeOrderProduct, normalizeItemRuleStrategies, toNonNegativeInt, toPriceString } from "./utils";
|
|
34
36
|
import { createModule } from "../BookingByStep/types";
|
|
@@ -49,6 +51,8 @@ import { composeLinePrice, createUuidV4, getProductSkuOptions, sumOptionUnitPric
|
|
|
49
51
|
import { OrderModule } from "../../modules/Order";
|
|
50
52
|
import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
|
|
51
53
|
import Decimal from 'decimal.js';
|
|
54
|
+
import { HolderModule } from "../../modules/Holder";
|
|
55
|
+
import { getFormIdFromHolderConfig, getProductHolderConfig } from "../../modules/Holder/utils";
|
|
52
56
|
export * from "./types";
|
|
53
57
|
var OPEN_DATA_SECTION_CODES = ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow', 'checkout'];
|
|
54
58
|
function cloneCustomDepositData(customDepositData) {
|
|
@@ -59,8 +63,8 @@ function cloneCustomDepositData(customDepositData) {
|
|
|
59
63
|
deposit_policy_data: Array.isArray(customDepositData.deposit_policy_data) ? _toConsumableArray(customDepositData.deposit_policy_data) : []
|
|
60
64
|
});
|
|
61
65
|
}
|
|
62
|
-
export var VenueBookingImpl = /*#__PURE__*/function (
|
|
63
|
-
_inherits(VenueBookingImpl,
|
|
66
|
+
export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
67
|
+
_inherits(VenueBookingImpl, _BaseSalesImpl);
|
|
64
68
|
var _super = _createSuper(VenueBookingImpl);
|
|
65
69
|
function VenueBookingImpl(name, version) {
|
|
66
70
|
var _this;
|
|
@@ -269,6 +273,76 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
269
273
|
}
|
|
270
274
|
return addLog;
|
|
271
275
|
}()
|
|
276
|
+
}, {
|
|
277
|
+
key: "getRegisteredModuleNames",
|
|
278
|
+
value: function getRegisteredModuleNames() {
|
|
279
|
+
return ['scanOrderLogger', 'products', 'order', 'salesSummary', 'venueProducts', 'addonProducts', 'date', 'schedule', 'quotation', 'openData'];
|
|
280
|
+
}
|
|
281
|
+
}, {
|
|
282
|
+
key: "createSubModule",
|
|
283
|
+
value: function createSubModule(moduleName) {
|
|
284
|
+
switch (moduleName) {
|
|
285
|
+
case 'scanOrderLogger':
|
|
286
|
+
return createModule('scanOrderLogger', this.name);
|
|
287
|
+
case 'venueProducts':
|
|
288
|
+
return new ProductList("".concat(this.name, "_venueProducts"));
|
|
289
|
+
case 'addonProducts':
|
|
290
|
+
return new ProductList("".concat(this.name, "_addonProducts"));
|
|
291
|
+
case 'date':
|
|
292
|
+
return new DateModule("".concat(this.name, "_date"));
|
|
293
|
+
case 'openData':
|
|
294
|
+
return new OpenDataModule("".concat(this.name, "_openData"));
|
|
295
|
+
default:
|
|
296
|
+
return _get(_getPrototypeOf(VenueBookingImpl.prototype), "createSubModule", this).call(this, moduleName);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
key: "attachProductOriginToTempOrder",
|
|
301
|
+
value: function attachProductOriginToTempOrder(tempOrder, productUid, origin) {
|
|
302
|
+
var _tempOrder$_extend, _tempOrder$_extend2;
|
|
303
|
+
if (!productUid || !origin) return;
|
|
304
|
+
tempOrder._extend = _objectSpread(_objectSpread({}, tempOrder._extend || {}), {}, {
|
|
305
|
+
productsByUid: _objectSpread(_objectSpread({}, ((_tempOrder$_extend = tempOrder._extend) === null || _tempOrder$_extend === void 0 ? void 0 : _tempOrder$_extend.productsByUid) || {}), {}, _defineProperty({}, productUid, _objectSpread(_objectSpread({}, ((_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 || (_tempOrder$_extend2 = _tempOrder$_extend2.productsByUid) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2[productUid]) || {}), {}, {
|
|
306
|
+
origin: origin
|
|
307
|
+
})))
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}, {
|
|
311
|
+
key: "readProductOriginFromTempOrder",
|
|
312
|
+
value: function readProductOriginFromTempOrder(tempOrder, product) {
|
|
313
|
+
var _product$metadata, _tempOrder$_extend3;
|
|
314
|
+
var uid = ((_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.unique_identification_number) || product.identity_key;
|
|
315
|
+
if (uid && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
|
|
316
|
+
return tempOrder._extend.productsByUid[uid].origin;
|
|
317
|
+
}
|
|
318
|
+
return product._origin;
|
|
319
|
+
}
|
|
320
|
+
}, {
|
|
321
|
+
key: "normalizeVenueProductTitle",
|
|
322
|
+
value: function normalizeVenueProductTitle(value) {
|
|
323
|
+
if (typeof value === 'string') {
|
|
324
|
+
var text = value.trim();
|
|
325
|
+
return text ? {
|
|
326
|
+
auto: text
|
|
327
|
+
} : undefined;
|
|
328
|
+
}
|
|
329
|
+
if (!value || _typeof(value) !== 'object' || Array.isArray(value)) return undefined;
|
|
330
|
+
var source = value;
|
|
331
|
+
var normalized = {};
|
|
332
|
+
Object.entries(source).forEach(function (_ref) {
|
|
333
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
334
|
+
key = _ref2[0],
|
|
335
|
+
text = _ref2[1];
|
|
336
|
+
if (typeof text === 'string') normalized[key] = text;
|
|
337
|
+
});
|
|
338
|
+
if (!normalized.auto) {
|
|
339
|
+
var fallback = normalized.original || normalized.en || normalized['zh-CN'] || normalized['zh-HK'];
|
|
340
|
+
if (fallback) normalized.auto = fallback;
|
|
341
|
+
}
|
|
342
|
+
return Object.values(normalized).some(function (text) {
|
|
343
|
+
return String(text || '').trim();
|
|
344
|
+
}) ? normalized : undefined;
|
|
345
|
+
}
|
|
272
346
|
}, {
|
|
273
347
|
key: "normalizeCustomerId",
|
|
274
348
|
value: function normalizeCustomerId(value) {
|
|
@@ -288,20 +362,115 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
288
362
|
}
|
|
289
363
|
return null;
|
|
290
364
|
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "resolveHolderCustomerId",
|
|
367
|
+
value: function resolveHolderCustomerId() {
|
|
368
|
+
var _this$window, _this$window$getLocal;
|
|
369
|
+
var customer = JSON.parse(((_this$window = this.window) === null || _this$window === void 0 || (_this$window$getLocal = _this$window.getLocalStorage) === null || _this$window$getLocal === void 0 ? void 0 : _this$window$getLocal.call(_this$window, 'customer')) || '{}');
|
|
370
|
+
if (customer !== null && customer !== void 0 && customer.id) return Number(customer.id);
|
|
371
|
+
return undefined;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* 按商品 holder_config 预加载表单数据到 holderMap。
|
|
376
|
+
* appointment_booking 在加购时触发;venueBooking 在商品加载后预加载,避免 getHolderFormMap 为空。
|
|
377
|
+
*/
|
|
378
|
+
}, {
|
|
379
|
+
key: "preloadHolderForms",
|
|
380
|
+
value: (function () {
|
|
381
|
+
var _preloadHolderForms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(products) {
|
|
382
|
+
var seenFormIds, _iterator, _step, _item$_origin, item, holderConfig, formId, _item$_origin2, _item$_origin3;
|
|
383
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
384
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
385
|
+
case 0:
|
|
386
|
+
if (!(!this.store.holder || !products.length)) {
|
|
387
|
+
_context3.next = 2;
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
return _context3.abrupt("return");
|
|
391
|
+
case 2:
|
|
392
|
+
seenFormIds = new Set();
|
|
393
|
+
_iterator = _createForOfIteratorHelper(products);
|
|
394
|
+
_context3.prev = 4;
|
|
395
|
+
_iterator.s();
|
|
396
|
+
case 6:
|
|
397
|
+
if ((_step = _iterator.n()).done) {
|
|
398
|
+
_context3.next = 25;
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
item = _step.value;
|
|
402
|
+
holderConfig = getProductHolderConfig(item === null || item === void 0 || (_item$_origin = item._origin) === null || _item$_origin === void 0 ? void 0 : _item$_origin.product);
|
|
403
|
+
if (holderConfig) {
|
|
404
|
+
_context3.next = 11;
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
return _context3.abrupt("continue", 23);
|
|
408
|
+
case 11:
|
|
409
|
+
formId = getFormIdFromHolderConfig(holderConfig);
|
|
410
|
+
if (!seenFormIds.has(formId)) {
|
|
411
|
+
_context3.next = 14;
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
return _context3.abrupt("continue", 23);
|
|
415
|
+
case 14:
|
|
416
|
+
seenFormIds.add(formId);
|
|
417
|
+
_context3.prev = 15;
|
|
418
|
+
_context3.next = 18;
|
|
419
|
+
return this.store.holder.ensureFormByProduct({
|
|
420
|
+
product: (item === null || item === void 0 || (_item$_origin2 = item._origin) === null || _item$_origin2 === void 0 ? void 0 : _item$_origin2.product) || {},
|
|
421
|
+
customer_id: this.resolveHolderCustomerId(),
|
|
422
|
+
shop_id: item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.shop_id,
|
|
423
|
+
useCache: true
|
|
424
|
+
});
|
|
425
|
+
case 18:
|
|
426
|
+
_context3.next = 23;
|
|
427
|
+
break;
|
|
428
|
+
case 20:
|
|
429
|
+
_context3.prev = 20;
|
|
430
|
+
_context3.t0 = _context3["catch"](15);
|
|
431
|
+
console.error('[VenueBooking] 预加载 holder 表单失败', {
|
|
432
|
+
formId: formId,
|
|
433
|
+
error: _context3.t0
|
|
434
|
+
});
|
|
435
|
+
case 23:
|
|
436
|
+
_context3.next = 6;
|
|
437
|
+
break;
|
|
438
|
+
case 25:
|
|
439
|
+
_context3.next = 30;
|
|
440
|
+
break;
|
|
441
|
+
case 27:
|
|
442
|
+
_context3.prev = 27;
|
|
443
|
+
_context3.t1 = _context3["catch"](4);
|
|
444
|
+
_iterator.e(_context3.t1);
|
|
445
|
+
case 30:
|
|
446
|
+
_context3.prev = 30;
|
|
447
|
+
_iterator.f();
|
|
448
|
+
return _context3.finish(30);
|
|
449
|
+
case 33:
|
|
450
|
+
case "end":
|
|
451
|
+
return _context3.stop();
|
|
452
|
+
}
|
|
453
|
+
}, _callee3, this, [[4, 27, 30, 33], [15, 20]]);
|
|
454
|
+
}));
|
|
455
|
+
function preloadHolderForms(_x3) {
|
|
456
|
+
return _preloadHolderForms.apply(this, arguments);
|
|
457
|
+
}
|
|
458
|
+
return preloadHolderForms;
|
|
459
|
+
}())
|
|
291
460
|
}, {
|
|
292
461
|
key: "clearLoginEffectListeners",
|
|
293
462
|
value: function clearLoginEffectListeners() {
|
|
294
|
-
var
|
|
295
|
-
|
|
463
|
+
var _iterator2 = _createForOfIteratorHelper(this.loginEffectDisposers),
|
|
464
|
+
_step2;
|
|
296
465
|
try {
|
|
297
|
-
for (
|
|
298
|
-
var dispose =
|
|
466
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
467
|
+
var dispose = _step2.value;
|
|
299
468
|
dispose();
|
|
300
469
|
}
|
|
301
470
|
} catch (err) {
|
|
302
|
-
|
|
471
|
+
_iterator2.e(err);
|
|
303
472
|
} finally {
|
|
304
|
-
|
|
473
|
+
_iterator2.f();
|
|
305
474
|
}
|
|
306
475
|
this.loginEffectDisposers = [];
|
|
307
476
|
}
|
|
@@ -332,30 +501,30 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
332
501
|
var currentAccount = (accountModule === null || accountModule === void 0 || (_accountModule$getCur = accountModule.getCurrentAccount) === null || _accountModule$getCur === void 0 ? void 0 : _accountModule$getCur.call(accountModule)) || (accountModule === null || accountModule === void 0 || (_accountModule$getAcc = accountModule.getAccount) === null || _accountModule$getAcc === void 0 ? void 0 : _accountModule$getAcc.call(accountModule)) || null;
|
|
333
502
|
var createHandleLogin = function createHandleLogin(eventName) {
|
|
334
503
|
return /*#__PURE__*/function () {
|
|
335
|
-
var
|
|
504
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
|
|
336
505
|
var customerId;
|
|
337
|
-
return _regeneratorRuntime().wrap(function
|
|
338
|
-
while (1) switch (
|
|
506
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
507
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
339
508
|
case 0:
|
|
340
509
|
customerId = _this2.resolveCustomerIdFromLoginPayload(payload);
|
|
341
510
|
if (customerId) {
|
|
342
|
-
|
|
511
|
+
_context4.next = 3;
|
|
343
512
|
break;
|
|
344
513
|
}
|
|
345
|
-
return
|
|
514
|
+
return _context4.abrupt("return");
|
|
346
515
|
case 3:
|
|
347
|
-
|
|
516
|
+
_context4.next = 5;
|
|
348
517
|
return _this2.refreshOrderMarketingAfterLogin({
|
|
349
518
|
customerId: customerId
|
|
350
519
|
});
|
|
351
520
|
case 5:
|
|
352
521
|
case "end":
|
|
353
|
-
return
|
|
522
|
+
return _context4.stop();
|
|
354
523
|
}
|
|
355
|
-
},
|
|
524
|
+
}, _callee4);
|
|
356
525
|
}));
|
|
357
|
-
return function (
|
|
358
|
-
return
|
|
526
|
+
return function (_x4) {
|
|
527
|
+
return _ref3.apply(this, arguments);
|
|
359
528
|
};
|
|
360
529
|
}();
|
|
361
530
|
};
|
|
@@ -365,97 +534,107 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
365
534
|
}, {
|
|
366
535
|
key: "refreshOrderMarketingAfterLogin",
|
|
367
536
|
value: function () {
|
|
368
|
-
var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
537
|
+
var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
369
538
|
var _this3 = this;
|
|
370
539
|
var refreshTask;
|
|
371
|
-
return _regeneratorRuntime().wrap(function
|
|
372
|
-
while (1) switch (
|
|
540
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
541
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
373
542
|
case 0:
|
|
374
543
|
if (this.store.order) {
|
|
375
|
-
|
|
544
|
+
_context6.next = 2;
|
|
376
545
|
break;
|
|
377
546
|
}
|
|
378
547
|
throw new Error('order 模块未初始化');
|
|
379
548
|
case 2:
|
|
380
549
|
if (!this.customerLoginRefreshInFlight) {
|
|
381
|
-
|
|
550
|
+
_context6.next = 9;
|
|
382
551
|
break;
|
|
383
552
|
}
|
|
384
553
|
if (!(this.customerLoginRefreshIdInFlight === params.customerId)) {
|
|
385
|
-
|
|
554
|
+
_context6.next = 7;
|
|
386
555
|
break;
|
|
387
556
|
}
|
|
388
|
-
|
|
557
|
+
_context6.next = 6;
|
|
389
558
|
return this.customerLoginRefreshInFlight;
|
|
390
559
|
case 6:
|
|
391
|
-
return
|
|
560
|
+
return _context6.abrupt("return");
|
|
392
561
|
case 7:
|
|
393
|
-
|
|
562
|
+
_context6.next = 9;
|
|
394
563
|
return this.customerLoginRefreshInFlight;
|
|
395
564
|
case 9:
|
|
396
565
|
this.customerLoginRefreshIdInFlight = params.customerId;
|
|
397
|
-
refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
566
|
+
refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
398
567
|
var _this3$otherParams;
|
|
399
|
-
return _regeneratorRuntime().wrap(function
|
|
400
|
-
while (1) switch (
|
|
568
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
569
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
401
570
|
case 0:
|
|
571
|
+
if (!_this3.store.holder) {
|
|
572
|
+
_context5.next = 3;
|
|
573
|
+
break;
|
|
574
|
+
}
|
|
575
|
+
_context5.next = 3;
|
|
576
|
+
return _this3.store.holder.refreshAllFormRecords({
|
|
577
|
+
customer_id: params.customerId,
|
|
578
|
+
useCache: false
|
|
579
|
+
});
|
|
580
|
+
case 3:
|
|
402
581
|
if (!_this3.store.quotation) {
|
|
403
|
-
|
|
582
|
+
_context5.next = 6;
|
|
404
583
|
break;
|
|
405
584
|
}
|
|
406
|
-
|
|
585
|
+
_context5.next = 6;
|
|
407
586
|
return _this3.store.quotation.loadQuotations({
|
|
408
587
|
channel: (_this3$otherParams = _this3.otherParams) === null || _this3$otherParams === void 0 ? void 0 : _this3$otherParams.channel
|
|
409
588
|
});
|
|
410
|
-
case
|
|
589
|
+
case 6:
|
|
411
590
|
_this3.recalculateOrderPricesFromQuotation();
|
|
412
|
-
|
|
591
|
+
_context5.next = 9;
|
|
413
592
|
return _this3.store.order.loadDiscountConfig({
|
|
414
593
|
customerId: params.customerId
|
|
415
594
|
});
|
|
416
|
-
case
|
|
417
|
-
|
|
595
|
+
case 9:
|
|
596
|
+
_context5.next = 11;
|
|
418
597
|
return _this3.store.order.recalculateSummary({
|
|
419
598
|
createIfMissing: true
|
|
420
599
|
});
|
|
421
|
-
case
|
|
600
|
+
case 11:
|
|
422
601
|
_this3.store.order.persistTempOrder();
|
|
423
|
-
|
|
602
|
+
_context5.next = 14;
|
|
424
603
|
return _this3.refreshItemRuleQuantityLimits();
|
|
425
|
-
case
|
|
426
|
-
|
|
604
|
+
case 14:
|
|
605
|
+
_context5.next = 16;
|
|
427
606
|
return _this3.refreshCartValidationPassed();
|
|
428
|
-
case
|
|
607
|
+
case 16:
|
|
429
608
|
case "end":
|
|
430
|
-
return
|
|
609
|
+
return _context5.stop();
|
|
431
610
|
}
|
|
432
|
-
},
|
|
611
|
+
}, _callee5);
|
|
433
612
|
}))();
|
|
434
613
|
this.customerLoginRefreshInFlight = refreshTask;
|
|
435
|
-
|
|
436
|
-
|
|
614
|
+
_context6.prev = 12;
|
|
615
|
+
_context6.next = 15;
|
|
437
616
|
return refreshTask;
|
|
438
617
|
case 15:
|
|
439
|
-
|
|
618
|
+
_context6.next = 20;
|
|
440
619
|
break;
|
|
441
620
|
case 17:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
throw
|
|
621
|
+
_context6.prev = 17;
|
|
622
|
+
_context6.t0 = _context6["catch"](12);
|
|
623
|
+
throw _context6.t0;
|
|
445
624
|
case 20:
|
|
446
|
-
|
|
625
|
+
_context6.prev = 20;
|
|
447
626
|
if (this.customerLoginRefreshInFlight === refreshTask) {
|
|
448
627
|
this.customerLoginRefreshInFlight = null;
|
|
449
628
|
this.customerLoginRefreshIdInFlight = null;
|
|
450
629
|
}
|
|
451
|
-
return
|
|
630
|
+
return _context6.finish(20);
|
|
452
631
|
case 23:
|
|
453
632
|
case "end":
|
|
454
|
-
return
|
|
633
|
+
return _context6.stop();
|
|
455
634
|
}
|
|
456
|
-
},
|
|
635
|
+
}, _callee6, this, [[12, 17, 20, 23]]);
|
|
457
636
|
}));
|
|
458
|
-
function refreshOrderMarketingAfterLogin(
|
|
637
|
+
function refreshOrderMarketingAfterLogin(_x5) {
|
|
459
638
|
return _refreshOrderMarketingAfterLogin.apply(this, arguments);
|
|
460
639
|
}
|
|
461
640
|
return refreshOrderMarketingAfterLogin;
|
|
@@ -463,16 +642,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
463
642
|
}, {
|
|
464
643
|
key: "initialize",
|
|
465
644
|
value: function () {
|
|
466
|
-
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
645
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(core) {
|
|
467
646
|
var _options$otherParams,
|
|
468
647
|
_options$otherParams2,
|
|
469
648
|
_this$otherParams,
|
|
470
649
|
_this$otherParams2,
|
|
471
650
|
_this$otherParams3,
|
|
472
651
|
_this4 = this,
|
|
473
|
-
_this$
|
|
474
|
-
_this$
|
|
652
|
+
_this$otherParams6,
|
|
653
|
+
_this$otherParams7,
|
|
654
|
+
_this$otherParams8,
|
|
655
|
+
_this$otherParams9,
|
|
656
|
+
_this$otherParams10;
|
|
475
657
|
var options,
|
|
658
|
+
_this$otherParams4,
|
|
659
|
+
_this$otherParams5,
|
|
476
660
|
baseModules,
|
|
477
661
|
venueProductsModule,
|
|
478
662
|
addonProductsModule,
|
|
@@ -480,18 +664,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
480
664
|
scheduleModule,
|
|
481
665
|
quotationModule,
|
|
482
666
|
openDataModule,
|
|
667
|
+
holderCacheState,
|
|
668
|
+
sessionData,
|
|
669
|
+
_data$this$otherParam,
|
|
670
|
+
data,
|
|
671
|
+
holderModule,
|
|
483
672
|
_this$store$order,
|
|
484
673
|
_this$store$order2,
|
|
485
674
|
_this$store$quotation,
|
|
486
|
-
_this$
|
|
487
|
-
|
|
488
|
-
return _regeneratorRuntime().wrap(function
|
|
489
|
-
while (1) switch (
|
|
675
|
+
_this$otherParams11,
|
|
676
|
+
_args7 = arguments;
|
|
677
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
678
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
490
679
|
case 0:
|
|
491
|
-
options =
|
|
680
|
+
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
492
681
|
this.logMethodStart('initialize');
|
|
493
|
-
this.core = core;
|
|
494
|
-
this.initializeOptions = options || {};
|
|
495
682
|
this.store = _objectSpread(_objectSpread({}, this.store), options.store);
|
|
496
683
|
this.store.entryContext = ((_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.entryContext) || this.store.entryContext;
|
|
497
684
|
this.store.status = 'initializing';
|
|
@@ -510,22 +697,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
510
697
|
passed: null,
|
|
511
698
|
failures: []
|
|
512
699
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
700
|
+
_context7.next = 19;
|
|
701
|
+
return _get(_getPrototypeOf(VenueBookingImpl.prototype), "initialize", this).call(this, core, options);
|
|
702
|
+
case 19:
|
|
703
|
+
if (this.store.scanOrderLogger) {
|
|
704
|
+
this.store.scanOrderLogger.setProvider(((_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.loggerProvider) || 'feishu');
|
|
705
|
+
this.store.scanOrderLogger.setProviderConfig(((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.loggerConfig) || {
|
|
706
|
+
feishu: {
|
|
707
|
+
webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
|
|
708
|
+
errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
this.store.scanOrderLogger.setContext(this.getLoggerContext());
|
|
525
712
|
}
|
|
526
|
-
this.logMethodError('initialize', 'request plugin missing');
|
|
527
|
-
throw new Error('venueBooking解决方案需要 request 插件支持');
|
|
528
|
-
case 27:
|
|
529
713
|
// 注册基础模块(order, salesSummary, products, logger)
|
|
530
714
|
baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
|
|
531
715
|
baseModules.forEach(function (step) {
|
|
@@ -538,10 +722,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
538
722
|
} : {};
|
|
539
723
|
var loggerProvider = ((_this4$otherParams = _this4.otherParams) === null || _this4$otherParams === void 0 ? void 0 : _this4$otherParams.loggerProvider) || 'feishu';
|
|
540
724
|
var loggerConfig = ((_this4$otherParams2 = _this4.otherParams) === null || _this4$otherParams2 === void 0 ? void 0 : _this4$otherParams2.loggerConfig) || {
|
|
541
|
-
feishu: {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
725
|
+
// feishu: {
|
|
726
|
+
// webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
|
|
727
|
+
// errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d',
|
|
728
|
+
// },
|
|
545
729
|
};
|
|
546
730
|
_this4.core.registerModule(targetModule, {
|
|
547
731
|
initialState: initialState,
|
|
@@ -613,69 +797,87 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
613
797
|
this.core.registerModule(openDataModule, {
|
|
614
798
|
otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
|
|
615
799
|
fatherModule: this.name,
|
|
616
|
-
openCache: !!((_this$
|
|
617
|
-
cacheId: (_this$
|
|
800
|
+
openCache: !!((_this$otherParams6 = this.otherParams) !== null && _this$otherParams6 !== void 0 && _this$otherParams6.cacheId),
|
|
801
|
+
cacheId: (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.cacheId
|
|
618
802
|
})
|
|
619
803
|
});
|
|
620
|
-
if (this.
|
|
621
|
-
this.
|
|
804
|
+
if ((_this$otherParams8 = this.otherParams) !== null && _this$otherParams8 !== void 0 && _this$otherParams8.cacheId) {
|
|
805
|
+
sessionData = this.window.sessionStorage.getItem(this.name);
|
|
806
|
+
if (sessionData) {
|
|
807
|
+
try {
|
|
808
|
+
data = JSON.parse(sessionData);
|
|
809
|
+
holderCacheState = (_data$this$otherParam = data[this.otherParams.cacheId]) === null || _data$this$otherParam === void 0 ? void 0 : _data$this$otherParam["".concat(this.name, "_holder")];
|
|
810
|
+
} catch (_unused2) {
|
|
811
|
+
// ignore invalid session cache
|
|
812
|
+
}
|
|
813
|
+
}
|
|
622
814
|
}
|
|
815
|
+
holderModule = new HolderModule("".concat(this.name, "_holder"));
|
|
816
|
+
this.store.holder = holderModule;
|
|
817
|
+
this.core.registerModule(holderModule, {
|
|
818
|
+
initialState: holderCacheState,
|
|
819
|
+
otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
|
|
820
|
+
fatherModule: this.name,
|
|
821
|
+
openCache: !!((_this$otherParams9 = this.otherParams) !== null && _this$otherParams9 !== void 0 && _this$otherParams9.cacheId),
|
|
822
|
+
cacheId: (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.cacheId
|
|
823
|
+
})
|
|
824
|
+
});
|
|
623
825
|
this.registerCustomerLoginListeners();
|
|
624
826
|
console.log('[VenueBooking] 初始化开始');
|
|
625
|
-
|
|
626
|
-
|
|
827
|
+
_context7.prev = 46;
|
|
828
|
+
_context7.next = 49;
|
|
627
829
|
return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
|
|
628
830
|
createIfMissing: false
|
|
629
831
|
});
|
|
630
|
-
case
|
|
832
|
+
case 49:
|
|
631
833
|
(_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
|
|
632
|
-
|
|
834
|
+
_context7.next = 52;
|
|
633
835
|
return this.loadRuntimeConfigs();
|
|
634
|
-
case
|
|
836
|
+
case 52:
|
|
635
837
|
if (!this.store.schedule) {
|
|
636
|
-
|
|
838
|
+
_context7.next = 57;
|
|
637
839
|
break;
|
|
638
840
|
}
|
|
639
|
-
|
|
841
|
+
_context7.next = 55;
|
|
640
842
|
return this.store.schedule.loadAllSchedule();
|
|
641
|
-
case
|
|
843
|
+
case 55:
|
|
642
844
|
this.injectScheduleResolverToQuotation();
|
|
643
845
|
(_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
|
|
644
|
-
channel: (_this$
|
|
846
|
+
channel: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.channel
|
|
645
847
|
});
|
|
646
|
-
case
|
|
647
|
-
|
|
848
|
+
case 57:
|
|
849
|
+
_context7.next = 59;
|
|
648
850
|
return this.refreshItemRuleQuantityLimits();
|
|
649
|
-
case
|
|
851
|
+
case 59:
|
|
650
852
|
this.store.status = 'ready';
|
|
651
853
|
console.log('[VenueBooking] 初始化完成');
|
|
652
|
-
|
|
854
|
+
_context7.next = 63;
|
|
653
855
|
return this.core.effects.emit(VenueBookingHooks.onInited, {
|
|
654
856
|
status: this.store.status
|
|
655
857
|
});
|
|
656
|
-
case
|
|
858
|
+
case 63:
|
|
657
859
|
this.logMethodSuccess('initialize', {
|
|
658
860
|
status: this.store.status
|
|
659
861
|
});
|
|
660
|
-
|
|
862
|
+
_context7.next = 73;
|
|
661
863
|
break;
|
|
662
|
-
case
|
|
663
|
-
|
|
664
|
-
|
|
864
|
+
case 66:
|
|
865
|
+
_context7.prev = 66;
|
|
866
|
+
_context7.t0 = _context7["catch"](46);
|
|
665
867
|
this.store.status = 'error';
|
|
666
|
-
this.store.error =
|
|
667
|
-
console.error('[VenueBooking] 初始化失败',
|
|
668
|
-
this.logMethodError('initialize',
|
|
868
|
+
this.store.error = _context7.t0 instanceof Error ? _context7.t0.message : '初始化失败';
|
|
869
|
+
console.error('[VenueBooking] 初始化失败', _context7.t0);
|
|
870
|
+
this.logMethodError('initialize', _context7.t0, {
|
|
669
871
|
status: this.store.status
|
|
670
872
|
});
|
|
671
|
-
throw
|
|
672
|
-
case
|
|
873
|
+
throw _context7.t0;
|
|
874
|
+
case 73:
|
|
673
875
|
case "end":
|
|
674
|
-
return
|
|
876
|
+
return _context7.stop();
|
|
675
877
|
}
|
|
676
|
-
},
|
|
878
|
+
}, _callee7, this, [[46, 66]]);
|
|
677
879
|
}));
|
|
678
|
-
function initialize(
|
|
880
|
+
function initialize(_x6) {
|
|
679
881
|
return _initialize.apply(this, arguments);
|
|
680
882
|
}
|
|
681
883
|
return initialize;
|
|
@@ -683,22 +885,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
683
885
|
}, {
|
|
684
886
|
key: "destroy",
|
|
685
887
|
value: function () {
|
|
686
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
687
|
-
return _regeneratorRuntime().wrap(function
|
|
688
|
-
while (1) switch (
|
|
888
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
889
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
890
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
689
891
|
case 0:
|
|
690
892
|
this.logMethodStart('destroy');
|
|
691
893
|
this.clearLoginEffectListeners();
|
|
692
|
-
|
|
894
|
+
_context8.next = 4;
|
|
693
895
|
return this.core.effects.emit(VenueBookingHooks.onDestroy, {});
|
|
694
896
|
case 4:
|
|
695
897
|
console.log('[VenueBooking] 已销毁');
|
|
696
898
|
this.logMethodSuccess('destroy');
|
|
697
899
|
case 6:
|
|
698
900
|
case "end":
|
|
699
|
-
return
|
|
901
|
+
return _context8.stop();
|
|
700
902
|
}
|
|
701
|
-
},
|
|
903
|
+
}, _callee8, this);
|
|
702
904
|
}));
|
|
703
905
|
function destroy() {
|
|
704
906
|
return _destroy.apply(this, arguments);
|
|
@@ -708,32 +910,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
708
910
|
}, {
|
|
709
911
|
key: "retryInit",
|
|
710
912
|
value: function () {
|
|
711
|
-
var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
712
|
-
return _regeneratorRuntime().wrap(function
|
|
713
|
-
while (1) switch (
|
|
913
|
+
var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
914
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
915
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
714
916
|
case 0:
|
|
715
917
|
this.logMethodStart('retryInit');
|
|
716
918
|
console.log('[VenueBooking] retryInit 调用');
|
|
717
|
-
|
|
919
|
+
_context9.next = 4;
|
|
718
920
|
return this.core.effects.emit(VenueBookingHooks.onRetryInit, {});
|
|
719
921
|
case 4:
|
|
720
|
-
|
|
721
|
-
|
|
922
|
+
_context9.prev = 4;
|
|
923
|
+
_context9.next = 7;
|
|
722
924
|
return this.initialize(this.core, this.initializeOptions);
|
|
723
925
|
case 7:
|
|
724
926
|
this.logMethodSuccess('retryInit');
|
|
725
|
-
|
|
927
|
+
_context9.next = 14;
|
|
726
928
|
break;
|
|
727
929
|
case 10:
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
this.logMethodError('retryInit',
|
|
731
|
-
throw
|
|
930
|
+
_context9.prev = 10;
|
|
931
|
+
_context9.t0 = _context9["catch"](4);
|
|
932
|
+
this.logMethodError('retryInit', _context9.t0);
|
|
933
|
+
throw _context9.t0;
|
|
732
934
|
case 14:
|
|
733
935
|
case "end":
|
|
734
|
-
return
|
|
936
|
+
return _context9.stop();
|
|
735
937
|
}
|
|
736
|
-
},
|
|
938
|
+
}, _callee9, this, [[4, 10]]);
|
|
737
939
|
}));
|
|
738
940
|
function retryInit() {
|
|
739
941
|
return _retryInit.apply(this, arguments);
|
|
@@ -743,22 +945,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
743
945
|
}, {
|
|
744
946
|
key: "refresh",
|
|
745
947
|
value: function () {
|
|
746
|
-
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
747
|
-
return _regeneratorRuntime().wrap(function
|
|
748
|
-
while (1) switch (
|
|
948
|
+
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
949
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
950
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
749
951
|
case 0:
|
|
750
952
|
this.logMethodStart('refresh');
|
|
751
953
|
console.log('[VenueBooking] refresh 调用');
|
|
752
|
-
|
|
954
|
+
_context10.prev = 2;
|
|
753
955
|
this.store.status = 'initializing';
|
|
754
|
-
|
|
956
|
+
_context10.next = 6;
|
|
755
957
|
return this.loadRuntimeConfigs();
|
|
756
958
|
case 6:
|
|
757
|
-
|
|
959
|
+
_context10.next = 8;
|
|
758
960
|
return this.refreshItemRuleQuantityLimits();
|
|
759
961
|
case 8:
|
|
760
962
|
this.store.status = 'ready';
|
|
761
|
-
|
|
963
|
+
_context10.next = 11;
|
|
762
964
|
return this.core.effects.emit(VenueBookingHooks.onRefresh, {
|
|
763
965
|
status: this.store.status
|
|
764
966
|
});
|
|
@@ -766,18 +968,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
766
968
|
this.logMethodSuccess('refresh', {
|
|
767
969
|
status: this.store.status
|
|
768
970
|
});
|
|
769
|
-
|
|
971
|
+
_context10.next = 18;
|
|
770
972
|
break;
|
|
771
973
|
case 14:
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
this.logMethodError('refresh',
|
|
775
|
-
throw
|
|
974
|
+
_context10.prev = 14;
|
|
975
|
+
_context10.t0 = _context10["catch"](2);
|
|
976
|
+
this.logMethodError('refresh', _context10.t0);
|
|
977
|
+
throw _context10.t0;
|
|
776
978
|
case 18:
|
|
777
979
|
case "end":
|
|
778
|
-
return
|
|
980
|
+
return _context10.stop();
|
|
779
981
|
}
|
|
780
|
-
},
|
|
982
|
+
}, _callee10, this, [[2, 14]]);
|
|
781
983
|
}));
|
|
782
984
|
function refresh() {
|
|
783
985
|
return _refresh.apply(this, arguments);
|
|
@@ -818,26 +1020,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
818
1020
|
}, {
|
|
819
1021
|
key: "loadAllProducts",
|
|
820
1022
|
value: function () {
|
|
821
|
-
var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1023
|
+
var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
822
1024
|
var _this5 = this;
|
|
823
|
-
return _regeneratorRuntime().wrap(function
|
|
824
|
-
while (1) switch (
|
|
1025
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1026
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
825
1027
|
case 0:
|
|
826
1028
|
if (!this.loadAllProductsInFlight) {
|
|
827
|
-
|
|
1029
|
+
_context11.next = 2;
|
|
828
1030
|
break;
|
|
829
1031
|
}
|
|
830
|
-
return
|
|
1032
|
+
return _context11.abrupt("return", this.loadAllProductsInFlight);
|
|
831
1033
|
case 2:
|
|
832
1034
|
this.loadAllProductsInFlight = this._doLoadAllProducts().finally(function () {
|
|
833
1035
|
_this5.loadAllProductsInFlight = null;
|
|
834
1036
|
});
|
|
835
|
-
return
|
|
1037
|
+
return _context11.abrupt("return", this.loadAllProductsInFlight);
|
|
836
1038
|
case 4:
|
|
837
1039
|
case "end":
|
|
838
|
-
return
|
|
1040
|
+
return _context11.stop();
|
|
839
1041
|
}
|
|
840
|
-
},
|
|
1042
|
+
}, _callee11, this);
|
|
841
1043
|
}));
|
|
842
1044
|
function loadAllProducts() {
|
|
843
1045
|
return _loadAllProducts.apply(this, arguments);
|
|
@@ -847,31 +1049,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
847
1049
|
}, {
|
|
848
1050
|
key: "_doLoadAllProducts",
|
|
849
1051
|
value: function () {
|
|
850
|
-
var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
851
|
-
var _this$
|
|
852
|
-
return _regeneratorRuntime().wrap(function
|
|
853
|
-
while (1) switch (
|
|
1052
|
+
var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
1053
|
+
var _this$otherParams12, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore, _this$store$order3, _this$store$order3$ge, products;
|
|
1054
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1055
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
854
1056
|
case 0:
|
|
855
1057
|
this.logMethodStart('loadAllProducts');
|
|
856
|
-
|
|
1058
|
+
_context12.prev = 1;
|
|
857
1059
|
if (this.store.venueProducts) {
|
|
858
|
-
|
|
1060
|
+
_context12.next = 4;
|
|
859
1061
|
break;
|
|
860
1062
|
}
|
|
861
1063
|
throw new Error('venueProducts 模块未初始化');
|
|
862
1064
|
case 4:
|
|
863
1065
|
if (this.store.addonProducts) {
|
|
864
|
-
|
|
1066
|
+
_context12.next = 6;
|
|
865
1067
|
break;
|
|
866
1068
|
}
|
|
867
1069
|
throw new Error('addonProducts 模块未初始化');
|
|
868
1070
|
case 6:
|
|
869
|
-
|
|
1071
|
+
_context12.next = 8;
|
|
870
1072
|
return this.loadOpenDataConfig();
|
|
871
1073
|
case 8:
|
|
872
|
-
associatedMenus = ((_this$
|
|
1074
|
+
associatedMenus = ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 || (_this$otherParams12 = _this$otherParams12.openData) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12['menu.associated_menus']) || [];
|
|
873
1075
|
if (associatedMenus.length) {
|
|
874
|
-
|
|
1076
|
+
_context12.next = 12;
|
|
875
1077
|
break;
|
|
876
1078
|
}
|
|
877
1079
|
this.logMethodError('loadAllProducts', new Error('未获取到餐牌配置(menu.associated_menus),请检查 OpenData 配置'));
|
|
@@ -880,7 +1082,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
880
1082
|
menuListIds = associatedMenus.map(function (n) {
|
|
881
1083
|
return Number(n.value);
|
|
882
1084
|
});
|
|
883
|
-
|
|
1085
|
+
_context12.next = 15;
|
|
884
1086
|
return this.store.venueProducts.loadProducts({
|
|
885
1087
|
menu_list_ids: menuListIds,
|
|
886
1088
|
cacheId: this.cacheId,
|
|
@@ -888,7 +1090,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
888
1090
|
schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
889
1091
|
});
|
|
890
1092
|
case 15:
|
|
891
|
-
allProducts =
|
|
1093
|
+
allProducts = _context12.sent;
|
|
892
1094
|
list = Array.isArray(allProducts) ? allProducts : [];
|
|
893
1095
|
venueList = list.filter(function (p) {
|
|
894
1096
|
return p.duration != null;
|
|
@@ -904,6 +1106,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
904
1106
|
}
|
|
905
1107
|
this.store.addonProducts.addProduct(addonList);
|
|
906
1108
|
this.resourceProductMap = buildResourceProductMap(venueList);
|
|
1109
|
+
|
|
1110
|
+
// 加载 holder 表单
|
|
1111
|
+
if (!this.store.order) {
|
|
1112
|
+
_context12.next = 27;
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
products = ((_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getOrderProducts) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3)) || [];
|
|
1116
|
+
_context12.next = 27;
|
|
1117
|
+
return this.preloadHolderForms(products);
|
|
1118
|
+
case 27:
|
|
907
1119
|
this.productsLoaded = true;
|
|
908
1120
|
this.logMethodSuccess('loadAllProducts', {
|
|
909
1121
|
total: list.length,
|
|
@@ -911,20 +1123,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
911
1123
|
addonCount: addonList.length,
|
|
912
1124
|
resourceCount: this.resourceProductMap.size
|
|
913
1125
|
});
|
|
914
|
-
return
|
|
1126
|
+
return _context12.abrupt("return", {
|
|
915
1127
|
venueProducts: venueList,
|
|
916
1128
|
addonProducts: addonList
|
|
917
1129
|
});
|
|
918
|
-
case 28:
|
|
919
|
-
_context11.prev = 28;
|
|
920
|
-
_context11.t0 = _context11["catch"](1);
|
|
921
|
-
this.logMethodError('loadAllProducts', _context11.t0);
|
|
922
|
-
throw _context11.t0;
|
|
923
1130
|
case 32:
|
|
1131
|
+
_context12.prev = 32;
|
|
1132
|
+
_context12.t0 = _context12["catch"](1);
|
|
1133
|
+
this.logMethodError('loadAllProducts', _context12.t0);
|
|
1134
|
+
throw _context12.t0;
|
|
1135
|
+
case 36:
|
|
924
1136
|
case "end":
|
|
925
|
-
return
|
|
1137
|
+
return _context12.stop();
|
|
926
1138
|
}
|
|
927
|
-
},
|
|
1139
|
+
}, _callee12, this, [[1, 32]]);
|
|
928
1140
|
}));
|
|
929
1141
|
function _doLoadAllProducts() {
|
|
930
1142
|
return _doLoadAllProducts2.apply(this, arguments);
|
|
@@ -934,21 +1146,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
934
1146
|
}, {
|
|
935
1147
|
key: "loadVenueProducts",
|
|
936
1148
|
value: function () {
|
|
937
|
-
var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1149
|
+
var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
938
1150
|
var result;
|
|
939
|
-
return _regeneratorRuntime().wrap(function
|
|
940
|
-
while (1) switch (
|
|
1151
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1152
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
941
1153
|
case 0:
|
|
942
|
-
|
|
1154
|
+
_context13.next = 2;
|
|
943
1155
|
return this.loadAllProducts();
|
|
944
1156
|
case 2:
|
|
945
|
-
result =
|
|
946
|
-
return
|
|
1157
|
+
result = _context13.sent;
|
|
1158
|
+
return _context13.abrupt("return", result.venueProducts);
|
|
947
1159
|
case 4:
|
|
948
1160
|
case "end":
|
|
949
|
-
return
|
|
1161
|
+
return _context13.stop();
|
|
950
1162
|
}
|
|
951
|
-
},
|
|
1163
|
+
}, _callee13, this);
|
|
952
1164
|
}));
|
|
953
1165
|
function loadVenueProducts() {
|
|
954
1166
|
return _loadVenueProducts.apply(this, arguments);
|
|
@@ -958,21 +1170,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
958
1170
|
}, {
|
|
959
1171
|
key: "loadAddonProducts",
|
|
960
1172
|
value: function () {
|
|
961
|
-
var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1173
|
+
var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
962
1174
|
var result;
|
|
963
|
-
return _regeneratorRuntime().wrap(function
|
|
964
|
-
while (1) switch (
|
|
1175
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1176
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
965
1177
|
case 0:
|
|
966
|
-
|
|
1178
|
+
_context14.next = 2;
|
|
967
1179
|
return this.loadAllProducts();
|
|
968
1180
|
case 2:
|
|
969
|
-
result =
|
|
970
|
-
return
|
|
1181
|
+
result = _context14.sent;
|
|
1182
|
+
return _context14.abrupt("return", result.addonProducts);
|
|
971
1183
|
case 4:
|
|
972
1184
|
case "end":
|
|
973
|
-
return
|
|
1185
|
+
return _context14.stop();
|
|
974
1186
|
}
|
|
975
|
-
},
|
|
1187
|
+
}, _callee14, this);
|
|
976
1188
|
}));
|
|
977
1189
|
function loadAddonProducts() {
|
|
978
1190
|
return _loadAddonProducts.apply(this, arguments);
|
|
@@ -996,38 +1208,38 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
996
1208
|
}, {
|
|
997
1209
|
key: "loadQuotations",
|
|
998
1210
|
value: function () {
|
|
999
|
-
var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1000
|
-
return _regeneratorRuntime().wrap(function
|
|
1001
|
-
while (1) switch (
|
|
1211
|
+
var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
|
|
1212
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1213
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1002
1214
|
case 0:
|
|
1003
1215
|
this.logMethodStart('loadQuotations');
|
|
1004
|
-
|
|
1216
|
+
_context15.prev = 1;
|
|
1005
1217
|
if (this.store.quotation) {
|
|
1006
|
-
|
|
1218
|
+
_context15.next = 4;
|
|
1007
1219
|
break;
|
|
1008
1220
|
}
|
|
1009
1221
|
throw new Error('quotation 模块未初始化');
|
|
1010
1222
|
case 4:
|
|
1011
|
-
|
|
1223
|
+
_context15.next = 6;
|
|
1012
1224
|
return this.store.quotation.loadQuotations(params);
|
|
1013
1225
|
case 6:
|
|
1014
1226
|
this.logMethodSuccess('loadQuotations', {
|
|
1015
1227
|
count: this.store.quotation.getQuotationList().length
|
|
1016
1228
|
});
|
|
1017
|
-
|
|
1229
|
+
_context15.next = 13;
|
|
1018
1230
|
break;
|
|
1019
1231
|
case 9:
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
this.logMethodError('loadQuotations',
|
|
1023
|
-
throw
|
|
1232
|
+
_context15.prev = 9;
|
|
1233
|
+
_context15.t0 = _context15["catch"](1);
|
|
1234
|
+
this.logMethodError('loadQuotations', _context15.t0);
|
|
1235
|
+
throw _context15.t0;
|
|
1024
1236
|
case 13:
|
|
1025
1237
|
case "end":
|
|
1026
|
-
return
|
|
1238
|
+
return _context15.stop();
|
|
1027
1239
|
}
|
|
1028
|
-
},
|
|
1240
|
+
}, _callee15, this, [[1, 9]]);
|
|
1029
1241
|
}));
|
|
1030
|
-
function loadQuotations(
|
|
1242
|
+
function loadQuotations(_x7) {
|
|
1031
1243
|
return _loadQuotations.apply(this, arguments);
|
|
1032
1244
|
}
|
|
1033
1245
|
return loadQuotations;
|
|
@@ -1035,46 +1247,46 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1035
1247
|
}, {
|
|
1036
1248
|
key: "fetchResourceAvailability",
|
|
1037
1249
|
value: function () {
|
|
1038
|
-
var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1039
|
-
var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData,
|
|
1040
|
-
return _regeneratorRuntime().wrap(function
|
|
1041
|
-
while (1) switch (
|
|
1250
|
+
var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
|
|
1251
|
+
var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator3, _step3, item, _i3, _rawData, _item, mappings, _iterator4, _step4, mapping;
|
|
1252
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1253
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1042
1254
|
case 0:
|
|
1043
1255
|
this.logMethodStart('fetchResourceAvailability', params);
|
|
1044
|
-
|
|
1256
|
+
_context16.prev = 1;
|
|
1045
1257
|
venueProducts = this.getVenueProducts();
|
|
1046
1258
|
if (venueProducts.length) {
|
|
1047
|
-
|
|
1259
|
+
_context16.next = 7;
|
|
1048
1260
|
break;
|
|
1049
1261
|
}
|
|
1050
1262
|
this.store.rawResourceData = [];
|
|
1051
1263
|
this.logMethodSuccess('fetchResourceAvailability', {
|
|
1052
1264
|
resourceCount: 0
|
|
1053
1265
|
});
|
|
1054
|
-
return
|
|
1266
|
+
return _context16.abrupt("return");
|
|
1055
1267
|
case 7:
|
|
1056
1268
|
resourceIds = extractResourceIds(venueProducts);
|
|
1057
1269
|
if (resourceIds.length) {
|
|
1058
|
-
|
|
1270
|
+
_context16.next = 12;
|
|
1059
1271
|
break;
|
|
1060
1272
|
}
|
|
1061
1273
|
this.store.rawResourceData = [];
|
|
1062
1274
|
this.logMethodSuccess('fetchResourceAvailability', {
|
|
1063
1275
|
resourceIds: []
|
|
1064
1276
|
});
|
|
1065
|
-
return
|
|
1277
|
+
return _context16.abrupt("return");
|
|
1066
1278
|
case 12:
|
|
1067
1279
|
// 跨天营业时,endDate 扩展一天以覆盖次日凌晨时段
|
|
1068
1280
|
config = this.store.slotConfig;
|
|
1069
1281
|
crossDay = isBusinessHoursCrossDay(config);
|
|
1070
1282
|
effectiveEndDate = crossDay ? dayjs(params.endDate).add(1, 'day').format('YYYY-MM-DD') : params.endDate;
|
|
1071
1283
|
if (this.store.date) {
|
|
1072
|
-
|
|
1284
|
+
_context16.next = 17;
|
|
1073
1285
|
break;
|
|
1074
1286
|
}
|
|
1075
1287
|
throw new Error('date 模块未初始化');
|
|
1076
1288
|
case 17:
|
|
1077
|
-
|
|
1289
|
+
_context16.next = 19;
|
|
1078
1290
|
return this.store.date.fetchResourceDates({
|
|
1079
1291
|
query: {
|
|
1080
1292
|
start_date: params.startDate,
|
|
@@ -1084,13 +1296,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1084
1296
|
useCache: false
|
|
1085
1297
|
});
|
|
1086
1298
|
case 19:
|
|
1087
|
-
res =
|
|
1299
|
+
res = _context16.sent;
|
|
1088
1300
|
rawData = [];
|
|
1089
1301
|
if (res !== null && res !== void 0 && res.data && Array.isArray(res.data)) {
|
|
1090
|
-
|
|
1302
|
+
_iterator3 = _createForOfIteratorHelper(res.data);
|
|
1091
1303
|
try {
|
|
1092
|
-
for (
|
|
1093
|
-
item =
|
|
1304
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1305
|
+
item = _step3.value;
|
|
1094
1306
|
rawData.push(_objectSpread({
|
|
1095
1307
|
resourceId: item.id,
|
|
1096
1308
|
formId: item.form_id,
|
|
@@ -1098,41 +1310,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1098
1310
|
}, item));
|
|
1099
1311
|
}
|
|
1100
1312
|
} catch (err) {
|
|
1101
|
-
|
|
1313
|
+
_iterator3.e(err);
|
|
1102
1314
|
} finally {
|
|
1103
|
-
|
|
1315
|
+
_iterator3.f();
|
|
1104
1316
|
}
|
|
1105
1317
|
}
|
|
1106
1318
|
this.store.rawResourceData = rawData;
|
|
1107
1319
|
_i3 = 0, _rawData = rawData;
|
|
1108
1320
|
case 24:
|
|
1109
1321
|
if (!(_i3 < _rawData.length)) {
|
|
1110
|
-
|
|
1322
|
+
_context16.next = 34;
|
|
1111
1323
|
break;
|
|
1112
1324
|
}
|
|
1113
1325
|
_item = _rawData[_i3];
|
|
1114
1326
|
mappings = this.resourceProductMap.get(_item.resourceId);
|
|
1115
1327
|
if (mappings) {
|
|
1116
|
-
|
|
1328
|
+
_context16.next = 29;
|
|
1117
1329
|
break;
|
|
1118
1330
|
}
|
|
1119
|
-
return
|
|
1331
|
+
return _context16.abrupt("continue", 31);
|
|
1120
1332
|
case 29:
|
|
1121
|
-
|
|
1333
|
+
_iterator4 = _createForOfIteratorHelper(mappings);
|
|
1122
1334
|
try {
|
|
1123
|
-
for (
|
|
1124
|
-
mapping =
|
|
1335
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1336
|
+
mapping = _step4.value;
|
|
1125
1337
|
if (_item.main_field) mapping.resourceName = _item.main_field;
|
|
1126
1338
|
if (_item.resource_form_id) mapping.formId = _item.resource_form_id;
|
|
1127
1339
|
}
|
|
1128
1340
|
} catch (err) {
|
|
1129
|
-
|
|
1341
|
+
_iterator4.e(err);
|
|
1130
1342
|
} finally {
|
|
1131
|
-
|
|
1343
|
+
_iterator4.f();
|
|
1132
1344
|
}
|
|
1133
1345
|
case 31:
|
|
1134
1346
|
_i3++;
|
|
1135
|
-
|
|
1347
|
+
_context16.next = 24;
|
|
1136
1348
|
break;
|
|
1137
1349
|
case 34:
|
|
1138
1350
|
this.logMethodSuccess('fetchResourceAvailability', {
|
|
@@ -1141,21 +1353,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1141
1353
|
return sum + r.times.length;
|
|
1142
1354
|
}, 0)
|
|
1143
1355
|
});
|
|
1144
|
-
|
|
1356
|
+
_context16.next = 42;
|
|
1145
1357
|
break;
|
|
1146
1358
|
case 37:
|
|
1147
|
-
|
|
1148
|
-
|
|
1359
|
+
_context16.prev = 37;
|
|
1360
|
+
_context16.t0 = _context16["catch"](1);
|
|
1149
1361
|
this.store.rawResourceData = [];
|
|
1150
|
-
this.logMethodError('fetchResourceAvailability',
|
|
1151
|
-
throw
|
|
1362
|
+
this.logMethodError('fetchResourceAvailability', _context16.t0);
|
|
1363
|
+
throw _context16.t0;
|
|
1152
1364
|
case 42:
|
|
1153
1365
|
case "end":
|
|
1154
|
-
return
|
|
1366
|
+
return _context16.stop();
|
|
1155
1367
|
}
|
|
1156
|
-
},
|
|
1368
|
+
}, _callee16, this, [[1, 37]]);
|
|
1157
1369
|
}));
|
|
1158
|
-
function fetchResourceAvailability(
|
|
1370
|
+
function fetchResourceAvailability(_x8) {
|
|
1159
1371
|
return _fetchResourceAvailability.apply(this, arguments);
|
|
1160
1372
|
}
|
|
1161
1373
|
return fetchResourceAvailability;
|
|
@@ -1187,18 +1399,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1187
1399
|
var timeRangeMap = calcMinTimeMaxTimeBySchedules(scheduleList, undefined, date);
|
|
1188
1400
|
var earliestStart = null;
|
|
1189
1401
|
var latestEnd = null;
|
|
1190
|
-
var
|
|
1191
|
-
|
|
1402
|
+
var _iterator5 = _createForOfIteratorHelper(scheduleList),
|
|
1403
|
+
_step5;
|
|
1192
1404
|
try {
|
|
1193
|
-
for (
|
|
1405
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1194
1406
|
var _timeRangeMap$schedul;
|
|
1195
|
-
var schedule =
|
|
1407
|
+
var schedule = _step5.value;
|
|
1196
1408
|
var dateRangeList = (timeRangeMap === null || timeRangeMap === void 0 || (_timeRangeMap$schedul = timeRangeMap[schedule.id]) === null || _timeRangeMap$schedul === void 0 ? void 0 : _timeRangeMap$schedul.dateRangeFormat) || [];
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1409
|
+
var _iterator6 = _createForOfIteratorHelper(dateRangeList),
|
|
1410
|
+
_step6;
|
|
1199
1411
|
try {
|
|
1200
|
-
for (
|
|
1201
|
-
var range =
|
|
1412
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1413
|
+
var range = _step6.value;
|
|
1202
1414
|
var start = dayjs(range === null || range === void 0 ? void 0 : range.start);
|
|
1203
1415
|
var end = dayjs(range === null || range === void 0 ? void 0 : range.end);
|
|
1204
1416
|
if (!start.isValid() || !end.isValid()) continue;
|
|
@@ -1210,15 +1422,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1210
1422
|
}
|
|
1211
1423
|
}
|
|
1212
1424
|
} catch (err) {
|
|
1213
|
-
|
|
1425
|
+
_iterator6.e(err);
|
|
1214
1426
|
} finally {
|
|
1215
|
-
|
|
1427
|
+
_iterator6.f();
|
|
1216
1428
|
}
|
|
1217
1429
|
}
|
|
1218
1430
|
} catch (err) {
|
|
1219
|
-
|
|
1431
|
+
_iterator5.e(err);
|
|
1220
1432
|
} finally {
|
|
1221
|
-
|
|
1433
|
+
_iterator5.f();
|
|
1222
1434
|
}
|
|
1223
1435
|
if (!earliestStart || !latestEnd) return nextSlotConfig;
|
|
1224
1436
|
return _objectSpread(_objectSpread({}, nextSlotConfig), {}, {
|
|
@@ -1288,20 +1500,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1288
1500
|
}, {
|
|
1289
1501
|
key: "toggleSlot",
|
|
1290
1502
|
value: function () {
|
|
1291
|
-
var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1503
|
+
var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(slot) {
|
|
1292
1504
|
var mappings, mapping, currentSlots, existIndex, nextSlots, products;
|
|
1293
|
-
return _regeneratorRuntime().wrap(function
|
|
1294
|
-
while (1) switch (
|
|
1505
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1506
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1295
1507
|
case 0:
|
|
1296
1508
|
this.logMethodStart('toggleSlot', {
|
|
1297
1509
|
resourceId: slot.resourceId,
|
|
1298
1510
|
productId: slot.productId,
|
|
1299
1511
|
startTime: slot.startTime
|
|
1300
1512
|
});
|
|
1301
|
-
|
|
1513
|
+
_context17.prev = 1;
|
|
1302
1514
|
mappings = this.resourceProductMap.get(slot.resourceId);
|
|
1303
1515
|
if (!(!mappings || !mappings.length)) {
|
|
1304
|
-
|
|
1516
|
+
_context17.next = 5;
|
|
1305
1517
|
break;
|
|
1306
1518
|
}
|
|
1307
1519
|
throw new Error("\u672A\u627E\u5230\u8D44\u6E90 ".concat(slot.resourceId, " \u7684\u5546\u54C1\u6620\u5C04"));
|
|
@@ -1310,13 +1522,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1310
1522
|
return m.productId === slot.productId;
|
|
1311
1523
|
});
|
|
1312
1524
|
if (mapping) {
|
|
1313
|
-
|
|
1525
|
+
_context17.next = 8;
|
|
1314
1526
|
break;
|
|
1315
1527
|
}
|
|
1316
1528
|
throw new Error("\u8D44\u6E90 ".concat(slot.resourceId, " \u672A\u5173\u8054\u5546\u54C1 ").concat(slot.productId));
|
|
1317
1529
|
case 8:
|
|
1318
1530
|
if (this.store.order) {
|
|
1319
|
-
|
|
1531
|
+
_context17.next = 10;
|
|
1320
1532
|
break;
|
|
1321
1533
|
}
|
|
1322
1534
|
throw new Error('order 模块未初始化');
|
|
@@ -1332,14 +1544,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1332
1544
|
} else {
|
|
1333
1545
|
nextSlots = [].concat(_toConsumableArray(currentSlots), [slot]);
|
|
1334
1546
|
}
|
|
1335
|
-
|
|
1547
|
+
_context17.next = 15;
|
|
1336
1548
|
return this.reconcileOrderForResourceProduct(slot.resourceId, slot.productId, nextSlots);
|
|
1337
1549
|
case 15:
|
|
1338
1550
|
products = this.store.order.getOrderProducts();
|
|
1339
|
-
|
|
1551
|
+
_context17.next = 18;
|
|
1340
1552
|
return this.refreshItemRuleQuantityLimits();
|
|
1341
1553
|
case 18:
|
|
1342
|
-
|
|
1554
|
+
_context17.next = 20;
|
|
1343
1555
|
return this.refreshCartValidationPassed();
|
|
1344
1556
|
case 20:
|
|
1345
1557
|
this.logMethodSuccess('toggleSlot', {
|
|
@@ -1348,19 +1560,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1348
1560
|
productId: slot.productId,
|
|
1349
1561
|
slotCount: nextSlots.length
|
|
1350
1562
|
});
|
|
1351
|
-
return
|
|
1563
|
+
return _context17.abrupt("return", products);
|
|
1352
1564
|
case 24:
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
this.logMethodError('toggleSlot',
|
|
1356
|
-
throw
|
|
1565
|
+
_context17.prev = 24;
|
|
1566
|
+
_context17.t0 = _context17["catch"](1);
|
|
1567
|
+
this.logMethodError('toggleSlot', _context17.t0);
|
|
1568
|
+
throw _context17.t0;
|
|
1357
1569
|
case 28:
|
|
1358
1570
|
case "end":
|
|
1359
|
-
return
|
|
1571
|
+
return _context17.stop();
|
|
1360
1572
|
}
|
|
1361
|
-
},
|
|
1573
|
+
}, _callee17, this, [[1, 24]]);
|
|
1362
1574
|
}));
|
|
1363
|
-
function toggleSlot(
|
|
1575
|
+
function toggleSlot(_x9) {
|
|
1364
1576
|
return _toggleSlot.apply(this, arguments);
|
|
1365
1577
|
}
|
|
1366
1578
|
return toggleSlot;
|
|
@@ -1372,8 +1584,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1372
1584
|
}, {
|
|
1373
1585
|
key: "getSelectedSlotsForResource",
|
|
1374
1586
|
value: function getSelectedSlotsForResource(resourceId, productId) {
|
|
1375
|
-
var _this$store$
|
|
1376
|
-
var tempOrder = (_this$store$
|
|
1587
|
+
var _this$store$order4;
|
|
1588
|
+
var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
|
|
1377
1589
|
if (!tempOrder) return [];
|
|
1378
1590
|
var venueProducts = tempOrder.products.filter(function (p) {
|
|
1379
1591
|
var _p$metadata, _p$metadata2;
|
|
@@ -1384,24 +1596,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1384
1596
|
});
|
|
1385
1597
|
var slotDuration = this.store.slotConfig.slotDurationMinutes;
|
|
1386
1598
|
var slots = [];
|
|
1387
|
-
var
|
|
1388
|
-
|
|
1599
|
+
var _iterator7 = _createForOfIteratorHelper(venueProducts),
|
|
1600
|
+
_step7;
|
|
1389
1601
|
try {
|
|
1390
1602
|
var _loop = function _loop() {
|
|
1391
|
-
var product =
|
|
1603
|
+
var product = _step7.value;
|
|
1392
1604
|
slots.push.apply(slots, _toConsumableArray(expandMergedSlotToIndividual(product, slotDuration).map(function (s) {
|
|
1393
1605
|
return _objectSpread(_objectSpread({}, s), {}, {
|
|
1394
1606
|
productId: Number(product.product_id)
|
|
1395
1607
|
});
|
|
1396
1608
|
})));
|
|
1397
1609
|
};
|
|
1398
|
-
for (
|
|
1610
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1399
1611
|
_loop();
|
|
1400
1612
|
}
|
|
1401
1613
|
} catch (err) {
|
|
1402
|
-
|
|
1614
|
+
_iterator7.e(err);
|
|
1403
1615
|
} finally {
|
|
1404
|
-
|
|
1616
|
+
_iterator7.f();
|
|
1405
1617
|
}
|
|
1406
1618
|
return slots.sort(function (a, b) {
|
|
1407
1619
|
return a.startTime.localeCompare(b.startTime);
|
|
@@ -1474,28 +1686,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1474
1686
|
|
|
1475
1687
|
// 规则 2:当前是组合资源,任一子资源被选 → 禁用
|
|
1476
1688
|
if (currentIsCombined) {
|
|
1477
|
-
var
|
|
1478
|
-
|
|
1689
|
+
var _iterator8 = _createForOfIteratorHelper(currentChildIds),
|
|
1690
|
+
_step8;
|
|
1479
1691
|
try {
|
|
1480
|
-
for (
|
|
1481
|
-
var childId =
|
|
1692
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1693
|
+
var childId = _step8.value;
|
|
1482
1694
|
if (getSelectedAt(childId).length > 0) return true;
|
|
1483
1695
|
}
|
|
1484
1696
|
} catch (err) {
|
|
1485
|
-
|
|
1697
|
+
_iterator8.e(err);
|
|
1486
1698
|
} finally {
|
|
1487
|
-
|
|
1699
|
+
_iterator8.f();
|
|
1488
1700
|
}
|
|
1489
1701
|
}
|
|
1490
1702
|
|
|
1491
1703
|
// 规则 3 & 4:扫描所有已选的 (resId),若是组合资源,检查其 children 是否包含当前 resourceId 或与当前 child 集合有交集
|
|
1492
|
-
var
|
|
1493
|
-
|
|
1704
|
+
var _iterator9 = _createForOfIteratorHelper(allSelected),
|
|
1705
|
+
_step9;
|
|
1494
1706
|
try {
|
|
1495
|
-
for (
|
|
1496
|
-
var
|
|
1497
|
-
selectedResId =
|
|
1498
|
-
slots =
|
|
1707
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1708
|
+
var _step9$value = _slicedToArray(_step9.value, 2),
|
|
1709
|
+
selectedResId = _step9$value[0],
|
|
1710
|
+
slots = _step9$value[1];
|
|
1499
1711
|
if (!slots.some(function (s) {
|
|
1500
1712
|
return s.startTime === startTime;
|
|
1501
1713
|
})) continue;
|
|
@@ -1521,9 +1733,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1521
1733
|
}
|
|
1522
1734
|
}
|
|
1523
1735
|
} catch (err) {
|
|
1524
|
-
|
|
1736
|
+
_iterator9.e(err);
|
|
1525
1737
|
} finally {
|
|
1526
|
-
|
|
1738
|
+
_iterator9.f();
|
|
1527
1739
|
}
|
|
1528
1740
|
return false;
|
|
1529
1741
|
}
|
|
@@ -1534,22 +1746,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1534
1746
|
}, {
|
|
1535
1747
|
key: "getAllSelectedSlots",
|
|
1536
1748
|
value: function getAllSelectedSlots() {
|
|
1537
|
-
var _this$store$
|
|
1749
|
+
var _this$store$order5;
|
|
1538
1750
|
var result = new Map();
|
|
1539
|
-
var tempOrder = (_this$store$
|
|
1751
|
+
var tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder();
|
|
1540
1752
|
if (!tempOrder) return result;
|
|
1541
1753
|
var venueProducts = tempOrder.products.filter(function (p) {
|
|
1542
1754
|
var _p$metadata3;
|
|
1543
1755
|
return (_p$metadata3 = p.metadata) === null || _p$metadata3 === void 0 ? void 0 : _p$metadata3.venue_booking;
|
|
1544
1756
|
});
|
|
1545
1757
|
var slotDuration = this.store.slotConfig.slotDurationMinutes;
|
|
1546
|
-
var
|
|
1547
|
-
|
|
1758
|
+
var _iterator10 = _createForOfIteratorHelper(venueProducts),
|
|
1759
|
+
_step10;
|
|
1548
1760
|
try {
|
|
1549
1761
|
var _loop2 = function _loop2() {
|
|
1550
|
-
var _product$
|
|
1551
|
-
var product =
|
|
1552
|
-
var resourceId = (_product$
|
|
1762
|
+
var _product$metadata2;
|
|
1763
|
+
var product = _step10.value;
|
|
1764
|
+
var resourceId = (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.resource_id;
|
|
1553
1765
|
if (resourceId == null) return 1; // continue
|
|
1554
1766
|
var productId = Number(product.product_id);
|
|
1555
1767
|
var existing = result.get(resourceId) || [];
|
|
@@ -1560,29 +1772,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1560
1772
|
})));
|
|
1561
1773
|
result.set(resourceId, existing);
|
|
1562
1774
|
};
|
|
1563
|
-
for (
|
|
1775
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1564
1776
|
if (_loop2()) continue;
|
|
1565
1777
|
}
|
|
1566
1778
|
} catch (err) {
|
|
1567
|
-
|
|
1779
|
+
_iterator10.e(err);
|
|
1568
1780
|
} finally {
|
|
1569
|
-
|
|
1781
|
+
_iterator10.f();
|
|
1570
1782
|
}
|
|
1571
|
-
var
|
|
1572
|
-
|
|
1783
|
+
var _iterator11 = _createForOfIteratorHelper(result),
|
|
1784
|
+
_step11;
|
|
1573
1785
|
try {
|
|
1574
|
-
for (
|
|
1575
|
-
var
|
|
1576
|
-
key =
|
|
1577
|
-
slots =
|
|
1786
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
1787
|
+
var _step11$value = _slicedToArray(_step11.value, 2),
|
|
1788
|
+
key = _step11$value[0],
|
|
1789
|
+
slots = _step11$value[1];
|
|
1578
1790
|
result.set(key, slots.sort(function (a, b) {
|
|
1579
1791
|
return a.startTime.localeCompare(b.startTime);
|
|
1580
1792
|
}));
|
|
1581
1793
|
}
|
|
1582
1794
|
} catch (err) {
|
|
1583
|
-
|
|
1795
|
+
_iterator11.e(err);
|
|
1584
1796
|
} finally {
|
|
1585
|
-
|
|
1797
|
+
_iterator11.f();
|
|
1586
1798
|
}
|
|
1587
1799
|
return result;
|
|
1588
1800
|
}
|
|
@@ -1595,26 +1807,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1595
1807
|
}, {
|
|
1596
1808
|
key: "reconcileOrderForResourceProduct",
|
|
1597
1809
|
value: (function () {
|
|
1598
|
-
var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1599
|
-
var
|
|
1600
|
-
|
|
1601
|
-
|
|
1810
|
+
var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(resourceId, productId, slots) {
|
|
1811
|
+
var _this$store$order6, _this$store$order6$ge;
|
|
1812
|
+
var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, productTitle, resourceEntry, venueProductOrigin, normalizedVenueOrderProduct, venueOrderProduct, booking, products;
|
|
1813
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1814
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1602
1815
|
case 0:
|
|
1603
1816
|
mappings = this.resourceProductMap.get(resourceId);
|
|
1604
1817
|
if (!(!mappings || !mappings.length || !this.store.order)) {
|
|
1605
|
-
|
|
1818
|
+
_context18.next = 3;
|
|
1606
1819
|
break;
|
|
1607
1820
|
}
|
|
1608
|
-
return
|
|
1821
|
+
return _context18.abrupt("return");
|
|
1609
1822
|
case 3:
|
|
1610
1823
|
mapping = mappings.find(function (m) {
|
|
1611
1824
|
return m.productId === productId;
|
|
1612
1825
|
});
|
|
1613
1826
|
if (mapping) {
|
|
1614
|
-
|
|
1827
|
+
_context18.next = 6;
|
|
1615
1828
|
break;
|
|
1616
1829
|
}
|
|
1617
|
-
return
|
|
1830
|
+
return _context18.abrupt("return");
|
|
1618
1831
|
case 6:
|
|
1619
1832
|
tempOrder = this.store.order.ensureTempOrder();
|
|
1620
1833
|
matchesCurrent = function matchesCurrent(meta, pid) {
|
|
@@ -1632,17 +1845,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1632
1845
|
return Number(bookingProductId) !== Number(productId);
|
|
1633
1846
|
});
|
|
1634
1847
|
if (slots.length) {
|
|
1635
|
-
|
|
1848
|
+
_context18.next = 16;
|
|
1636
1849
|
break;
|
|
1637
1850
|
}
|
|
1638
1851
|
this.store.order.applyDiscount();
|
|
1639
|
-
|
|
1852
|
+
_context18.next = 14;
|
|
1640
1853
|
return this.store.order.recalculateSummary({
|
|
1641
1854
|
createIfMissing: true
|
|
1642
1855
|
});
|
|
1643
1856
|
case 14:
|
|
1644
1857
|
this.store.order.persistTempOrder();
|
|
1645
|
-
return
|
|
1858
|
+
return _context18.abrupt("return");
|
|
1646
1859
|
case 16:
|
|
1647
1860
|
merged = mergeConsecutiveSlots(slots);
|
|
1648
1861
|
rawResource = this.store.rawResourceData.find(function (r) {
|
|
@@ -1661,6 +1874,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1661
1874
|
endMoment = dayjs(group.endTime, 'YYYY-MM-DD HH:mm');
|
|
1662
1875
|
duration = endMoment.diff(startMoment, 'minute');
|
|
1663
1876
|
customDepositData = cloneCustomDepositData(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.custom_deposit_data);
|
|
1877
|
+
productTitle = this.normalizeVenueProductTitle(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.product_title) || this.normalizeVenueProductTitle(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.title) || this.normalizeVenueProductTitle(mapping.productTitle);
|
|
1664
1878
|
resourceEntry = {
|
|
1665
1879
|
relation_type: 'form',
|
|
1666
1880
|
like_status: 'common',
|
|
@@ -1689,7 +1903,45 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1689
1903
|
};
|
|
1690
1904
|
});
|
|
1691
1905
|
}
|
|
1692
|
-
|
|
1906
|
+
venueProductOrigin = {
|
|
1907
|
+
name: mapping.productTitle,
|
|
1908
|
+
product_title: productTitle,
|
|
1909
|
+
cover: (venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.cover) || '',
|
|
1910
|
+
custom_deposit_data: customDepositData,
|
|
1911
|
+
id: 0,
|
|
1912
|
+
number: 1,
|
|
1913
|
+
registration_type: 'all',
|
|
1914
|
+
relation_products: [],
|
|
1915
|
+
is_all: false,
|
|
1916
|
+
product: {
|
|
1917
|
+
product_id: mapping.productId,
|
|
1918
|
+
product_variant_id: 0,
|
|
1919
|
+
num: 1,
|
|
1920
|
+
product_bundle: [],
|
|
1921
|
+
product_sku: {
|
|
1922
|
+
option: []
|
|
1923
|
+
},
|
|
1924
|
+
discount_list: [],
|
|
1925
|
+
custom_deposit_data: customDepositData,
|
|
1926
|
+
metadata: {}
|
|
1927
|
+
},
|
|
1928
|
+
sub_type: 'minutes',
|
|
1929
|
+
duration: duration,
|
|
1930
|
+
like_status: 'common',
|
|
1931
|
+
resources: [resourceEntry],
|
|
1932
|
+
schedule_id: 0,
|
|
1933
|
+
select_date: startMoment.format('YYYY-MM-DD'),
|
|
1934
|
+
start_date: startMoment.format('YYYY-MM-DD'),
|
|
1935
|
+
start_time: startMoment.format('HH:mm'),
|
|
1936
|
+
end_date: endMoment.format('YYYY-MM-DD'),
|
|
1937
|
+
end_time: endMoment.format('HH:mm'),
|
|
1938
|
+
metadata: {
|
|
1939
|
+
venue_booking: true,
|
|
1940
|
+
slot_count: group.slotCount
|
|
1941
|
+
},
|
|
1942
|
+
holder: null
|
|
1943
|
+
};
|
|
1944
|
+
normalizedVenueOrderProduct = normalizeOrderProduct({
|
|
1693
1945
|
product_id: mapping.productId,
|
|
1694
1946
|
product_variant_id: 0,
|
|
1695
1947
|
identity_key: identityKey,
|
|
@@ -1697,8 +1949,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1697
1949
|
selling_price: group.totalPrice,
|
|
1698
1950
|
original_price: group.totalPrice,
|
|
1699
1951
|
is_charge_tax: (_venueProduct$is_char = venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.is_charge_tax) !== null && _venueProduct$is_char !== void 0 ? _venueProduct$is_char : 0,
|
|
1700
|
-
metadata: {
|
|
1701
|
-
venue_booking: true
|
|
1952
|
+
metadata: _objectSpread(_objectSpread({
|
|
1953
|
+
venue_booking: true
|
|
1954
|
+
}, productTitle ? {
|
|
1955
|
+
product_title: productTitle
|
|
1956
|
+
} : {}), {}, {
|
|
1702
1957
|
resource_id: resourceId,
|
|
1703
1958
|
resource_form_id: mapping.formId,
|
|
1704
1959
|
resource_name: mapping.resourceName,
|
|
@@ -1711,45 +1966,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1711
1966
|
productId: mapping.productId,
|
|
1712
1967
|
quotation: this.store.quotation
|
|
1713
1968
|
})
|
|
1714
|
-
},
|
|
1715
|
-
_origin:
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
relation_products: [],
|
|
1723
|
-
is_all: false,
|
|
1724
|
-
product: {
|
|
1725
|
-
product_id: mapping.productId,
|
|
1726
|
-
product_variant_id: 0,
|
|
1727
|
-
num: 1,
|
|
1728
|
-
product_bundle: [],
|
|
1729
|
-
product_sku: {
|
|
1730
|
-
option: []
|
|
1731
|
-
},
|
|
1732
|
-
discount_list: [],
|
|
1733
|
-
custom_deposit_data: customDepositData,
|
|
1734
|
-
metadata: {}
|
|
1735
|
-
},
|
|
1736
|
-
sub_type: 'minutes',
|
|
1737
|
-
duration: duration,
|
|
1738
|
-
like_status: 'common',
|
|
1739
|
-
resources: [resourceEntry],
|
|
1740
|
-
schedule_id: 0,
|
|
1741
|
-
select_date: startMoment.format('YYYY-MM-DD'),
|
|
1742
|
-
start_date: startMoment.format('YYYY-MM-DD'),
|
|
1743
|
-
start_time: startMoment.format('HH:mm'),
|
|
1744
|
-
end_date: endMoment.format('YYYY-MM-DD'),
|
|
1745
|
-
end_time: endMoment.format('HH:mm'),
|
|
1746
|
-
metadata: {
|
|
1747
|
-
venue_booking: true,
|
|
1748
|
-
slot_count: group.slotCount
|
|
1749
|
-
},
|
|
1750
|
-
holder: null
|
|
1751
|
-
}
|
|
1752
|
-
}));
|
|
1969
|
+
}),
|
|
1970
|
+
_origin: venueProductOrigin
|
|
1971
|
+
});
|
|
1972
|
+
venueOrderProduct = productTitle ? _objectSpread(_objectSpread({}, normalizedVenueOrderProduct), {}, {
|
|
1973
|
+
product_title: productTitle
|
|
1974
|
+
}) : normalizedVenueOrderProduct;
|
|
1975
|
+
this.attachProductOriginToTempOrder(tempOrder, identityKey, venueProductOrigin);
|
|
1976
|
+
tempOrder.products.push(venueOrderProduct);
|
|
1753
1977
|
booking = buildVenueBookingEntry({
|
|
1754
1978
|
group: group,
|
|
1755
1979
|
resourceId: resourceId,
|
|
@@ -1761,20 +1985,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1761
1985
|
});
|
|
1762
1986
|
tempOrder.bookings.push(booking);
|
|
1763
1987
|
}
|
|
1988
|
+
|
|
1989
|
+
// 获取表单信息
|
|
1990
|
+
products = ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 || (_this$store$order6$ge = _this$store$order6.getOrderProducts) === null || _this$store$order6$ge === void 0 ? void 0 : _this$store$order6$ge.call(_this$store$order6)) || [];
|
|
1991
|
+
_context18.next = 25;
|
|
1992
|
+
return this.preloadHolderForms(products);
|
|
1993
|
+
case 25:
|
|
1764
1994
|
this.store.order.applyDiscount();
|
|
1765
|
-
|
|
1995
|
+
_context18.next = 28;
|
|
1766
1996
|
return this.store.order.recalculateSummary({
|
|
1767
1997
|
createIfMissing: true
|
|
1768
1998
|
});
|
|
1769
|
-
case
|
|
1999
|
+
case 28:
|
|
1770
2000
|
this.store.order.persistTempOrder();
|
|
1771
|
-
case
|
|
2001
|
+
case 29:
|
|
1772
2002
|
case "end":
|
|
1773
|
-
return
|
|
2003
|
+
return _context18.stop();
|
|
1774
2004
|
}
|
|
1775
|
-
},
|
|
2005
|
+
}, _callee18, this);
|
|
1776
2006
|
}));
|
|
1777
|
-
function reconcileOrderForResourceProduct(
|
|
2007
|
+
function reconcileOrderForResourceProduct(_x10, _x11, _x12) {
|
|
1778
2008
|
return _reconcileOrderForResourceProduct.apply(this, arguments);
|
|
1779
2009
|
}
|
|
1780
2010
|
return reconcileOrderForResourceProduct;
|
|
@@ -1789,23 +2019,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1789
2019
|
return undefined;
|
|
1790
2020
|
}
|
|
1791
2021
|
var children = [];
|
|
1792
|
-
var
|
|
1793
|
-
|
|
2022
|
+
var _iterator12 = _createForOfIteratorHelper(combined.resource_ids),
|
|
2023
|
+
_step12;
|
|
1794
2024
|
try {
|
|
1795
2025
|
var _loop3 = function _loop3() {
|
|
1796
|
-
var id =
|
|
2026
|
+
var id = _step12.value;
|
|
1797
2027
|
var child = _this8.store.rawResourceData.find(function (r) {
|
|
1798
2028
|
return String(r.resourceId) === String(id);
|
|
1799
2029
|
});
|
|
1800
2030
|
if (child) children.push(child);
|
|
1801
2031
|
};
|
|
1802
|
-
for (
|
|
2032
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1803
2033
|
_loop3();
|
|
1804
2034
|
}
|
|
1805
2035
|
} catch (err) {
|
|
1806
|
-
|
|
2036
|
+
_iterator12.e(err);
|
|
1807
2037
|
} finally {
|
|
1808
|
-
|
|
2038
|
+
_iterator12.f();
|
|
1809
2039
|
}
|
|
1810
2040
|
return children.length ? children : undefined;
|
|
1811
2041
|
}
|
|
@@ -1827,35 +2057,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1827
2057
|
}, {
|
|
1828
2058
|
key: "loadSchedules",
|
|
1829
2059
|
value: function () {
|
|
1830
|
-
var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1831
|
-
return _regeneratorRuntime().wrap(function
|
|
1832
|
-
while (1) switch (
|
|
2060
|
+
var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
2061
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
2062
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1833
2063
|
case 0:
|
|
1834
2064
|
this.logMethodStart('loadSchedules');
|
|
1835
|
-
|
|
2065
|
+
_context19.prev = 1;
|
|
1836
2066
|
if (this.store.schedule) {
|
|
1837
|
-
|
|
2067
|
+
_context19.next = 4;
|
|
1838
2068
|
break;
|
|
1839
2069
|
}
|
|
1840
2070
|
throw new Error('schedule 模块未初始化');
|
|
1841
2071
|
case 4:
|
|
1842
|
-
|
|
2072
|
+
_context19.next = 6;
|
|
1843
2073
|
return this.store.schedule.loadAllSchedule();
|
|
1844
2074
|
case 6:
|
|
1845
2075
|
this.injectScheduleResolverToQuotation();
|
|
1846
2076
|
this.logMethodSuccess('loadSchedules');
|
|
1847
|
-
|
|
2077
|
+
_context19.next = 14;
|
|
1848
2078
|
break;
|
|
1849
2079
|
case 10:
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
this.logMethodError('loadSchedules',
|
|
1853
|
-
throw
|
|
2080
|
+
_context19.prev = 10;
|
|
2081
|
+
_context19.t0 = _context19["catch"](1);
|
|
2082
|
+
this.logMethodError('loadSchedules', _context19.t0);
|
|
2083
|
+
throw _context19.t0;
|
|
1854
2084
|
case 14:
|
|
1855
2085
|
case "end":
|
|
1856
|
-
return
|
|
2086
|
+
return _context19.stop();
|
|
1857
2087
|
}
|
|
1858
|
-
},
|
|
2088
|
+
}, _callee19, this, [[1, 10]]);
|
|
1859
2089
|
}));
|
|
1860
2090
|
function loadSchedules() {
|
|
1861
2091
|
return _loadSchedules.apply(this, arguments);
|
|
@@ -1883,15 +2113,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1883
2113
|
}, {
|
|
1884
2114
|
key: "getTempOrder",
|
|
1885
2115
|
value: function getTempOrder() {
|
|
1886
|
-
var _this$store$
|
|
1887
|
-
var result = ((_this$store$
|
|
2116
|
+
var _this$store$order7;
|
|
2117
|
+
var result = ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getTempOrder()) || null;
|
|
1888
2118
|
return result;
|
|
1889
2119
|
}
|
|
1890
2120
|
}, {
|
|
1891
2121
|
key: "updateTempOrderNote",
|
|
1892
2122
|
value: function updateTempOrderNote(note) {
|
|
2123
|
+
var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1893
2124
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1894
|
-
return this.store.order.updateTempOrderNote(note);
|
|
2125
|
+
return this.store.order.updateTempOrderNote(note, sync);
|
|
1895
2126
|
}
|
|
1896
2127
|
}, {
|
|
1897
2128
|
key: "updateTempOrderContactsInfo",
|
|
@@ -1900,23 +2131,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1900
2131
|
return this.store.order.updateTempOrderContactsInfo(contactsInfo);
|
|
1901
2132
|
}
|
|
1902
2133
|
}, {
|
|
1903
|
-
key: "
|
|
1904
|
-
value: function
|
|
2134
|
+
key: "ensureVenueTempOrder",
|
|
2135
|
+
value: function ensureVenueTempOrder() {
|
|
1905
2136
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1906
2137
|
return this.store.order.ensureTempOrder();
|
|
1907
2138
|
}
|
|
1908
2139
|
}, {
|
|
1909
2140
|
key: "onCustomerLogin",
|
|
1910
2141
|
value: function () {
|
|
1911
|
-
var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1912
|
-
return _regeneratorRuntime().wrap(function
|
|
1913
|
-
while (1) switch (
|
|
2142
|
+
var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
|
|
2143
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
2144
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1914
2145
|
case 0:
|
|
1915
2146
|
this.logMethodStart('onCustomerLogin', {
|
|
1916
2147
|
customerId: params.customerId
|
|
1917
2148
|
});
|
|
1918
|
-
|
|
1919
|
-
|
|
2149
|
+
_context20.prev = 1;
|
|
2150
|
+
_context20.next = 4;
|
|
1920
2151
|
return this.refreshOrderMarketingAfterLogin({
|
|
1921
2152
|
customerId: params.customerId
|
|
1922
2153
|
});
|
|
@@ -1924,20 +2155,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1924
2155
|
this.logMethodSuccess('onCustomerLogin', {
|
|
1925
2156
|
customerId: params.customerId
|
|
1926
2157
|
});
|
|
1927
|
-
|
|
2158
|
+
_context20.next = 11;
|
|
1928
2159
|
break;
|
|
1929
2160
|
case 7:
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
this.logMethodError('onCustomerLogin',
|
|
1933
|
-
throw
|
|
2161
|
+
_context20.prev = 7;
|
|
2162
|
+
_context20.t0 = _context20["catch"](1);
|
|
2163
|
+
this.logMethodError('onCustomerLogin', _context20.t0);
|
|
2164
|
+
throw _context20.t0;
|
|
1934
2165
|
case 11:
|
|
1935
2166
|
case "end":
|
|
1936
|
-
return
|
|
2167
|
+
return _context20.stop();
|
|
1937
2168
|
}
|
|
1938
|
-
},
|
|
2169
|
+
}, _callee20, this, [[1, 7]]);
|
|
1939
2170
|
}));
|
|
1940
|
-
function onCustomerLogin(
|
|
2171
|
+
function onCustomerLogin(_x13) {
|
|
1941
2172
|
return _onCustomerLogin.apply(this, arguments);
|
|
1942
2173
|
}
|
|
1943
2174
|
return onCustomerLogin;
|
|
@@ -1951,13 +2182,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1951
2182
|
var tempOrder = this.store.order.getTempOrder();
|
|
1952
2183
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
|
|
1953
2184
|
var now = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
1954
|
-
var
|
|
1955
|
-
|
|
2185
|
+
var _iterator13 = _createForOfIteratorHelper(tempOrder.products),
|
|
2186
|
+
_step13;
|
|
1956
2187
|
try {
|
|
1957
2188
|
var _loop4 = function _loop4() {
|
|
1958
|
-
var _product$
|
|
1959
|
-
var product =
|
|
1960
|
-
if ((_product$
|
|
2189
|
+
var _product$metadata3;
|
|
2190
|
+
var product = _step13.value;
|
|
2191
|
+
if ((_product$metadata3 = product.metadata) !== null && _product$metadata3 !== void 0 && _product$metadata3.venue_booking) {
|
|
1961
2192
|
var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
|
|
1962
2193
|
if (!mappings || !mappings.length) return 0; // continue
|
|
1963
2194
|
var mapping = mappings.find(function (m) {
|
|
@@ -1999,43 +2230,43 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1999
2230
|
}
|
|
2000
2231
|
},
|
|
2001
2232
|
_ret;
|
|
2002
|
-
for (
|
|
2233
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
2003
2234
|
_ret = _loop4();
|
|
2004
2235
|
if (_ret === 0) continue;
|
|
2005
2236
|
}
|
|
2006
2237
|
} catch (err) {
|
|
2007
|
-
|
|
2238
|
+
_iterator13.e(err);
|
|
2008
2239
|
} finally {
|
|
2009
|
-
|
|
2240
|
+
_iterator13.f();
|
|
2010
2241
|
}
|
|
2011
2242
|
}
|
|
2012
2243
|
}, {
|
|
2013
2244
|
key: "scanCode",
|
|
2014
2245
|
value: function () {
|
|
2015
|
-
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2246
|
+
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(code, customerId) {
|
|
2016
2247
|
var result;
|
|
2017
|
-
return _regeneratorRuntime().wrap(function
|
|
2018
|
-
while (1) switch (
|
|
2248
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2249
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
2019
2250
|
case 0:
|
|
2020
2251
|
this.logMethodStart('scanCode', {
|
|
2021
2252
|
code: code
|
|
2022
2253
|
});
|
|
2023
|
-
|
|
2254
|
+
_context21.prev = 1;
|
|
2024
2255
|
if (this.store.order) {
|
|
2025
|
-
|
|
2256
|
+
_context21.next = 4;
|
|
2026
2257
|
break;
|
|
2027
2258
|
}
|
|
2028
2259
|
throw new Error('order 模块未初始化');
|
|
2029
2260
|
case 4:
|
|
2030
|
-
|
|
2261
|
+
_context21.next = 6;
|
|
2031
2262
|
return this.store.order.scanCode(code, customerId);
|
|
2032
2263
|
case 6:
|
|
2033
|
-
result =
|
|
2264
|
+
result = _context21.sent;
|
|
2034
2265
|
if (!result.isAvailable) {
|
|
2035
|
-
|
|
2266
|
+
_context21.next = 11;
|
|
2036
2267
|
break;
|
|
2037
2268
|
}
|
|
2038
|
-
|
|
2269
|
+
_context21.next = 10;
|
|
2039
2270
|
return this.store.order.recalculateSummary({
|
|
2040
2271
|
createIfMissing: true
|
|
2041
2272
|
});
|
|
@@ -2045,19 +2276,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2045
2276
|
this.logMethodSuccess('scanCode', {
|
|
2046
2277
|
isAvailable: result.isAvailable
|
|
2047
2278
|
});
|
|
2048
|
-
return
|
|
2279
|
+
return _context21.abrupt("return", result);
|
|
2049
2280
|
case 15:
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
this.logMethodError('scanCode',
|
|
2053
|
-
throw
|
|
2281
|
+
_context21.prev = 15;
|
|
2282
|
+
_context21.t0 = _context21["catch"](1);
|
|
2283
|
+
this.logMethodError('scanCode', _context21.t0);
|
|
2284
|
+
throw _context21.t0;
|
|
2054
2285
|
case 19:
|
|
2055
2286
|
case "end":
|
|
2056
|
-
return
|
|
2287
|
+
return _context21.stop();
|
|
2057
2288
|
}
|
|
2058
|
-
},
|
|
2289
|
+
}, _callee21, this, [[1, 15]]);
|
|
2059
2290
|
}));
|
|
2060
|
-
function scanCode(
|
|
2291
|
+
function scanCode(_x14, _x15) {
|
|
2061
2292
|
return _scanCode.apply(this, arguments);
|
|
2062
2293
|
}
|
|
2063
2294
|
return scanCode;
|
|
@@ -2073,15 +2304,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2073
2304
|
}, {
|
|
2074
2305
|
key: "setDiscountSelected",
|
|
2075
2306
|
value: (function () {
|
|
2076
|
-
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2077
|
-
var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds,
|
|
2078
|
-
return _regeneratorRuntime().wrap(function
|
|
2079
|
-
while (1) switch (
|
|
2307
|
+
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
|
|
2308
|
+
var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _product$metadata$sou, _product$metadata4, _product$metadata5, _product$original_pri, product, origin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
|
|
2309
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2310
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
2080
2311
|
case 0:
|
|
2081
2312
|
this.logMethodStart('setDiscountSelected', params);
|
|
2082
|
-
|
|
2313
|
+
_context22.prev = 1;
|
|
2083
2314
|
if (this.store.order) {
|
|
2084
|
-
|
|
2315
|
+
_context22.next = 4;
|
|
2085
2316
|
break;
|
|
2086
2317
|
}
|
|
2087
2318
|
throw new Error('order 模块未初始化');
|
|
@@ -2107,7 +2338,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2107
2338
|
form_record_id: tempOrder.holder.form_record_id
|
|
2108
2339
|
}] : [];
|
|
2109
2340
|
nextDiscountList = updated;
|
|
2110
|
-
|
|
2341
|
+
_context22.next = 16;
|
|
2111
2342
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
|
|
2112
2343
|
case 16:
|
|
2113
2344
|
if (rulesModule) {
|
|
@@ -2134,18 +2365,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2134
2365
|
}).map(function (d) {
|
|
2135
2366
|
return d.id;
|
|
2136
2367
|
}));
|
|
2137
|
-
|
|
2368
|
+
_iterator14 = _createForOfIteratorHelper(nextDiscountList);
|
|
2138
2369
|
try {
|
|
2139
|
-
for (
|
|
2140
|
-
d =
|
|
2370
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
2371
|
+
d = _step14.value;
|
|
2141
2372
|
if (d.isSelected && !beforeSelectedIds.has(d.id)) {
|
|
2142
2373
|
d.isSelected = false;
|
|
2143
2374
|
}
|
|
2144
2375
|
}
|
|
2145
2376
|
} catch (err) {
|
|
2146
|
-
|
|
2377
|
+
_iterator14.e(err);
|
|
2147
2378
|
} finally {
|
|
2148
|
-
|
|
2379
|
+
_iterator14.f();
|
|
2149
2380
|
}
|
|
2150
2381
|
}
|
|
2151
2382
|
}
|
|
@@ -2158,21 +2389,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2158
2389
|
// 都以 original_price - Σ (当前选中 discount_list.amount) 重算 selling_price。
|
|
2159
2390
|
// 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
|
|
2160
2391
|
// 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2392
|
+
_iterator15 = _createForOfIteratorHelper(tempOrder.products);
|
|
2393
|
+
_context22.prev = 19;
|
|
2394
|
+
_iterator15.s();
|
|
2164
2395
|
case 21:
|
|
2165
|
-
if ((
|
|
2166
|
-
|
|
2396
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
2397
|
+
_context22.next = 36;
|
|
2167
2398
|
break;
|
|
2168
2399
|
}
|
|
2169
|
-
product =
|
|
2170
|
-
|
|
2171
|
-
|
|
2400
|
+
product = _step15.value;
|
|
2401
|
+
origin = this.readProductOriginFromTempOrder(tempOrder, product);
|
|
2402
|
+
if (!(origin !== null && origin !== void 0 && origin.isManualDiscount)) {
|
|
2403
|
+
_context22.next = 26;
|
|
2172
2404
|
break;
|
|
2173
2405
|
}
|
|
2174
|
-
return
|
|
2175
|
-
case
|
|
2406
|
+
return _context22.abrupt("continue", 34);
|
|
2407
|
+
case 26:
|
|
2176
2408
|
// 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
|
|
2177
2409
|
product.discount_list = (product.discount_list || []).filter(function (pd) {
|
|
2178
2410
|
var _pd$discount$resource, _pd$discount;
|
|
@@ -2186,7 +2418,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2186
2418
|
return sum + (pd.amount || 0);
|
|
2187
2419
|
}, 0);
|
|
2188
2420
|
optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
|
|
2189
|
-
sourcePrice = (_product$metadata$sou = (_product$
|
|
2421
|
+
sourcePrice = (_product$metadata$sou = (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.source_product_price) !== null && _product$metadata$sou !== void 0 ? _product$metadata$sou : ((_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.main_product_original_price) != null ? new Decimal(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : '0';
|
|
2190
2422
|
newSourceSellingPrice = new Decimal(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
2191
2423
|
newMainSellingPrice = new Decimal(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
2192
2424
|
if (product.metadata) {
|
|
@@ -2197,36 +2429,36 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2197
2429
|
mainPrice: newMainSellingPrice,
|
|
2198
2430
|
bundle: product.product_bundle
|
|
2199
2431
|
});
|
|
2200
|
-
case
|
|
2201
|
-
|
|
2432
|
+
case 34:
|
|
2433
|
+
_context22.next = 21;
|
|
2202
2434
|
break;
|
|
2203
|
-
case
|
|
2204
|
-
|
|
2435
|
+
case 36:
|
|
2436
|
+
_context22.next = 41;
|
|
2205
2437
|
break;
|
|
2206
|
-
case
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
case
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
return
|
|
2214
|
-
case
|
|
2438
|
+
case 38:
|
|
2439
|
+
_context22.prev = 38;
|
|
2440
|
+
_context22.t0 = _context22["catch"](19);
|
|
2441
|
+
_iterator15.e(_context22.t0);
|
|
2442
|
+
case 41:
|
|
2443
|
+
_context22.prev = 41;
|
|
2444
|
+
_iterator15.f();
|
|
2445
|
+
return _context22.finish(41);
|
|
2446
|
+
case 44:
|
|
2215
2447
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
2216
|
-
|
|
2448
|
+
_context22.next = 47;
|
|
2217
2449
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
2218
|
-
case
|
|
2450
|
+
case 47:
|
|
2219
2451
|
tempOrder.discount_list = (nextDiscountList || []).filter(function (d) {
|
|
2220
2452
|
return d.isSelected;
|
|
2221
2453
|
});
|
|
2222
2454
|
afterApplyTarget = this.store.order.getDiscountList().find(function (d) {
|
|
2223
2455
|
return d.id === params.discountId;
|
|
2224
2456
|
}) || null;
|
|
2225
|
-
|
|
2457
|
+
_context22.next = 51;
|
|
2226
2458
|
return this.store.order.recalculateSummary({
|
|
2227
2459
|
createIfMissing: true
|
|
2228
2460
|
});
|
|
2229
|
-
case
|
|
2461
|
+
case 51:
|
|
2230
2462
|
this.store.order.persistTempOrder();
|
|
2231
2463
|
finalSummary = ((_this$store$order$get = this.store.order.getTempOrder()) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.summary) || null;
|
|
2232
2464
|
finalProduct = ((_this$store$order$get2 = this.store.order.getTempOrder()) === null || _this$store$order$get2 === void 0 || (_this$store$order$get2 = _this$store$order$get2.products) === null || _this$store$order$get2 === void 0 ? void 0 : _this$store$order$get2[0]) || null;
|
|
@@ -2234,19 +2466,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2234
2466
|
finalTarget = this.store.order.getDiscountList().find(function (d) {
|
|
2235
2467
|
return d.id === params.discountId;
|
|
2236
2468
|
}) || null;
|
|
2237
|
-
return
|
|
2238
|
-
case
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
this.logMethodError('setDiscountSelected',
|
|
2242
|
-
throw
|
|
2243
|
-
case
|
|
2469
|
+
return _context22.abrupt("return", this.store.order.getDiscountList());
|
|
2470
|
+
case 59:
|
|
2471
|
+
_context22.prev = 59;
|
|
2472
|
+
_context22.t1 = _context22["catch"](1);
|
|
2473
|
+
this.logMethodError('setDiscountSelected', _context22.t1);
|
|
2474
|
+
throw _context22.t1;
|
|
2475
|
+
case 63:
|
|
2244
2476
|
case "end":
|
|
2245
|
-
return
|
|
2477
|
+
return _context22.stop();
|
|
2246
2478
|
}
|
|
2247
|
-
},
|
|
2479
|
+
}, _callee22, this, [[1, 59], [19, 38, 41, 44]]);
|
|
2248
2480
|
}));
|
|
2249
|
-
function setDiscountSelected(
|
|
2481
|
+
function setDiscountSelected(_x16) {
|
|
2250
2482
|
return _setDiscountSelected.apply(this, arguments);
|
|
2251
2483
|
}
|
|
2252
2484
|
return setDiscountSelected;
|
|
@@ -2254,37 +2486,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2254
2486
|
}, {
|
|
2255
2487
|
key: "addNewOrder",
|
|
2256
2488
|
value: function () {
|
|
2257
|
-
var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2489
|
+
var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2258
2490
|
var tempOrder;
|
|
2259
|
-
return _regeneratorRuntime().wrap(function
|
|
2260
|
-
while (1) switch (
|
|
2491
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2492
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2261
2493
|
case 0:
|
|
2262
2494
|
this.logMethodStart('addNewOrder');
|
|
2263
|
-
|
|
2495
|
+
_context23.prev = 1;
|
|
2264
2496
|
if (this.store.order) {
|
|
2265
|
-
|
|
2497
|
+
_context23.next = 4;
|
|
2266
2498
|
break;
|
|
2267
2499
|
}
|
|
2268
2500
|
throw new Error('order 模块未初始化');
|
|
2269
2501
|
case 4:
|
|
2270
|
-
|
|
2502
|
+
_context23.next = 6;
|
|
2271
2503
|
return this.store.order.addNewOrder();
|
|
2272
2504
|
case 6:
|
|
2273
|
-
tempOrder =
|
|
2505
|
+
tempOrder = _context23.sent;
|
|
2274
2506
|
this.logMethodSuccess('addNewOrder', {
|
|
2275
2507
|
productCount: tempOrder.products.length
|
|
2276
2508
|
});
|
|
2277
|
-
return
|
|
2509
|
+
return _context23.abrupt("return", tempOrder);
|
|
2278
2510
|
case 11:
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
this.logMethodError('addNewOrder',
|
|
2282
|
-
throw
|
|
2511
|
+
_context23.prev = 11;
|
|
2512
|
+
_context23.t0 = _context23["catch"](1);
|
|
2513
|
+
this.logMethodError('addNewOrder', _context23.t0);
|
|
2514
|
+
throw _context23.t0;
|
|
2283
2515
|
case 15:
|
|
2284
2516
|
case "end":
|
|
2285
|
-
return
|
|
2517
|
+
return _context23.stop();
|
|
2286
2518
|
}
|
|
2287
|
-
},
|
|
2519
|
+
}, _callee23, this, [[1, 11]]);
|
|
2288
2520
|
}));
|
|
2289
2521
|
function addNewOrder() {
|
|
2290
2522
|
return _addNewOrder.apply(this, arguments);
|
|
@@ -2301,37 +2533,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2301
2533
|
}, {
|
|
2302
2534
|
key: "getSummary",
|
|
2303
2535
|
value: function () {
|
|
2304
|
-
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2536
|
+
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
2305
2537
|
var summary;
|
|
2306
|
-
return _regeneratorRuntime().wrap(function
|
|
2307
|
-
while (1) switch (
|
|
2538
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2539
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
2308
2540
|
case 0:
|
|
2309
2541
|
this.logMethodStart('getSummary');
|
|
2310
|
-
|
|
2542
|
+
_context24.prev = 1;
|
|
2311
2543
|
if (this.store.order) {
|
|
2312
|
-
|
|
2544
|
+
_context24.next = 4;
|
|
2313
2545
|
break;
|
|
2314
2546
|
}
|
|
2315
2547
|
throw new Error('order 模块未初始化');
|
|
2316
2548
|
case 4:
|
|
2317
|
-
|
|
2549
|
+
_context24.next = 6;
|
|
2318
2550
|
return this.store.order.getOrderSummary();
|
|
2319
2551
|
case 6:
|
|
2320
|
-
summary =
|
|
2552
|
+
summary = _context24.sent;
|
|
2321
2553
|
this.logMethodSuccess('getSummary', {
|
|
2322
2554
|
totalAmount: summary.total_amount
|
|
2323
2555
|
});
|
|
2324
|
-
return
|
|
2556
|
+
return _context24.abrupt("return", summary);
|
|
2325
2557
|
case 11:
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
this.logMethodError('getSummary',
|
|
2329
|
-
throw
|
|
2558
|
+
_context24.prev = 11;
|
|
2559
|
+
_context24.t0 = _context24["catch"](1);
|
|
2560
|
+
this.logMethodError('getSummary', _context24.t0);
|
|
2561
|
+
throw _context24.t0;
|
|
2330
2562
|
case 15:
|
|
2331
2563
|
case "end":
|
|
2332
|
-
return
|
|
2564
|
+
return _context24.stop();
|
|
2333
2565
|
}
|
|
2334
|
-
},
|
|
2566
|
+
}, _callee24, this, [[1, 11]]);
|
|
2335
2567
|
}));
|
|
2336
2568
|
function getSummary() {
|
|
2337
2569
|
return _getSummary.apply(this, arguments);
|
|
@@ -2341,47 +2573,47 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2341
2573
|
}, {
|
|
2342
2574
|
key: "submitOrder",
|
|
2343
2575
|
value: function () {
|
|
2344
|
-
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2345
|
-
var _this$
|
|
2346
|
-
return _regeneratorRuntime().wrap(function
|
|
2347
|
-
while (1) switch (
|
|
2576
|
+
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
2577
|
+
var _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16, _tempOrder$products2, result, tempOrder;
|
|
2578
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2579
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2348
2580
|
case 0:
|
|
2349
2581
|
this.logMethodStart('submitOrder');
|
|
2350
|
-
|
|
2351
|
-
|
|
2582
|
+
_context25.prev = 1;
|
|
2583
|
+
_context25.next = 4;
|
|
2352
2584
|
return this.validateBeforeSubmitByItemRule();
|
|
2353
2585
|
case 4:
|
|
2354
2586
|
if (this.store.order) {
|
|
2355
|
-
|
|
2587
|
+
_context25.next = 6;
|
|
2356
2588
|
break;
|
|
2357
2589
|
}
|
|
2358
2590
|
throw new Error('venueBooking解决方案需要 order 模块支持');
|
|
2359
2591
|
case 6:
|
|
2360
|
-
|
|
2592
|
+
_context25.next = 8;
|
|
2361
2593
|
return this.store.order.submitTempOrder({
|
|
2362
2594
|
cacheId: this.cacheId,
|
|
2363
|
-
platform: (_this$
|
|
2364
|
-
businessCode: (_this$
|
|
2365
|
-
channel: (_this$
|
|
2366
|
-
type: (_this$
|
|
2595
|
+
platform: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform,
|
|
2596
|
+
businessCode: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode,
|
|
2597
|
+
channel: (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.channel,
|
|
2598
|
+
type: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.type
|
|
2367
2599
|
});
|
|
2368
2600
|
case 8:
|
|
2369
|
-
result =
|
|
2601
|
+
result = _context25.sent;
|
|
2370
2602
|
tempOrder = this.store.order.getTempOrder();
|
|
2371
2603
|
this.logMethodSuccess('submitOrder', {
|
|
2372
2604
|
productCount: (tempOrder === null || tempOrder === void 0 || (_tempOrder$products2 = tempOrder.products) === null || _tempOrder$products2 === void 0 ? void 0 : _tempOrder$products2.length) || 0
|
|
2373
2605
|
});
|
|
2374
|
-
return
|
|
2606
|
+
return _context25.abrupt("return", result);
|
|
2375
2607
|
case 14:
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
this.logMethodError('submitOrder',
|
|
2379
|
-
throw
|
|
2608
|
+
_context25.prev = 14;
|
|
2609
|
+
_context25.t0 = _context25["catch"](1);
|
|
2610
|
+
this.logMethodError('submitOrder', _context25.t0);
|
|
2611
|
+
throw _context25.t0;
|
|
2380
2612
|
case 18:
|
|
2381
2613
|
case "end":
|
|
2382
|
-
return
|
|
2614
|
+
return _context25.stop();
|
|
2383
2615
|
}
|
|
2384
|
-
},
|
|
2616
|
+
}, _callee25, this, [[1, 14]]);
|
|
2385
2617
|
}));
|
|
2386
2618
|
function submitOrder() {
|
|
2387
2619
|
return _submitOrder.apply(this, arguments);
|
|
@@ -2391,23 +2623,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2391
2623
|
}, {
|
|
2392
2624
|
key: "addProductToOrder",
|
|
2393
2625
|
value: function () {
|
|
2394
|
-
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2395
|
-
var _product$
|
|
2396
|
-
return _regeneratorRuntime().wrap(function
|
|
2397
|
-
while (1) switch (
|
|
2626
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(product) {
|
|
2627
|
+
var _product$metadata6, _product$product_vari2, quotationPrice, products;
|
|
2628
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2629
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2398
2630
|
case 0:
|
|
2399
2631
|
this.logMethodStart('addProductToOrder', {
|
|
2400
2632
|
product_id: product.product_id,
|
|
2401
2633
|
product_variant_id: product.product_variant_id
|
|
2402
2634
|
});
|
|
2403
|
-
|
|
2635
|
+
_context26.prev = 1;
|
|
2404
2636
|
if (this.store.order) {
|
|
2405
|
-
|
|
2637
|
+
_context26.next = 4;
|
|
2406
2638
|
break;
|
|
2407
2639
|
}
|
|
2408
2640
|
throw new Error('order 模块未初始化');
|
|
2409
2641
|
case 4:
|
|
2410
|
-
if (!((_product$
|
|
2642
|
+
if (!((_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) && this.store.quotation && product.product_id != null) {
|
|
2411
2643
|
quotationPrice = this.store.quotation.getPriceForProduct({
|
|
2412
2644
|
productId: product.product_id,
|
|
2413
2645
|
variantId: (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : undefined,
|
|
@@ -2420,32 +2652,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2420
2652
|
product.original_price = product.selling_price;
|
|
2421
2653
|
}
|
|
2422
2654
|
}
|
|
2423
|
-
|
|
2655
|
+
_context26.next = 7;
|
|
2424
2656
|
return this.store.order.addProductToOrder(product);
|
|
2425
2657
|
case 7:
|
|
2426
|
-
products =
|
|
2427
|
-
|
|
2658
|
+
products = _context26.sent;
|
|
2659
|
+
_context26.next = 10;
|
|
2428
2660
|
return this.refreshItemRuleQuantityLimits();
|
|
2429
2661
|
case 10:
|
|
2430
|
-
|
|
2662
|
+
_context26.next = 12;
|
|
2431
2663
|
return this.refreshCartValidationPassed();
|
|
2432
2664
|
case 12:
|
|
2433
2665
|
this.logMethodSuccess('addProductToOrder', {
|
|
2434
2666
|
productCount: products.length
|
|
2435
2667
|
});
|
|
2436
|
-
return
|
|
2668
|
+
return _context26.abrupt("return", products);
|
|
2437
2669
|
case 16:
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
this.logMethodError('addProductToOrder',
|
|
2441
|
-
throw
|
|
2670
|
+
_context26.prev = 16;
|
|
2671
|
+
_context26.t0 = _context26["catch"](1);
|
|
2672
|
+
this.logMethodError('addProductToOrder', _context26.t0);
|
|
2673
|
+
throw _context26.t0;
|
|
2442
2674
|
case 20:
|
|
2443
2675
|
case "end":
|
|
2444
|
-
return
|
|
2676
|
+
return _context26.stop();
|
|
2445
2677
|
}
|
|
2446
|
-
},
|
|
2678
|
+
}, _callee26, this, [[1, 16]]);
|
|
2447
2679
|
}));
|
|
2448
|
-
function addProductToOrder(
|
|
2680
|
+
function addProductToOrder(_x17) {
|
|
2449
2681
|
return _addProductToOrder.apply(this, arguments);
|
|
2450
2682
|
}
|
|
2451
2683
|
return addProductToOrder;
|
|
@@ -2453,48 +2685,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2453
2685
|
}, {
|
|
2454
2686
|
key: "updateOrderProduct",
|
|
2455
2687
|
value: function () {
|
|
2456
|
-
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2688
|
+
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2457
2689
|
var products;
|
|
2458
|
-
return _regeneratorRuntime().wrap(function
|
|
2459
|
-
while (1) switch (
|
|
2690
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2691
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2460
2692
|
case 0:
|
|
2461
2693
|
this.logMethodStart('updateOrderProduct', {
|
|
2462
2694
|
product_id: params.product_id,
|
|
2463
2695
|
product_variant_id: params.product_variant_id
|
|
2464
2696
|
});
|
|
2465
|
-
|
|
2697
|
+
_context27.prev = 1;
|
|
2466
2698
|
if (this.store.order) {
|
|
2467
|
-
|
|
2699
|
+
_context27.next = 4;
|
|
2468
2700
|
break;
|
|
2469
2701
|
}
|
|
2470
2702
|
throw new Error('order 模块未初始化');
|
|
2471
2703
|
case 4:
|
|
2472
|
-
|
|
2704
|
+
_context27.next = 6;
|
|
2473
2705
|
return this.store.order.updateOrderProduct(params);
|
|
2474
2706
|
case 6:
|
|
2475
|
-
products =
|
|
2476
|
-
|
|
2707
|
+
products = _context27.sent;
|
|
2708
|
+
_context27.next = 9;
|
|
2477
2709
|
return this.refreshItemRuleQuantityLimits();
|
|
2478
2710
|
case 9:
|
|
2479
|
-
|
|
2711
|
+
_context27.next = 11;
|
|
2480
2712
|
return this.refreshCartValidationPassed();
|
|
2481
2713
|
case 11:
|
|
2482
2714
|
this.logMethodSuccess('updateOrderProduct', {
|
|
2483
2715
|
productCount: products.length
|
|
2484
2716
|
});
|
|
2485
|
-
return
|
|
2717
|
+
return _context27.abrupt("return", products);
|
|
2486
2718
|
case 15:
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
this.logMethodError('updateOrderProduct',
|
|
2490
|
-
throw
|
|
2719
|
+
_context27.prev = 15;
|
|
2720
|
+
_context27.t0 = _context27["catch"](1);
|
|
2721
|
+
this.logMethodError('updateOrderProduct', _context27.t0);
|
|
2722
|
+
throw _context27.t0;
|
|
2491
2723
|
case 19:
|
|
2492
2724
|
case "end":
|
|
2493
|
-
return
|
|
2725
|
+
return _context27.stop();
|
|
2494
2726
|
}
|
|
2495
|
-
},
|
|
2727
|
+
}, _callee27, this, [[1, 15]]);
|
|
2496
2728
|
}));
|
|
2497
|
-
function updateOrderProduct(
|
|
2729
|
+
function updateOrderProduct(_x18) {
|
|
2498
2730
|
return _updateOrderProduct.apply(this, arguments);
|
|
2499
2731
|
}
|
|
2500
2732
|
return updateOrderProduct;
|
|
@@ -2502,66 +2734,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2502
2734
|
}, {
|
|
2503
2735
|
key: "removeProductFromOrder",
|
|
2504
2736
|
value: function () {
|
|
2505
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2506
|
-
var _this$store$order$get3, _this$store$
|
|
2507
|
-
return _regeneratorRuntime().wrap(function
|
|
2508
|
-
while (1) switch (
|
|
2737
|
+
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
|
|
2738
|
+
var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata7, _product$metadata8, product, beforeBookingCount, _this$store$order$per, _this$store$order10;
|
|
2739
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2740
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2509
2741
|
case 0:
|
|
2510
2742
|
this.logMethodStart('removeProductFromOrder', {
|
|
2511
2743
|
product_id: identity.product_id,
|
|
2512
2744
|
product_variant_id: identity.product_variant_id
|
|
2513
2745
|
});
|
|
2514
|
-
|
|
2746
|
+
_context28.prev = 1;
|
|
2515
2747
|
if (this.store.order) {
|
|
2516
|
-
|
|
2748
|
+
_context28.next = 4;
|
|
2517
2749
|
break;
|
|
2518
2750
|
}
|
|
2519
2751
|
throw new Error('order 模块未初始化');
|
|
2520
2752
|
case 4:
|
|
2521
|
-
tempOrder = ((_this$store$order$get3 = (_this$store$
|
|
2522
|
-
|
|
2753
|
+
tempOrder = ((_this$store$order$get3 = (_this$store$order8 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order8)) || ((_this$store$order$ens = (_this$store$order9 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order9));
|
|
2754
|
+
_context28.next = 7;
|
|
2523
2755
|
return this.store.order.removeProductFromOrder(identity);
|
|
2524
2756
|
case 7:
|
|
2525
|
-
products =
|
|
2757
|
+
products = _context28.sent;
|
|
2526
2758
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
|
|
2527
|
-
|
|
2759
|
+
_context28.next = 33;
|
|
2528
2760
|
break;
|
|
2529
2761
|
}
|
|
2530
2762
|
venueProductUids = new Set();
|
|
2531
2763
|
venueBookingUids = new Set();
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2764
|
+
_iterator16 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
2765
|
+
_context28.prev = 12;
|
|
2766
|
+
_iterator16.s();
|
|
2535
2767
|
case 14:
|
|
2536
|
-
if ((
|
|
2537
|
-
|
|
2768
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
2769
|
+
_context28.next = 22;
|
|
2538
2770
|
break;
|
|
2539
2771
|
}
|
|
2540
|
-
product =
|
|
2541
|
-
if (product !== null && product !== void 0 && (_product$
|
|
2542
|
-
|
|
2772
|
+
product = _step16.value;
|
|
2773
|
+
if (product !== null && product !== void 0 && (_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.venue_booking) {
|
|
2774
|
+
_context28.next = 18;
|
|
2543
2775
|
break;
|
|
2544
2776
|
}
|
|
2545
|
-
return
|
|
2777
|
+
return _context28.abrupt("continue", 20);
|
|
2546
2778
|
case 18:
|
|
2547
2779
|
if (product.identity_key) venueProductUids.add(String(product.identity_key));
|
|
2548
|
-
if ((_product$
|
|
2780
|
+
if ((_product$metadata8 = product.metadata) !== null && _product$metadata8 !== void 0 && _product$metadata8.booking_uid) {
|
|
2549
2781
|
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
2550
2782
|
}
|
|
2551
2783
|
case 20:
|
|
2552
|
-
|
|
2784
|
+
_context28.next = 14;
|
|
2553
2785
|
break;
|
|
2554
2786
|
case 22:
|
|
2555
|
-
|
|
2787
|
+
_context28.next = 27;
|
|
2556
2788
|
break;
|
|
2557
2789
|
case 24:
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2790
|
+
_context28.prev = 24;
|
|
2791
|
+
_context28.t0 = _context28["catch"](12);
|
|
2792
|
+
_iterator16.e(_context28.t0);
|
|
2561
2793
|
case 27:
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
return
|
|
2794
|
+
_context28.prev = 27;
|
|
2795
|
+
_iterator16.f();
|
|
2796
|
+
return _context28.finish(27);
|
|
2565
2797
|
case 30:
|
|
2566
2798
|
beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
|
|
2567
2799
|
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
@@ -2575,31 +2807,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2575
2807
|
return true;
|
|
2576
2808
|
});
|
|
2577
2809
|
if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
|
|
2578
|
-
(_this$store$order$per = (_this$store$
|
|
2810
|
+
(_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
|
|
2579
2811
|
}
|
|
2580
2812
|
case 33:
|
|
2581
|
-
|
|
2813
|
+
_context28.next = 35;
|
|
2582
2814
|
return this.refreshItemRuleQuantityLimits();
|
|
2583
2815
|
case 35:
|
|
2584
|
-
|
|
2816
|
+
_context28.next = 37;
|
|
2585
2817
|
return this.refreshCartValidationPassed();
|
|
2586
2818
|
case 37:
|
|
2587
2819
|
this.logMethodSuccess('removeProductFromOrder', {
|
|
2588
2820
|
productCount: products.length
|
|
2589
2821
|
});
|
|
2590
|
-
return
|
|
2822
|
+
return _context28.abrupt("return", products);
|
|
2591
2823
|
case 41:
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
this.logMethodError('removeProductFromOrder',
|
|
2595
|
-
throw
|
|
2824
|
+
_context28.prev = 41;
|
|
2825
|
+
_context28.t1 = _context28["catch"](1);
|
|
2826
|
+
this.logMethodError('removeProductFromOrder', _context28.t1);
|
|
2827
|
+
throw _context28.t1;
|
|
2596
2828
|
case 45:
|
|
2597
2829
|
case "end":
|
|
2598
|
-
return
|
|
2830
|
+
return _context28.stop();
|
|
2599
2831
|
}
|
|
2600
|
-
},
|
|
2832
|
+
}, _callee28, this, [[1, 41], [12, 24, 27, 30]]);
|
|
2601
2833
|
}));
|
|
2602
|
-
function removeProductFromOrder(
|
|
2834
|
+
function removeProductFromOrder(_x19) {
|
|
2603
2835
|
return _removeProductFromOrder.apply(this, arguments);
|
|
2604
2836
|
}
|
|
2605
2837
|
return removeProductFromOrder;
|
|
@@ -2607,27 +2839,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2607
2839
|
}, {
|
|
2608
2840
|
key: "getProductList",
|
|
2609
2841
|
value: function () {
|
|
2610
|
-
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2842
|
+
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
2611
2843
|
var result;
|
|
2612
|
-
return _regeneratorRuntime().wrap(function
|
|
2613
|
-
while (1) switch (
|
|
2844
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2845
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2614
2846
|
case 0:
|
|
2615
2847
|
if (!this.productsLoaded) {
|
|
2616
|
-
|
|
2848
|
+
_context29.next = 2;
|
|
2617
2849
|
break;
|
|
2618
2850
|
}
|
|
2619
|
-
return
|
|
2851
|
+
return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
|
|
2620
2852
|
case 2:
|
|
2621
|
-
|
|
2853
|
+
_context29.next = 4;
|
|
2622
2854
|
return this.loadAllProducts();
|
|
2623
2855
|
case 4:
|
|
2624
|
-
result =
|
|
2625
|
-
return
|
|
2856
|
+
result = _context29.sent;
|
|
2857
|
+
return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
|
|
2626
2858
|
case 6:
|
|
2627
2859
|
case "end":
|
|
2628
|
-
return
|
|
2860
|
+
return _context29.stop();
|
|
2629
2861
|
}
|
|
2630
|
-
},
|
|
2862
|
+
}, _callee29, this);
|
|
2631
2863
|
}));
|
|
2632
2864
|
function getProductList() {
|
|
2633
2865
|
return _getProductList.apply(this, arguments);
|
|
@@ -2637,13 +2869,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2637
2869
|
}, {
|
|
2638
2870
|
key: "loadOpenDataConfig",
|
|
2639
2871
|
value: function () {
|
|
2640
|
-
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2872
|
+
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2641
2873
|
var lastFetchedAt, cachedData, openDataConfig;
|
|
2642
|
-
return _regeneratorRuntime().wrap(function
|
|
2643
|
-
while (1) switch (
|
|
2874
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2875
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2644
2876
|
case 0:
|
|
2645
2877
|
if (this.store.openData) {
|
|
2646
|
-
|
|
2878
|
+
_context30.next = 2;
|
|
2647
2879
|
break;
|
|
2648
2880
|
}
|
|
2649
2881
|
throw new Error('openData 模块未初始化');
|
|
@@ -2651,42 +2883,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2651
2883
|
lastFetchedAt = this.store.openData.getLastFetchedAt();
|
|
2652
2884
|
cachedData = this.store.openData.getOpenData();
|
|
2653
2885
|
if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
|
|
2654
|
-
|
|
2886
|
+
_context30.next = 7;
|
|
2655
2887
|
break;
|
|
2656
2888
|
}
|
|
2657
2889
|
this.otherParams.openData = cachedData;
|
|
2658
|
-
return
|
|
2890
|
+
return _context30.abrupt("return", cachedData);
|
|
2659
2891
|
case 7:
|
|
2660
2892
|
if (!this.loadOpenDataConfigInFlight) {
|
|
2661
|
-
|
|
2893
|
+
_context30.next = 11;
|
|
2662
2894
|
break;
|
|
2663
2895
|
}
|
|
2664
|
-
|
|
2896
|
+
_context30.next = 10;
|
|
2665
2897
|
return this.loadOpenDataConfigInFlight;
|
|
2666
2898
|
case 10:
|
|
2667
|
-
return
|
|
2899
|
+
return _context30.abrupt("return", _context30.sent);
|
|
2668
2900
|
case 11:
|
|
2669
2901
|
this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
|
|
2670
2902
|
scope: 'board',
|
|
2671
2903
|
target: 'venue_booking+online_store',
|
|
2672
2904
|
section_code: [].concat(OPEN_DATA_SECTION_CODES)
|
|
2673
2905
|
});
|
|
2674
|
-
|
|
2675
|
-
|
|
2906
|
+
_context30.prev = 12;
|
|
2907
|
+
_context30.next = 15;
|
|
2676
2908
|
return this.loadOpenDataConfigInFlight;
|
|
2677
2909
|
case 15:
|
|
2678
|
-
openDataConfig =
|
|
2910
|
+
openDataConfig = _context30.sent;
|
|
2679
2911
|
this.otherParams.openData = openDataConfig;
|
|
2680
|
-
return
|
|
2912
|
+
return _context30.abrupt("return", openDataConfig);
|
|
2681
2913
|
case 18:
|
|
2682
|
-
|
|
2914
|
+
_context30.prev = 18;
|
|
2683
2915
|
this.loadOpenDataConfigInFlight = null;
|
|
2684
|
-
return
|
|
2916
|
+
return _context30.finish(18);
|
|
2685
2917
|
case 21:
|
|
2686
2918
|
case "end":
|
|
2687
|
-
return
|
|
2919
|
+
return _context30.stop();
|
|
2688
2920
|
}
|
|
2689
|
-
},
|
|
2921
|
+
}, _callee30, this, [[12,, 18, 21]]);
|
|
2690
2922
|
}));
|
|
2691
2923
|
function loadOpenDataConfig() {
|
|
2692
2924
|
return _loadOpenDataConfig.apply(this, arguments);
|
|
@@ -2696,29 +2928,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2696
2928
|
}, {
|
|
2697
2929
|
key: "loadRuntimeConfigs",
|
|
2698
2930
|
value: function () {
|
|
2699
|
-
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2931
|
+
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2700
2932
|
var itemRuleConfigs;
|
|
2701
|
-
return _regeneratorRuntime().wrap(function
|
|
2702
|
-
while (1) switch (
|
|
2933
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2934
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2703
2935
|
case 0:
|
|
2704
|
-
|
|
2936
|
+
_context31.next = 2;
|
|
2705
2937
|
return this.loadOpenDataConfig();
|
|
2706
2938
|
case 2:
|
|
2707
|
-
|
|
2939
|
+
_context31.next = 4;
|
|
2708
2940
|
return this.ensureItemRuleConfigsLoaded();
|
|
2709
2941
|
case 4:
|
|
2710
|
-
itemRuleConfigs =
|
|
2942
|
+
itemRuleConfigs = _context31.sent;
|
|
2711
2943
|
this.logMethodSuccess('loadRuntimeConfigs', {
|
|
2712
2944
|
itemRuleCount: itemRuleConfigs.length
|
|
2713
2945
|
});
|
|
2714
|
-
return
|
|
2946
|
+
return _context31.abrupt("return", {
|
|
2715
2947
|
itemRuleConfigs: itemRuleConfigs
|
|
2716
2948
|
});
|
|
2717
2949
|
case 7:
|
|
2718
2950
|
case "end":
|
|
2719
|
-
return
|
|
2951
|
+
return _context31.stop();
|
|
2720
2952
|
}
|
|
2721
|
-
},
|
|
2953
|
+
}, _callee31, this);
|
|
2722
2954
|
}));
|
|
2723
2955
|
function loadRuntimeConfigs() {
|
|
2724
2956
|
return _loadRuntimeConfigs.apply(this, arguments);
|
|
@@ -2728,22 +2960,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2728
2960
|
}, {
|
|
2729
2961
|
key: "fetchItemRuleConfigsByModelIds",
|
|
2730
2962
|
value: function () {
|
|
2731
|
-
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2963
|
+
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(strategyModelIds) {
|
|
2732
2964
|
var result, configs;
|
|
2733
|
-
return _regeneratorRuntime().wrap(function
|
|
2734
|
-
while (1) switch (
|
|
2965
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2966
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2735
2967
|
case 0:
|
|
2736
2968
|
this.logMethodStart('fetchItemRuleConfigsByModelIds', {
|
|
2737
2969
|
strategyModelIds: strategyModelIds
|
|
2738
2970
|
});
|
|
2739
2971
|
if (strategyModelIds.length) {
|
|
2740
|
-
|
|
2972
|
+
_context32.next = 3;
|
|
2741
2973
|
break;
|
|
2742
2974
|
}
|
|
2743
|
-
return
|
|
2975
|
+
return _context32.abrupt("return", []);
|
|
2744
2976
|
case 3:
|
|
2745
|
-
|
|
2746
|
-
|
|
2977
|
+
_context32.prev = 3;
|
|
2978
|
+
_context32.next = 6;
|
|
2747
2979
|
return this.request.get('/promotion', {
|
|
2748
2980
|
skip: 1,
|
|
2749
2981
|
num: 99,
|
|
@@ -2751,7 +2983,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2751
2983
|
ids: strategyModelIds
|
|
2752
2984
|
});
|
|
2753
2985
|
case 6:
|
|
2754
|
-
result =
|
|
2986
|
+
result = _context32.sent;
|
|
2755
2987
|
configs = [];
|
|
2756
2988
|
if (result.code === 200) {
|
|
2757
2989
|
configs = result.data.list.map(function (item) {
|
|
@@ -2762,21 +2994,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2762
2994
|
strategyModelIds: strategyModelIds,
|
|
2763
2995
|
strategyCount: configs.length
|
|
2764
2996
|
});
|
|
2765
|
-
return
|
|
2997
|
+
return _context32.abrupt("return", configs);
|
|
2766
2998
|
case 13:
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
this.logMethodError('fetchItemRuleConfigsByModelIds',
|
|
2999
|
+
_context32.prev = 13;
|
|
3000
|
+
_context32.t0 = _context32["catch"](3);
|
|
3001
|
+
this.logMethodError('fetchItemRuleConfigsByModelIds', _context32.t0, {
|
|
2770
3002
|
strategyModelIds: strategyModelIds
|
|
2771
3003
|
});
|
|
2772
|
-
return
|
|
3004
|
+
return _context32.abrupt("return", []);
|
|
2773
3005
|
case 17:
|
|
2774
3006
|
case "end":
|
|
2775
|
-
return
|
|
3007
|
+
return _context32.stop();
|
|
2776
3008
|
}
|
|
2777
|
-
},
|
|
3009
|
+
}, _callee32, this, [[3, 13]]);
|
|
2778
3010
|
}));
|
|
2779
|
-
function fetchItemRuleConfigsByModelIds(
|
|
3011
|
+
function fetchItemRuleConfigsByModelIds(_x20) {
|
|
2780
3012
|
return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
|
|
2781
3013
|
}
|
|
2782
3014
|
return fetchItemRuleConfigsByModelIds;
|
|
@@ -2784,22 +3016,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2784
3016
|
}, {
|
|
2785
3017
|
key: "buildPrefillProductSourceMap",
|
|
2786
3018
|
value: function () {
|
|
2787
|
-
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3019
|
+
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
|
|
2788
3020
|
var sourceMap, productList, visited, collectFromValue;
|
|
2789
|
-
return _regeneratorRuntime().wrap(function
|
|
2790
|
-
while (1) switch (
|
|
3021
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
3022
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2791
3023
|
case 0:
|
|
2792
3024
|
sourceMap = new Map();
|
|
2793
|
-
|
|
2794
|
-
|
|
3025
|
+
_context33.prev = 1;
|
|
3026
|
+
_context33.next = 4;
|
|
2795
3027
|
return this.getProductList();
|
|
2796
3028
|
case 4:
|
|
2797
|
-
productList =
|
|
3029
|
+
productList = _context33.sent;
|
|
2798
3030
|
if (Array.isArray(productList)) {
|
|
2799
|
-
|
|
3031
|
+
_context33.next = 7;
|
|
2800
3032
|
break;
|
|
2801
3033
|
}
|
|
2802
|
-
return
|
|
3034
|
+
return _context33.abrupt("return", sourceMap);
|
|
2803
3035
|
case 7:
|
|
2804
3036
|
visited = new Set();
|
|
2805
3037
|
collectFromValue = function collectFromValue(value) {
|
|
@@ -2808,17 +3040,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2808
3040
|
if (visited.has(value)) return;
|
|
2809
3041
|
visited.add(value);
|
|
2810
3042
|
if (Array.isArray(value)) {
|
|
2811
|
-
var
|
|
2812
|
-
|
|
3043
|
+
var _iterator17 = _createForOfIteratorHelper(value),
|
|
3044
|
+
_step17;
|
|
2813
3045
|
try {
|
|
2814
|
-
for (
|
|
2815
|
-
var item =
|
|
3046
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
|
3047
|
+
var item = _step17.value;
|
|
2816
3048
|
collectFromValue(item);
|
|
2817
3049
|
}
|
|
2818
3050
|
} catch (err) {
|
|
2819
|
-
|
|
3051
|
+
_iterator17.e(err);
|
|
2820
3052
|
} finally {
|
|
2821
|
-
|
|
3053
|
+
_iterator17.f();
|
|
2822
3054
|
}
|
|
2823
3055
|
return;
|
|
2824
3056
|
}
|
|
@@ -2826,8 +3058,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2826
3058
|
var rawProductId = (_node$product_id = node.product_id) !== null && _node$product_id !== void 0 ? _node$product_id : node.id;
|
|
2827
3059
|
var productId = Number(rawProductId);
|
|
2828
3060
|
if (Number.isFinite(productId) && productId > 0) {
|
|
2829
|
-
var
|
|
2830
|
-
var productVariantId = Number((
|
|
3061
|
+
var _ref5, _node$product_variant;
|
|
3062
|
+
var productVariantId = Number((_ref5 = (_node$product_variant = node.product_variant_id) !== null && _node$product_variant !== void 0 ? _node$product_variant : node.variant_id) !== null && _ref5 !== void 0 ? _ref5 : 0);
|
|
2831
3063
|
var normalizedVariantId = Number.isNaN(productVariantId) ? 0 : productVariantId;
|
|
2832
3064
|
var key = buildProductKey(productId, normalizedVariantId);
|
|
2833
3065
|
if (!sourceMap.has(key)) sourceMap.set(key, node);
|
|
@@ -2838,19 +3070,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2838
3070
|
}
|
|
2839
3071
|
};
|
|
2840
3072
|
collectFromValue(productList);
|
|
2841
|
-
|
|
3073
|
+
_context33.next = 15;
|
|
2842
3074
|
break;
|
|
2843
3075
|
case 12:
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
this.logMethodError('buildPrefillProductSourceMap',
|
|
3076
|
+
_context33.prev = 12;
|
|
3077
|
+
_context33.t0 = _context33["catch"](1);
|
|
3078
|
+
this.logMethodError('buildPrefillProductSourceMap', _context33.t0);
|
|
2847
3079
|
case 15:
|
|
2848
|
-
return
|
|
3080
|
+
return _context33.abrupt("return", sourceMap);
|
|
2849
3081
|
case 16:
|
|
2850
3082
|
case "end":
|
|
2851
|
-
return
|
|
3083
|
+
return _context33.stop();
|
|
2852
3084
|
}
|
|
2853
|
-
},
|
|
3085
|
+
}, _callee33, this, [[1, 12]]);
|
|
2854
3086
|
}));
|
|
2855
3087
|
function buildPrefillProductSourceMap() {
|
|
2856
3088
|
return _buildPrefillProductSourceMap.apply(this, arguments);
|
|
@@ -2865,56 +3097,56 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2865
3097
|
}, {
|
|
2866
3098
|
key: "ensureItemRuleConfigsLoaded",
|
|
2867
3099
|
value: function () {
|
|
2868
|
-
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3100
|
+
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2869
3101
|
var _this11 = this;
|
|
2870
|
-
return _regeneratorRuntime().wrap(function
|
|
2871
|
-
while (1) switch (
|
|
3102
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
3103
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2872
3104
|
case 0:
|
|
2873
3105
|
if (!(this.itemRuleConfigs.length > 0)) {
|
|
2874
|
-
|
|
3106
|
+
_context35.next = 2;
|
|
2875
3107
|
break;
|
|
2876
3108
|
}
|
|
2877
|
-
return
|
|
3109
|
+
return _context35.abrupt("return", this.itemRuleConfigs);
|
|
2878
3110
|
case 2:
|
|
2879
3111
|
if (!this.itemRuleConfigsPromise) {
|
|
2880
|
-
|
|
3112
|
+
_context35.next = 4;
|
|
2881
3113
|
break;
|
|
2882
3114
|
}
|
|
2883
|
-
return
|
|
3115
|
+
return _context35.abrupt("return", this.itemRuleConfigsPromise);
|
|
2884
3116
|
case 4:
|
|
2885
|
-
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3117
|
+
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2886
3118
|
var runtimeConfig, staticConfigs;
|
|
2887
|
-
return _regeneratorRuntime().wrap(function
|
|
2888
|
-
while (1) switch (
|
|
3119
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
3120
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2889
3121
|
case 0:
|
|
2890
3122
|
runtimeConfig = _this11.getItemRuleRuntimeConfig();
|
|
2891
3123
|
staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
|
|
2892
3124
|
if (!(staticConfigs.length > 0)) {
|
|
2893
|
-
|
|
3125
|
+
_context34.next = 6;
|
|
2894
3126
|
break;
|
|
2895
3127
|
}
|
|
2896
3128
|
_this11.itemRuleConfigs = staticConfigs;
|
|
2897
3129
|
_this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
|
|
2898
|
-
return
|
|
3130
|
+
return _context34.abrupt("return", _this11.itemRuleConfigs);
|
|
2899
3131
|
case 6:
|
|
2900
3132
|
_this11.itemRuleConfigs = [];
|
|
2901
3133
|
_this11.itemRuleEvaluator.setStrategyConfigs([]);
|
|
2902
|
-
return
|
|
3134
|
+
return _context34.abrupt("return", _this11.itemRuleConfigs);
|
|
2903
3135
|
case 9:
|
|
2904
3136
|
case "end":
|
|
2905
|
-
return
|
|
3137
|
+
return _context34.stop();
|
|
2906
3138
|
}
|
|
2907
|
-
},
|
|
3139
|
+
}, _callee34);
|
|
2908
3140
|
}))();
|
|
2909
|
-
|
|
3141
|
+
_context35.next = 7;
|
|
2910
3142
|
return this.itemRuleConfigsPromise;
|
|
2911
3143
|
case 7:
|
|
2912
|
-
return
|
|
3144
|
+
return _context35.abrupt("return", _context35.sent);
|
|
2913
3145
|
case 8:
|
|
2914
3146
|
case "end":
|
|
2915
|
-
return
|
|
3147
|
+
return _context35.stop();
|
|
2916
3148
|
}
|
|
2917
|
-
},
|
|
3149
|
+
}, _callee35, this);
|
|
2918
3150
|
}));
|
|
2919
3151
|
function ensureItemRuleConfigsLoaded() {
|
|
2920
3152
|
return _ensureItemRuleConfigsLoaded.apply(this, arguments);
|
|
@@ -2924,25 +3156,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2924
3156
|
}, {
|
|
2925
3157
|
key: "refreshItemRuleQuantityLimits",
|
|
2926
3158
|
value: function () {
|
|
2927
|
-
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3159
|
+
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
2928
3160
|
var strategyConfigs, businessData, limits;
|
|
2929
|
-
return _regeneratorRuntime().wrap(function
|
|
2930
|
-
while (1) switch (
|
|
3161
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
3162
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2931
3163
|
case 0:
|
|
2932
|
-
|
|
2933
|
-
|
|
3164
|
+
_context36.prev = 0;
|
|
3165
|
+
_context36.next = 3;
|
|
2934
3166
|
return this.ensureItemRuleConfigsLoaded();
|
|
2935
3167
|
case 3:
|
|
2936
|
-
strategyConfigs =
|
|
3168
|
+
strategyConfigs = _context36.sent;
|
|
2937
3169
|
if (strategyConfigs.length) {
|
|
2938
|
-
|
|
3170
|
+
_context36.next = 7;
|
|
2939
3171
|
break;
|
|
2940
3172
|
}
|
|
2941
3173
|
this.store.itemRuleQuantityLimits = [];
|
|
2942
|
-
return
|
|
3174
|
+
return _context36.abrupt("return", []);
|
|
2943
3175
|
case 7:
|
|
2944
3176
|
businessData = buildItemRuleBusinessData({
|
|
2945
|
-
tempOrder: this.
|
|
3177
|
+
tempOrder: this.ensureVenueTempOrder(),
|
|
2946
3178
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
2947
3179
|
itemRuleConfigs: this.itemRuleConfigs
|
|
2948
3180
|
});
|
|
@@ -2951,18 +3183,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2951
3183
|
this.logMethodSuccess('refreshItemRuleQuantityLimits', {
|
|
2952
3184
|
limitCount: limits.length
|
|
2953
3185
|
});
|
|
2954
|
-
return
|
|
3186
|
+
return _context36.abrupt("return", limits);
|
|
2955
3187
|
case 14:
|
|
2956
|
-
|
|
2957
|
-
|
|
3188
|
+
_context36.prev = 14;
|
|
3189
|
+
_context36.t0 = _context36["catch"](0);
|
|
2958
3190
|
this.store.itemRuleQuantityLimits = [];
|
|
2959
|
-
this.logMethodError('refreshItemRuleQuantityLimits',
|
|
2960
|
-
return
|
|
3191
|
+
this.logMethodError('refreshItemRuleQuantityLimits', _context36.t0);
|
|
3192
|
+
return _context36.abrupt("return", []);
|
|
2961
3193
|
case 19:
|
|
2962
3194
|
case "end":
|
|
2963
|
-
return
|
|
3195
|
+
return _context36.stop();
|
|
2964
3196
|
}
|
|
2965
|
-
},
|
|
3197
|
+
}, _callee36, this, [[0, 14]]);
|
|
2966
3198
|
}));
|
|
2967
3199
|
function refreshItemRuleQuantityLimits() {
|
|
2968
3200
|
return _refreshItemRuleQuantityLimits.apply(this, arguments);
|
|
@@ -2972,75 +3204,75 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2972
3204
|
}, {
|
|
2973
3205
|
key: "applyPrefillByItemRule",
|
|
2974
3206
|
value: function () {
|
|
2975
|
-
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2976
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges,
|
|
2977
|
-
return _regeneratorRuntime().wrap(function
|
|
2978
|
-
while (1) switch (
|
|
3207
|
+
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
|
|
3208
|
+
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, _product$metadata9, sellingPrice, origin, product, productUid, targetProduct, previousOrigin, nextOrigin, existedQuantity, delta, nextProduct, _nextProduct$metadata, _productUid;
|
|
3209
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3210
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2979
3211
|
case 0:
|
|
2980
3212
|
if (!this.itemRulePrefillApplied) {
|
|
2981
|
-
|
|
3213
|
+
_context37.next = 2;
|
|
2982
3214
|
break;
|
|
2983
3215
|
}
|
|
2984
|
-
return
|
|
3216
|
+
return _context37.abrupt("return");
|
|
2985
3217
|
case 2:
|
|
2986
3218
|
if (this.store.order) {
|
|
2987
|
-
|
|
3219
|
+
_context37.next = 4;
|
|
2988
3220
|
break;
|
|
2989
3221
|
}
|
|
2990
|
-
return
|
|
3222
|
+
return _context37.abrupt("return");
|
|
2991
3223
|
case 4:
|
|
2992
|
-
|
|
3224
|
+
_context37.next = 6;
|
|
2993
3225
|
return this.ensureItemRuleConfigsLoaded();
|
|
2994
3226
|
case 6:
|
|
2995
|
-
strategyConfigs =
|
|
3227
|
+
strategyConfigs = _context37.sent;
|
|
2996
3228
|
if (strategyConfigs.length) {
|
|
2997
|
-
|
|
3229
|
+
_context37.next = 9;
|
|
2998
3230
|
break;
|
|
2999
3231
|
}
|
|
3000
|
-
return
|
|
3232
|
+
return _context37.abrupt("return");
|
|
3001
3233
|
case 9:
|
|
3002
3234
|
businessData = buildItemRuleBusinessData({
|
|
3003
|
-
tempOrder: this.
|
|
3235
|
+
tempOrder: this.ensureVenueTempOrder(),
|
|
3004
3236
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
3005
3237
|
itemRuleConfigs: this.itemRuleConfigs
|
|
3006
3238
|
});
|
|
3007
3239
|
prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
|
|
3008
3240
|
if (prefillItems.length) {
|
|
3009
|
-
|
|
3241
|
+
_context37.next = 14;
|
|
3010
3242
|
break;
|
|
3011
3243
|
}
|
|
3012
3244
|
this.itemRulePrefillApplied = true;
|
|
3013
|
-
return
|
|
3245
|
+
return _context37.abrupt("return");
|
|
3014
3246
|
case 14:
|
|
3015
|
-
|
|
3247
|
+
_context37.next = 16;
|
|
3016
3248
|
return this.buildPrefillProductSourceMap();
|
|
3017
3249
|
case 16:
|
|
3018
|
-
productSourceMap =
|
|
3019
|
-
tempOrder = this.
|
|
3250
|
+
productSourceMap = _context37.sent;
|
|
3251
|
+
tempOrder = this.ensureVenueTempOrder();
|
|
3020
3252
|
hasChanges = false;
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3253
|
+
_iterator18 = _createForOfIteratorHelper(prefillItems);
|
|
3254
|
+
_context37.prev = 20;
|
|
3255
|
+
_iterator18.s();
|
|
3024
3256
|
case 22:
|
|
3025
|
-
if ((
|
|
3026
|
-
|
|
3257
|
+
if ((_step18 = _iterator18.n()).done) {
|
|
3258
|
+
_context37.next = 51;
|
|
3027
3259
|
break;
|
|
3028
3260
|
}
|
|
3029
|
-
prefillItem =
|
|
3261
|
+
prefillItem = _step18.value;
|
|
3030
3262
|
productId = Number(prefillItem.product_id);
|
|
3031
3263
|
productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
|
|
3032
3264
|
targetQuantity = toNonNegativeInt(prefillItem.quantity);
|
|
3033
3265
|
if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
|
|
3034
|
-
|
|
3266
|
+
_context37.next = 29;
|
|
3035
3267
|
break;
|
|
3036
3268
|
}
|
|
3037
|
-
return
|
|
3269
|
+
return _context37.abrupt("continue", 49);
|
|
3038
3270
|
case 29:
|
|
3039
3271
|
if (!Number.isNaN(productVariantId)) {
|
|
3040
|
-
|
|
3272
|
+
_context37.next = 31;
|
|
3041
3273
|
break;
|
|
3042
3274
|
}
|
|
3043
|
-
return
|
|
3275
|
+
return _context37.abrupt("continue", 49);
|
|
3044
3276
|
case 31:
|
|
3045
3277
|
sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
|
|
3046
3278
|
productIndex = getProductIdentityIndex(tempOrder.products, {
|
|
@@ -3048,11 +3280,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3048
3280
|
product_variant_id: productVariantId
|
|
3049
3281
|
});
|
|
3050
3282
|
if (!(productIndex === -1)) {
|
|
3051
|
-
|
|
3283
|
+
_context37.next = 42;
|
|
3052
3284
|
break;
|
|
3053
3285
|
}
|
|
3054
3286
|
sellingPrice = toPriceString((_sourceItem$price = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _sourceItem$price !== void 0 ? _sourceItem$price : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price, '0.00');
|
|
3055
|
-
|
|
3287
|
+
origin = _objectSpread(_objectSpread({}, sourceItem || {}), {}, {
|
|
3288
|
+
item_rule_prefill: true,
|
|
3289
|
+
item_rule_id: prefillItem.ruleId
|
|
3290
|
+
});
|
|
3291
|
+
product = normalizeOrderProduct({
|
|
3056
3292
|
product_id: productId,
|
|
3057
3293
|
product_variant_id: productVariantId,
|
|
3058
3294
|
num: targetQuantity,
|
|
@@ -3062,15 +3298,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3062
3298
|
item_rule_prefill: true,
|
|
3063
3299
|
item_rule_id: prefillItem.ruleId
|
|
3064
3300
|
},
|
|
3065
|
-
_origin:
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3301
|
+
_origin: origin
|
|
3302
|
+
});
|
|
3303
|
+
productUid = String(((_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.unique_identification_number) || '');
|
|
3304
|
+
this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
|
|
3305
|
+
tempOrder.products.push(product);
|
|
3070
3306
|
hasChanges = true;
|
|
3071
|
-
return
|
|
3072
|
-
case
|
|
3307
|
+
return _context37.abrupt("continue", 49);
|
|
3308
|
+
case 42:
|
|
3073
3309
|
targetProduct = tempOrder.products[productIndex];
|
|
3310
|
+
previousOrigin = this.readProductOriginFromTempOrder(tempOrder, targetProduct);
|
|
3311
|
+
nextOrigin = sourceItem ? _objectSpread(_objectSpread({}, previousOrigin || {}), sourceItem) : previousOrigin;
|
|
3074
3312
|
existedQuantity = toNonNegativeInt(targetProduct.num);
|
|
3075
3313
|
delta = targetQuantity - existedQuantity;
|
|
3076
3314
|
nextProduct = _objectSpread(_objectSpread(_objectSpread({}, targetProduct), delta > 0 ? {
|
|
@@ -3079,54 +3317,55 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3079
3317
|
metadata: _objectSpread(_objectSpread({}, targetProduct.metadata || {}), {}, {
|
|
3080
3318
|
item_rule_prefill: true,
|
|
3081
3319
|
item_rule_id: prefillItem.ruleId
|
|
3082
|
-
})
|
|
3083
|
-
_origin: sourceItem ? _objectSpread(_objectSpread({}, targetProduct._origin || {}), sourceItem) : targetProduct._origin
|
|
3320
|
+
})
|
|
3084
3321
|
});
|
|
3085
|
-
if (delta > 0 || Boolean(sourceItem && (!
|
|
3322
|
+
if (delta > 0 || Boolean(sourceItem && (!previousOrigin || (previousOrigin === null || previousOrigin === void 0 ? void 0 : previousOrigin.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
|
|
3323
|
+
_productUid = String(((_nextProduct$metadata = nextProduct.metadata) === null || _nextProduct$metadata === void 0 ? void 0 : _nextProduct$metadata.unique_identification_number) || '');
|
|
3324
|
+
this.attachProductOriginToTempOrder(tempOrder, _productUid, nextOrigin);
|
|
3086
3325
|
tempOrder.products[productIndex] = nextProduct;
|
|
3087
3326
|
hasChanges = true;
|
|
3088
3327
|
}
|
|
3089
|
-
case
|
|
3090
|
-
|
|
3328
|
+
case 49:
|
|
3329
|
+
_context37.next = 22;
|
|
3091
3330
|
break;
|
|
3092
|
-
case
|
|
3093
|
-
|
|
3331
|
+
case 51:
|
|
3332
|
+
_context37.next = 56;
|
|
3094
3333
|
break;
|
|
3095
|
-
case 47:
|
|
3096
|
-
_context36.prev = 47;
|
|
3097
|
-
_context36.t0 = _context36["catch"](20);
|
|
3098
|
-
_iterator17.e(_context36.t0);
|
|
3099
|
-
case 50:
|
|
3100
|
-
_context36.prev = 50;
|
|
3101
|
-
_iterator17.f();
|
|
3102
|
-
return _context36.finish(50);
|
|
3103
3334
|
case 53:
|
|
3335
|
+
_context37.prev = 53;
|
|
3336
|
+
_context37.t0 = _context37["catch"](20);
|
|
3337
|
+
_iterator18.e(_context37.t0);
|
|
3338
|
+
case 56:
|
|
3339
|
+
_context37.prev = 56;
|
|
3340
|
+
_iterator18.f();
|
|
3341
|
+
return _context37.finish(56);
|
|
3342
|
+
case 59:
|
|
3104
3343
|
if (!hasChanges) {
|
|
3105
|
-
|
|
3344
|
+
_context37.next = 64;
|
|
3106
3345
|
break;
|
|
3107
3346
|
}
|
|
3108
3347
|
// Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
|
|
3109
3348
|
this.store.order.applyDiscount();
|
|
3110
|
-
|
|
3349
|
+
_context37.next = 63;
|
|
3111
3350
|
return this.store.order.recalculateSummary({
|
|
3112
3351
|
createIfMissing: true
|
|
3113
3352
|
});
|
|
3114
|
-
case
|
|
3353
|
+
case 63:
|
|
3115
3354
|
this.store.order.persistTempOrder();
|
|
3116
|
-
case
|
|
3117
|
-
|
|
3355
|
+
case 64:
|
|
3356
|
+
_context37.next = 66;
|
|
3118
3357
|
return this.refreshItemRuleQuantityLimits();
|
|
3119
|
-
case
|
|
3358
|
+
case 66:
|
|
3120
3359
|
this.itemRulePrefillApplied = true;
|
|
3121
3360
|
this.logMethodSuccess('applyPrefillByItemRule', {
|
|
3122
3361
|
prefillCount: prefillItems.length,
|
|
3123
3362
|
hasChanges: hasChanges
|
|
3124
3363
|
});
|
|
3125
|
-
case
|
|
3364
|
+
case 68:
|
|
3126
3365
|
case "end":
|
|
3127
|
-
return
|
|
3366
|
+
return _context37.stop();
|
|
3128
3367
|
}
|
|
3129
|
-
},
|
|
3368
|
+
}, _callee37, this, [[20, 53, 56, 59]]);
|
|
3130
3369
|
}));
|
|
3131
3370
|
function applyPrefillByItemRule() {
|
|
3132
3371
|
return _applyPrefillByItemRule.apply(this, arguments);
|
|
@@ -3136,24 +3375,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3136
3375
|
}, {
|
|
3137
3376
|
key: "applyItemRulePrefill",
|
|
3138
3377
|
value: function () {
|
|
3139
|
-
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3140
|
-
return _regeneratorRuntime().wrap(function
|
|
3141
|
-
while (1) switch (
|
|
3378
|
+
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
|
|
3379
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
3380
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
3142
3381
|
case 0:
|
|
3143
3382
|
this.logMethodStart('applyItemRulePrefill');
|
|
3144
|
-
|
|
3383
|
+
_context38.next = 3;
|
|
3145
3384
|
return this.applyPrefillByItemRule();
|
|
3146
3385
|
case 3:
|
|
3147
|
-
|
|
3386
|
+
_context38.next = 5;
|
|
3148
3387
|
return this.refreshItemRuleQuantityLimits();
|
|
3149
3388
|
case 5:
|
|
3150
|
-
|
|
3389
|
+
_context38.next = 7;
|
|
3151
3390
|
return this.refreshCartValidationPassed();
|
|
3152
3391
|
case 7:
|
|
3153
3392
|
case "end":
|
|
3154
|
-
return
|
|
3393
|
+
return _context38.stop();
|
|
3155
3394
|
}
|
|
3156
|
-
},
|
|
3395
|
+
}, _callee38, this);
|
|
3157
3396
|
}));
|
|
3158
3397
|
function applyItemRulePrefill() {
|
|
3159
3398
|
return _applyItemRulePrefill.apply(this, arguments);
|
|
@@ -3163,35 +3402,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3163
3402
|
}, {
|
|
3164
3403
|
key: "evaluateCartValidationByItemRule",
|
|
3165
3404
|
value: function () {
|
|
3166
|
-
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3405
|
+
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
|
|
3167
3406
|
var strategyConfigs, businessData;
|
|
3168
|
-
return _regeneratorRuntime().wrap(function
|
|
3169
|
-
while (1) switch (
|
|
3407
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3408
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3170
3409
|
case 0:
|
|
3171
|
-
|
|
3410
|
+
_context39.next = 2;
|
|
3172
3411
|
return this.ensureItemRuleConfigsLoaded();
|
|
3173
3412
|
case 2:
|
|
3174
|
-
strategyConfigs =
|
|
3413
|
+
strategyConfigs = _context39.sent;
|
|
3175
3414
|
if (strategyConfigs.length) {
|
|
3176
|
-
|
|
3415
|
+
_context39.next = 5;
|
|
3177
3416
|
break;
|
|
3178
3417
|
}
|
|
3179
|
-
return
|
|
3418
|
+
return _context39.abrupt("return", {
|
|
3180
3419
|
passed: true,
|
|
3181
3420
|
failures: []
|
|
3182
3421
|
});
|
|
3183
3422
|
case 5:
|
|
3184
3423
|
businessData = buildItemRuleBusinessData({
|
|
3185
|
-
tempOrder: this.
|
|
3424
|
+
tempOrder: this.ensureVenueTempOrder(),
|
|
3186
3425
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
3187
3426
|
itemRuleConfigs: this.itemRuleConfigs
|
|
3188
3427
|
});
|
|
3189
|
-
return
|
|
3428
|
+
return _context39.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
|
|
3190
3429
|
case 7:
|
|
3191
3430
|
case "end":
|
|
3192
|
-
return
|
|
3431
|
+
return _context39.stop();
|
|
3193
3432
|
}
|
|
3194
|
-
},
|
|
3433
|
+
}, _callee39, this);
|
|
3195
3434
|
}));
|
|
3196
3435
|
function evaluateCartValidationByItemRule() {
|
|
3197
3436
|
return _evaluateCartValidationByItemRule.apply(this, arguments);
|
|
@@ -3201,20 +3440,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3201
3440
|
}, {
|
|
3202
3441
|
key: "validateBeforeSubmitByItemRule",
|
|
3203
3442
|
value: function () {
|
|
3204
|
-
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3443
|
+
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
|
|
3205
3444
|
var validationResult, firstFailure, errorMessage, error;
|
|
3206
|
-
return _regeneratorRuntime().wrap(function
|
|
3207
|
-
while (1) switch (
|
|
3445
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3446
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
3208
3447
|
case 0:
|
|
3209
|
-
|
|
3448
|
+
_context40.next = 2;
|
|
3210
3449
|
return this.evaluateCartValidationByItemRule();
|
|
3211
3450
|
case 2:
|
|
3212
|
-
validationResult =
|
|
3451
|
+
validationResult = _context40.sent;
|
|
3213
3452
|
if (!validationResult.passed) {
|
|
3214
|
-
|
|
3453
|
+
_context40.next = 5;
|
|
3215
3454
|
break;
|
|
3216
3455
|
}
|
|
3217
|
-
return
|
|
3456
|
+
return _context40.abrupt("return");
|
|
3218
3457
|
case 5:
|
|
3219
3458
|
firstFailure = validationResult.failures[0];
|
|
3220
3459
|
errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
|
|
@@ -3223,9 +3462,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3223
3462
|
throw error;
|
|
3224
3463
|
case 10:
|
|
3225
3464
|
case "end":
|
|
3226
|
-
return
|
|
3465
|
+
return _context40.stop();
|
|
3227
3466
|
}
|
|
3228
|
-
},
|
|
3467
|
+
}, _callee40, this);
|
|
3229
3468
|
}));
|
|
3230
3469
|
function validateBeforeSubmitByItemRule() {
|
|
3231
3470
|
return _validateBeforeSubmitByItemRule.apply(this, arguments);
|
|
@@ -3235,10 +3474,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3235
3474
|
}, {
|
|
3236
3475
|
key: "refreshCartValidationPassed",
|
|
3237
3476
|
value: function () {
|
|
3238
|
-
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3477
|
+
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
|
|
3239
3478
|
var previous, nextState, validationResult, changed;
|
|
3240
|
-
return _regeneratorRuntime().wrap(function
|
|
3241
|
-
while (1) switch (
|
|
3479
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3480
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
3242
3481
|
case 0:
|
|
3243
3482
|
previous = this.store.cartValidation || {
|
|
3244
3483
|
passed: null,
|
|
@@ -3248,20 +3487,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3248
3487
|
passed: null,
|
|
3249
3488
|
failures: []
|
|
3250
3489
|
};
|
|
3251
|
-
|
|
3252
|
-
|
|
3490
|
+
_context41.prev = 2;
|
|
3491
|
+
_context41.next = 5;
|
|
3253
3492
|
return this.evaluateCartValidationByItemRule();
|
|
3254
3493
|
case 5:
|
|
3255
|
-
validationResult =
|
|
3494
|
+
validationResult = _context41.sent;
|
|
3256
3495
|
nextState = {
|
|
3257
3496
|
passed: validationResult.passed,
|
|
3258
3497
|
failures: validationResult.failures || []
|
|
3259
3498
|
};
|
|
3260
|
-
|
|
3499
|
+
_context41.next = 12;
|
|
3261
3500
|
break;
|
|
3262
3501
|
case 9:
|
|
3263
|
-
|
|
3264
|
-
|
|
3502
|
+
_context41.prev = 9;
|
|
3503
|
+
_context41.t0 = _context41["catch"](2);
|
|
3265
3504
|
nextState = {
|
|
3266
3505
|
passed: false,
|
|
3267
3506
|
failures: []
|
|
@@ -3270,21 +3509,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3270
3509
|
this.store.cartValidation = nextState;
|
|
3271
3510
|
changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
|
|
3272
3511
|
if (!changed) {
|
|
3273
|
-
|
|
3512
|
+
_context41.next = 17;
|
|
3274
3513
|
break;
|
|
3275
3514
|
}
|
|
3276
|
-
|
|
3515
|
+
_context41.next = 17;
|
|
3277
3516
|
return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
|
|
3278
3517
|
cartValidation: nextState,
|
|
3279
3518
|
cartValidationPassed: nextState.passed
|
|
3280
3519
|
});
|
|
3281
3520
|
case 17:
|
|
3282
|
-
return
|
|
3521
|
+
return _context41.abrupt("return", nextState.passed);
|
|
3283
3522
|
case 18:
|
|
3284
3523
|
case "end":
|
|
3285
|
-
return
|
|
3524
|
+
return _context41.stop();
|
|
3286
3525
|
}
|
|
3287
|
-
},
|
|
3526
|
+
}, _callee41, this, [[2, 9]]);
|
|
3288
3527
|
}));
|
|
3289
3528
|
function refreshCartValidationPassed() {
|
|
3290
3529
|
return _refreshCartValidationPassed.apply(this, arguments);
|
|
@@ -3294,14 +3533,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3294
3533
|
}, {
|
|
3295
3534
|
key: "setItemRuleRuntimeConfig",
|
|
3296
3535
|
value: function () {
|
|
3297
|
-
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3536
|
+
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
|
|
3298
3537
|
var _this$itemRuleRuntime, _this$itemRuleRuntime2;
|
|
3299
3538
|
var config,
|
|
3300
|
-
|
|
3301
|
-
return _regeneratorRuntime().wrap(function
|
|
3302
|
-
while (1) switch (
|
|
3539
|
+
_args42 = arguments;
|
|
3540
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
3541
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
3303
3542
|
case 0:
|
|
3304
|
-
config =
|
|
3543
|
+
config = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
|
|
3305
3544
|
this.logMethodStart('setItemRuleRuntimeConfig');
|
|
3306
3545
|
this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
|
|
3307
3546
|
pax: _objectSpread(_objectSpread({}, ((_this$itemRuleRuntime = this.itemRuleRuntimeConfig) === null || _this$itemRuleRuntime === void 0 ? void 0 : _this$itemRuleRuntime.pax) || {}), (config === null || config === void 0 ? void 0 : config.pax) || {}),
|
|
@@ -3313,10 +3552,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3313
3552
|
this.itemRuleEvaluator.setStrategyConfigs([]);
|
|
3314
3553
|
}
|
|
3315
3554
|
this.itemRulePrefillApplied = false;
|
|
3316
|
-
|
|
3555
|
+
_context42.next = 7;
|
|
3317
3556
|
return this.refreshItemRuleQuantityLimits();
|
|
3318
3557
|
case 7:
|
|
3319
|
-
|
|
3558
|
+
_context42.next = 9;
|
|
3320
3559
|
return this.refreshCartValidationPassed();
|
|
3321
3560
|
case 9:
|
|
3322
3561
|
this.logMethodSuccess('setItemRuleRuntimeConfig', {
|
|
@@ -3324,9 +3563,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3324
3563
|
});
|
|
3325
3564
|
case 10:
|
|
3326
3565
|
case "end":
|
|
3327
|
-
return
|
|
3566
|
+
return _context42.stop();
|
|
3328
3567
|
}
|
|
3329
|
-
},
|
|
3568
|
+
}, _callee42, this);
|
|
3330
3569
|
}));
|
|
3331
3570
|
function setItemRuleRuntimeConfig() {
|
|
3332
3571
|
return _setItemRuleRuntimeConfig.apply(this, arguments);
|
|
@@ -3353,23 +3592,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3353
3592
|
}, {
|
|
3354
3593
|
key: "readUIStateBucket",
|
|
3355
3594
|
value: function readUIStateBucket() {
|
|
3356
|
-
var _this$
|
|
3595
|
+
var _this$window2;
|
|
3357
3596
|
var key = this.getUIStateBucketKey();
|
|
3358
|
-
if (!key || !((_this$
|
|
3597
|
+
if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return {};
|
|
3359
3598
|
try {
|
|
3360
3599
|
var raw = this.window.sessionStorage.getItem(key) || '{}';
|
|
3361
3600
|
var parsed = JSON.parse(raw);
|
|
3362
3601
|
return parsed && _typeof(parsed) === 'object' ? parsed : {};
|
|
3363
|
-
} catch (
|
|
3602
|
+
} catch (_unused4) {
|
|
3364
3603
|
return {};
|
|
3365
3604
|
}
|
|
3366
3605
|
}
|
|
3367
3606
|
}, {
|
|
3368
3607
|
key: "writeUIStateBucket",
|
|
3369
3608
|
value: function writeUIStateBucket(bucket) {
|
|
3370
|
-
var _this$
|
|
3609
|
+
var _this$window3;
|
|
3371
3610
|
var key = this.getUIStateBucketKey();
|
|
3372
|
-
if (!key || !((_this$
|
|
3611
|
+
if (!key || !((_this$window3 = this.window) !== null && _this$window3 !== void 0 && _this$window3.sessionStorage)) return;
|
|
3373
3612
|
this.window.sessionStorage.setItem(key, JSON.stringify(bucket));
|
|
3374
3613
|
}
|
|
3375
3614
|
}, {
|
|
@@ -3397,30 +3636,118 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3397
3636
|
this.writeUIStateBucket(bucket);
|
|
3398
3637
|
}
|
|
3399
3638
|
}
|
|
3639
|
+
}, {
|
|
3640
|
+
key: "setBookingHolder",
|
|
3641
|
+
value: function setBookingHolder(bookingUid, holder) {
|
|
3642
|
+
var _tempOrder$bookings4;
|
|
3643
|
+
if (!this.store.order) return;
|
|
3644
|
+
var tempOrder = this.store.order.ensureTempOrder();
|
|
3645
|
+
var booking = (_tempOrder$bookings4 = tempOrder.bookings) === null || _tempOrder$bookings4 === void 0 ? void 0 : _tempOrder$bookings4.find(function (b) {
|
|
3646
|
+
var _b$metadata4;
|
|
3647
|
+
return ((_b$metadata4 = b.metadata) === null || _b$metadata4 === void 0 ? void 0 : _b$metadata4.unique_identification_number) === bookingUid;
|
|
3648
|
+
});
|
|
3649
|
+
if (booking) {
|
|
3650
|
+
booking.holder = holder;
|
|
3651
|
+
}
|
|
3652
|
+
var _iterator19 = _createForOfIteratorHelper(tempOrder.products),
|
|
3653
|
+
_step19;
|
|
3654
|
+
try {
|
|
3655
|
+
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
|
|
3656
|
+
var _runtimeProduct$metad, _runtimeProduct$metad2, _runtimeProduct$_orig;
|
|
3657
|
+
var product = _step19.value;
|
|
3658
|
+
var runtimeProduct = product;
|
|
3659
|
+
var productBookingUid = (_runtimeProduct$metad = (_runtimeProduct$metad2 = runtimeProduct.metadata) === null || _runtimeProduct$metad2 === void 0 ? void 0 : _runtimeProduct$metad2.booking_uid) !== null && _runtimeProduct$metad !== void 0 ? _runtimeProduct$metad : (_runtimeProduct$_orig = runtimeProduct._origin) === null || _runtimeProduct$_orig === void 0 || (_runtimeProduct$_orig = _runtimeProduct$_orig.product) === null || _runtimeProduct$_orig === void 0 ? void 0 : _runtimeProduct$_orig.bookingUuid;
|
|
3660
|
+
if (String(productBookingUid) !== String(bookingUid)) continue;
|
|
3661
|
+
var origin = runtimeProduct._origin && _typeof(runtimeProduct._origin) === 'object' ? runtimeProduct._origin : {};
|
|
3662
|
+
origin.holder = holder;
|
|
3663
|
+
runtimeProduct._origin = origin;
|
|
3664
|
+
}
|
|
3665
|
+
} catch (err) {
|
|
3666
|
+
_iterator19.e(err);
|
|
3667
|
+
} finally {
|
|
3668
|
+
_iterator19.f();
|
|
3669
|
+
}
|
|
3670
|
+
this.store.order.notifyTempOrderChanged();
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
/**
|
|
3674
|
+
* 获取 holder 表单 map
|
|
3675
|
+
*/
|
|
3676
|
+
}, {
|
|
3677
|
+
key: "getHolderFormMap",
|
|
3678
|
+
value: function getHolderFormMap() {
|
|
3679
|
+
if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
|
|
3680
|
+
return this.store.holder.getHolderFormMap();
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
/**
|
|
3684
|
+
* UI 层触发:按当前 holderMap 批量刷新所有表单的 records
|
|
3685
|
+
*/
|
|
3686
|
+
}, {
|
|
3687
|
+
key: "refreshAllHolderFormRecords",
|
|
3688
|
+
value: (function () {
|
|
3689
|
+
var _refreshAllHolderFormRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
|
|
3690
|
+
var _params$customer_id, _params$useCache;
|
|
3691
|
+
var customer_id;
|
|
3692
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3693
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
3694
|
+
case 0:
|
|
3695
|
+
if (this.store.holder) {
|
|
3696
|
+
_context43.next = 2;
|
|
3697
|
+
break;
|
|
3698
|
+
}
|
|
3699
|
+
throw new Error('[VenueBooking] holder 模块未初始化');
|
|
3700
|
+
case 2:
|
|
3701
|
+
customer_id = (_params$customer_id = params === null || params === void 0 ? void 0 : params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.resolveHolderCustomerId();
|
|
3702
|
+
return _context43.abrupt("return", this.store.holder.refreshAllFormRecords(_objectSpread(_objectSpread({}, params), {}, {
|
|
3703
|
+
customer_id: customer_id,
|
|
3704
|
+
useCache: (_params$useCache = params === null || params === void 0 ? void 0 : params.useCache) !== null && _params$useCache !== void 0 ? _params$useCache : false
|
|
3705
|
+
})));
|
|
3706
|
+
case 4:
|
|
3707
|
+
case "end":
|
|
3708
|
+
return _context43.stop();
|
|
3709
|
+
}
|
|
3710
|
+
}, _callee43, this);
|
|
3711
|
+
}));
|
|
3712
|
+
function refreshAllHolderFormRecords(_x21) {
|
|
3713
|
+
return _refreshAllHolderFormRecords.apply(this, arguments);
|
|
3714
|
+
}
|
|
3715
|
+
return refreshAllHolderFormRecords;
|
|
3716
|
+
}()
|
|
3717
|
+
/**
|
|
3718
|
+
* 添加表单记录
|
|
3719
|
+
*/
|
|
3720
|
+
)
|
|
3721
|
+
}, {
|
|
3722
|
+
key: "appendFormRecord",
|
|
3723
|
+
value: function appendFormRecord(params) {
|
|
3724
|
+
if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
|
|
3725
|
+
return this.store.holder.appendFormRecord(params);
|
|
3726
|
+
}
|
|
3400
3727
|
|
|
3401
3728
|
// ─── OpenData 可用性 ───
|
|
3402
3729
|
}, {
|
|
3403
3730
|
key: "checkOpenDataAvailability",
|
|
3404
3731
|
value: function () {
|
|
3405
|
-
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3406
|
-
return _regeneratorRuntime().wrap(function
|
|
3407
|
-
while (1) switch (
|
|
3732
|
+
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44() {
|
|
3733
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
|
3734
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
3408
3735
|
case 0:
|
|
3409
3736
|
if (this.store.openData) {
|
|
3410
|
-
|
|
3737
|
+
_context44.next = 2;
|
|
3411
3738
|
break;
|
|
3412
3739
|
}
|
|
3413
3740
|
throw new Error('openData 模块未初始化');
|
|
3414
3741
|
case 2:
|
|
3415
|
-
|
|
3742
|
+
_context44.next = 4;
|
|
3416
3743
|
return this.loadOpenDataConfig();
|
|
3417
3744
|
case 4:
|
|
3418
|
-
return
|
|
3745
|
+
return _context44.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
|
|
3419
3746
|
case 5:
|
|
3420
3747
|
case "end":
|
|
3421
|
-
return
|
|
3748
|
+
return _context44.stop();
|
|
3422
3749
|
}
|
|
3423
|
-
},
|
|
3750
|
+
}, _callee44, this);
|
|
3424
3751
|
}));
|
|
3425
3752
|
function checkOpenDataAvailability() {
|
|
3426
3753
|
return _checkOpenDataAvailability.apply(this, arguments);
|
|
@@ -3430,15 +3757,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3430
3757
|
}, {
|
|
3431
3758
|
key: "setOtherParams",
|
|
3432
3759
|
value: function () {
|
|
3433
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3434
|
-
var
|
|
3435
|
-
|
|
3760
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
|
|
3761
|
+
var _ref7,
|
|
3762
|
+
_ref7$cover,
|
|
3436
3763
|
cover,
|
|
3437
|
-
|
|
3438
|
-
return _regeneratorRuntime().wrap(function
|
|
3439
|
-
while (1) switch (
|
|
3764
|
+
_args45 = arguments;
|
|
3765
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
3766
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
3440
3767
|
case 0:
|
|
3441
|
-
|
|
3768
|
+
_ref7 = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {}, _ref7$cover = _ref7.cover, cover = _ref7$cover === void 0 ? false : _ref7$cover;
|
|
3442
3769
|
if (cover) {
|
|
3443
3770
|
this.otherParams = params;
|
|
3444
3771
|
} else {
|
|
@@ -3446,17 +3773,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3446
3773
|
}
|
|
3447
3774
|
case 2:
|
|
3448
3775
|
case "end":
|
|
3449
|
-
return
|
|
3776
|
+
return _context45.stop();
|
|
3450
3777
|
}
|
|
3451
|
-
},
|
|
3778
|
+
}, _callee45, this);
|
|
3452
3779
|
}));
|
|
3453
|
-
function setOtherParams(
|
|
3780
|
+
function setOtherParams(_x22) {
|
|
3454
3781
|
return _setOtherParams.apply(this, arguments);
|
|
3455
3782
|
}
|
|
3456
3783
|
return setOtherParams;
|
|
3457
3784
|
}()
|
|
3458
3785
|
}]);
|
|
3459
3786
|
return VenueBookingImpl;
|
|
3460
|
-
}(
|
|
3787
|
+
}(BaseSalesImpl);
|
|
3461
3788
|
_defineProperty(VenueBookingImpl, "OPEN_DATA_CACHE_TTL", 5 * 60 * 1000);
|
|
3462
3789
|
_defineProperty(VenueBookingImpl, "UI_STATE_KEY_PREFIX", 'pisell.venueBooking.uiState:');
|