@pisell/private-materials 6.3.136 → 6.3.138

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.
Files changed (173) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/businessModel/SalesModel/index.d.ts +1 -0
  8. package/es/components/booking/addons/model.d.ts +1 -10
  9. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  10. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  11. package/es/components/booking/deposit/index.d.ts +1 -0
  12. package/es/components/booking/forms/model.d.ts +1 -10
  13. package/es/components/booking/forms/single/index.d.ts +1 -0
  14. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  15. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  16. package/es/components/booking/info/date/index.d.ts +1 -0
  17. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  18. package/es/components/booking/info/index.d.ts +1 -0
  19. package/es/components/booking/info/model.d.ts +1 -10
  20. package/es/components/booking/info/notes/index.d.ts +1 -0
  21. package/es/components/booking/info/service/Lists.d.ts +1 -0
  22. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  23. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  24. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  25. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  26. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  27. package/es/components/booking/info/service2/utils.d.ts +1 -1
  28. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  29. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  30. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  31. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  32. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  33. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  34. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  35. package/es/components/booking/model.d.ts +1 -9
  36. package/es/components/booking/notes/model.d.ts +1 -10
  37. package/es/components/booking/payments/model.d.ts +1 -10
  38. package/es/components/eftposPay/amount.d.ts +1 -0
  39. package/es/components/eftposPay/app.d.ts +1 -0
  40. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  41. package/es/components/eftposPay/device.d.ts +1 -0
  42. package/es/components/eftposPay/hooks.d.ts +2 -2
  43. package/es/components/eftposPay/index.d.ts +1 -0
  44. package/es/components/eftposPay/linkly/index.d.ts +1 -0
  45. package/es/components/eftposPay/pay.d.ts +1 -0
  46. package/es/components/eftposPay/store/index.d.ts +5 -5
  47. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  48. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  49. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  50. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  51. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  52. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  53. package/es/components/eventBooking/index.d.ts +1 -0
  54. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  55. package/es/components/pay/toC/model.d.ts +1 -9
  56. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  57. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  58. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  59. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  60. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  61. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  62. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  63. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  64. package/es/components/productExtension/index.d.ts +1 -0
  65. package/es/components/ruleSetting/index.d.ts +1 -0
  66. package/es/components/scanOrder/components/Content/index.js +251 -69
  67. package/es/components/scanOrder/context.js +6 -18
  68. package/es/components/scanOrder/utils/toShoppingCartProducts.d.ts +2 -1
  69. package/es/components/scanOrder/utils/toShoppingCartProducts.js +15 -9
  70. package/es/components/scanOrder/utils/transformProductDetail.d.ts +2 -1
  71. package/es/components/scanOrder/utils/transformProductDetail.js +7 -6
  72. package/es/components/schedules/model.d.ts +1 -9
  73. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  74. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  75. package/es/components/shoppingCart/index.d.ts +1 -0
  76. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  77. package/es/components/venueBooking/components/Checkout/index.js +36 -5
  78. package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.js +1 -1
  79. package/es/components/venueBooking/context.js +32 -6
  80. package/es/components/venueBooking/locales.d.ts +15 -0
  81. package/es/components/venueBooking/locales.js +15 -0
  82. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
  83. package/es/plus/pisellSalesManagement/config/booking.d.ts +6 -6
  84. package/es/plus/pisellSalesProductCard/index.js +16 -1
  85. package/es/plus/pisellSalesProductCard/types.d.ts +21 -1
  86. package/es/plus/productSelect/ProductCard/ProductCardV2.js +6 -2
  87. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  88. package/es/pro/NumericStepper/index.d.ts +19 -0
  89. package/es/pro/NumericStepper/index.js +37 -6
  90. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  91. package/lib/components/booking/addons/model.d.ts +1 -10
  92. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  93. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  94. package/lib/components/booking/deposit/index.d.ts +1 -0
  95. package/lib/components/booking/forms/model.d.ts +1 -10
  96. package/lib/components/booking/forms/single/index.d.ts +1 -0
  97. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  98. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  99. package/lib/components/booking/info/date/index.d.ts +1 -0
  100. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  101. package/lib/components/booking/info/index.d.ts +1 -0
  102. package/lib/components/booking/info/model.d.ts +1 -10
  103. package/lib/components/booking/info/notes/index.d.ts +1 -0
  104. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  105. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  106. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  107. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  108. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  109. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  110. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  111. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  112. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  113. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  114. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  115. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  116. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  117. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  118. package/lib/components/booking/model.d.ts +1 -9
  119. package/lib/components/booking/notes/model.d.ts +1 -10
  120. package/lib/components/booking/payments/model.d.ts +1 -10
  121. package/lib/components/eftposPay/amount.d.ts +1 -0
  122. package/lib/components/eftposPay/app.d.ts +1 -0
  123. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  124. package/lib/components/eftposPay/device.d.ts +1 -0
  125. package/lib/components/eftposPay/hooks.d.ts +2 -2
  126. package/lib/components/eftposPay/index.d.ts +1 -0
  127. package/lib/components/eftposPay/linkly/index.d.ts +1 -0
  128. package/lib/components/eftposPay/pay.d.ts +1 -0
  129. package/lib/components/eftposPay/store/index.d.ts +5 -5
  130. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  131. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  132. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  133. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  134. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  135. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  136. package/lib/components/eventBooking/index.d.ts +1 -0
  137. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  138. package/lib/components/pay/toC/model.d.ts +1 -9
  139. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  140. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  141. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  142. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  143. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  144. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  145. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  146. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  147. package/lib/components/productExtension/index.d.ts +1 -0
  148. package/lib/components/ruleSetting/index.d.ts +1 -0
  149. package/lib/components/scanOrder/components/Content/index.js +150 -41
  150. package/lib/components/scanOrder/context.js +0 -10
  151. package/lib/components/scanOrder/utils/toShoppingCartProducts.d.ts +2 -1
  152. package/lib/components/scanOrder/utils/toShoppingCartProducts.js +8 -5
  153. package/lib/components/scanOrder/utils/transformProductDetail.d.ts +2 -1
  154. package/lib/components/scanOrder/utils/transformProductDetail.js +1 -9
  155. package/lib/components/schedules/model.d.ts +1 -9
  156. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  157. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  158. package/lib/components/shoppingCart/index.d.ts +1 -0
  159. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  160. package/lib/components/venueBooking/components/Checkout/index.js +28 -3
  161. package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.js +1 -1
  162. package/lib/components/venueBooking/context.js +14 -6
  163. package/lib/components/venueBooking/locales.d.ts +15 -0
  164. package/lib/components/venueBooking/locales.js +15 -0
  165. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
  166. package/lib/plus/pisellSalesManagement/config/booking.d.ts +6 -6
  167. package/lib/plus/pisellSalesProductCard/index.js +10 -0
  168. package/lib/plus/pisellSalesProductCard/types.d.ts +21 -1
  169. package/lib/plus/productSelect/ProductCard/ProductCardV2.js +6 -2
  170. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  171. package/lib/pro/NumericStepper/index.d.ts +19 -0
  172. package/lib/pro/NumericStepper/index.js +21 -4
  173. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
1
  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; }
2
2
  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); } }
3
3
  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); }); }; }
4
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- 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); }
8
- 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; }
9
6
  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; } }
10
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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; } } }; }
9
+ 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
+ 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; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
12
  import React, { useEffect, useMemo, useRef, useState } from 'react';
12
13
  import { isMobile, locales } from '@pisell/utils';
13
14
  import { Modal } from 'antd';
@@ -24,6 +25,38 @@ import Check from "../Check";
24
25
  import PolicyModal from "../../../appointmentBooking/deposit/components/PolicyModal";
25
26
  import useComponents from "../../../../hooks/useComponents";
26
27
  import "./index.less";
28
+ /** 从 pisell1.handlePaxModal 的 callback 入参中解析人数(兼容数字、字符串或对象字段) */
29
+ function extractEntryPaxNumber(payload) {
30
+ if (payload == null) return null;
31
+ if (typeof payload === 'number' && Number.isFinite(payload) && payload >= 1) {
32
+ return Math.floor(payload);
33
+ }
34
+ if (typeof payload === 'string') {
35
+ var n = Number(payload);
36
+ if (Number.isFinite(n) && n >= 1) return Math.floor(n);
37
+ }
38
+ if (_typeof(payload) === 'object') {
39
+ var o = payload;
40
+ var _iterator = _createForOfIteratorHelper(['entryPaxNumber', 'pax', 'num', 'count', 'value']),
41
+ _step;
42
+ try {
43
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
44
+ var k = _step.value;
45
+ var v = o[k];
46
+ if (typeof v === 'number' && Number.isFinite(v) && v >= 1) return Math.floor(v);
47
+ if (typeof v === 'string') {
48
+ var _n = Number(v);
49
+ if (Number.isFinite(_n) && _n >= 1) return Math.floor(_n);
50
+ }
51
+ }
52
+ } catch (err) {
53
+ _iterator.e(err);
54
+ } finally {
55
+ _iterator.f();
56
+ }
57
+ }
58
+ return null;
59
+ }
27
60
  function ReadyState() {
28
61
  var _formModal$content, _formModal$content2, _formModal$content3, _formModal$content4;
29
62
  var _useScanOrderContext = useScanOrderContext(),
@@ -69,6 +102,22 @@ function ReadyState() {
69
102
  _useState8 = _slicedToArray(_useState7, 2),
70
103
  pendingFormPayload = _useState8[0],
71
104
  setPendingFormPayload = _useState8[1];
105
+ var _useState9 = useState('default'),
106
+ _useState10 = _slicedToArray(_useState9, 2),
107
+ entryMode = _useState10[0],
108
+ setEntryMode = _useState10[1];
109
+ /** checkResourceAvailable 返回 requestEntryPax === 1 时,在协议/表单之后弹人数并写入 scanOrder otherParams */
110
+ var requestEntryPaxRef = useRef(0);
111
+ var requestPaxMinRef = useRef(1);
112
+ var requestPaxMaxRef = useRef(1);
113
+ var tableFormRecordRef = useRef(null);
114
+
115
+ /** 根据当前语言从多语言 name 对象中取值,兜底 original -> en -> 空串 */
116
+ var getLocalizedName = function getLocalizedName(nameMap) {
117
+ if (!nameMap) return '';
118
+ var currentLocale = locales.getLocale();
119
+ return nameMap[currentLocale] || nameMap.original || nameMap.en || '';
120
+ };
72
121
  var normalizeFormPayload = function normalizeFormPayload(formPayload, partyroomBookingPayload) {
73
122
  var _ref, _ref2, _sourcePayload$id;
74
123
  var sourcePayload = formPayload !== null && formPayload !== void 0 ? formPayload : partyroomBookingPayload;
@@ -91,6 +140,17 @@ function ReadyState() {
91
140
  var link = "/order/details?id=".concat(order_id);
92
141
  location.replace(link);
93
142
  };
143
+ var handleBack = function handleBack() {
144
+ if (currentStep !== 'product') {
145
+ prevStep();
146
+ return;
147
+ }
148
+ if (entryMode === 'additional_order' && entryContext !== null && entryContext !== void 0 && entryContext.order_id) {
149
+ handleOrderDetail(entryContext.order_id);
150
+ return;
151
+ }
152
+ location.replace('/');
153
+ };
94
154
  var enterProductStep = /*#__PURE__*/function () {
95
155
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
96
156
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -123,6 +183,74 @@ function ReadyState() {
123
183
  return _ref3.apply(this, arguments);
124
184
  };
125
185
  }();
186
+
187
+ /** 需要时先走人数弹窗与 setOtherParams(entryPaxNumber),再进入商品步 */
188
+ var runEntryPaxGateThenEnterProduct = /*#__PURE__*/function () {
189
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
190
+ var pax;
191
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
192
+ while (1) switch (_context2.prev = _context2.next) {
193
+ case 0:
194
+ if (!(requestEntryPaxRef.current !== 1)) {
195
+ _context2.next = 4;
196
+ break;
197
+ }
198
+ _context2.next = 3;
199
+ return enterProductStep();
200
+ case 3:
201
+ return _context2.abrupt("return");
202
+ case 4:
203
+ _context2.next = 6;
204
+ return new Promise(function (resolve) {
205
+ var _tableFormRecordRef$c;
206
+ if (typeof (utils === null || utils === void 0 ? void 0 : utils.action) !== 'function') {
207
+ resolve(null);
208
+ return;
209
+ }
210
+ utils.action({
211
+ type: 'pisell1.handlePaxModal',
212
+ data: {
213
+ tableName: getLocalizedName((_tableFormRecordRef$c = tableFormRecordRef.current) === null || _tableFormRecordRef$c === void 0 ? void 0 : _tableFormRecordRef$c.name),
214
+ requestPaxMin: requestPaxMinRef.current,
215
+ requestPaxMax: requestPaxMaxRef.current
216
+ },
217
+ callback: function callback(result) {
218
+ resolve(extractEntryPaxNumber(result));
219
+ }
220
+ });
221
+ });
222
+ case 6:
223
+ pax = _context2.sent;
224
+ if (!(pax == null)) {
225
+ _context2.next = 10;
226
+ break;
227
+ }
228
+ location.replace('/');
229
+ return _context2.abrupt("return");
230
+ case 10:
231
+ _context2.prev = 10;
232
+ _context2.next = 13;
233
+ return runModuleAction('setEntryPaxNumber', pax);
234
+ case 13:
235
+ _context2.next = 18;
236
+ break;
237
+ case 15:
238
+ _context2.prev = 15;
239
+ _context2.t0 = _context2["catch"](10);
240
+ console.warn('[scanOrder] setOtherParams failed', _context2.t0);
241
+ case 18:
242
+ _context2.next = 20;
243
+ return enterProductStep();
244
+ case 20:
245
+ case "end":
246
+ return _context2.stop();
247
+ }
248
+ }, _callee2, null, [[10, 15]]);
249
+ }));
250
+ return function runEntryPaxGateThenEnterProduct() {
251
+ return _ref4.apply(this, arguments);
252
+ };
253
+ }();
126
254
  var closePolicyAndBack = function closePolicyAndBack() {
127
255
  setPolicyModal({
128
256
  open: false,
@@ -155,7 +283,7 @@ function ReadyState() {
155
283
  content: null
156
284
  });
157
285
  setPendingFormPayload(null);
158
- void enterProductStep();
286
+ void runEntryPaxGateThenEnterProduct();
159
287
  };
160
288
  var handleFormConfirm = function handleFormConfirm() {
161
289
  var _formModalRef$current, _formModalRef$current2;
@@ -172,7 +300,7 @@ function ReadyState() {
172
300
  openFormModal(pendingFormPayload);
173
301
  return;
174
302
  }
175
- void enterProductStep();
303
+ void runEntryPaxGateThenEnterProduct();
176
304
  };
177
305
  var depositProtocolRequest = function depositProtocolRequest(id) {
178
306
  var _utils$request, _utils$request$get;
@@ -180,36 +308,43 @@ function ReadyState() {
180
308
  };
181
309
  useEffect(function () {
182
310
  var checkResourceAvailable = /*#__PURE__*/function () {
183
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
184
- var hasOrderId, _yield$runModuleActio, mode, order_id, errorTips, policy, form, partyroom_booking, normalizedFormPayload, normalizedPolicyPayload, content;
185
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
186
- while (1) switch (_context2.prev = _context2.next) {
311
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
312
+ var hasOrderId, _yield$runModuleActio, mode, order_id, errorTips, policy, form, partyroom_booking, requestEntryPax, requestPaxMin, requestPaxMax, table_form_record, normalizedFormPayload, isAdditionalOrder, normalizedPolicyPayload, content;
313
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
314
+ while (1) switch (_context3.prev = _context3.next) {
187
315
  case 0:
188
316
  hasOrderId = !!(entryContext !== null && entryContext !== void 0 && entryContext.order_id);
189
- _context2.next = 3;
317
+ _context3.next = 3;
190
318
  return runModuleAction('checkResourceAvailable', entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id, hasOrderId);
191
319
  case 3:
192
- _yield$runModuleActio = _context2.sent;
320
+ _yield$runModuleActio = _context3.sent;
193
321
  mode = _yield$runModuleActio.mode;
194
322
  order_id = _yield$runModuleActio.order_id;
195
323
  errorTips = _yield$runModuleActio.errorTips;
196
324
  policy = _yield$runModuleActio.policy;
197
325
  form = _yield$runModuleActio.form;
198
326
  partyroom_booking = _yield$runModuleActio.partyroom_booking;
199
- normalizedFormPayload = normalizeFormPayload(form, partyroom_booking); // 资源空闲或者是加单模式,进入商品选择
200
- if (!(mode === 'idle' || mode === 'additional_order' || mode === 'additional_order_with_code')) {
201
- _context2.next = 25;
327
+ requestEntryPax = _yield$runModuleActio.requestEntryPax;
328
+ requestPaxMin = _yield$runModuleActio.requestPaxMin;
329
+ requestPaxMax = _yield$runModuleActio.requestPaxMax;
330
+ table_form_record = _yield$runModuleActio.table_form_record;
331
+ requestEntryPaxRef.current = Number(requestEntryPax) === 1 ? 1 : 0;
332
+ requestPaxMinRef.current = Number(requestPaxMin) || 1;
333
+ requestPaxMaxRef.current = Number(requestPaxMax) || 1;
334
+ tableFormRecordRef.current = table_form_record || {};
335
+ normalizedFormPayload = normalizeFormPayload(form, partyroom_booking);
336
+ isAdditionalOrder = mode === 'additional_order' || mode === 'additional_order_with_code';
337
+ setEntryMode(isAdditionalOrder ? 'additional_order' : 'default');
338
+ // 资源空闲:按需依次弹 协议 -> 表单 -> 人数,最后进入商品选择
339
+ if (!(mode === 'idle')) {
340
+ _context3.next = 34;
202
341
  break;
203
342
  }
204
343
  normalizedPolicyPayload = _typeof(policy) === 'object' && policy !== null ? policy : {
205
344
  id: policy
206
- }; // 加餐不需要显示协议和表单
207
- if (!(mode === 'idle')) {
208
- _context2.next = 21;
209
- break;
210
- }
345
+ };
211
346
  if (!(normalizedPolicyPayload !== null && normalizedPolicyPayload !== void 0 && normalizedPolicyPayload.id)) {
212
- _context2.next = 18;
347
+ _context3.next = 27;
213
348
  break;
214
349
  }
215
350
  setPendingFormPayload(normalizedFormPayload);
@@ -217,21 +352,31 @@ function ReadyState() {
217
352
  open: true,
218
353
  content: normalizedPolicyPayload
219
354
  });
220
- return _context2.abrupt("return");
221
- case 18:
355
+ return _context3.abrupt("return");
356
+ case 27:
222
357
  if (!normalizedFormPayload) {
223
- _context2.next = 21;
358
+ _context3.next = 30;
224
359
  break;
225
360
  }
226
361
  openFormModal(normalizedFormPayload);
227
- return _context2.abrupt("return");
228
- case 21:
229
- _context2.next = 23;
362
+ return _context3.abrupt("return");
363
+ case 30:
364
+ _context3.next = 32;
365
+ return runEntryPaxGateThenEnterProduct();
366
+ case 32:
367
+ _context3.next = 40;
368
+ break;
369
+ case 34:
370
+ if (!isAdditionalOrder) {
371
+ _context3.next = 39;
372
+ break;
373
+ }
374
+ _context3.next = 37;
230
375
  return enterProductStep();
231
- case 23:
232
- _context2.next = 26;
376
+ case 37:
377
+ _context3.next = 40;
233
378
  break;
234
- case 25:
379
+ case 39:
235
380
  if (mode === 'resource_busy') {
236
381
  // 如果资源是占用,则跳转到订单详情页
237
382
  // 需要检测当前是否已经登录,如果未登录则先登录再跳转
@@ -266,14 +411,14 @@ function ReadyState() {
266
411
  }
267
412
  });
268
413
  }
269
- case 26:
414
+ case 40:
270
415
  case "end":
271
- return _context2.stop();
416
+ return _context3.stop();
272
417
  }
273
- }, _callee2);
418
+ }, _callee3);
274
419
  }));
275
420
  return function checkResourceAvailable() {
276
- return _ref4.apply(this, arguments);
421
+ return _ref5.apply(this, arguments);
277
422
  };
278
423
  }();
279
424
  checkResourceAvailable();
@@ -307,63 +452,100 @@ function ReadyState() {
307
452
  message: locales.getText('pisell2.scan.order.store.status.exception')
308
453
  })
309
454
  };
310
- var getFirstFailedProductId = function getFirstFailedProductId() {
455
+ var getFirstFailedProductIds = function getFirstFailedProductIds() {
311
456
  var firstFailure = Array.isArray(cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.failures) ? cartValidation.failures[0] : null;
312
- var firstFailedTarget = Array.isArray(firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.targets) ? firstFailure.targets[0] : null;
313
- var firstFailedProductId = Number(firstFailedTarget === null || firstFailedTarget === void 0 ? void 0 : firstFailedTarget.product_id);
314
- if (!Number.isFinite(firstFailedProductId) || firstFailedProductId <= 0) {
315
- return null;
457
+ var targets = Array.isArray(firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.targets) ? firstFailure.targets : [];
458
+ var ids = [];
459
+ var seen = new Set();
460
+ var _iterator2 = _createForOfIteratorHelper(targets),
461
+ _step2;
462
+ try {
463
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
464
+ var target = _step2.value;
465
+ var id = Number(target === null || target === void 0 ? void 0 : target.product_id);
466
+ if (Number.isFinite(id) && id > 0 && !seen.has(id)) {
467
+ seen.add(id);
468
+ ids.push(id);
469
+ }
470
+ }
471
+ } catch (err) {
472
+ _iterator2.e(err);
473
+ } finally {
474
+ _iterator2.f();
316
475
  }
317
- return firstFailedProductId;
476
+ return ids;
318
477
  };
319
- var scrollAndHighlightProductById = function scrollAndHighlightProductById(productId) {
320
- var failedProductElement = document.querySelector("[data-product-id=\"".concat(String(productId), "\"]"));
321
- if (!failedProductElement) return false;
322
- failedProductElement.classList.remove('highlight-product-item');
323
- failedProductElement.scrollIntoView({
324
- behavior: 'smooth',
325
- block: 'center'
326
- });
327
- failedProductElement.classList.add('highlight-product-item');
328
- setTimeout(function () {
329
- failedProductElement.classList.remove('highlight-product-item');
330
- }, 3000);
331
- return true;
478
+ var scrollAndHighlightProductsByIds = function scrollAndHighlightProductsByIds(productIds) {
479
+ if (!(productIds !== null && productIds !== void 0 && productIds.length)) return false;
480
+ var scrolled = false;
481
+ var highlighted = false;
482
+ var _iterator3 = _createForOfIteratorHelper(productIds),
483
+ _step3;
484
+ try {
485
+ var _loop = function _loop() {
486
+ var productId = _step3.value;
487
+ var failedProductElement = document.querySelector("[data-product-id=\"".concat(String(productId), "\"]"));
488
+ if (!failedProductElement) return 1; // continue
489
+ failedProductElement.classList.remove('highlight-product-item');
490
+ if (!scrolled) {
491
+ failedProductElement.scrollIntoView({
492
+ behavior: 'smooth',
493
+ block: 'center'
494
+ });
495
+ scrolled = true;
496
+ }
497
+ // 触发重绘,确保动画从头播放
498
+ void failedProductElement.offsetWidth;
499
+ failedProductElement.classList.add('highlight-product-item');
500
+ setTimeout(function () {
501
+ failedProductElement.classList.remove('highlight-product-item');
502
+ }, 3000);
503
+ highlighted = true;
504
+ };
505
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
506
+ if (_loop()) continue;
507
+ }
508
+ } catch (err) {
509
+ _iterator3.e(err);
510
+ } finally {
511
+ _iterator3.f();
512
+ }
513
+ return highlighted;
332
514
  };
333
515
 
334
516
  // 跳转到订单确认页
335
517
  var gotoCheckOrder = /*#__PURE__*/function () {
336
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
518
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
337
519
  var _otherParams$dineInCo;
338
- var firstFailure, firstFailedProductId, failureTips, otherParams, dineInConfig, isPauseOrder, _dineInConfig$availab;
339
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
340
- while (1) switch (_context3.prev = _context3.next) {
520
+ var firstFailure, failedProductIds, failureTips, otherParams, dineInConfig, isPauseOrder, _dineInConfig$availab;
521
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
522
+ while (1) switch (_context4.prev = _context4.next) {
341
523
  case 0:
342
524
  firstFailure = Array.isArray(cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.failures) ? cartValidation.failures[0] : null;
343
525
  if (!((cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.passed) === false)) {
344
- _context3.next = 7;
526
+ _context4.next = 7;
345
527
  break;
346
528
  }
347
- firstFailedProductId = getFirstFailedProductId();
348
- if (firstFailedProductId) {
349
- scrollAndHighlightProductById(firstFailedProductId);
529
+ failedProductIds = getFirstFailedProductIds();
530
+ if (failedProductIds.length) {
531
+ scrollAndHighlightProductsByIds(failedProductIds);
350
532
  }
351
533
  failureTips = String((firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '').trim();
352
534
  PisellToast({
353
535
  content: failureTips,
354
536
  duration: 2
355
537
  });
356
- return _context3.abrupt("return");
538
+ return _context4.abrupt("return");
357
539
  case 7:
358
- _context3.next = 9;
540
+ _context4.next = 9;
359
541
  return runModuleAction('getOtherParams');
360
542
  case 9:
361
- otherParams = _context3.sent;
543
+ otherParams = _context4.sent;
362
544
  console.log('otherParams >>>>> ', otherParams);
363
545
  dineInConfig = (_otherParams$dineInCo = otherParams === null || otherParams === void 0 ? void 0 : otherParams.dineInConfig) !== null && _otherParams$dineInCo !== void 0 ? _otherParams$dineInCo : {};
364
546
  isPauseOrder = dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.paused']; // 如果暂停接单直接弹提示,点完确定回首页
365
547
  if (!isPauseOrder) {
366
- _context3.next = 16;
548
+ _context4.next = 16;
367
549
  break;
368
550
  }
369
551
  Modal.info({
@@ -374,7 +556,7 @@ function ReadyState() {
374
556
  location.replace('/');
375
557
  }
376
558
  });
377
- return _context3.abrupt("return");
559
+ return _context4.abrupt("return");
378
560
  case 16:
379
561
  // 需要先确认当前是否登录,如果没有则需要登录
380
562
  if (!isLogin) {
@@ -390,12 +572,12 @@ function ReadyState() {
390
572
  }
391
573
  case 17:
392
574
  case "end":
393
- return _context3.stop();
575
+ return _context4.stop();
394
576
  }
395
- }, _callee3);
577
+ }, _callee4);
396
578
  }));
397
579
  return function gotoCheckOrder() {
398
- return _ref5.apply(this, arguments);
580
+ return _ref6.apply(this, arguments);
399
581
  };
400
582
  }();
401
583
  var isMobileView = isMobile();
@@ -409,7 +591,7 @@ function ReadyState() {
409
591
  }, [currentStep, isMobileView]);
410
592
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
411
593
  currentStep: currentStep,
412
- onBack: prevStep
594
+ onBack: handleBack
413
595
  }), /*#__PURE__*/React.createElement("div", {
414
596
  className: "pisell-scan-order-content-wrap ".concat(isMobileView ? 'pisell-scan-order-content-mobile-wrap' : ''),
415
597
  "data-cart-validation-passed": String(cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.passed)
@@ -251,38 +251,26 @@ export function ScanOrderProvider(_ref) {
251
251
  return scanOrderModule.getPageConfig(entryContext);
252
252
  case 18:
253
253
  _context5.next = 20;
254
- return safeRunModuleAction(scanOrderModule, 'setItemRuleRuntimeConfig', {
255
- pax: {
256
- total: 2,
257
- adult: 2,
258
- child: 0
259
- },
260
- serviceType: 'dine-in',
261
- submissionIndex: 0,
262
- historicalItems: []
263
- });
264
- case 20:
265
- _context5.next = 22;
266
254
  return refreshViewModel();
267
- case 22:
255
+ case 20:
268
256
  if (!unmounted) {
269
257
  setErrorMessage('');
270
258
  setIsLoading(false);
271
259
  }
272
- _context5.next = 28;
260
+ _context5.next = 26;
273
261
  break;
274
- case 25:
275
- _context5.prev = 25;
262
+ case 23:
263
+ _context5.prev = 23;
276
264
  _context5.t1 = _context5["catch"](0);
277
265
  if (!unmounted) {
278
266
  setErrorMessage((_context5.t1 === null || _context5.t1 === void 0 ? void 0 : _context5.t1.message) || 'scanOrder load failed');
279
267
  setIsLoading(false);
280
268
  }
281
- case 28:
269
+ case 26:
282
270
  case "end":
283
271
  return _context5.stop();
284
272
  }
285
- }, _callee5, null, [[0, 25]]);
273
+ }, _callee5, null, [[0, 23]]);
286
274
  }));
287
275
  return function bootstrap() {
288
276
  return _ref6.apply(this, arguments);
@@ -2,8 +2,9 @@ interface ScanOrderOrderProduct {
2
2
  product_id: number | null;
3
3
  product_variant_id: number;
4
4
  num?: number;
5
- payment_price?: string | number;
5
+ /** 券后单品单价(订单域成交单价)。 */
6
6
  selling_price?: string | number;
7
+ /** 券前单品单价(店铺售价)。 */
7
8
  original_price?: string | number;
8
9
  product_option_item?: any[];
9
10
  product_bundle?: any[];
@@ -14,23 +14,29 @@ function getDisplayName(product) {
14
14
  var origin = (product === null || product === void 0 ? void 0 : product._origin) || {};
15
15
  var callbackData = (origin === null || origin === void 0 ? void 0 : origin.callbackData) || {};
16
16
  var callbackOrigin = (callbackData === null || callbackData === void 0 ? void 0 : callbackData.origin) || {};
17
- return (callbackData === null || callbackData === void 0 ? void 0 : callbackData.name) || (callbackData === null || callbackData === void 0 ? void 0 : callbackData.title) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.name) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.title) || (origin === null || origin === void 0 ? void 0 : origin.name) || (origin === null || origin === void 0 ? void 0 : origin.title) || (origin === null || origin === void 0 || (_origin$resources = origin.resources) === null || _origin$resources === void 0 || (_origin$resources = _origin$resources[0]) === null || _origin$resources === void 0 ? void 0 : _origin$resources.main_field) || (product === null || product === void 0 || (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_name) || "Product #".concat((_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : 'unknown');
17
+ var sourceItem = (origin === null || origin === void 0 ? void 0 : origin.sourceItem) || {};
18
+ return (callbackData === null || callbackData === void 0 ? void 0 : callbackData.name) || (callbackData === null || callbackData === void 0 ? void 0 : callbackData.title) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.name) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.title) || (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.name) || (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.title) || (origin === null || origin === void 0 ? void 0 : origin.name) || (origin === null || origin === void 0 ? void 0 : origin.title) || (origin === null || origin === void 0 || (_origin$resources = origin.resources) === null || _origin$resources === void 0 || (_origin$resources = _origin$resources[0]) === null || _origin$resources === void 0 ? void 0 : _origin$resources.main_field) || (product === null || product === void 0 || (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_name) || "Product #".concat((_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : 'unknown');
18
19
  }
19
20
  function getDisplayImage(product) {
20
21
  var origin = (product === null || product === void 0 ? void 0 : product._origin) || {};
21
22
  var callbackData = (origin === null || origin === void 0 ? void 0 : origin.callbackData) || {};
22
23
  var callbackOrigin = (callbackData === null || callbackData === void 0 ? void 0 : callbackData.origin) || {};
23
- return (callbackData === null || callbackData === void 0 ? void 0 : callbackData.image) || (callbackData === null || callbackData === void 0 ? void 0 : callbackData.cover) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.image) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.cover) || (origin === null || origin === void 0 ? void 0 : origin.image) || (origin === null || origin === void 0 ? void 0 : origin.cover) || '';
24
+ var sourceItem = (origin === null || origin === void 0 ? void 0 : origin.sourceItem) || {};
25
+ return (callbackData === null || callbackData === void 0 ? void 0 : callbackData.image) || (callbackData === null || callbackData === void 0 ? void 0 : callbackData.cover) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.image) || (callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.cover) || (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.image) || (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.cover) || (origin === null || origin === void 0 ? void 0 : origin.image) || (origin === null || origin === void 0 ? void 0 : origin.cover) || '';
24
26
  }
25
27
  function getUnitPrice(product) {
26
- var origin = (product === null || product === void 0 ? void 0 : product._origin) || {};
27
- var callbackData = (origin === null || origin === void 0 ? void 0 : origin.callbackData) || {};
28
+ var _product$_origin, _product$_origin2;
29
+ var callbackData = (product === null || product === void 0 || (_product$_origin = product._origin) === null || _product$_origin === void 0 ? void 0 : _product$_origin.callbackData) || {};
28
30
  var callbackOrigin = (callbackData === null || callbackData === void 0 ? void 0 : callbackData.origin) || {};
29
- return toNumber(product.payment_price, NaN) || toNumber(product.selling_price, NaN) || toNumber(product.original_price, NaN) || toNumber(callbackData === null || callbackData === void 0 ? void 0 : callbackData.price, NaN) || toNumber(callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.price, NaN) || toNumber(origin === null || origin === void 0 ? void 0 : origin.price, NaN) || toNumber(origin === null || origin === void 0 ? void 0 : origin.selling_price, NaN) || toNumber(origin === null || origin === void 0 ? void 0 : origin.base_price, 0);
31
+ var sourceItem = (product === null || product === void 0 || (_product$_origin2 = product._origin) === null || _product$_origin2 === void 0 ? void 0 : _product$_origin2.sourceItem) || {};
32
+ // 注:本地临时订单链路不再用 payment_price 作为展示单价。
33
+ // payment_price 语义为「券后单价」,仅用于订单提交,不参与购物车展示;
34
+ // 券带来的节省由 origin_total 与 total 的对照以及 SubTotal 汇总体现。
35
+ return toNumber(product.selling_price, NaN) || toNumber(product.original_price, NaN) || toNumber(callbackData === null || callbackData === void 0 ? void 0 : callbackData.price, NaN) || toNumber(callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.price, NaN) || toNumber(sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price, 0);
30
36
  }
31
37
  function normalizeOptions(product) {
32
- var _product$_origin;
33
- var callbackData = (product === null || product === void 0 || (_product$_origin = product._origin) === null || _product$_origin === void 0 ? void 0 : _product$_origin.callbackData) || {};
38
+ var _product$_origin3;
39
+ var callbackData = (product === null || product === void 0 || (_product$_origin3 = product._origin) === null || _product$_origin3 === void 0 ? void 0 : _product$_origin3.callbackData) || {};
34
40
  var sourceOptions = Array.isArray(callbackData === null || callbackData === void 0 ? void 0 : callbackData.option) ? callbackData.option : (product === null || product === void 0 ? void 0 : product.product_option_item) || [];
35
41
  return sourceOptions.map(function (optionItem) {
36
42
  var _optionItem$product_o;
@@ -47,8 +53,8 @@ function normalizeOptions(product) {
47
53
  });
48
54
  }
49
55
  function normalizeBundles(product) {
50
- var _product$_origin2;
51
- var callbackData = (product === null || product === void 0 || (_product$_origin2 = product._origin) === null || _product$_origin2 === void 0 ? void 0 : _product$_origin2.callbackData) || {};
56
+ var _product$_origin4;
57
+ var callbackData = (product === null || product === void 0 || (_product$_origin4 = product._origin) === null || _product$_origin4 === void 0 ? void 0 : _product$_origin4.callbackData) || {};
52
58
  var sourceBundles = Array.isArray(callbackData === null || callbackData === void 0 ? void 0 : callbackData.bundle) ? callbackData.bundle : (product === null || product === void 0 ? void 0 : product.product_bundle) || [];
53
59
  return sourceBundles.map(function (bundleItem, bundleIndex) {
54
60
  var _ref, _bundleItem$price, _bundleItem$id;
@@ -43,9 +43,10 @@ export interface ScanOrderOrderProductInput {
43
43
  price: number;
44
44
  }>;
45
45
  product_bundle: ProductDetailBundleItem[];
46
+ /** 券后单品单价;初次加购由入口置为 selling_price,之后由 SDK Rules 引擎维护。 */
46
47
  selling_price: string;
48
+ /** 券前单品单价(店铺售价)。 */
47
49
  original_price: string;
48
- payment_price: string;
49
50
  tax_fee: string;
50
51
  is_charge_tax: number;
51
52
  metadata: Record<string, any>;