@pisell/private-materials 6.3.177 → 6.3.178

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 (191) 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.css +1 -1
  6. package/build/lowcode/render/default/view.js +9 -9
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/businessModel/SalesModel/index.d.ts +1 -0
  10. package/es/components/appointmentBooking/components/Cart/Item/index.js +91 -24
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +24 -20
  12. package/es/components/appointmentBooking/components/Header/index.js +4 -24
  13. package/es/components/appointmentBooking/components/Voucher/index.js +10 -0
  14. package/es/components/appointmentBooking/hooks.d.ts +1 -17
  15. package/es/components/appointmentBooking/hooks.js +54 -128
  16. package/es/components/appointmentBooking/utils.d.ts +1 -0
  17. package/es/components/appointmentBooking/utils.js +54 -33
  18. package/es/components/booking/addons/model.d.ts +1 -10
  19. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  20. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  21. package/es/components/booking/deposit/index.d.ts +1 -0
  22. package/es/components/booking/forms/model.d.ts +1 -10
  23. package/es/components/booking/forms/single/index.d.ts +1 -0
  24. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  25. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  26. package/es/components/booking/info/date/index.d.ts +1 -0
  27. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  28. package/es/components/booking/info/index.d.ts +1 -0
  29. package/es/components/booking/info/model.d.ts +1 -10
  30. package/es/components/booking/info/notes/index.d.ts +1 -0
  31. package/es/components/booking/info/service/Lists.d.ts +1 -0
  32. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  33. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  34. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  35. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  36. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  37. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  38. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  39. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  40. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  41. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  42. package/es/components/booking/model.d.ts +1 -9
  43. package/es/components/booking/notes/model.d.ts +1 -10
  44. package/es/components/booking/payments/model.d.ts +1 -10
  45. package/es/components/booking/utils.d.ts +2 -2
  46. package/es/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
  47. package/es/components/eftposPay/amount.d.ts +1 -0
  48. package/es/components/eftposPay/app.d.ts +1 -0
  49. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  50. package/es/components/eftposPay/device.js +4 -11
  51. package/es/components/eftposPay/hooks.d.ts +1 -1
  52. package/es/components/eftposPay/index.d.ts +1 -0
  53. package/es/components/eftposPay/linkly/index.d.ts +1 -0
  54. package/es/components/eftposPay/pay.d.ts +1 -0
  55. package/es/components/eftposPay/store/index.d.ts +1 -1
  56. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  57. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  58. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  59. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  60. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  61. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  62. package/es/components/eventBooking/components/progressBar/index.d.ts +1 -8
  63. package/es/components/eventBooking/components/progressBar/index.js +10 -30
  64. package/es/components/eventBooking/index.d.ts +1 -0
  65. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  66. package/es/components/pay/toC/model.d.ts +1 -9
  67. package/es/components/pisellCashCounting/hooks.d.ts +1 -0
  68. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  69. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  70. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  71. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  72. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  73. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  74. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  75. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  76. package/es/components/productExtension/index.d.ts +1 -0
  77. package/es/components/ruleSetting/index.d.ts +1 -0
  78. package/es/components/scanOrder/components/Check/index.js +46 -187
  79. package/es/components/scanOrder/components/Check/index.less +0 -39
  80. package/es/components/scanOrder/components/Content/index.js +72 -189
  81. package/es/components/scanOrder/components/Menu/index.js +5 -11
  82. package/es/components/scanOrder/hooks.js +0 -7
  83. package/es/components/scanOrder/locales.d.ts +0 -75
  84. package/es/components/scanOrder/locales.js +0 -75
  85. package/es/components/schedules/model.d.ts +1 -9
  86. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  87. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  88. package/es/components/shoppingCart/index.d.ts +1 -0
  89. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  90. package/es/components/venueBooking/components/Cart/index.js +159 -46
  91. package/es/components/venueBooking/components/Voucher/index.js +1 -6
  92. package/es/components/venueBooking/context.js +15 -2
  93. package/es/components/venueBooking/locales.d.ts +5 -0
  94. package/es/components/venueBooking/locales.js +10 -5
  95. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
  96. package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
  97. package/es/pro/Login2.0/locales.js +1 -1
  98. package/es/utils/buildCartHolderParams.d.ts +92 -0
  99. package/es/utils/buildCartHolderParams.js +191 -0
  100. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  101. package/lib/components/appointmentBooking/components/Cart/Item/index.js +71 -9
  102. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +6 -2
  103. package/lib/components/appointmentBooking/components/Header/index.js +1 -13
  104. package/lib/components/appointmentBooking/components/Voucher/index.js +10 -0
  105. package/lib/components/appointmentBooking/hooks.d.ts +1 -17
  106. package/lib/components/appointmentBooking/hooks.js +16 -91
  107. package/lib/components/appointmentBooking/utils.d.ts +1 -0
  108. package/lib/components/appointmentBooking/utils.js +24 -13
  109. package/lib/components/booking/addons/model.d.ts +1 -10
  110. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  111. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  112. package/lib/components/booking/deposit/index.d.ts +1 -0
  113. package/lib/components/booking/forms/model.d.ts +1 -10
  114. package/lib/components/booking/forms/single/index.d.ts +1 -0
  115. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  116. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  117. package/lib/components/booking/info/date/index.d.ts +1 -0
  118. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  119. package/lib/components/booking/info/index.d.ts +1 -0
  120. package/lib/components/booking/info/model.d.ts +1 -10
  121. package/lib/components/booking/info/notes/index.d.ts +1 -0
  122. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  123. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  124. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  125. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  126. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  127. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  128. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  129. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  130. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  131. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  132. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  133. package/lib/components/booking/model.d.ts +1 -9
  134. package/lib/components/booking/notes/model.d.ts +1 -10
  135. package/lib/components/booking/payments/model.d.ts +1 -10
  136. package/lib/components/booking/utils.d.ts +2 -2
  137. package/lib/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
  138. package/lib/components/eftposPay/amount.d.ts +1 -0
  139. package/lib/components/eftposPay/app.d.ts +1 -0
  140. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  141. package/lib/components/eftposPay/device.js +4 -6
  142. package/lib/components/eftposPay/hooks.d.ts +1 -1
  143. package/lib/components/eftposPay/index.d.ts +1 -0
  144. package/lib/components/eftposPay/linkly/index.d.ts +1 -0
  145. package/lib/components/eftposPay/pay.d.ts +1 -0
  146. package/lib/components/eftposPay/store/index.d.ts +1 -1
  147. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  148. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  149. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  150. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  151. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  152. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  153. package/lib/components/eventBooking/components/progressBar/index.d.ts +1 -8
  154. package/lib/components/eventBooking/components/progressBar/index.js +9 -29
  155. package/lib/components/eventBooking/index.d.ts +1 -0
  156. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  157. package/lib/components/pay/toC/model.d.ts +1 -9
  158. package/lib/components/pisellCashCounting/hooks.d.ts +1 -0
  159. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  160. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  161. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  162. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  163. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  164. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  165. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  166. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  167. package/lib/components/productExtension/index.d.ts +1 -0
  168. package/lib/components/ruleSetting/index.d.ts +1 -0
  169. package/lib/components/scanOrder/components/Check/index.js +3 -116
  170. package/lib/components/scanOrder/components/Check/index.less +0 -39
  171. package/lib/components/scanOrder/components/Content/index.js +25 -106
  172. package/lib/components/scanOrder/components/Menu/index.js +0 -2
  173. package/lib/components/scanOrder/hooks.js +0 -7
  174. package/lib/components/scanOrder/locales.d.ts +0 -75
  175. package/lib/components/scanOrder/locales.js +0 -75
  176. package/lib/components/schedules/model.d.ts +1 -9
  177. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  178. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  179. package/lib/components/shoppingCart/index.d.ts +1 -0
  180. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  181. package/lib/components/venueBooking/components/Cart/index.js +92 -14
  182. package/lib/components/venueBooking/components/Voucher/index.js +1 -5
  183. package/lib/components/venueBooking/context.js +12 -2
  184. package/lib/components/venueBooking/locales.d.ts +5 -0
  185. package/lib/components/venueBooking/locales.js +10 -5
  186. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
  187. package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
  188. package/lib/pro/Login2.0/locales.js +1 -1
  189. package/lib/utils/buildCartHolderParams.d.ts +92 -0
  190. package/lib/utils/buildCartHolderParams.js +167 -0
  191. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const SalesModel: ({ children, hooks, config }: any) => JSX.Element;
2
3
  export * from './Sales';
3
4
  export default SalesModel;
@@ -1,10 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
3
  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."); }
4
- 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); }
5
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
- 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; }
8
6
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
7
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
8
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -13,7 +11,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
11
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
12
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
13
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
- import React, { useMemo } from 'react';
14
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
+ 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."); }
16
+ 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); }
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; }
18
+ 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; } }
19
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+ import React, { useEffect, useMemo, useState } from 'react';
17
21
  import { isMobile, locales } from '@pisell/utils';
18
22
  import ShoppingCart from "../../../../shoppingCart";
19
23
  import ContinueButton from "../ContinueButton";
@@ -25,6 +29,8 @@ import { formatHolder, formatCurrentUser, openForm, getMultiResources, updateCar
25
29
  import VoucherCard from "../../Voucher";
26
30
  import Deposit from "../../Deposit";
27
31
  import { handleAddHolder } from "../utils";
32
+ import { buildCartHolderParams, getAppointmentCartHolderConfig } from "../../../../../utils/buildCartHolderParams";
33
+ import { getSkuRelationFormId, handleCartHolderFormSuccess } from "../../../../../utils/buildCartHolderParams";
28
34
  import "./index.less";
29
35
  var CartItem = function CartItem(_ref) {
30
36
  var _businessUtils$getApp, _businessUtils$getApp2, _currentStep$step, _currentStep$step2;
@@ -55,12 +61,34 @@ var CartItem = function CartItem(_ref) {
55
61
  isLogin = _useAppointmentBookin4.isLogin;
56
62
  var utils = contextUtils();
57
63
  var businessUtils = utils.businessUtils,
58
- translation = utils.translation;
64
+ translation = utils.translation,
65
+ pisellos = utils.pisellos;
59
66
  var taxTitle = summary.taxTitle,
60
67
  totalTaxFee = summary.totalTaxFee,
61
68
  isPriceIncludeTax = summary.isPriceIncludeTax,
62
69
  total = summary.total,
63
70
  deposit = summary.deposit;
71
+ var _useState = useState({}),
72
+ _useState2 = _slicedToArray(_useState, 2),
73
+ holderMap = _useState2[0],
74
+ setHolderMap = _useState2[1];
75
+ useEffect(function () {
76
+ var _pisellos$effects;
77
+ var onHolderChanged = function onHolderChanged(res) {
78
+ if ((res === null || res === void 0 ? void 0 : res.path) === 'holderMap') {
79
+ setHolderMap(res === null || res === void 0 ? void 0 : res.value);
80
+ }
81
+ };
82
+ pisellos === null || pisellos === void 0 || (_pisellos$effects = pisellos.effects) === null || _pisellos$effects === void 0 || _pisellos$effects.on('appointmentBooking_holder:changed', onHolderChanged);
83
+ return function () {
84
+ var _pisellos$effects2;
85
+ pisellos === null || pisellos === void 0 || (_pisellos$effects2 = pisellos.effects) === null || _pisellos$effects2 === void 0 || _pisellos$effects2.off('appointmentBooking_holder:changed', onHolderChanged);
86
+ };
87
+ }, []);
88
+ useEffect(function () {
89
+ var _holderMap = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getHolderFormMap()) || {};
90
+ setHolderMap(_holderMap);
91
+ }, []);
64
92
 
65
93
  /**
66
94
  * @title: 当前客户
@@ -149,35 +177,58 @@ var CartItem = function CartItem(_ref) {
149
177
 
150
178
  // 添加holder
151
179
  if (type === 'add_holder') {
180
+ var _e$_productInit;
152
181
  // 关联的表单id
153
182
  var relationShipFormId = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.relationship_form_id;
183
+ var formId = e === null || e === void 0 || (_e$_productInit = e._productInit) === null || _e$_productInit === void 0 || (_e$_productInit = _e$_productInit.holder_config) === null || _e$_productInit === void 0 ? void 0 : _e$_productInit.resource_id;
184
+ var skuRelationFormId = getSkuRelationFormId(holderMap, formId);
154
185
  return openForm({
155
- form_id: relationShipFormId || (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id),
186
+ form_id: skuRelationFormId || formId || relationShipFormId || (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id),
156
187
  title: locales.getText('pisell2.event.create.form'),
157
188
  utils: utils,
158
189
  callback: function () {
159
190
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
160
- var result;
191
+ var result, _handleCartHolderForm, formRecordId, mainField;
161
192
  return _regeneratorRuntime().wrap(function _callee$(_context) {
162
193
  while (1) switch (_context.prev = _context.next) {
163
194
  case 0:
164
195
  if (!((res === null || res === void 0 ? void 0 : res.status) === 'success')) {
165
- _context.next = 12;
196
+ _context.next = 16;
166
197
  break;
167
198
  }
168
- result = undefined; // 未关联表,则将接口返回的数据作为holder数据
199
+ result = undefined;
200
+ if (!formId) {
201
+ _context.next = 6;
202
+ break;
203
+ }
204
+ _handleCartHolderForm = handleCartHolderFormSuccess({
205
+ res: res,
206
+ formId: formId,
207
+ skuRelationFormId: skuRelationFormId,
208
+ utils: utils,
209
+ module: appointmentBooking
210
+ }), formRecordId = _handleCartHolderForm.formRecordId, mainField = _handleCartHolderForm.mainField;
211
+ appointmentBooking.updateCart({
212
+ _id: e === null || e === void 0 ? void 0 : e._id,
213
+ account: {
214
+ id: formRecordId,
215
+ username: mainField
216
+ }
217
+ });
218
+ return _context.abrupt("return");
219
+ case 6:
169
220
  if (relationShipFormId) {
170
- _context.next = 8;
221
+ _context.next = 12;
171
222
  break;
172
223
  }
173
- _context.next = 5;
224
+ _context.next = 9;
174
225
  return addAccount(res === null || res === void 0 ? void 0 : res.values, 'holder');
175
- case 5:
226
+ case 9:
176
227
  result = _context.sent;
177
- _context.next = 11;
228
+ _context.next = 15;
178
229
  break;
179
- case 8:
180
- _context.next = 10;
230
+ case 12:
231
+ _context.next = 14;
181
232
  return handleAddHolder({
182
233
  res: res,
183
234
  bookingSubject: bookingSubject,
@@ -186,9 +237,9 @@ var CartItem = function CartItem(_ref) {
186
237
  getHolders: getHolders,
187
238
  appointmentBooking: appointmentBooking
188
239
  });
189
- case 10:
240
+ case 14:
190
241
  result = _context.sent;
191
- case 11:
242
+ case 15:
192
243
  // 更新购物车的holder数据
193
244
  if (result) {
194
245
  appointmentBooking.updateCart({
@@ -196,7 +247,7 @@ var CartItem = function CartItem(_ref) {
196
247
  account: result
197
248
  });
198
249
  }
199
- case 12:
250
+ case 16:
200
251
  case "end":
201
252
  return _context.stop();
202
253
  }
@@ -212,11 +263,25 @@ var CartItem = function CartItem(_ref) {
212
263
  };
213
264
  var products = useMemo(function () {
214
265
  if (!(carts !== null && carts !== void 0 && carts.length)) return [];
215
- carts.forEach(function (item) {
216
- item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
266
+ var enrichedCarts = carts.map(function (item) {
267
+ // item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(
268
+ // item?._id
269
+ // );
270
+ // 是否是普通商品,本期普通商品不支持holder
271
+ var isNormalProduct = appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
272
+ var holderConfig = getAppointmentCartHolderConfig(item);
273
+ var formData = holderMap === null || holderMap === void 0 ? void 0 : holderMap[holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.resource_id];
274
+ var holderParams = buildCartHolderParams({
275
+ item: item,
276
+ holderConfig: holderConfig,
277
+ formData: formData,
278
+ translation: translation,
279
+ enabled: !isFormSubject ? false : !isNormalProduct
280
+ });
281
+ return _objectSpread(_objectSpread({}, item), holderParams);
217
282
  });
218
283
  if ((currentSelectedResources === null || currentSelectedResources === void 0 ? void 0 : currentSelectedResources.length) > 0) {
219
- var newCarts = carts.map(function (item) {
284
+ var newCarts = enrichedCarts.map(function (item) {
220
285
  var currentResourceData = currentSelectedResources.find(function (resource) {
221
286
  return (resource === null || resource === void 0 ? void 0 : resource._id) === (item === null || item === void 0 ? void 0 : item._id);
222
287
  });
@@ -225,15 +290,15 @@ var CartItem = function CartItem(_ref) {
225
290
  var multiResources = getMultiResources(item, currentResourceData === null || currentResourceData === void 0 ? void 0 : currentResourceData.currentSelectedResource, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key);
226
291
  return _objectSpread(_objectSpread({}, item), {}, {
227
292
  isMultipleResource: true,
228
- multiResources: multiResources,
229
- isErrorHolder: isErrorHolder || false
293
+ multiResources: multiResources
294
+ // isErrorHolder: isErrorHolder || false,
230
295
  });
231
296
  });
232
297
  return newCarts;
233
298
  } else {
234
- return carts;
299
+ return enrichedCarts;
235
300
  }
236
- }, [carts, currentSelectedResources, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, isErrorHolder]);
301
+ }, [carts, currentSelectedResources, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, isErrorHolder, holderMap, isFormSubject]);
237
302
 
238
303
  /**
239
304
  * @description: 结算列表数据
@@ -287,7 +352,9 @@ var CartItem = function CartItem(_ref) {
287
352
  isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-service',
288
353
  isShowPackageNote: false,
289
354
  isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
355
+ // isShowChangeHolder: isLastStep ? false : !isRetailTemplate && isLogin,
290
356
  isShowHolder: isFormSubject,
357
+ // isShowHolder: !isRetailTemplate,
291
358
  isShowAddHolderButton: true
292
359
  },
293
360
  collapseParams: {
@@ -44,7 +44,8 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
44
44
  setTimes = _ref.setTimes;
45
45
  var _useAppointmentBookin = useAppointmentBookingSetting(),
46
46
  isRetailTemplate = _useAppointmentBookin.isRetailTemplate,
47
- bookingSetting = _useAppointmentBookin.bookingSetting;
47
+ bookingSetting = _useAppointmentBookin.bookingSetting,
48
+ isFormSubject = _useAppointmentBookin.isFormSubject;
48
49
  console.log(bookingSetting, 'bookingSetting');
49
50
  var _Form$useForm = Form.useForm(),
50
51
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -282,21 +283,24 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
282
283
  */
283
284
  var onCheckout = /*#__PURE__*/function () {
284
285
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(extraData) {
285
- var deposit, _yield$appointmentBoo, data, _ref8, is_deposit, deposit_amount, total_amount, order_id, _total, freeResult;
286
+ var _extraData, deposit, _yield$appointmentBoo, data, _ref8, is_deposit, deposit_amount, total_amount, order_id, _total, freeResult;
286
287
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
287
288
  while (1) switch (_context5.prev = _context5.next) {
288
289
  case 0:
289
290
  _context5.prev = 0;
291
+ _extraData = _objectSpread(_objectSpread({}, extraData), {}, {
292
+ is_add_holder_info: isFormSubject
293
+ });
290
294
  deposit = summary.deposit;
291
- _context5.next = 4;
292
- return appointmentBooking.submitOrder(extraData);
293
- case 4:
295
+ _context5.next = 5;
296
+ return appointmentBooking.submitOrder(_extraData);
297
+ case 5:
294
298
  _yield$appointmentBoo = _context5.sent;
295
299
  data = _yield$appointmentBoo.data;
296
300
  _ref8 = data || {}, is_deposit = _ref8.is_deposit, deposit_amount = _ref8.deposit_amount, total_amount = _ref8.total_amount, order_id = _ref8.order_id; // 如果有定金,则支付定金金额,否则订单金额
297
301
  _total = is_deposit ? deposit_amount : total_amount;
298
302
  if (!(_total > 0)) {
299
- _context5.next = 13;
303
+ _context5.next = 14;
300
304
  break;
301
305
  }
302
306
  // 拉起支付弹窗
@@ -310,19 +314,19 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
310
314
  setTimeout(function () {
311
315
  setLoading(false);
312
316
  }, 200);
313
- _context5.next = 21;
317
+ _context5.next = 22;
314
318
  break;
315
- case 13:
319
+ case 14:
316
320
  if (!(deposit !== null && deposit !== void 0 && deposit.hasDeposit)) {
317
- _context5.next = 16;
321
+ _context5.next = 17;
318
322
  break;
319
323
  }
320
324
  goPaymentFinish(order_id, _total);
321
325
  return _context5.abrupt("return");
322
- case 16:
323
- _context5.next = 18;
326
+ case 17:
327
+ _context5.next = 19;
324
328
  return appointmentBooking.getFreeProduct(order_id);
325
- case 18:
329
+ case 19:
326
330
  freeResult = _context5.sent;
327
331
  console.log(freeResult, 'freeResult');
328
332
  if (freeResult !== null && freeResult !== void 0 && freeResult.status) {
@@ -330,28 +334,28 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
330
334
  } else {
331
335
  Toast(freeResult === null || freeResult === void 0 ? void 0 : freeResult.message);
332
336
  }
333
- case 21:
334
- _context5.next = 30;
337
+ case 22:
338
+ _context5.next = 31;
335
339
  break;
336
- case 23:
337
- _context5.prev = 23;
340
+ case 24:
341
+ _context5.prev = 24;
338
342
  _context5.t0 = _context5["catch"](0);
339
343
  if (!checkProductStock(productStockCheckModalRef, _context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.data, carts)) {
340
- _context5.next = 28;
344
+ _context5.next = 29;
341
345
  break;
342
346
  }
343
347
  setLoading(false);
344
348
  return _context5.abrupt("return");
345
- case 28:
349
+ case 29:
346
350
  Toast((_context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.message) || '');
347
351
  setTimeout(function () {
348
352
  setLoading(false);
349
353
  }, 50);
350
- case 30:
354
+ case 31:
351
355
  case "end":
352
356
  return _context5.stop();
353
357
  }
354
- }, _callee5, null, [[0, 23]]);
358
+ }, _callee5, null, [[0, 24]]);
355
359
  }));
356
360
  return function onCheckout(_x5) {
357
361
  return _ref7.apply(this, arguments);
@@ -7,16 +7,16 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
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
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
- import React, { useMemo, useRef } from 'react';
10
+ import React, { useMemo } from 'react';
11
11
  import { locales } from '@pisell/utils';
12
12
  import ProgressBar from "../../../eventBooking/components/progressBar";
13
13
  import { useAppointmentBookingContext } from "../../context";
14
- import { useShopDiscount, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct, contextUtils, useInterceptBrowserBack } from "../../hooks";
14
+ import { useShopDiscount, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct, contextUtils } from "../../hooks";
15
15
  import useEngineContext from "../../../../hooks/useEngineContext";
16
16
  import { getResourceTitle } from "../../utils";
17
17
  import "./index.less";
18
18
  var Header = function Header() {
19
- var _currentStep$step3, _currentStep$index;
19
+ var _currentStep$step3;
20
20
  var _ref = useAppointmentBookingContext(),
21
21
  currentStep = _ref.currentStep,
22
22
  appointmentBooking = _ref.appointmentBooking,
@@ -36,7 +36,6 @@ var Header = function Header() {
36
36
  var _useAppointmentBookin3 = useAppointmentBookingProduct(),
37
37
  checkProductType = _useAppointmentBookin3.checkProductType;
38
38
  var utils = contextUtils();
39
- var progressBarRef = useRef(null);
40
39
 
41
40
  /**
42
41
  * @title: 获取资源名称
@@ -186,25 +185,7 @@ var Header = function Header() {
186
185
  var utils = context.appHelper.utils || {};
187
186
  utils === null || utils === void 0 || (_utils$history = utils.history) === null || _utils$history === void 0 || _utils$history.replace('/');
188
187
  };
189
-
190
- /**
191
- * 移动端浏览器/系统返回键:逐步触发 handleBack,第一步时打开关闭确认弹窗。
192
- */
193
- var _useInterceptBrowserB = useInterceptBrowserBack({
194
- stepIndex: (_currentStep$index = currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) !== null && _currentStep$index !== void 0 ? _currentStep$index : 0,
195
- canGoBack: function canGoBack() {
196
- var _currentStep$index2;
197
- return ((_currentStep$index2 = currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) !== null && _currentStep$index2 !== void 0 ? _currentStep$index2 : 0) > 0;
198
- },
199
- onBack: handleBack,
200
- onExit: function onExit() {
201
- var _progressBarRef$curre;
202
- return (_progressBarRef$curre = progressBarRef.current) === null || _progressBarRef$curre === void 0 ? void 0 : _progressBarRef$curre.triggerClose();
203
- }
204
- }),
205
- restoreBackTrap = _useInterceptBrowserB.restoreBackTrap;
206
188
  return /*#__PURE__*/React.createElement(ProgressBar, {
207
- ref: progressBarRef,
208
189
  title: currentStep ? "".concat(locales.getText('pisell2.appointment.step')((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 1)) : '',
209
190
  description: stepName,
210
191
  showBack: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) > 0,
@@ -213,8 +194,7 @@ var Header = function Header() {
213
194
  },
214
195
  onClose: function onClose() {
215
196
  return handleClose();
216
- },
217
- onConfirmCancel: restoreBackTrap
197
+ }
218
198
  });
219
199
  };
220
200
  export default Header;
@@ -30,6 +30,7 @@ import "../../../booking/components/voucher/index.less";
30
30
  import { showDiscountScanFailMessage } from "../../../booking/utils";
31
31
  import "./index.less";
32
32
  import { useDebounceFn } from 'ahooks';
33
+ import { getCustomer } from "../../utils";
33
34
  var ShopDiscountHooks = {
34
35
  onInited: 'shopDiscount:onInited',
35
36
  onDestroy: 'shopDiscount:onDestroy',
@@ -292,7 +293,16 @@ var VoucherCard = function VoucherCard(props) {
292
293
  onClick: function onClick() {
293
294
  if (!action) return;
294
295
  openLoginModal({
296
+ data: {
297
+ type: 'plugin'
298
+ },
295
299
  callback: function callback(status) {
300
+ if (status === 'success') {
301
+ var customer = getCustomer(utils);
302
+ appointmentBooking === null || appointmentBooking === void 0 || appointmentBooking.refreshAllHolderFormRecords({
303
+ customer_id: customer === null || customer === void 0 ? void 0 : customer.id
304
+ });
305
+ }
296
306
  // const user = utils.store?.getState()?.global?.userInfo;
297
307
  // const currentUser = formatCustomer(user);
298
308
  // const meAccount = accountLists?.find((d: any) => !d?.isGuest);
@@ -46,6 +46,7 @@ export declare const useAppointmentBookingLogin: () => {
46
46
  isLogin: boolean;
47
47
  openLoginModal: (params: {
48
48
  callback: any;
49
+ data?: any;
49
50
  }) => void;
50
51
  };
51
52
  /**
@@ -105,20 +106,3 @@ export declare const useAppointmentBookingSetting: () => {
105
106
  formName: any;
106
107
  bookingSetting: any;
107
108
  };
108
- export interface UseInterceptBrowserBackOptions {
109
- /** 是否启用拦截,默认 true */
110
- enabled?: boolean;
111
- /** 当前步骤 index(0-based),用于同步 history 栈深度 */
112
- stepIndex: number;
113
- /** 是否还能在流程内后退(如 currentStep.index > 0) */
114
- canGoBack: () => boolean;
115
- /** 流程内后退,对应 Header.handleBack */
116
- onBack: () => void | Promise<void>;
117
- /** 已在第一步时的退出逻辑,对应 Header.handleClose */
118
- onExit?: () => void;
119
- }
120
- export interface UseInterceptBrowserBackResult {
121
- /** 系统返回触发退出确认但被取消时,补回 history trap */
122
- restoreBackTrap: () => void;
123
- }
124
- export declare const useInterceptBrowserBack: ({ enabled, stepIndex, canGoBack, onBack, onExit, }: UseInterceptBrowserBackOptions) => UseInterceptBrowserBackResult;