@pisell/pisellos 2.3.197 → 2.3.199
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/Date/index.d.ts +1 -1
- package/dist/modules/Date/index.js +60 -14
- package/dist/modules/Date/types.d.ts +5 -0
- package/dist/modules/Schedule/index.d.ts +7 -1
- package/dist/modules/Schedule/index.js +155 -39
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/bookingReadValidation.d.ts +6 -0
- package/dist/modules/bookingReadValidation.js +72 -0
- package/dist/plugins/request.d.ts +2 -0
- package/dist/shared/receipt/small-ticket.d.ts +1 -0
- package/dist/shared/receipt/small-ticket.js +4 -1
- package/dist/solution/BookingByStep/index.d.ts +17 -3
- package/dist/solution/BookingByStep/index.js +666 -356
- package/dist/solution/BookingTicket/index.d.ts +14 -2
- package/dist/solution/OrderInvoicePreview/index.js +4 -3
- package/lib/modules/Date/index.d.ts +1 -1
- package/lib/modules/Date/index.js +28 -5
- package/lib/modules/Date/types.d.ts +5 -0
- package/lib/modules/Schedule/index.d.ts +7 -1
- package/lib/modules/Schedule/index.js +68 -4
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/bookingReadValidation.d.ts +6 -0
- package/lib/modules/bookingReadValidation.js +56 -0
- package/lib/plugins/request.d.ts +2 -0
- package/lib/shared/receipt/small-ticket.d.ts +1 -0
- package/lib/shared/receipt/small-ticket.js +4 -1
- package/lib/solution/BookingByStep/index.d.ts +17 -3
- package/lib/solution/BookingByStep/index.js +212 -12
- package/lib/solution/BookingTicket/index.d.ts +14 -2
- package/lib/solution/OrderInvoicePreview/index.js +1 -0
- package/package.json +1 -1
|
@@ -4,17 +4,17 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
4
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; } }
|
|
5
5
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
6
6
|
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; } } }; }
|
|
7
|
+
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; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
12
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
13
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
14
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
15
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
16
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
-
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; }
|
|
14
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
-
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); } }
|
|
17
|
-
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); }); }; }
|
|
18
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
19
|
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); } }
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -65,16 +65,107 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
65
65
|
_defineProperty(_assertThisInitialized(_this), "shopStore", void 0);
|
|
66
66
|
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
67
67
|
_defineProperty(_assertThisInitialized(_this), "otherParams", {});
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleRuntimeParams", {});
|
|
68
69
|
_defineProperty(_assertThisInitialized(_this), "cacheId", void 0);
|
|
69
70
|
_defineProperty(_assertThisInitialized(_this), "otherData", {});
|
|
70
71
|
// 提供给 UI 层的临时数据存储,会进缓存
|
|
71
72
|
_defineProperty(_assertThisInitialized(_this), "platform", void 0);
|
|
73
|
+
// 平台类型,用于判断是 PC / H5
|
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "productDetailGeneration", 0);
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "sessionAvailabilityRequestVersion", 0);
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "lifecycleGeneration", 0);
|
|
77
|
+
_defineProperty(_assertThisInitialized(_this), "disposed", false);
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "resourcePreparation", void 0);
|
|
72
79
|
return _this;
|
|
73
80
|
}
|
|
74
81
|
_createClass(BookingByStepImpl, [{
|
|
82
|
+
key: "staleSelection",
|
|
83
|
+
value: function staleSelection() {
|
|
84
|
+
return Object.assign(new Error('Booking selection changed'), {
|
|
85
|
+
name: 'AbortError'
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "resourceSelectionKey",
|
|
90
|
+
value: function resourceSelectionKey() {
|
|
91
|
+
var items = this.store.cart.getItems();
|
|
92
|
+
var sessionDates = items.filter(function (item) {
|
|
93
|
+
return isSessionProduct(item._productOrigin);
|
|
94
|
+
}).flatMap(function (item) {
|
|
95
|
+
return [item.start_date, item.end_date];
|
|
96
|
+
}).filter(Boolean);
|
|
97
|
+
return JSON.stringify({
|
|
98
|
+
lifecycle: this.lifecycleGeneration,
|
|
99
|
+
dates: sessionDates.length ? _toConsumableArray(new Set(sessionDates)).sort() : (this.store.date.getDateRange() || []).map(function (date) {
|
|
100
|
+
return date.date;
|
|
101
|
+
}).sort(),
|
|
102
|
+
cart: items.map(function (item) {
|
|
103
|
+
var _item$_origin, _item$_productOrigin, _item$_productOrigin2, _item$_productOrigin3, _item$_productOrigin4, _item$_productOrigin5;
|
|
104
|
+
return {
|
|
105
|
+
id: item._id,
|
|
106
|
+
num: item.num,
|
|
107
|
+
holder: item.holder_id,
|
|
108
|
+
start: [item.start_date, item.start_time],
|
|
109
|
+
end: [item.end_date, item.end_time],
|
|
110
|
+
resources: (_item$_origin = item._origin) === null || _item$_origin === void 0 ? void 0 : _item$_origin.resources,
|
|
111
|
+
capacity: getCapacityInfoByCartItem(item).currentCapacity,
|
|
112
|
+
product: {
|
|
113
|
+
id: (_item$_productOrigin = item._productOrigin) === null || _item$_productOrigin === void 0 ? void 0 : _item$_productOrigin.id,
|
|
114
|
+
schedules: (_item$_productOrigin2 = item._productOrigin) === null || _item$_productOrigin2 === void 0 ? void 0 : _item$_productOrigin2['schedule.ids'],
|
|
115
|
+
resources: (_item$_productOrigin3 = item._productOrigin) === null || _item$_productOrigin3 === void 0 || (_item$_productOrigin3 = _item$_productOrigin3.product_resource) === null || _item$_productOrigin3 === void 0 || (_item$_productOrigin3 = _item$_productOrigin3.resources) === null || _item$_productOrigin3 === void 0 ? void 0 : _item$_productOrigin3.map(function (resource) {
|
|
116
|
+
return {
|
|
117
|
+
id: resource.id,
|
|
118
|
+
resource_type_id: resource.resource_type_id,
|
|
119
|
+
status: resource.status,
|
|
120
|
+
code: resource.code,
|
|
121
|
+
type: resource.type,
|
|
122
|
+
default_resource: resource.default_resource || [],
|
|
123
|
+
// Resource rendering removes required IDs from the optional list in place.
|
|
124
|
+
// Compare the same effective inputs before and after that normalization.
|
|
125
|
+
optional_resource: (resource.optional_resource || []).filter(function (id) {
|
|
126
|
+
return !(resource.default_resource || []).includes(id);
|
|
127
|
+
}),
|
|
128
|
+
select_type: resource.select_type && {
|
|
129
|
+
type: resource.select_type.type,
|
|
130
|
+
min: resource.select_type.min,
|
|
131
|
+
max: resource.select_type.max
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}),
|
|
135
|
+
duration: (_item$_productOrigin4 = item._productOrigin) === null || _item$_productOrigin4 === void 0 ? void 0 : _item$_productOrigin4.duration,
|
|
136
|
+
cutoff: (_item$_productOrigin5 = item._productOrigin) === null || _item$_productOrigin5 === void 0 ? void 0 : _item$_productOrigin5.cut_off_time
|
|
137
|
+
},
|
|
138
|
+
bundle: item._bundleOrigin,
|
|
139
|
+
options: item._optionsOrigin
|
|
140
|
+
};
|
|
141
|
+
})
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Semantic selection token for async UI transitions. */
|
|
146
|
+
}, {
|
|
147
|
+
key: "getBookingSelectionKey",
|
|
148
|
+
value: function getBookingSelectionKey() {
|
|
149
|
+
return this.resourceSelectionKey();
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "refreshCurrentProductSchedule",
|
|
153
|
+
value: function refreshCurrentProductSchedule() {
|
|
154
|
+
var product = this.store.currentProduct;
|
|
155
|
+
if (!(product !== null && product !== void 0 && product['schedule.ids']) || !this.store.schedule.isScheduleListLoaded()) return;
|
|
156
|
+
var version = this.store.schedule.getScheduleCatalogVersion();
|
|
157
|
+
var meta = this.store.currentProductMeta || {};
|
|
158
|
+
if (meta.scheduleCatalogVersion !== version) {
|
|
159
|
+
this.store.currentProductMeta = _objectSpread(_objectSpread({}, meta), {}, {
|
|
160
|
+
schedule: this.getScheduleDataByIds(product['schedule.ids']),
|
|
161
|
+
scheduleCatalogVersion: version,
|
|
162
|
+
timeSlotBySchedule: undefined
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
75
167
|
key: "initialize",
|
|
76
|
-
value:
|
|
77
|
-
function () {
|
|
168
|
+
value: function () {
|
|
78
169
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
79
170
|
var _this$otherParams,
|
|
80
171
|
_this$otherParams2,
|
|
@@ -84,25 +175,29 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
84
175
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
85
176
|
while (1) switch (_context.prev = _context.next) {
|
|
86
177
|
case 0:
|
|
178
|
+
this.disposed = false;
|
|
179
|
+
this.lifecycleGeneration += 1;
|
|
180
|
+
this.productDetailGeneration += 1;
|
|
87
181
|
this.core = core;
|
|
88
182
|
this.store = options.store || {};
|
|
89
183
|
this.otherParams = options.otherParams || {};
|
|
184
|
+
this.scheduleRuntimeParams = _objectSpread({}, this.otherParams);
|
|
90
185
|
// 获取依赖的插件
|
|
91
186
|
this.request = core.getPlugin('request');
|
|
92
187
|
this.window = core.getPlugin('window');
|
|
93
188
|
this.shopStore = core.getPlugin('shopStore');
|
|
94
189
|
if (this.request) {
|
|
95
|
-
_context.next =
|
|
190
|
+
_context.next = 12;
|
|
96
191
|
break;
|
|
97
192
|
}
|
|
98
193
|
throw new Error('bookingByStep解决方案需要 request 插件支持');
|
|
99
|
-
case
|
|
194
|
+
case 12:
|
|
100
195
|
if (this.shopStore) {
|
|
101
|
-
_context.next =
|
|
196
|
+
_context.next = 14;
|
|
102
197
|
break;
|
|
103
198
|
}
|
|
104
199
|
throw new Error('SummaryModule 需要 shopStore 插件支持');
|
|
105
|
-
case
|
|
200
|
+
case 14:
|
|
106
201
|
// 如果有传 cacheid,默认需要收集上面这些模块里用户操作选中的数据
|
|
107
202
|
// 并且在上面 registerModule 的时候,读取 sessionStroage 里的数据,塞进默认值
|
|
108
203
|
targetCacheData = {};
|
|
@@ -129,15 +224,20 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
129
224
|
fatherModule: _this2.name,
|
|
130
225
|
openCache: (_this2$otherParams = _this2.otherParams) !== null && _this2$otherParams !== void 0 && _this2$otherParams.cacheId ? true : false,
|
|
131
226
|
cacheId: (_this2$otherParams2 = _this2.otherParams) === null || _this2$otherParams2 === void 0 ? void 0 : _this2$otherParams2.cacheId
|
|
132
|
-
}
|
|
227
|
+
}, step === 'schedule' ? {
|
|
228
|
+
scheduleCatalogCache: 'memory',
|
|
229
|
+
bookingRead: true
|
|
230
|
+
} : {})
|
|
133
231
|
});
|
|
134
232
|
} else {
|
|
135
233
|
throw new Error("\u6A21\u5757 ".concat(step, " \u4E0D\u5B58\u5728"));
|
|
136
234
|
}
|
|
137
235
|
});
|
|
138
|
-
this.store.schedule.
|
|
236
|
+
this.store.schedule.ensureScheduleReady().catch(function (error) {
|
|
237
|
+
if ((error === null || error === void 0 ? void 0 : error.name) !== 'AbortError') console.error('[BookingByStep] Schedule preload failed', error);
|
|
238
|
+
});
|
|
139
239
|
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
140
|
-
case
|
|
240
|
+
case 22:
|
|
141
241
|
case "end":
|
|
142
242
|
return _context.stop();
|
|
143
243
|
}
|
|
@@ -257,6 +357,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
257
357
|
startDate: schedule_date || dayjs().format('YYYY-MM-DD'),
|
|
258
358
|
endDate: schedule_date || dayjs().format('YYYY-MM-DD'),
|
|
259
359
|
products: _toConsumableArray(res)
|
|
360
|
+
}).catch(function (error) {
|
|
361
|
+
if ((error === null || error === void 0 ? void 0 : error.name) !== 'AbortError') console.error('[BookingByStep] Resource preload failed', error);
|
|
260
362
|
});
|
|
261
363
|
return _context2.abrupt("return", res);
|
|
262
364
|
case 6:
|
|
@@ -428,17 +530,18 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
428
530
|
key: "loadScheduleAvailableDate",
|
|
429
531
|
value: (function () {
|
|
430
532
|
var _loadScheduleAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref3) {
|
|
431
|
-
var startDate, endDate, custom_page_id, channel;
|
|
533
|
+
var startDate, endDate, custom_page_id, channel, assertCurrent;
|
|
432
534
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
433
535
|
while (1) switch (_context5.prev = _context5.next) {
|
|
434
536
|
case 0:
|
|
435
|
-
startDate = _ref3.startDate, endDate = _ref3.endDate, custom_page_id = _ref3.custom_page_id, channel = _ref3.channel;
|
|
537
|
+
startDate = _ref3.startDate, endDate = _ref3.endDate, custom_page_id = _ref3.custom_page_id, channel = _ref3.channel, assertCurrent = _ref3.assertCurrent;
|
|
436
538
|
_context5.next = 3;
|
|
437
539
|
return this.store.schedule.loadScheduleAvailableDate({
|
|
438
540
|
startDate: startDate,
|
|
439
541
|
endDate: endDate,
|
|
440
542
|
custom_page_id: custom_page_id,
|
|
441
|
-
channel: channel
|
|
543
|
+
channel: channel,
|
|
544
|
+
assertCurrent: assertCurrent
|
|
442
545
|
});
|
|
443
546
|
case 3:
|
|
444
547
|
return _context5.abrupt("return", _context5.sent);
|
|
@@ -751,6 +854,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
751
854
|
value: function () {
|
|
752
855
|
var _getAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
753
856
|
var _this4 = this,
|
|
857
|
+
_this$store$currentPr,
|
|
754
858
|
_dateRange$,
|
|
755
859
|
_dateRange$2,
|
|
756
860
|
_dateRange$3;
|
|
@@ -762,7 +866,12 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
762
866
|
_params$useCache,
|
|
763
867
|
useCache,
|
|
764
868
|
tempProducts,
|
|
765
|
-
|
|
869
|
+
generation,
|
|
870
|
+
lifecycle,
|
|
871
|
+
selectionKey,
|
|
872
|
+
_assertCurrent,
|
|
873
|
+
requiresSchedule,
|
|
874
|
+
_this$store$currentPr2,
|
|
766
875
|
dateRange,
|
|
767
876
|
tempStartDate,
|
|
768
877
|
tempEndDate,
|
|
@@ -770,6 +879,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
770
879
|
resourceIds,
|
|
771
880
|
rules,
|
|
772
881
|
resourcesMap,
|
|
882
|
+
catalogVersion,
|
|
773
883
|
res,
|
|
774
884
|
_args13 = arguments;
|
|
775
885
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
@@ -784,6 +894,37 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
784
894
|
tempProducts = products || this.store.cart.getItems().map(function (p) {
|
|
785
895
|
return p._productOrigin;
|
|
786
896
|
});
|
|
897
|
+
generation = this.productDetailGeneration;
|
|
898
|
+
lifecycle = this.lifecycleGeneration;
|
|
899
|
+
selectionKey = products ? undefined : this.resourceSelectionKey();
|
|
900
|
+
_assertCurrent = function assertCurrent() {
|
|
901
|
+
var _params$assertCurrent;
|
|
902
|
+
if (_this4.disposed || lifecycle !== _this4.lifecycleGeneration || (!products || !params.assertCurrent) && generation !== _this4.productDetailGeneration || selectionKey !== undefined && selectionKey !== _this4.resourceSelectionKey()) throw _this4.staleSelection();
|
|
903
|
+
(_params$assertCurrent = params.assertCurrent) === null || _params$assertCurrent === void 0 || _params$assertCurrent.call(params);
|
|
904
|
+
};
|
|
905
|
+
requiresSchedule = tempProducts.some(function (product) {
|
|
906
|
+
var _product$scheduleIds;
|
|
907
|
+
return product === null || product === void 0 || (_product$scheduleIds = product['schedule.ids']) === null || _product$scheduleIds === void 0 ? void 0 : _product$scheduleIds.length;
|
|
908
|
+
}) || !products && !!((_this$store$currentPr = this.store.currentProduct) !== null && _this$store$currentPr !== void 0 && (_this$store$currentPr = _this$store$currentPr['schedule.ids']) !== null && _this$store$currentPr !== void 0 && _this$store$currentPr.length);
|
|
909
|
+
if (!requiresSchedule) {
|
|
910
|
+
_context13.next = 21;
|
|
911
|
+
break;
|
|
912
|
+
}
|
|
913
|
+
_context13.prev = 10;
|
|
914
|
+
_context13.next = 13;
|
|
915
|
+
return this.store.schedule.ensureScheduleReady();
|
|
916
|
+
case 13:
|
|
917
|
+
_context13.next = 19;
|
|
918
|
+
break;
|
|
919
|
+
case 15:
|
|
920
|
+
_context13.prev = 15;
|
|
921
|
+
_context13.t0 = _context13["catch"](10);
|
|
922
|
+
_assertCurrent();
|
|
923
|
+
throw _context13.t0;
|
|
924
|
+
case 19:
|
|
925
|
+
_assertCurrent();
|
|
926
|
+
this.refreshCurrentProductSchedule();
|
|
927
|
+
case 21:
|
|
787
928
|
if (tempProducts.length) {
|
|
788
929
|
tempProducts.forEach(function (p) {
|
|
789
930
|
if (p !== null && p !== void 0 && p['schedule.ids']) {
|
|
@@ -793,24 +934,25 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
793
934
|
});
|
|
794
935
|
}
|
|
795
936
|
// 如果当前打开了某个的商品详情弹窗,则应该默认用这个商品
|
|
796
|
-
if (this.store.currentProduct) {
|
|
937
|
+
if (!products && this.store.currentProduct) {
|
|
797
938
|
tempProducts = [_objectSpread(_objectSpread({}, this.store.currentProduct), {}, {
|
|
798
|
-
_schedule: (_this$store$
|
|
939
|
+
_schedule: (_this$store$currentPr2 = this.store.currentProductMeta) === null || _this$store$currentPr2 === void 0 ? void 0 : _this$store$currentPr2['schedule']
|
|
799
940
|
})];
|
|
800
941
|
}
|
|
801
942
|
dateRange = this.store.date.getDateRange();
|
|
802
943
|
tempStartDate = startDate || (dateRange === null || dateRange === void 0 || (_dateRange$ = dateRange[0]) === null || _dateRange$ === void 0 ? void 0 : _dateRange$.date);
|
|
803
944
|
tempEndDate = endDate || (dateRange === null || dateRange === void 0 || (_dateRange$2 = dateRange[1]) === null || _dateRange$2 === void 0 ? void 0 : _dateRange$2.date) || (dateRange === null || dateRange === void 0 || (_dateRange$3 = dateRange[0]) === null || _dateRange$3 === void 0 ? void 0 : _dateRange$3.date);
|
|
804
945
|
if (tempProducts.length) {
|
|
805
|
-
_context13.next =
|
|
946
|
+
_context13.next = 28;
|
|
806
947
|
break;
|
|
807
948
|
}
|
|
808
949
|
return _context13.abrupt("return", []);
|
|
809
|
-
case
|
|
950
|
+
case 28:
|
|
810
951
|
// 在这里需要把能收集到的数据都收集上来,拼装好给 date 模块去查询
|
|
811
952
|
_ref4 = getAvailableProductResources(tempProducts) || {}, resourceIds = _ref4.resourceIds, rules = _ref4.rules, resourcesMap = _ref4.resourcesMap;
|
|
812
953
|
this.otherParams.currentResourcesMap = resourcesMap;
|
|
813
|
-
|
|
954
|
+
catalogVersion = this.store.schedule.getScheduleCatalogVersion();
|
|
955
|
+
_context13.next = 33;
|
|
814
956
|
return this.store.date.getResourceDates({
|
|
815
957
|
url: params.url,
|
|
816
958
|
query: {
|
|
@@ -820,44 +962,119 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
820
962
|
},
|
|
821
963
|
rules: rules,
|
|
822
964
|
type: type,
|
|
823
|
-
useCache: useCache
|
|
965
|
+
useCache: useCache,
|
|
966
|
+
bookingRead: true,
|
|
967
|
+
errorMode: 'throw',
|
|
968
|
+
assertCurrent: function assertCurrent() {
|
|
969
|
+
_assertCurrent();
|
|
970
|
+
if (requiresSchedule && catalogVersion !== _this4.store.schedule.getScheduleCatalogVersion()) throw _this4.staleSelection();
|
|
971
|
+
}
|
|
824
972
|
});
|
|
825
|
-
case
|
|
973
|
+
case 33:
|
|
826
974
|
res = _context13.sent;
|
|
827
975
|
return _context13.abrupt("return", res);
|
|
828
|
-
case
|
|
976
|
+
case 35:
|
|
829
977
|
case "end":
|
|
830
978
|
return _context13.stop();
|
|
831
979
|
}
|
|
832
|
-
}, _callee13, this);
|
|
980
|
+
}, _callee13, this, [[10, 15]]);
|
|
833
981
|
}));
|
|
834
982
|
function getAvailableDate() {
|
|
835
983
|
return _getAvailableDate.apply(this, arguments);
|
|
836
984
|
}
|
|
837
985
|
return getAvailableDate;
|
|
838
|
-
}()
|
|
986
|
+
}() /** Prepare the exact cart/date selection before synchronous resource checks. */
|
|
987
|
+
}, {
|
|
988
|
+
key: "prepareResourcesForCurrentSelection",
|
|
989
|
+
value: function prepareResourcesForCurrentSelection() {
|
|
990
|
+
var _this$resourcePrepara,
|
|
991
|
+
_this5 = this;
|
|
992
|
+
var key = this.resourceSelectionKey();
|
|
993
|
+
if (((_this$resourcePrepara = this.resourcePreparation) === null || _this$resourcePrepara === void 0 ? void 0 : _this$resourcePrepara.key) === key) return this.resourcePreparation.promise;
|
|
994
|
+
var selected = cloneDeep(this.store.date.getDateRange() || []);
|
|
995
|
+
var cart = this.store.cart.getItems().filter(function (item) {
|
|
996
|
+
return !isNormalProduct(item._productOrigin);
|
|
997
|
+
});
|
|
998
|
+
var sessionDates = cart.filter(function (item) {
|
|
999
|
+
return isSessionProduct(item._productOrigin);
|
|
1000
|
+
}).flatMap(function (item) {
|
|
1001
|
+
return [item.start_date, item.end_date];
|
|
1002
|
+
}).filter(Boolean);
|
|
1003
|
+
var selectedDates = sessionDates.length ? _toConsumableArray(new Set(sessionDates)).sort() : selected.map(function (date) {
|
|
1004
|
+
return date.date;
|
|
1005
|
+
}).sort();
|
|
1006
|
+
var dates = selectedDates;
|
|
1007
|
+
if (!cart.length || !dates.length) return Promise.resolve();
|
|
1008
|
+
var assertCurrent = function assertCurrent() {
|
|
1009
|
+
if (_this5.disposed || key !== _this5.resourceSelectionKey()) throw _this5.staleSelection();
|
|
1010
|
+
};
|
|
1011
|
+
var promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
1012
|
+
var available;
|
|
1013
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1014
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1015
|
+
case 0:
|
|
1016
|
+
_context14.next = 2;
|
|
1017
|
+
return _this5.getAvailableDate({
|
|
1018
|
+
startDate: dates[0],
|
|
1019
|
+
endDate: dates[dates.length - 1],
|
|
1020
|
+
products: cart.map(function (item) {
|
|
1021
|
+
return item._productOrigin;
|
|
1022
|
+
}),
|
|
1023
|
+
assertCurrent: assertCurrent
|
|
1024
|
+
});
|
|
1025
|
+
case 2:
|
|
1026
|
+
available = _context14.sent;
|
|
1027
|
+
assertCurrent();
|
|
1028
|
+
_this5.store.date.setDateRange(selectedDates.map(function (date) {
|
|
1029
|
+
return available.find(function (item) {
|
|
1030
|
+
return item.date === date;
|
|
1031
|
+
}) || {
|
|
1032
|
+
date: date,
|
|
1033
|
+
week: dayjs(date).format('ddd'),
|
|
1034
|
+
weekNum: dayjs(date).day(),
|
|
1035
|
+
status: 'unavailable',
|
|
1036
|
+
resource: []
|
|
1037
|
+
};
|
|
1038
|
+
}));
|
|
1039
|
+
case 5:
|
|
1040
|
+
case "end":
|
|
1041
|
+
return _context14.stop();
|
|
1042
|
+
}
|
|
1043
|
+
}, _callee14);
|
|
1044
|
+
}))();
|
|
1045
|
+
this.resourcePreparation = {
|
|
1046
|
+
key: key,
|
|
1047
|
+
promise: promise
|
|
1048
|
+
};
|
|
1049
|
+
void promise.finally(function () {
|
|
1050
|
+
var _this5$resourcePrepar;
|
|
1051
|
+
if (((_this5$resourcePrepar = _this5.resourcePreparation) === null || _this5$resourcePrepar === void 0 ? void 0 : _this5$resourcePrepar.promise) === promise) _this5.resourcePreparation = undefined;
|
|
1052
|
+
}).catch(function () {});
|
|
1053
|
+
return promise;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
839
1056
|
/**
|
|
840
1057
|
* 获取购物车汇总信息
|
|
841
1058
|
*/
|
|
842
1059
|
}, {
|
|
843
1060
|
key: "getSummary",
|
|
844
1061
|
value: (function () {
|
|
845
|
-
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1062
|
+
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
846
1063
|
var cartItems, summary;
|
|
847
|
-
return _regeneratorRuntime().wrap(function
|
|
848
|
-
while (1) switch (
|
|
1064
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1065
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
849
1066
|
case 0:
|
|
850
1067
|
cartItems = this.store.cart.getItems();
|
|
851
|
-
|
|
1068
|
+
_context15.next = 3;
|
|
852
1069
|
return this.store.summary.getSummary(cartItems);
|
|
853
1070
|
case 3:
|
|
854
|
-
summary =
|
|
855
|
-
return
|
|
1071
|
+
summary = _context15.sent;
|
|
1072
|
+
return _context15.abrupt("return", summary);
|
|
856
1073
|
case 5:
|
|
857
1074
|
case "end":
|
|
858
|
-
return
|
|
1075
|
+
return _context15.stop();
|
|
859
1076
|
}
|
|
860
|
-
},
|
|
1077
|
+
}, _callee15, this);
|
|
861
1078
|
}));
|
|
862
1079
|
function getSummary() {
|
|
863
1080
|
return _getSummary.apply(this, arguments);
|
|
@@ -871,16 +1088,16 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
871
1088
|
}, {
|
|
872
1089
|
key: "getProtocol",
|
|
873
1090
|
value: (function () {
|
|
874
|
-
var _getProtocol = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
875
|
-
return _regeneratorRuntime().wrap(function
|
|
876
|
-
while (1) switch (
|
|
1091
|
+
var _getProtocol = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(protocolId) {
|
|
1092
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1093
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
877
1094
|
case 0:
|
|
878
|
-
return
|
|
1095
|
+
return _context16.abrupt("return", this.store.summary.getProtocol(protocolId));
|
|
879
1096
|
case 1:
|
|
880
1097
|
case "end":
|
|
881
|
-
return
|
|
1098
|
+
return _context16.stop();
|
|
882
1099
|
}
|
|
883
|
-
},
|
|
1100
|
+
}, _callee16, this);
|
|
884
1101
|
}));
|
|
885
1102
|
function getProtocol(_x14) {
|
|
886
1103
|
return _getProtocol.apply(this, arguments);
|
|
@@ -891,16 +1108,16 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
891
1108
|
}, {
|
|
892
1109
|
key: "getProducts",
|
|
893
1110
|
value: function () {
|
|
894
|
-
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
895
|
-
return _regeneratorRuntime().wrap(function
|
|
896
|
-
while (1) switch (
|
|
1111
|
+
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1112
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1113
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
897
1114
|
case 0:
|
|
898
|
-
return
|
|
1115
|
+
return _context17.abrupt("return", this.store.products.getProducts());
|
|
899
1116
|
case 1:
|
|
900
1117
|
case "end":
|
|
901
|
-
return
|
|
1118
|
+
return _context17.stop();
|
|
902
1119
|
}
|
|
903
|
-
},
|
|
1120
|
+
}, _callee17, this);
|
|
904
1121
|
}));
|
|
905
1122
|
function getProducts() {
|
|
906
1123
|
return _getProducts.apply(this, arguments);
|
|
@@ -910,15 +1127,15 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
910
1127
|
}, {
|
|
911
1128
|
key: "setLoginAccount",
|
|
912
1129
|
value: function () {
|
|
913
|
-
var _setLoginAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
914
|
-
var
|
|
1130
|
+
var _setLoginAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(accountId, accountInfo) {
|
|
1131
|
+
var _this6 = this;
|
|
915
1132
|
var account, stateAccountId, cartItems, _this$store$date$getD2, date, normalProductCartItem, customerId;
|
|
916
|
-
return _regeneratorRuntime().wrap(function
|
|
917
|
-
while (1) switch (
|
|
1133
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1134
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
918
1135
|
case 0:
|
|
919
1136
|
account = this.store.accountList.getAccount(accountId);
|
|
920
1137
|
if (!account) {
|
|
921
|
-
|
|
1138
|
+
_context18.next = 23;
|
|
922
1139
|
break;
|
|
923
1140
|
}
|
|
924
1141
|
stateAccountId = account.getId();
|
|
@@ -928,7 +1145,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
928
1145
|
cartItems = this.store.cart.getItems();
|
|
929
1146
|
cartItems.forEach(function (item) {
|
|
930
1147
|
if (item.holder_id === accountId) {
|
|
931
|
-
|
|
1148
|
+
_this6.store.cart.updateItem({
|
|
932
1149
|
_id: item._id,
|
|
933
1150
|
account: accountInfo
|
|
934
1151
|
});
|
|
@@ -936,7 +1153,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
936
1153
|
});
|
|
937
1154
|
this.store.accountList.updateAccountListById(stateAccountId, accountInfo);
|
|
938
1155
|
if (!cartItems.length) {
|
|
939
|
-
|
|
1156
|
+
_context18.next = 21;
|
|
940
1157
|
break;
|
|
941
1158
|
}
|
|
942
1159
|
date = (_this$store$date$getD2 = this.store.date.getDateRange()) === null || _this$store$date$getD2 === void 0 || (_this$store$date$getD2 = _this$store$date$getD2[0]) === null || _this$store$date$getD2 === void 0 ? void 0 : _this$store$date$getD2.date;
|
|
@@ -951,29 +1168,29 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
951
1168
|
this.updateQuotationPriceAndCart(date);
|
|
952
1169
|
|
|
953
1170
|
// 登录后刷新 holder 表单
|
|
954
|
-
|
|
1171
|
+
_context18.prev = 12;
|
|
955
1172
|
customerId = Number(accountInfo.id);
|
|
956
|
-
|
|
1173
|
+
_context18.next = 16;
|
|
957
1174
|
return this.refreshAllHolderFormRecords({
|
|
958
1175
|
customer_id: customerId
|
|
959
1176
|
});
|
|
960
1177
|
case 16:
|
|
961
|
-
|
|
1178
|
+
_context18.next = 21;
|
|
962
1179
|
break;
|
|
963
1180
|
case 18:
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
console.error('[BookingByStep] 登录后刷新 holder 表单失败',
|
|
1181
|
+
_context18.prev = 18;
|
|
1182
|
+
_context18.t0 = _context18["catch"](12);
|
|
1183
|
+
console.error('[BookingByStep] 登录后刷新 holder 表单失败', _context18.t0);
|
|
967
1184
|
case 21:
|
|
968
|
-
|
|
1185
|
+
_context18.next = 24;
|
|
969
1186
|
break;
|
|
970
1187
|
case 23:
|
|
971
1188
|
throw new Error("\u6CA1\u6709\u627E\u5230".concat(accountId, "\u8D26\u6237"));
|
|
972
1189
|
case 24:
|
|
973
1190
|
case "end":
|
|
974
|
-
return
|
|
1191
|
+
return _context18.stop();
|
|
975
1192
|
}
|
|
976
|
-
},
|
|
1193
|
+
}, _callee18, this, [[12, 18]]);
|
|
977
1194
|
}));
|
|
978
1195
|
function setLoginAccount(_x15, _x16) {
|
|
979
1196
|
return _setLoginAccount.apply(this, arguments);
|
|
@@ -983,14 +1200,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
983
1200
|
}, {
|
|
984
1201
|
key: "generateCartData",
|
|
985
1202
|
value: function () {
|
|
986
|
-
var _generateCartData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
987
|
-
return _regeneratorRuntime().wrap(function
|
|
988
|
-
while (1) switch (
|
|
1203
|
+
var _generateCartData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1204
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1205
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
989
1206
|
case 0:
|
|
990
1207
|
case "end":
|
|
991
|
-
return
|
|
1208
|
+
return _context19.stop();
|
|
992
1209
|
}
|
|
993
|
-
},
|
|
1210
|
+
}, _callee19);
|
|
994
1211
|
}));
|
|
995
1212
|
function generateCartData() {
|
|
996
1213
|
return _generateCartData.apply(this, arguments);
|
|
@@ -1000,21 +1217,21 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1000
1217
|
}, {
|
|
1001
1218
|
key: "getFreeProduct",
|
|
1002
1219
|
value: function () {
|
|
1003
|
-
var _getFreeProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1220
|
+
var _getFreeProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(id) {
|
|
1004
1221
|
var res;
|
|
1005
|
-
return _regeneratorRuntime().wrap(function
|
|
1006
|
-
while (1) switch (
|
|
1222
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1223
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1007
1224
|
case 0:
|
|
1008
|
-
|
|
1225
|
+
_context20.next = 2;
|
|
1009
1226
|
return this.request.post("/pay/order/free-pay/".concat(id));
|
|
1010
1227
|
case 2:
|
|
1011
|
-
res =
|
|
1012
|
-
return
|
|
1228
|
+
res = _context20.sent;
|
|
1229
|
+
return _context20.abrupt("return", res);
|
|
1013
1230
|
case 4:
|
|
1014
1231
|
case "end":
|
|
1015
|
-
return
|
|
1232
|
+
return _context20.stop();
|
|
1016
1233
|
}
|
|
1017
|
-
},
|
|
1234
|
+
}, _callee20, this);
|
|
1018
1235
|
}));
|
|
1019
1236
|
function getFreeProduct(_x17) {
|
|
1020
1237
|
return _getFreeProduct.apply(this, arguments);
|
|
@@ -1039,17 +1256,17 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1039
1256
|
}, {
|
|
1040
1257
|
key: "submitOrder",
|
|
1041
1258
|
value: function () {
|
|
1042
|
-
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1259
|
+
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(extraData) {
|
|
1043
1260
|
var _this$otherParams4;
|
|
1044
1261
|
var cartItems, newCartItems, type;
|
|
1045
|
-
return _regeneratorRuntime().wrap(function
|
|
1046
|
-
while (1) switch (
|
|
1262
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1263
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1047
1264
|
case 0:
|
|
1048
1265
|
cartItems = this.store.cart.getItems();
|
|
1049
1266
|
newCartItems = cloneDeep(cartItems); // 先整个临时的逻辑,把购物车里所有商品的资源给他格式化一下
|
|
1050
1267
|
newCartItems.forEach(function (item) {
|
|
1051
1268
|
if (item._origin.resources && item._origin.resources.length) {
|
|
1052
|
-
var _item$
|
|
1269
|
+
var _item$_origin2;
|
|
1053
1270
|
item._origin.resources = item._origin.resources.map(function (n) {
|
|
1054
1271
|
var newResourcesItem = cloneDeep(n);
|
|
1055
1272
|
delete newResourcesItem.id;
|
|
@@ -1060,7 +1277,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1060
1277
|
var _getCapacityInfoByCar = getCapacityInfoByCartItem(item),
|
|
1061
1278
|
currentCapacity = _getCapacityInfoByCar.currentCapacity,
|
|
1062
1279
|
formatCapacity = _getCapacityInfoByCar.formatCapacity;
|
|
1063
|
-
if (!((_item$
|
|
1280
|
+
if (!((_item$_origin2 = item._origin) !== null && _item$_origin2 !== void 0 && _item$_origin2.metadata)) {
|
|
1064
1281
|
item._origin.metadata = {};
|
|
1065
1282
|
}
|
|
1066
1283
|
item._origin.metadata.capacity = formatCapacity;
|
|
@@ -1073,7 +1290,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1073
1290
|
}))) {
|
|
1074
1291
|
type = 'virtual';
|
|
1075
1292
|
}
|
|
1076
|
-
return
|
|
1293
|
+
return _context21.abrupt("return", this.store.order.submitOrder({
|
|
1077
1294
|
query: {
|
|
1078
1295
|
cartItems: newCartItems,
|
|
1079
1296
|
type: type,
|
|
@@ -1084,9 +1301,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1084
1301
|
}));
|
|
1085
1302
|
case 6:
|
|
1086
1303
|
case "end":
|
|
1087
|
-
return
|
|
1304
|
+
return _context21.stop();
|
|
1088
1305
|
}
|
|
1089
|
-
},
|
|
1306
|
+
}, _callee21, this);
|
|
1090
1307
|
}));
|
|
1091
1308
|
function submitOrder(_x18) {
|
|
1092
1309
|
return _submitOrder.apply(this, arguments);
|
|
@@ -1096,14 +1313,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1096
1313
|
}, {
|
|
1097
1314
|
key: "pay",
|
|
1098
1315
|
value: function () {
|
|
1099
|
-
var _pay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1100
|
-
return _regeneratorRuntime().wrap(function
|
|
1101
|
-
while (1) switch (
|
|
1316
|
+
var _pay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1317
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1318
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1102
1319
|
case 0:
|
|
1103
1320
|
case "end":
|
|
1104
|
-
return
|
|
1321
|
+
return _context22.stop();
|
|
1105
1322
|
}
|
|
1106
|
-
},
|
|
1323
|
+
}, _callee22);
|
|
1107
1324
|
}));
|
|
1108
1325
|
function pay() {
|
|
1109
1326
|
return _pay.apply(this, arguments);
|
|
@@ -1113,14 +1330,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1113
1330
|
}, {
|
|
1114
1331
|
key: "getPayInfo",
|
|
1115
1332
|
value: function () {
|
|
1116
|
-
var _getPayInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1117
|
-
return _regeneratorRuntime().wrap(function
|
|
1118
|
-
while (1) switch (
|
|
1333
|
+
var _getPayInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
1334
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1335
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1119
1336
|
case 0:
|
|
1120
1337
|
case "end":
|
|
1121
|
-
return
|
|
1338
|
+
return _context23.stop();
|
|
1122
1339
|
}
|
|
1123
|
-
},
|
|
1340
|
+
}, _callee23);
|
|
1124
1341
|
}));
|
|
1125
1342
|
function getPayInfo() {
|
|
1126
1343
|
return _getPayInfo.apply(this, arguments);
|
|
@@ -1130,25 +1347,33 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1130
1347
|
}, {
|
|
1131
1348
|
key: "setOtherParams",
|
|
1132
1349
|
value: function () {
|
|
1133
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1134
|
-
var
|
|
1135
|
-
|
|
1350
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(params) {
|
|
1351
|
+
var _this$store$schedule;
|
|
1352
|
+
var _ref6,
|
|
1353
|
+
_ref6$cover,
|
|
1136
1354
|
cover,
|
|
1137
|
-
|
|
1138
|
-
return _regeneratorRuntime().wrap(function
|
|
1139
|
-
while (1) switch (
|
|
1355
|
+
_args24 = arguments;
|
|
1356
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1357
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1140
1358
|
case 0:
|
|
1141
|
-
|
|
1359
|
+
_ref6 = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {}, _ref6$cover = _ref6.cover, cover = _ref6$cover === void 0 ? false : _ref6$cover;
|
|
1360
|
+
this.scheduleRuntimeParams = _objectSpread(_objectSpread({}, this.scheduleRuntimeParams), params);
|
|
1142
1361
|
if (cover) {
|
|
1143
1362
|
this.otherParams = params;
|
|
1144
1363
|
} else {
|
|
1145
1364
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
1146
1365
|
}
|
|
1147
|
-
|
|
1366
|
+
(_this$store$schedule = this.store.schedule) === null || _this$store$schedule === void 0 || _this$store$schedule.updateOtherParams(_objectSpread(_objectSpread({}, this.scheduleRuntimeParams), {}, {
|
|
1367
|
+
fatherModule: this.name,
|
|
1368
|
+
openCache: !!this.scheduleRuntimeParams.cacheId,
|
|
1369
|
+
scheduleCatalogCache: 'memory',
|
|
1370
|
+
bookingRead: true
|
|
1371
|
+
}));
|
|
1372
|
+
case 4:
|
|
1148
1373
|
case "end":
|
|
1149
|
-
return
|
|
1374
|
+
return _context24.stop();
|
|
1150
1375
|
}
|
|
1151
|
-
},
|
|
1376
|
+
}, _callee24, this);
|
|
1152
1377
|
}));
|
|
1153
1378
|
function setOtherParams(_x19) {
|
|
1154
1379
|
return _setOtherParams.apply(this, arguments);
|
|
@@ -1158,16 +1383,16 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1158
1383
|
}, {
|
|
1159
1384
|
key: "getOtherParams",
|
|
1160
1385
|
value: function () {
|
|
1161
|
-
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1162
|
-
return _regeneratorRuntime().wrap(function
|
|
1163
|
-
while (1) switch (
|
|
1386
|
+
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
1387
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1388
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1164
1389
|
case 0:
|
|
1165
|
-
return
|
|
1390
|
+
return _context25.abrupt("return", this.otherParams);
|
|
1166
1391
|
case 1:
|
|
1167
1392
|
case "end":
|
|
1168
|
-
return
|
|
1393
|
+
return _context25.stop();
|
|
1169
1394
|
}
|
|
1170
|
-
},
|
|
1395
|
+
}, _callee25, this);
|
|
1171
1396
|
}));
|
|
1172
1397
|
function getOtherParams() {
|
|
1173
1398
|
return _getOtherParams.apply(this, arguments);
|
|
@@ -1212,20 +1437,20 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1212
1437
|
*/
|
|
1213
1438
|
}, {
|
|
1214
1439
|
key: "addProductToCart",
|
|
1215
|
-
value: function addProductToCart(
|
|
1216
|
-
var product =
|
|
1217
|
-
date =
|
|
1218
|
-
account =
|
|
1219
|
-
|
|
1220
|
-
isLegacyOrder =
|
|
1221
|
-
var
|
|
1222
|
-
bundle =
|
|
1223
|
-
options =
|
|
1224
|
-
origin =
|
|
1225
|
-
product_variant_id =
|
|
1226
|
-
rowKey =
|
|
1227
|
-
|
|
1228
|
-
quantity =
|
|
1440
|
+
value: function addProductToCart(_ref7) {
|
|
1441
|
+
var product = _ref7.product,
|
|
1442
|
+
date = _ref7.date,
|
|
1443
|
+
account = _ref7.account,
|
|
1444
|
+
_ref7$isLegacyOrder = _ref7.isLegacyOrder,
|
|
1445
|
+
isLegacyOrder = _ref7$isLegacyOrder === void 0 ? false : _ref7$isLegacyOrder;
|
|
1446
|
+
var _ref8 = product || {},
|
|
1447
|
+
bundle = _ref8.bundle,
|
|
1448
|
+
options = _ref8.options,
|
|
1449
|
+
origin = _ref8.origin,
|
|
1450
|
+
product_variant_id = _ref8.product_variant_id,
|
|
1451
|
+
rowKey = _ref8.rowKey,
|
|
1452
|
+
_ref8$quantity = _ref8.quantity,
|
|
1453
|
+
quantity = _ref8$quantity === void 0 ? 1 : _ref8$quantity;
|
|
1229
1454
|
var productData = _objectSpread(_objectSpread({}, origin), {}, {
|
|
1230
1455
|
product_variant_id: product_variant_id
|
|
1231
1456
|
});
|
|
@@ -1317,9 +1542,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1317
1542
|
*/
|
|
1318
1543
|
}, {
|
|
1319
1544
|
key: "addProductCheck",
|
|
1320
|
-
value: function addProductCheck(
|
|
1321
|
-
var
|
|
1322
|
-
var date =
|
|
1545
|
+
value: function addProductCheck(_ref9) {
|
|
1546
|
+
var _this7 = this;
|
|
1547
|
+
var date = _ref9.date;
|
|
1323
1548
|
// 检测,有传递 date,检查购物车里其他商品的 date 是否在同一天,如果不在,清空那些不在同一天的商品
|
|
1324
1549
|
if (date) {
|
|
1325
1550
|
var cartItems = this.store.cart.getItems().filter(function (n) {
|
|
@@ -1330,7 +1555,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1330
1555
|
});
|
|
1331
1556
|
if (cartItemsByDate.length) {
|
|
1332
1557
|
cartItemsByDate.forEach(function (n) {
|
|
1333
|
-
|
|
1558
|
+
_this7.store.cart.removeItem(n._id);
|
|
1334
1559
|
});
|
|
1335
1560
|
}
|
|
1336
1561
|
// // 如果 date.startTime 和 dateRange 里的 startTime 不一样,需要修正 dateRange
|
|
@@ -1382,7 +1607,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1382
1607
|
key: "updateCartCheck",
|
|
1383
1608
|
value: function updateCartCheck(params, targetCartItem) {
|
|
1384
1609
|
var _params$resources,
|
|
1385
|
-
|
|
1610
|
+
_this8 = this;
|
|
1386
1611
|
// 零售模板不需要检测
|
|
1387
1612
|
if (this.otherParams.isRetailTemplate) {
|
|
1388
1613
|
return;
|
|
@@ -1443,7 +1668,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1443
1668
|
var end_time = item.end_time;
|
|
1444
1669
|
var start_date = item.start_date;
|
|
1445
1670
|
var end_date = item.end_date;
|
|
1446
|
-
|
|
1671
|
+
_this8.store.cart.updateItem({
|
|
1447
1672
|
_id: item._id,
|
|
1448
1673
|
resources: resources,
|
|
1449
1674
|
date: {
|
|
@@ -1452,7 +1677,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1452
1677
|
}
|
|
1453
1678
|
});
|
|
1454
1679
|
} else {
|
|
1455
|
-
|
|
1680
|
+
_this8.store.cart.updateItem({
|
|
1456
1681
|
_id: item._id,
|
|
1457
1682
|
resources: resources
|
|
1458
1683
|
});
|
|
@@ -1489,10 +1714,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1489
1714
|
}, {
|
|
1490
1715
|
key: "batchUpdateCart",
|
|
1491
1716
|
value: function batchUpdateCart(paramsList) {
|
|
1492
|
-
var
|
|
1717
|
+
var _this9 = this;
|
|
1493
1718
|
var cartItems = [];
|
|
1494
1719
|
paramsList.forEach(function (params) {
|
|
1495
|
-
var cartItem =
|
|
1720
|
+
var cartItem = _this9.store.cart.formatCartItem(params);
|
|
1496
1721
|
cartItems.push(cartItem);
|
|
1497
1722
|
});
|
|
1498
1723
|
this.store.cart.batchSetItems(cartItems);
|
|
@@ -1520,14 +1745,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1520
1745
|
}, {
|
|
1521
1746
|
key: "checkCartItems",
|
|
1522
1747
|
value: function checkCartItems(type) {
|
|
1523
|
-
var
|
|
1748
|
+
var _this10 = this;
|
|
1524
1749
|
// 预约流程中普通商品无需检测这些东西
|
|
1525
1750
|
var cartItems = this.store.cart.getItems().filter(function (n) {
|
|
1526
1751
|
return !isNormalProduct(n._productOrigin);
|
|
1527
1752
|
});
|
|
1528
1753
|
var errorCartItemIds = [];
|
|
1529
1754
|
cartItems.forEach(function (cartItem) {
|
|
1530
|
-
var result =
|
|
1755
|
+
var result = _this10.store.cart.checkCartItemByType(cartItem, type);
|
|
1531
1756
|
if (!result) {
|
|
1532
1757
|
errorCartItemIds.push(cartItem._id);
|
|
1533
1758
|
}
|
|
@@ -1537,7 +1762,12 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1537
1762
|
}, {
|
|
1538
1763
|
key: "destroy",
|
|
1539
1764
|
value: function destroy() {
|
|
1540
|
-
var _this$store$cart, _this$store$step, _this$store$products, _this$store$guests, _this$store$date, _this$store$accountLi;
|
|
1765
|
+
var _this$store$schedule2, _this$store$cart, _this$store$step, _this$store$products, _this$store$guests, _this$store$date, _this$store$accountLi;
|
|
1766
|
+
this.disposed = true;
|
|
1767
|
+
this.lifecycleGeneration += 1;
|
|
1768
|
+
this.productDetailGeneration += 1;
|
|
1769
|
+
this.resourcePreparation = undefined;
|
|
1770
|
+
(_this$store$schedule2 = this.store.schedule) === null || _this$store$schedule2 === void 0 || _this$store$schedule2.destroy();
|
|
1541
1771
|
(_this$store$cart = this.store.cart) === null || _this$store$cart === void 0 || _this$store$cart.destroy();
|
|
1542
1772
|
(_this$store$step = this.store.step) === null || _this$store$step === void 0 || _this$store$step.destroy();
|
|
1543
1773
|
(_this$store$products = this.store.products) === null || _this$store$products === void 0 || _this$store$products.destroy();
|
|
@@ -1552,7 +1782,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1552
1782
|
}, {
|
|
1553
1783
|
key: "getResourcesList",
|
|
1554
1784
|
value: function getResourcesList() {
|
|
1555
|
-
var
|
|
1785
|
+
var _this11 = this;
|
|
1556
1786
|
var dateRange = this.store.date.getDateRange();
|
|
1557
1787
|
var resources = [];
|
|
1558
1788
|
if (dateRange !== null && dateRange !== void 0 && dateRange.length) {
|
|
@@ -1642,9 +1872,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1642
1872
|
});
|
|
1643
1873
|
});
|
|
1644
1874
|
} else {
|
|
1645
|
-
var _cartItem$_productOri3,
|
|
1875
|
+
var _cartItem$_productOri3, _this11$shopStore$get, _cartItem$_productOri4, _cartItem$_productOri5;
|
|
1646
1876
|
var hasFlexibleDuration = ((_cartItem$_productOri3 = cartItem._productOrigin) === null || _cartItem$_productOri3 === void 0 || (_cartItem$_productOri3 = _cartItem$_productOri3.duration) === null || _cartItem$_productOri3 === void 0 ? void 0 : _cartItem$_productOri3.type) === 'flexible';
|
|
1647
|
-
var operating_day_boundary = (
|
|
1877
|
+
var operating_day_boundary = (_this11$shopStore$get = _this11.shopStore.get('core')) === null || _this11$shopStore$get === void 0 || (_this11$shopStore$get = _this11$shopStore$get.core) === null || _this11$shopStore$get === void 0 ? void 0 : _this11$shopStore$get.operating_day_boundary;
|
|
1648
1878
|
var maxBlockThreshold = (_cartItem$_productOri4 = cartItem._productOrigin) !== null && _cartItem$_productOri4 !== void 0 && (_cartItem$_productOri4 = _cartItem$_productOri4.duration) !== null && _cartItem$_productOri4 !== void 0 && (_cartItem$_productOri4 = _cartItem$_productOri4.flexible_config) !== null && _cartItem$_productOri4 !== void 0 && _cartItem$_productOri4.is_enable_minimum_duration ? ((_cartItem$_productOri5 = cartItem._productOrigin) === null || _cartItem$_productOri5 === void 0 || (_cartItem$_productOri5 = _cartItem$_productOri5.duration) === null || _cartItem$_productOri5 === void 0 || (_cartItem$_productOri5 = _cartItem$_productOri5.flexible_config) === null || _cartItem$_productOri5 === void 0 ? void 0 : _cartItem$_productOri5.block_threshold) || 0 : 0;
|
|
1649
1879
|
productResources.forEach(function (item) {
|
|
1650
1880
|
// 如果资源的 capacity 已经小于了当前需要的 capacity ,则需要把资源给过滤掉
|
|
@@ -1762,14 +1992,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1762
1992
|
// 自动分派可用资源-pro 版,ui 传递某个账号,自动给某个账号下所有商品分配第一种资源
|
|
1763
1993
|
}, {
|
|
1764
1994
|
key: "autoSelectAccountResources",
|
|
1765
|
-
value: function autoSelectAccountResources(
|
|
1995
|
+
value: function autoSelectAccountResources(_ref10) {
|
|
1766
1996
|
var _cartItem$_productOri8, _allProductResources$;
|
|
1767
|
-
var cartItem =
|
|
1768
|
-
holder_id =
|
|
1769
|
-
resources_code =
|
|
1770
|
-
timeSlots =
|
|
1771
|
-
countMap =
|
|
1772
|
-
capacity =
|
|
1997
|
+
var cartItem = _ref10.cartItem,
|
|
1998
|
+
holder_id = _ref10.holder_id,
|
|
1999
|
+
resources_code = _ref10.resources_code,
|
|
2000
|
+
timeSlots = _ref10.timeSlots,
|
|
2001
|
+
countMap = _ref10.countMap,
|
|
2002
|
+
capacity = _ref10.capacity;
|
|
1773
2003
|
if (isNormalProduct(cartItem._productOrigin)) {
|
|
1774
2004
|
return {};
|
|
1775
2005
|
}
|
|
@@ -1943,7 +2173,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1943
2173
|
key: "autoSelectAllProductResources",
|
|
1944
2174
|
value: function autoSelectAllProductResources(resources_code, timeSlots) {
|
|
1945
2175
|
var _dateRange$4,
|
|
1946
|
-
|
|
2176
|
+
_this12 = this;
|
|
1947
2177
|
var dateRange = this.store.date.getDateRange();
|
|
1948
2178
|
var resources = [];
|
|
1949
2179
|
if (dateRange !== null && dateRange !== void 0 && (_dateRange$4 = dateRange[0]) !== null && _dateRange$4 !== void 0 && _dateRange$4.date) {
|
|
@@ -1965,8 +2195,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1965
2195
|
// 第一个商品分配完以后,第二个商品分配的start_time应该是第一个商品的 end_time ,然后 end_time 应该是 start_time+duration
|
|
1966
2196
|
// 判断购物车里是否有 flexible 类型的商品,如果有则不累加时间
|
|
1967
2197
|
var hasFlexibleProduct = cartItems.some(function (item) {
|
|
1968
|
-
var _item$
|
|
1969
|
-
return ((_item$
|
|
2198
|
+
var _item$_productOrigin6;
|
|
2199
|
+
return ((_item$_productOrigin6 = item._productOrigin) === null || _item$_productOrigin6 === void 0 || (_item$_productOrigin6 = _item$_productOrigin6.duration) === null || _item$_productOrigin6 === void 0 ? void 0 : _item$_productOrigin6.type) === 'flexible';
|
|
1970
2200
|
});
|
|
1971
2201
|
cartItems.forEach(function (item, index) {
|
|
1972
2202
|
var _getCapacityInfoByCar6 = getCapacityInfoByCartItem(item),
|
|
@@ -1982,18 +2212,18 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1982
2212
|
};
|
|
1983
2213
|
}
|
|
1984
2214
|
if (recordTimeSlots) {
|
|
1985
|
-
var _item$
|
|
2215
|
+
var _item$_productOrigin7, _item$_productOrigin8;
|
|
1986
2216
|
// 同一账号下,如果当前商品不是第一个,则需要根据上一个商品的 end_time 和 duration 计算出当前商品的 start_time 和 end_time
|
|
1987
2217
|
// 前提:当前资源是单个预约才需要这么做
|
|
1988
|
-
var currentResourceConfig = (_item$
|
|
2218
|
+
var currentResourceConfig = (_item$_productOrigin7 = item._productOrigin) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.product_resource) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.resources) === null || _item$_productOrigin7 === void 0 ? void 0 : _item$_productOrigin7.find(function (n) {
|
|
1989
2219
|
return n.code === resources_code;
|
|
1990
2220
|
});
|
|
1991
2221
|
// 只有 duration 类商品且不含有灵活时间的商品需要这个操作
|
|
1992
|
-
if (index !== 0 && recordTimeSlots && (currentResourceConfig === null || currentResourceConfig === void 0 ? void 0 : currentResourceConfig.type) === 'single' && (_item$
|
|
1993
|
-
var _item$
|
|
2222
|
+
if (index !== 0 && recordTimeSlots && (currentResourceConfig === null || currentResourceConfig === void 0 ? void 0 : currentResourceConfig.type) === 'single' && (_item$_productOrigin8 = item._productOrigin) !== null && _item$_productOrigin8 !== void 0 && _item$_productOrigin8.duration && !hasFlexibleProduct && !hasOriginTimeSlot) {
|
|
2223
|
+
var _item$_productOrigin9;
|
|
1994
2224
|
var recordEndAt = recordTimeSlots.end_at ? dayjs(recordTimeSlots.end_at) : dayjs("".concat(item.start_date, " ").concat(recordTimeSlots.end_time));
|
|
1995
2225
|
var start_at = recordEndAt;
|
|
1996
|
-
var end_at = start_at.add(((_item$
|
|
2226
|
+
var end_at = start_at.add(((_item$_productOrigin9 = item._productOrigin) === null || _item$_productOrigin9 === void 0 || (_item$_productOrigin9 = _item$_productOrigin9.duration) === null || _item$_productOrigin9 === void 0 ? void 0 : _item$_productOrigin9.value) || 10, 'minutes');
|
|
1997
2227
|
recordTimeSlots = {
|
|
1998
2228
|
start_time: start_at.format('HH:mm'),
|
|
1999
2229
|
end_time: end_at.format('HH:mm'),
|
|
@@ -2002,7 +2232,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2002
2232
|
};
|
|
2003
2233
|
}
|
|
2004
2234
|
// 如果传递了 timeSlots,代表是第二种资源,则直接拿 timeSlots 去匹配
|
|
2005
|
-
var res =
|
|
2235
|
+
var res = _this12.autoSelectAccountResources({
|
|
2006
2236
|
cartItem: item,
|
|
2007
2237
|
holder_id: item.holder_id,
|
|
2008
2238
|
resources_code: resources_code,
|
|
@@ -2024,7 +2254,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2024
2254
|
}
|
|
2025
2255
|
res.selectedResource.capacity = currentCapacity;
|
|
2026
2256
|
checkSubResourcesCapacity(res.selectedResource);
|
|
2027
|
-
|
|
2257
|
+
_this12.store.cart.updateItem({
|
|
2028
2258
|
_id: item._id,
|
|
2029
2259
|
// 这里要做去重,避免出现同样类型的资源被塞进同一个商品
|
|
2030
2260
|
resources: [].concat(_toConsumableArray((item._origin.resources || []).filter(function (existingRes) {
|
|
@@ -2037,13 +2267,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2037
2267
|
errorList.push(item._id);
|
|
2038
2268
|
}
|
|
2039
2269
|
} else {
|
|
2040
|
-
var _item$
|
|
2270
|
+
var _item$_productOrigin10, _productResources$fin;
|
|
2041
2271
|
// 这里必须每次循环重新读,避免前一次循环操作了购物车,导致数据变更
|
|
2042
2272
|
// 能进到这种逻辑,说明是 duration 类商品或者灵活时长商品,且是第一种资源,还没有确定时间
|
|
2043
|
-
var allCartItems = cloneDeep(
|
|
2273
|
+
var allCartItems = cloneDeep(_this12.store.cart.getItems());
|
|
2044
2274
|
// 如果没有传递 timeSlots,代表是第一种资源,则直接拿商品的 duration,到资源列表里找一个公共可用的
|
|
2045
2275
|
var selectedResources = [];
|
|
2046
|
-
var _resources = cloneDeep(((_item$
|
|
2276
|
+
var _resources = cloneDeep(((_item$_productOrigin10 = item._productOrigin) === null || _item$_productOrigin10 === void 0 || (_item$_productOrigin10 = _item$_productOrigin10.product_resource) === null || _item$_productOrigin10 === void 0 ? void 0 : _item$_productOrigin10.resources) || []);
|
|
2047
2277
|
var currentResourcesRenderList = [];
|
|
2048
2278
|
_resources.forEach(function (n) {
|
|
2049
2279
|
var _n$renderList;
|
|
@@ -2083,7 +2313,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2083
2313
|
return n.code === resources_code;
|
|
2084
2314
|
})) === null || _productResources$fin === void 0 ? void 0 : _productResources$fin.renderList;
|
|
2085
2315
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
2086
|
-
var _item$_origin$resourc2, _dateRange$5, _item$duration2, _item$
|
|
2316
|
+
var _item$_origin$resourc2, _dateRange$5, _item$duration2, _item$_productOrigin11;
|
|
2087
2317
|
// 如果购物车里已经有同类型的 form_id 的资源了,则不处理
|
|
2088
2318
|
if ((_item$_origin$resourc2 = item._origin.resources) !== null && _item$_origin$resourc2 !== void 0 && _item$_origin$resourc2.some(function (n) {
|
|
2089
2319
|
return n.form_id === targetRenderList[0].form_id;
|
|
@@ -2095,7 +2325,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2095
2325
|
currentCapacity: currentCapacity,
|
|
2096
2326
|
countMap: selectResourcesMap,
|
|
2097
2327
|
targetDate: dateRange === null || dateRange === void 0 || (_dateRange$5 = dateRange[0]) === null || _dateRange$5 === void 0 ? void 0 : _dateRange$5.date,
|
|
2098
|
-
durationMinutes: (item === null || item === void 0 || (_item$duration2 = item.duration) === null || _item$duration2 === void 0 ? void 0 : _item$duration2.value) || (item === null || item === void 0 || (_item$
|
|
2328
|
+
durationMinutes: (item === null || item === void 0 || (_item$duration2 = item.duration) === null || _item$duration2 === void 0 ? void 0 : _item$duration2.value) || (item === null || item === void 0 || (_item$_productOrigin11 = item._productOrigin) === null || _item$_productOrigin11 === void 0 || (_item$_productOrigin11 = _item$_productOrigin11.duration) === null || _item$_productOrigin11 === void 0 ? void 0 : _item$_productOrigin11.value) || 10
|
|
2099
2329
|
});
|
|
2100
2330
|
var targetResource = fastestResource || targetRenderList[0];
|
|
2101
2331
|
targetResource.capacity = currentCapacity;
|
|
@@ -2106,7 +2336,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2106
2336
|
} else {
|
|
2107
2337
|
selectResourcesMap[targetResource.id] += currentCapacity;
|
|
2108
2338
|
}
|
|
2109
|
-
|
|
2339
|
+
_this12.store.cart.updateItem({
|
|
2110
2340
|
_id: item._id,
|
|
2111
2341
|
resources: [].concat(_toConsumableArray((item._origin.resources || []).filter(function (existingRes) {
|
|
2112
2342
|
return existingRes.resourceType !== targetRenderList[0].resourceType;
|
|
@@ -2126,7 +2356,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2126
2356
|
// 如果购物车里没有 holderid数据,证明不按 holder 类流程预约走,给所有购物车一次性分派即可,不做账号下资源互斥逻辑
|
|
2127
2357
|
if (cartItems !== null && cartItems !== void 0 && cartItems[0].holder_id) {
|
|
2128
2358
|
accountList.forEach(function (account) {
|
|
2129
|
-
var cartItems =
|
|
2359
|
+
var cartItems = _this12.store.cart.getCartByAccount(account.getId());
|
|
2130
2360
|
selectForCartResources(cartItems);
|
|
2131
2361
|
});
|
|
2132
2362
|
} else {
|
|
@@ -2142,7 +2372,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2142
2372
|
value: function getTimeSlotByAllResources(resources_code) {
|
|
2143
2373
|
var _dateRange,
|
|
2144
2374
|
_dateRange2,
|
|
2145
|
-
|
|
2375
|
+
_this13 = this,
|
|
2146
2376
|
_cartItems$,
|
|
2147
2377
|
_cartItems$2,
|
|
2148
2378
|
_this$shopStore$get;
|
|
@@ -2162,8 +2392,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2162
2392
|
var maxCutOffTime = undefined;
|
|
2163
2393
|
var maxCutOffTimeValue = dayjs();
|
|
2164
2394
|
cartItems.forEach(function (item) {
|
|
2165
|
-
var _item$
|
|
2166
|
-
(_item$
|
|
2395
|
+
var _item$_productOrigin12, _item$_productOrigin13, _item$_productOrigin14, _item$_productOrigin15;
|
|
2396
|
+
(_item$_productOrigin12 = item._productOrigin) === null || _item$_productOrigin12 === void 0 || (_item$_productOrigin12 = _item$_productOrigin12.product_resource) === null || _item$_productOrigin12 === void 0 || (_item$_productOrigin12 = _item$_productOrigin12.resources) === null || _item$_productOrigin12 === void 0 || _item$_productOrigin12.forEach(function (n) {
|
|
2167
2397
|
// TODO: 少了个 status 的判断
|
|
2168
2398
|
if (n.code === resources_code) {
|
|
2169
2399
|
resources.push.apply(resources, _toConsumableArray(n.renderList || []));
|
|
@@ -2176,10 +2406,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2176
2406
|
if (item.resource_id && !resourceIds.includes(item.resource_id)) {
|
|
2177
2407
|
resourceIds.push(item.resource_id);
|
|
2178
2408
|
}
|
|
2179
|
-
resourcesTypeId = item === null || item === void 0 || (_item$
|
|
2409
|
+
resourcesTypeId = item === null || item === void 0 || (_item$_productOrigin13 = item._productOrigin) === null || _item$_productOrigin13 === void 0 || (_item$_productOrigin13 = _item$_productOrigin13.product_resource) === null || _item$_productOrigin13 === void 0 || (_item$_productOrigin13 = _item$_productOrigin13.resources) === null || _item$_productOrigin13 === void 0 || (_item$_productOrigin13 = _item$_productOrigin13.find(function (n) {
|
|
2180
2410
|
return n.code === resources_code;
|
|
2181
|
-
})) === null || _item$
|
|
2182
|
-
if ((_item$
|
|
2411
|
+
})) === null || _item$_productOrigin13 === void 0 ? void 0 : _item$_productOrigin13.id;
|
|
2412
|
+
if ((_item$_productOrigin14 = item._productOrigin) !== null && _item$_productOrigin14 !== void 0 && _item$_productOrigin14.cut_off_time && ((_item$_productOrigin15 = item._productOrigin) === null || _item$_productOrigin15 === void 0 ? void 0 : _item$_productOrigin15.cut_off_time.type) === 'advance') {
|
|
2183
2413
|
var currentCutOffTime = dayjs().add(item._productOrigin.cut_off_time.unit, item._productOrigin.cut_off_time.unit_type);
|
|
2184
2414
|
if (currentCutOffTime.isAfter(maxCutOffTimeValue, 'minute')) {
|
|
2185
2415
|
maxCutOffTimeValue = currentCutOffTime;
|
|
@@ -2229,13 +2459,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2229
2459
|
cartItems.forEach(function (item) {
|
|
2230
2460
|
// 单个预约累加账号 多个预约取最大值
|
|
2231
2461
|
if (isSingleResource) {
|
|
2232
|
-
var _item$
|
|
2233
|
-
accountDuration += ((_item$
|
|
2462
|
+
var _item$_productOrigin16;
|
|
2463
|
+
accountDuration += ((_item$_productOrigin16 = item._productOrigin) === null || _item$_productOrigin16 === void 0 || (_item$_productOrigin16 = _item$_productOrigin16.duration) === null || _item$_productOrigin16 === void 0 ? void 0 : _item$_productOrigin16.value) || 10;
|
|
2234
2464
|
} else {
|
|
2235
|
-
var _item$
|
|
2236
|
-
if (accountDuration < (((_item$
|
|
2237
|
-
var _item$
|
|
2238
|
-
accountDuration = ((_item$
|
|
2465
|
+
var _item$_productOrigin17;
|
|
2466
|
+
if (accountDuration < (((_item$_productOrigin17 = item._productOrigin) === null || _item$_productOrigin17 === void 0 || (_item$_productOrigin17 = _item$_productOrigin17.duration) === null || _item$_productOrigin17 === void 0 ? void 0 : _item$_productOrigin17.value) || 10)) {
|
|
2467
|
+
var _item$_productOrigin18;
|
|
2468
|
+
accountDuration = ((_item$_productOrigin18 = item._productOrigin) === null || _item$_productOrigin18 === void 0 || (_item$_productOrigin18 = _item$_productOrigin18.duration) === null || _item$_productOrigin18 === void 0 ? void 0 : _item$_productOrigin18.value) || 10;
|
|
2239
2469
|
}
|
|
2240
2470
|
}
|
|
2241
2471
|
});
|
|
@@ -2245,7 +2475,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2245
2475
|
};
|
|
2246
2476
|
if (cartItems !== null && cartItems !== void 0 && cartItems[0].holder_id) {
|
|
2247
2477
|
accountList.forEach(function (account) {
|
|
2248
|
-
var cartItems =
|
|
2478
|
+
var cartItems = _this13.store.cart.getCartByAccount(account.getId());
|
|
2249
2479
|
checkDuration(cartItems);
|
|
2250
2480
|
});
|
|
2251
2481
|
} else {
|
|
@@ -2272,8 +2502,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2272
2502
|
}
|
|
2273
2503
|
var resourcesUseableMap = {};
|
|
2274
2504
|
var hasFlexibleDuration = cartItems.some(function (item) {
|
|
2275
|
-
var _item$
|
|
2276
|
-
return ((_item$
|
|
2505
|
+
var _item$_productOrigin19;
|
|
2506
|
+
return ((_item$_productOrigin19 = item._productOrigin) === null || _item$_productOrigin19 === void 0 || (_item$_productOrigin19 = _item$_productOrigin19.duration) === null || _item$_productOrigin19 === void 0 ? void 0 : _item$_productOrigin19.type) === 'flexible';
|
|
2277
2507
|
});
|
|
2278
2508
|
var operating_day_boundary = (_this$shopStore$get = this.shopStore.get('core')) === null || _this$shopStore$get === void 0 || (_this$shopStore$get = _this$shopStore$get.core) === null || _this$shopStore$get === void 0 ? void 0 : _this$shopStore$get.operating_day_boundary;
|
|
2279
2509
|
|
|
@@ -2281,11 +2511,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2281
2511
|
var maxBlockThreshold = 0;
|
|
2282
2512
|
if (hasFlexibleDuration) {
|
|
2283
2513
|
maxBlockThreshold = cartItems.reduce(function (max, item) {
|
|
2284
|
-
var _item$
|
|
2514
|
+
var _item$_productOrigin20;
|
|
2285
2515
|
// 如果开启了灵活时长商品配置,则取 block_threshold 的值
|
|
2286
|
-
if ((_item$
|
|
2287
|
-
var _item$
|
|
2288
|
-
return Math.max(max, ((_item$
|
|
2516
|
+
if ((_item$_productOrigin20 = item._productOrigin) !== null && _item$_productOrigin20 !== void 0 && (_item$_productOrigin20 = _item$_productOrigin20.duration) !== null && _item$_productOrigin20 !== void 0 && (_item$_productOrigin20 = _item$_productOrigin20.flexible_config) !== null && _item$_productOrigin20 !== void 0 && _item$_productOrigin20.is_enable_minimum_duration) {
|
|
2517
|
+
var _item$_productOrigin21;
|
|
2518
|
+
return Math.max(max, ((_item$_productOrigin21 = item._productOrigin) === null || _item$_productOrigin21 === void 0 || (_item$_productOrigin21 = _item$_productOrigin21.duration) === null || _item$_productOrigin21 === void 0 || (_item$_productOrigin21 = _item$_productOrigin21.flexible_config) === null || _item$_productOrigin21 === void 0 ? void 0 : _item$_productOrigin21.block_threshold) || 0);
|
|
2289
2519
|
}
|
|
2290
2520
|
return 0;
|
|
2291
2521
|
}, 0);
|
|
@@ -2316,7 +2546,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2316
2546
|
var maxCapacity = 1;
|
|
2317
2547
|
if (cartItems !== null && cartItems !== void 0 && cartItems[0].holder_id) {
|
|
2318
2548
|
accountList.forEach(function (account) {
|
|
2319
|
-
var accountCartItems =
|
|
2549
|
+
var accountCartItems = _this13.store.cart.getCartByAccount(account.getId());
|
|
2320
2550
|
var currentCapacity = calculateCapacityFromCartItems(accountCartItems);
|
|
2321
2551
|
if (currentCapacity > maxCapacity) {
|
|
2322
2552
|
maxCapacity = currentCapacity;
|
|
@@ -2344,22 +2574,22 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2344
2574
|
}, {
|
|
2345
2575
|
key: "getTimeSlotByAllResourcesForDate",
|
|
2346
2576
|
value: function () {
|
|
2347
|
-
var _getTimeSlotByAllResourcesForDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2348
|
-
var
|
|
2577
|
+
var _getTimeSlotByAllResourcesForDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(_ref11) {
|
|
2578
|
+
var _this14 = this,
|
|
2349
2579
|
_cartItems$5,
|
|
2350
2580
|
_cartItems$6,
|
|
2351
2581
|
_this$shopStore$get2;
|
|
2352
2582
|
var resources_code, startDate, endDate, resources, cartItems, resourceIds, resourcesTypeId, isSingleResource, maxCutOffTime, maxCutOffTimeValue, duration, accountList, checkDuration, resourcesUseableMap, hasFlexibleDuration, operating_day_boundary, maxBlockThreshold, calculateCapacityFromCartItems, maxCapacity, arr, today, _loop2, i;
|
|
2353
|
-
return _regeneratorRuntime().wrap(function
|
|
2354
|
-
while (1) switch (
|
|
2583
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context27) {
|
|
2584
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2355
2585
|
case 0:
|
|
2356
|
-
resources_code =
|
|
2586
|
+
resources_code = _ref11.resources_code, startDate = _ref11.startDate, endDate = _ref11.endDate;
|
|
2357
2587
|
// 如果 end_date 距离start_date小于 30 天,自动追加 end_date 为今天往后的 30 天
|
|
2358
2588
|
if (dayjs(endDate).diff(dayjs(startDate), 'day') < 30) {
|
|
2359
2589
|
endDate = dayjs(startDate).add(30, 'day').format('YYYY-MM-DD');
|
|
2360
2590
|
}
|
|
2361
2591
|
// 预请求资源数据,防止日期超过之前选择的范围
|
|
2362
|
-
|
|
2592
|
+
_context27.next = 4;
|
|
2363
2593
|
return this.getAvailableDate({
|
|
2364
2594
|
startDate: startDate,
|
|
2365
2595
|
endDate: endDate,
|
|
@@ -2377,8 +2607,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2377
2607
|
maxCutOffTime = undefined;
|
|
2378
2608
|
maxCutOffTimeValue = dayjs();
|
|
2379
2609
|
cartItems.forEach(function (item) {
|
|
2380
|
-
var _item$
|
|
2381
|
-
(_item$
|
|
2610
|
+
var _item$_productOrigin22, _item$_productOrigin23, _item$_productOrigin24, _item$_productOrigin25;
|
|
2611
|
+
(_item$_productOrigin22 = item._productOrigin) === null || _item$_productOrigin22 === void 0 || (_item$_productOrigin22 = _item$_productOrigin22.product_resource) === null || _item$_productOrigin22 === void 0 || (_item$_productOrigin22 = _item$_productOrigin22.resources) === null || _item$_productOrigin22 === void 0 || _item$_productOrigin22.forEach(function (n) {
|
|
2382
2612
|
// TODO: 少了个 status 的判断
|
|
2383
2613
|
if (n.code === resources_code) {
|
|
2384
2614
|
resources.push.apply(resources, _toConsumableArray(n.renderList || []));
|
|
@@ -2391,10 +2621,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2391
2621
|
if (item.resource_id && !resourceIds.includes(item.resource_id)) {
|
|
2392
2622
|
resourceIds.push(item.resource_id);
|
|
2393
2623
|
}
|
|
2394
|
-
resourcesTypeId = item === null || item === void 0 || (_item$
|
|
2624
|
+
resourcesTypeId = item === null || item === void 0 || (_item$_productOrigin23 = item._productOrigin) === null || _item$_productOrigin23 === void 0 || (_item$_productOrigin23 = _item$_productOrigin23.product_resource) === null || _item$_productOrigin23 === void 0 || (_item$_productOrigin23 = _item$_productOrigin23.resources) === null || _item$_productOrigin23 === void 0 || (_item$_productOrigin23 = _item$_productOrigin23.find(function (n) {
|
|
2395
2625
|
return n.code === resources_code;
|
|
2396
|
-
})) === null || _item$
|
|
2397
|
-
if ((_item$
|
|
2626
|
+
})) === null || _item$_productOrigin23 === void 0 ? void 0 : _item$_productOrigin23.id;
|
|
2627
|
+
if ((_item$_productOrigin24 = item._productOrigin) !== null && _item$_productOrigin24 !== void 0 && _item$_productOrigin24.cut_off_time && ((_item$_productOrigin25 = item._productOrigin) === null || _item$_productOrigin25 === void 0 ? void 0 : _item$_productOrigin25.cut_off_time.type) === 'advance') {
|
|
2398
2628
|
var currentCutOffTime = dayjs().add(item._productOrigin.cut_off_time.unit, item._productOrigin.cut_off_time.unit_type);
|
|
2399
2629
|
if (currentCutOffTime.isAfter(maxCutOffTimeValue, 'minute')) {
|
|
2400
2630
|
maxCutOffTimeValue = currentCutOffTime;
|
|
@@ -2405,10 +2635,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2405
2635
|
|
|
2406
2636
|
// 保护: 如果 resources 为空则直接 return
|
|
2407
2637
|
if (resources.length) {
|
|
2408
|
-
|
|
2638
|
+
_context27.next = 14;
|
|
2409
2639
|
break;
|
|
2410
2640
|
}
|
|
2411
|
-
return
|
|
2641
|
+
return _context27.abrupt("return", []);
|
|
2412
2642
|
case 14:
|
|
2413
2643
|
duration = 0; // duration = 不同账号的最长时间
|
|
2414
2644
|
accountList = this.store.accountList.getAccounts();
|
|
@@ -2417,13 +2647,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2417
2647
|
cartItems.forEach(function (item) {
|
|
2418
2648
|
// 单个预约累加账号 多个预约取最大值
|
|
2419
2649
|
if (isSingleResource) {
|
|
2420
|
-
var _item$
|
|
2421
|
-
accountDuration += ((_item$
|
|
2650
|
+
var _item$_productOrigin26;
|
|
2651
|
+
accountDuration += ((_item$_productOrigin26 = item._productOrigin) === null || _item$_productOrigin26 === void 0 || (_item$_productOrigin26 = _item$_productOrigin26.duration) === null || _item$_productOrigin26 === void 0 ? void 0 : _item$_productOrigin26.value) || 10;
|
|
2422
2652
|
} else {
|
|
2423
|
-
var _item$
|
|
2424
|
-
if (accountDuration < (((_item$
|
|
2425
|
-
var _item$
|
|
2426
|
-
accountDuration = ((_item$
|
|
2653
|
+
var _item$_productOrigin27;
|
|
2654
|
+
if (accountDuration < (((_item$_productOrigin27 = item._productOrigin) === null || _item$_productOrigin27 === void 0 || (_item$_productOrigin27 = _item$_productOrigin27.duration) === null || _item$_productOrigin27 === void 0 ? void 0 : _item$_productOrigin27.value) || 10)) {
|
|
2655
|
+
var _item$_productOrigin28;
|
|
2656
|
+
accountDuration = ((_item$_productOrigin28 = item._productOrigin) === null || _item$_productOrigin28 === void 0 || (_item$_productOrigin28 = _item$_productOrigin28.duration) === null || _item$_productOrigin28 === void 0 ? void 0 : _item$_productOrigin28.value) || 10;
|
|
2427
2657
|
}
|
|
2428
2658
|
}
|
|
2429
2659
|
});
|
|
@@ -2433,7 +2663,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2433
2663
|
};
|
|
2434
2664
|
if (cartItems !== null && cartItems !== void 0 && cartItems[0].holder_id) {
|
|
2435
2665
|
accountList.forEach(function (account) {
|
|
2436
|
-
var cartItems =
|
|
2666
|
+
var cartItems = _this14.store.cart.getCartByAccount(account.getId());
|
|
2437
2667
|
checkDuration(cartItems);
|
|
2438
2668
|
});
|
|
2439
2669
|
} else {
|
|
@@ -2442,25 +2672,25 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2442
2672
|
// 如果 cartItem 上既没有时间,也没有资源,认为外部属于异常调用,直接丢一个空数组出去
|
|
2443
2673
|
// 同时 session 类商品的流程也不应该调用这个方法
|
|
2444
2674
|
if (!(!(cartItems !== null && cartItems !== void 0 && (_cartItems$5 = cartItems[0]) !== null && _cartItems$5 !== void 0 && _cartItems$5.start_date) && !(cartItems !== null && cartItems !== void 0 && (_cartItems$6 = cartItems[0]) !== null && _cartItems$6 !== void 0 && _cartItems$6.resource_id) || !(cartItems !== null && cartItems !== void 0 && cartItems[0].duration))) {
|
|
2445
|
-
|
|
2675
|
+
_context27.next = 20;
|
|
2446
2676
|
break;
|
|
2447
2677
|
}
|
|
2448
|
-
return
|
|
2678
|
+
return _context27.abrupt("return", []);
|
|
2449
2679
|
case 20:
|
|
2450
2680
|
resourcesUseableMap = {};
|
|
2451
2681
|
hasFlexibleDuration = cartItems.some(function (item) {
|
|
2452
|
-
var _item$
|
|
2453
|
-
return ((_item$
|
|
2682
|
+
var _item$_productOrigin29;
|
|
2683
|
+
return ((_item$_productOrigin29 = item._productOrigin) === null || _item$_productOrigin29 === void 0 || (_item$_productOrigin29 = _item$_productOrigin29.duration) === null || _item$_productOrigin29 === void 0 ? void 0 : _item$_productOrigin29.type) === 'flexible';
|
|
2454
2684
|
});
|
|
2455
2685
|
operating_day_boundary = (_this$shopStore$get2 = this.shopStore.get('core')) === null || _this$shopStore$get2 === void 0 || (_this$shopStore$get2 = _this$shopStore$get2.core) === null || _this$shopStore$get2 === void 0 ? void 0 : _this$shopStore$get2.operating_day_boundary; // 如果有 hasFlexibleDuration,需要把动态时长商品(可能是多个,取最长的那个最低禁止购买时长)的最低禁止购买时长作为 split 的值
|
|
2456
2686
|
maxBlockThreshold = 0;
|
|
2457
2687
|
if (hasFlexibleDuration) {
|
|
2458
2688
|
maxBlockThreshold = cartItems.reduce(function (max, item) {
|
|
2459
|
-
var _item$
|
|
2689
|
+
var _item$_productOrigin30;
|
|
2460
2690
|
// 如果开启了灵活时长商品配置,则取 block_threshold 的值
|
|
2461
|
-
if ((_item$
|
|
2462
|
-
var _item$
|
|
2463
|
-
return Math.max(max, ((_item$
|
|
2691
|
+
if ((_item$_productOrigin30 = item._productOrigin) !== null && _item$_productOrigin30 !== void 0 && (_item$_productOrigin30 = _item$_productOrigin30.duration) !== null && _item$_productOrigin30 !== void 0 && (_item$_productOrigin30 = _item$_productOrigin30.flexible_config) !== null && _item$_productOrigin30 !== void 0 && _item$_productOrigin30.is_enable_minimum_duration) {
|
|
2692
|
+
var _item$_productOrigin31;
|
|
2693
|
+
return Math.max(max, ((_item$_productOrigin31 = item._productOrigin) === null || _item$_productOrigin31 === void 0 || (_item$_productOrigin31 = _item$_productOrigin31.duration) === null || _item$_productOrigin31 === void 0 || (_item$_productOrigin31 = _item$_productOrigin31.flexible_config) === null || _item$_productOrigin31 === void 0 ? void 0 : _item$_productOrigin31.block_threshold) || 0);
|
|
2464
2694
|
}
|
|
2465
2695
|
return 0;
|
|
2466
2696
|
}, 0);
|
|
@@ -2486,7 +2716,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2486
2716
|
maxCapacity = 1;
|
|
2487
2717
|
if (cartItems !== null && cartItems !== void 0 && cartItems[0].holder_id) {
|
|
2488
2718
|
accountList.forEach(function (account) {
|
|
2489
|
-
var accountCartItems =
|
|
2719
|
+
var accountCartItems = _this14.store.cart.getCartByAccount(account.getId());
|
|
2490
2720
|
var currentCapacity = calculateCapacityFromCartItems(accountCartItems);
|
|
2491
2721
|
if (currentCapacity > maxCapacity) {
|
|
2492
2722
|
maxCapacity = currentCapacity;
|
|
@@ -2499,11 +2729,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2499
2729
|
today = dayjs().startOf('day'); // 计算 start_date 到 end_date 之间的所有日期,遍历他们并且计算每一天的可用
|
|
2500
2730
|
_loop2 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop2() {
|
|
2501
2731
|
var currentDate, theDateResources, resourcesMap, timeSlots;
|
|
2502
|
-
return _regeneratorRuntime().wrap(function _loop2$(
|
|
2503
|
-
while (1) switch (
|
|
2732
|
+
return _regeneratorRuntime().wrap(function _loop2$(_context26) {
|
|
2733
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2504
2734
|
case 0:
|
|
2505
2735
|
currentDate = i.format('YYYY-MM-DD');
|
|
2506
|
-
theDateResources =
|
|
2736
|
+
theDateResources = _this14.store.date.getResourcesListByDate(currentDate);
|
|
2507
2737
|
resources.forEach(function (item) {
|
|
2508
2738
|
var _theDateResources$fin2;
|
|
2509
2739
|
item.times = (theDateResources === null || theDateResources === void 0 || (_theDateResources$fin2 = theDateResources.find(function (n) {
|
|
@@ -2512,7 +2742,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2512
2742
|
});
|
|
2513
2743
|
resourcesMap = getResourcesMap(resources); // 如果日期已经过期则直接标记为不可用
|
|
2514
2744
|
if (!i.isBefore(today)) {
|
|
2515
|
-
|
|
2745
|
+
_context26.next = 7;
|
|
2516
2746
|
break;
|
|
2517
2747
|
}
|
|
2518
2748
|
arr.push({
|
|
@@ -2521,7 +2751,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2521
2751
|
week: i.format('ddd'),
|
|
2522
2752
|
weekNum: i.day()
|
|
2523
2753
|
});
|
|
2524
|
-
return
|
|
2754
|
+
return _context26.abrupt("return", 1);
|
|
2525
2755
|
case 7:
|
|
2526
2756
|
timeSlots = getTimeSlicesByResources({
|
|
2527
2757
|
resourceIds: resourceIds,
|
|
@@ -2553,34 +2783,34 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2553
2783
|
}
|
|
2554
2784
|
case 9:
|
|
2555
2785
|
case "end":
|
|
2556
|
-
return
|
|
2786
|
+
return _context26.stop();
|
|
2557
2787
|
}
|
|
2558
2788
|
}, _loop2);
|
|
2559
2789
|
});
|
|
2560
2790
|
i = dayjs(startDate);
|
|
2561
2791
|
case 32:
|
|
2562
2792
|
if (!i.isBefore(dayjs(endDate))) {
|
|
2563
|
-
|
|
2793
|
+
_context27.next = 39;
|
|
2564
2794
|
break;
|
|
2565
2795
|
}
|
|
2566
|
-
return
|
|
2796
|
+
return _context27.delegateYield(_loop2(), "t0", 34);
|
|
2567
2797
|
case 34:
|
|
2568
|
-
if (!
|
|
2569
|
-
|
|
2798
|
+
if (!_context27.t0) {
|
|
2799
|
+
_context27.next = 36;
|
|
2570
2800
|
break;
|
|
2571
2801
|
}
|
|
2572
|
-
return
|
|
2802
|
+
return _context27.abrupt("continue", 36);
|
|
2573
2803
|
case 36:
|
|
2574
2804
|
i = i.add(1, 'day');
|
|
2575
|
-
|
|
2805
|
+
_context27.next = 32;
|
|
2576
2806
|
break;
|
|
2577
2807
|
case 39:
|
|
2578
|
-
return
|
|
2808
|
+
return _context27.abrupt("return", arr);
|
|
2579
2809
|
case 40:
|
|
2580
2810
|
case "end":
|
|
2581
|
-
return
|
|
2811
|
+
return _context27.stop();
|
|
2582
2812
|
}
|
|
2583
|
-
},
|
|
2813
|
+
}, _callee26, this);
|
|
2584
2814
|
}));
|
|
2585
2815
|
function getTimeSlotByAllResourcesForDate(_x20) {
|
|
2586
2816
|
return _getTimeSlotByAllResourcesForDate.apply(this, arguments);
|
|
@@ -2591,7 +2821,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2591
2821
|
key: "submitTimeSlot",
|
|
2592
2822
|
value: function submitTimeSlot(timeSlots) {
|
|
2593
2823
|
var _this$shopStore$get3,
|
|
2594
|
-
|
|
2824
|
+
_this15 = this;
|
|
2595
2825
|
// 以账号为维度处理数据。购物车里每一项的 startTime应该是前一个商品的 endTime,如果是第一个商品则用 timeSlots.start_at
|
|
2596
2826
|
var cartItems = this.store.cart.getItems().filter(function (n) {
|
|
2597
2827
|
return !isNormalProduct(n._productOrigin);
|
|
@@ -2621,10 +2851,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2621
2851
|
var osWarnTips = [];
|
|
2622
2852
|
var newResources = cloneDeep(item._origin.resources);
|
|
2623
2853
|
newResources.forEach(function (resource) {
|
|
2624
|
-
var _item$
|
|
2854
|
+
var _item$_productOrigin32;
|
|
2625
2855
|
// 如果商品配置的是灵活时长,开始时间设置为提交的时间,结束时间从资源的可用最晚时间和店铺营业结束时间里取一个最早的
|
|
2626
|
-
if (((_item$
|
|
2627
|
-
var _allResources$find, _item$
|
|
2856
|
+
if (((_item$_productOrigin32 = item._productOrigin) === null || _item$_productOrigin32 === void 0 || (_item$_productOrigin32 = _item$_productOrigin32.duration) === null || _item$_productOrigin32 === void 0 ? void 0 : _item$_productOrigin32.type) === 'flexible') {
|
|
2857
|
+
var _allResources$find, _item$_productOrigin33, _item$_productOrigin34;
|
|
2628
2858
|
item.duration = {
|
|
2629
2859
|
type: 'minutes',
|
|
2630
2860
|
value: 10
|
|
@@ -2636,10 +2866,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2636
2866
|
})) === null || _allResources$find === void 0 ? void 0 : _allResources$find.times;
|
|
2637
2867
|
// 找到最晚的 end_at 还没用,因为可能存在资源工作时间是 10:00-19:00,但是资源的 times 里有 16:30-19:00 被 block 的情况
|
|
2638
2868
|
// 所以还需要排除掉 block 时间
|
|
2639
|
-
function getEarliestBlockedStartTime(
|
|
2869
|
+
function getEarliestBlockedStartTime(_ref12) {
|
|
2640
2870
|
var _earliestBlockStart;
|
|
2641
|
-
var currentStartTime =
|
|
2642
|
-
times =
|
|
2871
|
+
var currentStartTime = _ref12.currentStartTime,
|
|
2872
|
+
times = _ref12.times;
|
|
2643
2873
|
var currentStart = dayjs(currentStartTime);
|
|
2644
2874
|
var earliestBlockStart;
|
|
2645
2875
|
var _iterator3 = _createForOfIteratorHelper(times || []),
|
|
@@ -2707,19 +2937,19 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2707
2937
|
resource.endTime = formattedEndTime.format('YYYY-MM-DD HH:mm');
|
|
2708
2938
|
// 如果是动态时长商品,并且当前选择的时间的结束时间小于了最低提示时长(warningThreshold),则追加一个提示
|
|
2709
2939
|
// 如果currentStartTime + warningThreshold 大于 currentEndTime,且 osWarnTips 没有pisell2.product.card.closing-soon.warning 这一项,则加入这一项
|
|
2710
|
-
if ((_item$
|
|
2940
|
+
if ((_item$_productOrigin33 = item._productOrigin) !== null && _item$_productOrigin33 !== void 0 && (_item$_productOrigin33 = _item$_productOrigin33.duration) !== null && _item$_productOrigin33 !== void 0 && (_item$_productOrigin33 = _item$_productOrigin33.flexible_config) !== null && _item$_productOrigin33 !== void 0 && _item$_productOrigin33.is_enable_minimum_duration && dayjs(currentStartTime).add(((_item$_productOrigin34 = item._productOrigin) === null || _item$_productOrigin34 === void 0 || (_item$_productOrigin34 = _item$_productOrigin34.duration) === null || _item$_productOrigin34 === void 0 || (_item$_productOrigin34 = _item$_productOrigin34.flexible_config) === null || _item$_productOrigin34 === void 0 ? void 0 : _item$_productOrigin34.warning_threshold) || 0, 'minutes').isAfter(dayjs(formattedEndTime))) {
|
|
2711
2941
|
if (!osWarnTips.includes('pisell2.product.card.closing-soon.warning')) {
|
|
2712
2942
|
osWarnTips.push('pisell2.product.card.closing-soon.warning');
|
|
2713
2943
|
}
|
|
2714
2944
|
}
|
|
2715
2945
|
} else {
|
|
2716
|
-
var _item$
|
|
2946
|
+
var _item$_productOrigin35;
|
|
2717
2947
|
resource.startTime = currentStartTime;
|
|
2718
|
-
resource.endTime = dayjs(currentStartTime).add(((_item$
|
|
2948
|
+
resource.endTime = dayjs(currentStartTime).add(((_item$_productOrigin35 = item._productOrigin) === null || _item$_productOrigin35 === void 0 || (_item$_productOrigin35 = _item$_productOrigin35.duration) === null || _item$_productOrigin35 === void 0 ? void 0 : _item$_productOrigin35.value) || 10, 'minutes').format('YYYY-MM-DD HH:mm');
|
|
2719
2949
|
}
|
|
2720
2950
|
// delete resource.times;
|
|
2721
2951
|
});
|
|
2722
|
-
|
|
2952
|
+
_this15.store.cart.updateItem({
|
|
2723
2953
|
_id: item._id,
|
|
2724
2954
|
resources: newResources,
|
|
2725
2955
|
osWarnTips: osWarnTips
|
|
@@ -2763,43 +2993,78 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2763
2993
|
}, {
|
|
2764
2994
|
key: "openProductDetail",
|
|
2765
2995
|
value: function () {
|
|
2766
|
-
var _openProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2767
|
-
var targetProductData, newScheduleArr, dateRange;
|
|
2768
|
-
return _regeneratorRuntime().wrap(function
|
|
2769
|
-
while (1) switch (
|
|
2996
|
+
var _openProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(productId) {
|
|
2997
|
+
var generation, targetProductData, _targetProductData, newScheduleArr, dateRange;
|
|
2998
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context28) {
|
|
2999
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2770
3000
|
case 0:
|
|
2771
|
-
|
|
3001
|
+
generation = ++this.productDetailGeneration;
|
|
3002
|
+
_context28.prev = 1;
|
|
3003
|
+
_context28.next = 4;
|
|
2772
3004
|
return this.store.products.getProduct(productId);
|
|
2773
|
-
case
|
|
2774
|
-
targetProductData =
|
|
3005
|
+
case 4:
|
|
3006
|
+
targetProductData = _context28.sent;
|
|
3007
|
+
if (!((_targetProductData = targetProductData) !== null && _targetProductData !== void 0 && (_targetProductData = _targetProductData['schedule.ids']) !== null && _targetProductData !== void 0 && _targetProductData.length)) {
|
|
3008
|
+
_context28.next = 8;
|
|
3009
|
+
break;
|
|
3010
|
+
}
|
|
3011
|
+
_context28.next = 8;
|
|
3012
|
+
return this.store.schedule.ensureScheduleReady();
|
|
3013
|
+
case 8:
|
|
3014
|
+
_context28.next = 15;
|
|
3015
|
+
break;
|
|
3016
|
+
case 10:
|
|
3017
|
+
_context28.prev = 10;
|
|
3018
|
+
_context28.t0 = _context28["catch"](1);
|
|
3019
|
+
if (!(this.disposed || generation !== this.productDetailGeneration)) {
|
|
3020
|
+
_context28.next = 14;
|
|
3021
|
+
break;
|
|
3022
|
+
}
|
|
3023
|
+
throw this.staleSelection();
|
|
3024
|
+
case 14:
|
|
3025
|
+
throw _context28.t0;
|
|
3026
|
+
case 15:
|
|
3027
|
+
if (!(this.disposed || generation !== this.productDetailGeneration)) {
|
|
3028
|
+
_context28.next = 17;
|
|
3029
|
+
break;
|
|
3030
|
+
}
|
|
3031
|
+
throw this.staleSelection();
|
|
3032
|
+
case 17:
|
|
3033
|
+
if (targetProductData) {
|
|
3034
|
+
_context28.next = 19;
|
|
3035
|
+
break;
|
|
3036
|
+
}
|
|
3037
|
+
throw new Error('Booking product is unavailable');
|
|
3038
|
+
case 19:
|
|
2775
3039
|
if (!targetProductData) {
|
|
2776
|
-
|
|
3040
|
+
_context28.next = 34;
|
|
2777
3041
|
break;
|
|
2778
3042
|
}
|
|
2779
3043
|
this.store.currentProduct = targetProductData;
|
|
2780
3044
|
this.store.currentProductMeta = {};
|
|
2781
3045
|
// 资源预加载,如果是 duration 类型的商品,且是先选日期的流程,在这里预拉取资源数据
|
|
2782
3046
|
if (!targetProductData['schedule.ids']) {
|
|
2783
|
-
|
|
3047
|
+
_context28.next = 29;
|
|
2784
3048
|
break;
|
|
2785
3049
|
}
|
|
2786
3050
|
newScheduleArr = this.getScheduleDataByIds(targetProductData['schedule.ids']);
|
|
2787
3051
|
if (!this.store.currentProductMeta) this.store.currentProductMeta = {};
|
|
2788
3052
|
this.store.currentProductMeta.schedule = newScheduleArr;
|
|
2789
|
-
|
|
3053
|
+
this.store.currentProductMeta.scheduleCatalogVersion = this.store.schedule.getScheduleCatalogVersion();
|
|
3054
|
+
_context28.next = 34;
|
|
2790
3055
|
break;
|
|
2791
|
-
case
|
|
3056
|
+
case 29:
|
|
2792
3057
|
if (!targetProductData.duration) {
|
|
2793
|
-
|
|
3058
|
+
_context28.next = 34;
|
|
2794
3059
|
break;
|
|
2795
3060
|
}
|
|
2796
3061
|
dateRange = this.store.date.getDateRange(); // 如果不是先选日期的流程 duration 商品就啥也不做
|
|
2797
3062
|
if (dateRange !== null && dateRange !== void 0 && dateRange.length) {
|
|
2798
|
-
|
|
3063
|
+
_context28.next = 33;
|
|
2799
3064
|
break;
|
|
2800
3065
|
}
|
|
2801
|
-
return
|
|
2802
|
-
case
|
|
3066
|
+
return _context28.abrupt("return");
|
|
3067
|
+
case 33:
|
|
2803
3068
|
// this.store.date.getResourceDates({
|
|
2804
3069
|
// query: {
|
|
2805
3070
|
// start_date: dateRange[0].date,
|
|
@@ -2811,12 +3076,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2811
3076
|
startDate: dateRange[0].date,
|
|
2812
3077
|
endDate: dateRange[dateRange.length - 1].date,
|
|
2813
3078
|
products: [targetProductData]
|
|
3079
|
+
}).catch(function (error) {
|
|
3080
|
+
if ((error === null || error === void 0 ? void 0 : error.name) !== 'AbortError') console.error('[BookingByStep] Product resource preload failed', error);
|
|
2814
3081
|
});
|
|
2815
|
-
case
|
|
3082
|
+
case 34:
|
|
2816
3083
|
case "end":
|
|
2817
|
-
return
|
|
3084
|
+
return _context28.stop();
|
|
2818
3085
|
}
|
|
2819
|
-
},
|
|
3086
|
+
}, _callee27, this, [[1, 10]]);
|
|
2820
3087
|
}));
|
|
2821
3088
|
function openProductDetail(_x21) {
|
|
2822
3089
|
return _openProductDetail.apply(this, arguments);
|
|
@@ -2826,23 +3093,22 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2826
3093
|
}, {
|
|
2827
3094
|
key: "closeProductDetail",
|
|
2828
3095
|
value: function closeProductDetail() {
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
}
|
|
3096
|
+
this.productDetailGeneration += 1;
|
|
3097
|
+
this.store.currentProductMeta = {};
|
|
2832
3098
|
this.store.currentProduct = undefined;
|
|
2833
3099
|
}
|
|
2834
3100
|
|
|
2835
3101
|
// 通过商品和 schedule 来获取视频可用的时间片、时间片内资源可用的数据
|
|
2836
3102
|
}, {
|
|
2837
3103
|
key: "getTimeslotBySchedule",
|
|
2838
|
-
value: function getTimeslotBySchedule(
|
|
2839
|
-
var _this$store$
|
|
3104
|
+
value: function getTimeslotBySchedule(_ref13) {
|
|
3105
|
+
var _this$store$currentPr3,
|
|
2840
3106
|
_targetProductData$pr,
|
|
2841
|
-
|
|
2842
|
-
var date =
|
|
2843
|
-
scheduleIds =
|
|
2844
|
-
resources =
|
|
2845
|
-
product =
|
|
3107
|
+
_this16 = this;
|
|
3108
|
+
var date = _ref13.date,
|
|
3109
|
+
scheduleIds = _ref13.scheduleIds,
|
|
3110
|
+
resources = _ref13.resources,
|
|
3111
|
+
product = _ref13.product;
|
|
2846
3112
|
var targetProduct = this.store.currentProduct;
|
|
2847
3113
|
// 如果外面传递了product 优先用外面的
|
|
2848
3114
|
var targetProductData = product || targetProduct;
|
|
@@ -2860,7 +3126,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2860
3126
|
var cartItems = cloneDeep(this.store.cart.getItems());
|
|
2861
3127
|
var resourcesMap = getResourcesMap((targetResourceDate === null || targetResourceDate === void 0 ? void 0 : targetResourceDate.resource) || []);
|
|
2862
3128
|
var selectedResources = getOthersSelectedResources(cartItems, '', resourcesMap);
|
|
2863
|
-
var productResources = getResourcesByProduct(resourcesMap, resources || ((_this$store$
|
|
3129
|
+
var productResources = getResourcesByProduct(resourcesMap, resources || ((_this$store$currentPr3 = this.store.currentProduct) === null || _this$store$currentPr3 === void 0 || (_this$store$currentPr3 = _this$store$currentPr3.product_resource) === null || _this$store$currentPr3 === void 0 ? void 0 : _this$store$currentPr3.resources) || [], selectedResources, 1);
|
|
2864
3130
|
var minTimeMaxTime = calcMinTimeMaxTimeBySchedules(targetSchedules, {}, date);
|
|
2865
3131
|
var scheduleTimeSlots = getAllSortedDateRanges(minTimeMaxTime);
|
|
2866
3132
|
// 当前所有待选择资源的集合,先提出来,提升性能
|
|
@@ -2978,7 +3244,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2978
3244
|
statsByResourceType[m.form_id] = currentStats;
|
|
2979
3245
|
});
|
|
2980
3246
|
// 容量检测
|
|
2981
|
-
var cartItems =
|
|
3247
|
+
var cartItems = _this16.store.cart.getItems();
|
|
2982
3248
|
productResources.forEach(function (n) {
|
|
2983
3249
|
var currentResourceTypeConfig = resourceTypeConfigById.get(n.id);
|
|
2984
3250
|
if (!currentResourceTypeConfig) return;
|
|
@@ -3024,7 +3290,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3024
3290
|
});
|
|
3025
3291
|
});
|
|
3026
3292
|
// 先确定是否每一个currentResourcesSet在这个时间点的 event_list 都是空的,如果不是空的还需要把他踢出currentResourcesSet
|
|
3027
|
-
var currentDataResources =
|
|
3293
|
+
var currentDataResources = _this16.store.date.getResourcesListByDate(dayjs(item.start).format('YYYY-MM-DD'));
|
|
3028
3294
|
currentDataResources === null || currentDataResources === void 0 || currentDataResources.forEach(function (m) {
|
|
3029
3295
|
if (currentResourcesSet.has(m.id)) {
|
|
3030
3296
|
var mTimes = m.times.filter(function (n) {
|
|
@@ -3246,7 +3512,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3246
3512
|
}, {
|
|
3247
3513
|
key: "checkMaxDurationCapacity",
|
|
3248
3514
|
value: function checkMaxDurationCapacity() {
|
|
3249
|
-
var
|
|
3515
|
+
var _this17 = this;
|
|
3250
3516
|
var cartItems = this.store.cart.getItems().filter(function (item) {
|
|
3251
3517
|
return !isNormalProduct(item._productOrigin);
|
|
3252
3518
|
});
|
|
@@ -3447,7 +3713,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3447
3713
|
// 为通过检测的商品分配一个公共可用时间段
|
|
3448
3714
|
|
|
3449
3715
|
// 找到所有资源都可用的时间段
|
|
3450
|
-
var commonTimeSlots =
|
|
3716
|
+
var commonTimeSlots = _this17.findCommonAvailableTimeSlots(resourcesOfThisType);
|
|
3451
3717
|
if (commonTimeSlots.length === 0) {
|
|
3452
3718
|
return {
|
|
3453
3719
|
v: {
|
|
@@ -3537,8 +3803,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3537
3803
|
var resourcesIdSet = new Set();
|
|
3538
3804
|
|
|
3539
3805
|
// 获取资源数据
|
|
3540
|
-
var dateRange =
|
|
3541
|
-
var resourcesDates =
|
|
3806
|
+
var dateRange = _this17.store.date.getDateRange();
|
|
3807
|
+
var resourcesDates = _this17.store.date.getDateList();
|
|
3542
3808
|
var targetResourceDate = resourcesDates.find(function (n) {
|
|
3543
3809
|
return n.date === startDate;
|
|
3544
3810
|
});
|
|
@@ -3594,17 +3860,17 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3594
3860
|
*/
|
|
3595
3861
|
}, {
|
|
3596
3862
|
key: "convertProductToCartItem",
|
|
3597
|
-
value: function convertProductToCartItem(
|
|
3598
|
-
var product =
|
|
3599
|
-
date =
|
|
3600
|
-
account =
|
|
3601
|
-
var
|
|
3602
|
-
bundle =
|
|
3603
|
-
options =
|
|
3604
|
-
origin =
|
|
3605
|
-
product_variant_id =
|
|
3606
|
-
|
|
3607
|
-
quantity =
|
|
3863
|
+
value: function convertProductToCartItem(_ref14) {
|
|
3864
|
+
var product = _ref14.product,
|
|
3865
|
+
date = _ref14.date,
|
|
3866
|
+
account = _ref14.account;
|
|
3867
|
+
var _ref15 = product || {},
|
|
3868
|
+
bundle = _ref15.bundle,
|
|
3869
|
+
options = _ref15.options,
|
|
3870
|
+
origin = _ref15.origin,
|
|
3871
|
+
product_variant_id = _ref15.product_variant_id,
|
|
3872
|
+
_ref15$quantity = _ref15.quantity,
|
|
3873
|
+
quantity = _ref15$quantity === void 0 ? 1 : _ref15$quantity;
|
|
3608
3874
|
|
|
3609
3875
|
// 处理商品数据,类似 addProductToCart 中的逻辑
|
|
3610
3876
|
var productData = _objectSpread(_objectSpread({}, origin), {}, {
|
|
@@ -3659,11 +3925,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3659
3925
|
}
|
|
3660
3926
|
}, {
|
|
3661
3927
|
key: "checkMaxDurationCapacityForDetailNums",
|
|
3662
|
-
value: function checkMaxDurationCapacityForDetailNums(
|
|
3663
|
-
var
|
|
3664
|
-
var product =
|
|
3665
|
-
date =
|
|
3666
|
-
account =
|
|
3928
|
+
value: function checkMaxDurationCapacityForDetailNums(_ref16) {
|
|
3929
|
+
var _this18 = this;
|
|
3930
|
+
var product = _ref16.product,
|
|
3931
|
+
date = _ref16.date,
|
|
3932
|
+
account = _ref16.account;
|
|
3667
3933
|
var cartItems = this.store.cart.getItems().filter(function (item) {
|
|
3668
3934
|
return !isNormalProduct(item._productOrigin);
|
|
3669
3935
|
});
|
|
@@ -3866,7 +4132,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3866
4132
|
// 为通过检测的商品分配一个公共可用时间段
|
|
3867
4133
|
|
|
3868
4134
|
// 找到所有资源都可用的时间段
|
|
3869
|
-
var commonTimeSlots =
|
|
4135
|
+
var commonTimeSlots = _this18.findCommonAvailableTimeSlots(resourcesOfThisType);
|
|
3870
4136
|
if (commonTimeSlots.length === 0) {
|
|
3871
4137
|
return {
|
|
3872
4138
|
v: {
|
|
@@ -3957,7 +4223,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3957
4223
|
|
|
3958
4224
|
// 获取资源数据
|
|
3959
4225
|
// const dateRange = this.store.date.getDateRange();
|
|
3960
|
-
var resourcesDates =
|
|
4226
|
+
var resourcesDates = _this18.store.date.getDateList();
|
|
3961
4227
|
var targetResourceDate = resourcesDates.find(function (n) {
|
|
3962
4228
|
return n.date === startDate;
|
|
3963
4229
|
});
|
|
@@ -4027,39 +4293,39 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4027
4293
|
}, {
|
|
4028
4294
|
key: "getProductTypeById",
|
|
4029
4295
|
value: function () {
|
|
4030
|
-
var _getProductTypeById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4296
|
+
var _getProductTypeById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(id) {
|
|
4031
4297
|
var productData, _productData$schedule;
|
|
4032
|
-
return _regeneratorRuntime().wrap(function
|
|
4033
|
-
while (1) switch (
|
|
4298
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context29) {
|
|
4299
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
4034
4300
|
case 0:
|
|
4035
|
-
|
|
4301
|
+
_context29.next = 2;
|
|
4036
4302
|
return this.store.products.getProduct(id);
|
|
4037
4303
|
case 2:
|
|
4038
|
-
productData =
|
|
4304
|
+
productData = _context29.sent;
|
|
4039
4305
|
if (!productData) {
|
|
4040
|
-
|
|
4306
|
+
_context29.next = 9;
|
|
4041
4307
|
break;
|
|
4042
4308
|
}
|
|
4043
4309
|
if (!productData.duration) {
|
|
4044
|
-
|
|
4310
|
+
_context29.next = 6;
|
|
4045
4311
|
break;
|
|
4046
4312
|
}
|
|
4047
|
-
return
|
|
4313
|
+
return _context29.abrupt("return", 'duration');
|
|
4048
4314
|
case 6:
|
|
4049
4315
|
if (!((_productData$schedule = productData['schedule.ids']) !== null && _productData$schedule !== void 0 && _productData$schedule.length)) {
|
|
4050
|
-
|
|
4316
|
+
_context29.next = 8;
|
|
4051
4317
|
break;
|
|
4052
4318
|
}
|
|
4053
|
-
return
|
|
4319
|
+
return _context29.abrupt("return", 'session');
|
|
4054
4320
|
case 8:
|
|
4055
|
-
return
|
|
4321
|
+
return _context29.abrupt("return", 'normal');
|
|
4056
4322
|
case 9:
|
|
4057
|
-
return
|
|
4323
|
+
return _context29.abrupt("return", 'normal');
|
|
4058
4324
|
case 10:
|
|
4059
4325
|
case "end":
|
|
4060
|
-
return
|
|
4326
|
+
return _context29.stop();
|
|
4061
4327
|
}
|
|
4062
|
-
},
|
|
4328
|
+
}, _callee28, this);
|
|
4063
4329
|
}));
|
|
4064
4330
|
function getProductTypeById(_x22) {
|
|
4065
4331
|
return _getProductTypeById.apply(this, arguments);
|
|
@@ -4181,12 +4447,12 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4181
4447
|
}, {
|
|
4182
4448
|
key: "getTimeslotsScheduleByDateRange",
|
|
4183
4449
|
value: (function () {
|
|
4184
|
-
var _getTimeslotsScheduleByDateRange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4450
|
+
var _getTimeslotsScheduleByDateRange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(_ref17) {
|
|
4185
4451
|
var startDate, endDate, scheduleIds, resources, dates, currentDate, end, results, _i5, _dates, date;
|
|
4186
|
-
return _regeneratorRuntime().wrap(function
|
|
4187
|
-
while (1) switch (
|
|
4452
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context30) {
|
|
4453
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
4188
4454
|
case 0:
|
|
4189
|
-
startDate =
|
|
4455
|
+
startDate = _ref17.startDate, endDate = _ref17.endDate, scheduleIds = _ref17.scheduleIds, resources = _ref17.resources;
|
|
4190
4456
|
// 生成日期范围内的所有日期
|
|
4191
4457
|
dates = [];
|
|
4192
4458
|
currentDate = dayjs(startDate);
|
|
@@ -4205,12 +4471,12 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4205
4471
|
resources: resources
|
|
4206
4472
|
});
|
|
4207
4473
|
}
|
|
4208
|
-
return
|
|
4474
|
+
return _context30.abrupt("return", results);
|
|
4209
4475
|
case 8:
|
|
4210
4476
|
case "end":
|
|
4211
|
-
return
|
|
4477
|
+
return _context30.stop();
|
|
4212
4478
|
}
|
|
4213
|
-
},
|
|
4479
|
+
}, _callee29, this);
|
|
4214
4480
|
}));
|
|
4215
4481
|
function getTimeslotsScheduleByDateRange(_x23) {
|
|
4216
4482
|
return _getTimeslotsScheduleByDateRange.apply(this, arguments);
|
|
@@ -4220,9 +4486,16 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4220
4486
|
}, {
|
|
4221
4487
|
key: "getAvailableDateForSessionOptimize",
|
|
4222
4488
|
value: function () {
|
|
4223
|
-
var _getAvailableDateForSessionOptimize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4224
|
-
var
|
|
4489
|
+
var _getAvailableDateForSessionOptimize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
4490
|
+
var _this19 = this,
|
|
4491
|
+
_this$store$currentPr4,
|
|
4492
|
+
_this$store$currentPr5,
|
|
4493
|
+
_tempProducts;
|
|
4225
4494
|
var params,
|
|
4495
|
+
requestVersion,
|
|
4496
|
+
generation,
|
|
4497
|
+
catalogVersion,
|
|
4498
|
+
assertCurrent,
|
|
4226
4499
|
startDate,
|
|
4227
4500
|
endDate,
|
|
4228
4501
|
endDateAfterMonth,
|
|
@@ -4240,12 +4513,41 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4240
4513
|
allProductResources,
|
|
4241
4514
|
targetSchedules,
|
|
4242
4515
|
_loop8,
|
|
4243
|
-
|
|
4244
|
-
return _regeneratorRuntime().wrap(function
|
|
4245
|
-
while (1) switch (
|
|
4516
|
+
_args32 = arguments;
|
|
4517
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context32) {
|
|
4518
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
4246
4519
|
case 0:
|
|
4247
|
-
params =
|
|
4248
|
-
|
|
4520
|
+
params = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : {};
|
|
4521
|
+
requestVersion = ++this.sessionAvailabilityRequestVersion;
|
|
4522
|
+
generation = this.productDetailGeneration;
|
|
4523
|
+
_context32.prev = 3;
|
|
4524
|
+
_context32.next = 6;
|
|
4525
|
+
return this.store.schedule.ensureScheduleReady();
|
|
4526
|
+
case 6:
|
|
4527
|
+
_context32.next = 13;
|
|
4528
|
+
break;
|
|
4529
|
+
case 8:
|
|
4530
|
+
_context32.prev = 8;
|
|
4531
|
+
_context32.t0 = _context32["catch"](3);
|
|
4532
|
+
if (!(this.disposed || generation !== this.productDetailGeneration || requestVersion !== this.sessionAvailabilityRequestVersion)) {
|
|
4533
|
+
_context32.next = 12;
|
|
4534
|
+
break;
|
|
4535
|
+
}
|
|
4536
|
+
throw this.staleSelection();
|
|
4537
|
+
case 12:
|
|
4538
|
+
throw _context32.t0;
|
|
4539
|
+
case 13:
|
|
4540
|
+
if (!(this.disposed || generation !== this.productDetailGeneration || requestVersion !== this.sessionAvailabilityRequestVersion || !this.store.currentProduct)) {
|
|
4541
|
+
_context32.next = 15;
|
|
4542
|
+
break;
|
|
4543
|
+
}
|
|
4544
|
+
throw this.staleSelection();
|
|
4545
|
+
case 15:
|
|
4546
|
+
this.refreshCurrentProductSchedule();
|
|
4547
|
+
catalogVersion = this.store.schedule.getScheduleCatalogVersion();
|
|
4548
|
+
assertCurrent = function assertCurrent() {
|
|
4549
|
+
if (_this19.disposed || generation !== _this19.productDetailGeneration || requestVersion !== _this19.sessionAvailabilityRequestVersion || catalogVersion !== _this19.store.schedule.getScheduleCatalogVersion()) throw _this19.staleSelection();
|
|
4550
|
+
}; // 开始日期如果小于今天,直接以今天当做开始日期
|
|
4249
4551
|
startDate = params.startDate, endDate = params.endDate; // 前端传递的 startDate,可能是今天之前的,如果 startDate 小于今天 且 endDate 小于或等于今天,需要把 startDate 置为今天
|
|
4250
4552
|
if (dayjs(startDate).isBefore(dayjs(), 'day') && (dayjs(endDate).isAfter(dayjs(), 'day') || dayjs(endDate).isSame(dayjs(), 'day'))) {
|
|
4251
4553
|
startDate = dayjs().format('YYYY-MM-DD');
|
|
@@ -4267,36 +4569,43 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4267
4569
|
endDate = tempEndDate;
|
|
4268
4570
|
|
|
4269
4571
|
// 先去读缓存结果,因为正常 UI 调用的是 7 天,而下面我会直接计算 30 天(最少也是 14 天),所以先去读缓存结果,如果缓存结果存在,则直接返回
|
|
4270
|
-
cache = (_this$store$
|
|
4572
|
+
cache = (_this$store$currentPr4 = this.store.currentProductMeta) === null || _this$store$currentPr4 === void 0 ? void 0 : _this$store$currentPr4['timeSlotBySchedule'];
|
|
4271
4573
|
if (!cache) {
|
|
4272
|
-
|
|
4574
|
+
_context32.next = 31;
|
|
4273
4575
|
break;
|
|
4274
4576
|
}
|
|
4275
4577
|
if (!(dayjs(params.startDate).isSameOrAfter(dayjs(cache.startDate), 'day') && dayjs(params.endDate).isSameOrBefore(dayjs(cache.endDate), 'day'))) {
|
|
4276
|
-
|
|
4578
|
+
_context32.next = 31;
|
|
4277
4579
|
break;
|
|
4278
4580
|
}
|
|
4279
|
-
|
|
4280
|
-
|
|
4581
|
+
assertCurrent();
|
|
4582
|
+
this.store.date.setDateList(cache.dateList, true);
|
|
4583
|
+
return _context32.abrupt("return", {
|
|
4281
4584
|
dateList: cache.dateList,
|
|
4282
4585
|
firstAvailableDate: cache.firstAvailableDate
|
|
4283
4586
|
});
|
|
4284
|
-
case
|
|
4587
|
+
case 31:
|
|
4285
4588
|
// 如果当前打开了某个的商品详情弹窗,则应该默认用这个商品
|
|
4286
4589
|
tempProducts = this.store.currentProduct;
|
|
4287
|
-
schedule = (_this$store$
|
|
4590
|
+
schedule = (_this$store$currentPr5 = this.store.currentProductMeta) === null || _this$store$currentPr5 === void 0 ? void 0 : _this$store$currentPr5['schedule'];
|
|
4288
4591
|
filteredSchedule = filterScheduleByDateRange(schedule, startDate || '', endDate || ''); // 1.后端返回的数据,确定资源在每一天的可用和使用情况
|
|
4289
4592
|
tempResourceIds = getResourcesIdsByProduct(tempProducts);
|
|
4290
|
-
|
|
4593
|
+
_context32.next = 37;
|
|
4291
4594
|
return this.store.date.fetchResourceDates({
|
|
4595
|
+
errorMode: 'throw',
|
|
4596
|
+
bookingRead: true,
|
|
4292
4597
|
query: {
|
|
4293
4598
|
start_date: startDate || '',
|
|
4294
4599
|
end_date: endDate || '',
|
|
4295
4600
|
resource_ids: tempResourceIds
|
|
4296
4601
|
}
|
|
4602
|
+
}).catch(function (error) {
|
|
4603
|
+
assertCurrent();
|
|
4604
|
+
throw error;
|
|
4297
4605
|
});
|
|
4298
|
-
case
|
|
4299
|
-
res =
|
|
4606
|
+
case 37:
|
|
4607
|
+
res = _context32.sent;
|
|
4608
|
+
assertCurrent();
|
|
4300
4609
|
// 2. 商品 schedule 数据,确定日程在每一天的时间片
|
|
4301
4610
|
// 3. 把后端返回的和 schedule 的数据进行合并,确定每一天的可用和使用情况
|
|
4302
4611
|
dates = [];
|
|
@@ -4318,8 +4627,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4318
4627
|
targetSchedules = this.store.schedule.getScheduleListByIds(tempProducts['schedule.ids']);
|
|
4319
4628
|
_loop8 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop8() {
|
|
4320
4629
|
var currentDateStr, status, summaryCount, availableCount, _checkSessionProductL, latestStartDate, earliestEndDate, scheduleByDate, minTimeMaxTime, scheduleTimeSlots, timesSlotCanUse, dateStatus, usageRatio;
|
|
4321
|
-
return _regeneratorRuntime().wrap(function _loop8$(
|
|
4322
|
-
while (1) switch (
|
|
4630
|
+
return _regeneratorRuntime().wrap(function _loop8$(_context31) {
|
|
4631
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
4323
4632
|
case 0:
|
|
4324
4633
|
currentDateStr = currentDate.format('YYYY-MM-DD');
|
|
4325
4634
|
status = 'available';
|
|
@@ -4478,37 +4787,38 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4478
4787
|
|
|
4479
4788
|
// 如果 firstAvailableDate 距离 startDate 大于 14 天了,则后面就不需要再找了,也是一种性能保护
|
|
4480
4789
|
if (!(firstAvailableDate && dayjs(currentDate).diff(dayjs(startDate), 'day') > 31)) {
|
|
4481
|
-
|
|
4790
|
+
_context31.next = 12;
|
|
4482
4791
|
break;
|
|
4483
4792
|
}
|
|
4484
|
-
return
|
|
4793
|
+
return _context31.abrupt("return", 1);
|
|
4485
4794
|
case 12:
|
|
4486
4795
|
currentDate = dayjs(currentDate).add(1, 'day');
|
|
4487
4796
|
case 13:
|
|
4488
4797
|
case "end":
|
|
4489
|
-
return
|
|
4798
|
+
return _context31.stop();
|
|
4490
4799
|
}
|
|
4491
4800
|
}, _loop8);
|
|
4492
4801
|
});
|
|
4493
|
-
case
|
|
4802
|
+
case 47:
|
|
4494
4803
|
if (!(dayjs(currentDate).isBefore(dayjs(endDate), 'day') || dayjs(currentDate).isSame(dayjs(endDate), 'day'))) {
|
|
4495
|
-
|
|
4804
|
+
_context32.next = 53;
|
|
4496
4805
|
break;
|
|
4497
4806
|
}
|
|
4498
|
-
return
|
|
4499
|
-
case
|
|
4500
|
-
if (!
|
|
4501
|
-
|
|
4807
|
+
return _context32.delegateYield(_loop8(), "t1", 49);
|
|
4808
|
+
case 49:
|
|
4809
|
+
if (!_context32.t1) {
|
|
4810
|
+
_context32.next = 51;
|
|
4502
4811
|
break;
|
|
4503
4812
|
}
|
|
4504
|
-
return
|
|
4505
|
-
case
|
|
4506
|
-
|
|
4813
|
+
return _context32.abrupt("break", 53);
|
|
4814
|
+
case 51:
|
|
4815
|
+
_context32.next = 47;
|
|
4507
4816
|
break;
|
|
4508
|
-
case
|
|
4817
|
+
case 53:
|
|
4509
4818
|
// 最终把资源数据也加到日期内
|
|
4510
4819
|
dates = handleAvailableDateByResource(res.data, dates);
|
|
4511
|
-
|
|
4820
|
+
assertCurrent();
|
|
4821
|
+
this.store.date.setDateList(dates, true);
|
|
4512
4822
|
|
|
4513
4823
|
// 缓存这次结果,以防后面他小幅度范围内去修改天数
|
|
4514
4824
|
if (!this.store.currentProductMeta) this.store.currentProductMeta = {};
|
|
@@ -4518,15 +4828,15 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4518
4828
|
startDate: startDate,
|
|
4519
4829
|
endDate: dayjs(currentDate).format('YYYY-MM-DD')
|
|
4520
4830
|
};
|
|
4521
|
-
return
|
|
4831
|
+
return _context32.abrupt("return", {
|
|
4522
4832
|
dateList: dates,
|
|
4523
4833
|
firstAvailableDate: firstAvailableDate
|
|
4524
4834
|
});
|
|
4525
|
-
case
|
|
4835
|
+
case 59:
|
|
4526
4836
|
case "end":
|
|
4527
|
-
return
|
|
4837
|
+
return _context32.stop();
|
|
4528
4838
|
}
|
|
4529
|
-
},
|
|
4839
|
+
}, _callee30, this, [[3, 8]]);
|
|
4530
4840
|
}));
|
|
4531
4841
|
function getAvailableDateForSessionOptimize() {
|
|
4532
4842
|
return _getAvailableDateForSessionOptimize.apply(this, arguments);
|
|
@@ -4573,16 +4883,16 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4573
4883
|
}, {
|
|
4574
4884
|
key: "getContactInfo",
|
|
4575
4885
|
value: (function () {
|
|
4576
|
-
var _getContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4577
|
-
return _regeneratorRuntime().wrap(function
|
|
4578
|
-
while (1) switch (
|
|
4886
|
+
var _getContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
4887
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context33) {
|
|
4888
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
4579
4889
|
case 0:
|
|
4580
|
-
return
|
|
4890
|
+
return _context33.abrupt("return", this.request.get('/customer/metadata', params));
|
|
4581
4891
|
case 1:
|
|
4582
4892
|
case "end":
|
|
4583
|
-
return
|
|
4893
|
+
return _context33.stop();
|
|
4584
4894
|
}
|
|
4585
|
-
},
|
|
4895
|
+
}, _callee31, this);
|
|
4586
4896
|
}));
|
|
4587
4897
|
function getContactInfo(_x24) {
|
|
4588
4898
|
return _getContactInfo.apply(this, arguments);
|