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