@pisell/private-materials 6.3.177 → 6.3.179

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 (213) 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 +90 -24
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +24 -20
  12. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Header/index.js +4 -24
  14. package/es/components/appointmentBooking/components/Voucher/index.js +10 -0
  15. package/es/components/appointmentBooking/hooks.d.ts +1 -17
  16. package/es/components/appointmentBooking/hooks.js +55 -128
  17. package/es/components/appointmentBooking/utils.d.ts +1 -0
  18. package/es/components/appointmentBooking/utils.js +54 -33
  19. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  20. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  21. package/es/components/booking/forms/table/index.d.ts +1 -0
  22. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  23. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  24. package/es/components/booking/info/index.d.ts +1 -0
  25. package/es/components/booking/info/service/like/index.d.ts +1 -0
  26. package/es/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
  27. package/es/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
  28. package/es/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
  29. package/es/components/eftpos/SettlementModal/Action.d.ts +1 -0
  30. package/es/components/eftpos/SettlementModal/index.d.ts +1 -0
  31. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  32. package/es/components/eftpos/form/index.d.ts +1 -0
  33. package/es/components/eftpos/group/index.d.ts +1 -0
  34. package/es/components/eftpos/hooks.d.ts +1 -0
  35. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  36. package/es/components/eftpos/icon/device.d.ts +1 -0
  37. package/es/components/eftpos/receipt/index.d.ts +1 -0
  38. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  39. package/es/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
  40. package/es/components/eftposPay/app.d.ts +1 -0
  41. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  42. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  43. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  44. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  45. package/es/components/eftposPay/device.js +4 -11
  46. package/es/components/eftposPay/hooks.d.ts +1 -1
  47. package/es/components/eftposPay/mx51/Action.d.ts +1 -0
  48. package/es/components/eftposPay/store/index.d.ts +1 -1
  49. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  50. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  51. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  52. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  53. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  54. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  55. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  56. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  57. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  58. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  59. package/es/components/eventBooking/components/progressBar/index.d.ts +1 -8
  60. package/es/components/eventBooking/components/progressBar/index.js +10 -30
  61. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  62. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  63. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  64. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  65. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  66. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  67. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  68. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  69. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  70. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/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/scanOrder/components/Check/index.js +46 -187
  74. package/es/components/scanOrder/components/Check/index.less +0 -39
  75. package/es/components/scanOrder/components/Content/index.js +72 -189
  76. package/es/components/scanOrder/components/Menu/index.js +5 -11
  77. package/es/components/scanOrder/hooks.js +0 -7
  78. package/es/components/scanOrder/locales.d.ts +0 -75
  79. package/es/components/scanOrder/locales.js +0 -75
  80. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  81. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  82. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  83. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  84. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  85. package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  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/systemSettings/registry/components/DataSourceTreeSelect/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 +165 -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/components/workSpaceList/components/Modal/index.d.ts +1 -0
  96. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  97. package/es/plus/clientName/index.d.ts +1 -0
  98. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
  99. package/es/plus/orderList/components/HandleActions.d.ts +1 -0
  100. package/es/plus/orderList/components/QuickFilter.d.ts +1 -0
  101. package/es/plus/orderList/components/Reset.d.ts +1 -0
  102. package/es/plus/orderList/components/Toolbar.d.ts +1 -0
  103. package/es/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +1 -0
  104. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  105. package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
  106. package/es/pro/Login2.0/locales.js +1 -1
  107. package/es/pro/Selector/demo.d.ts +1 -0
  108. package/es/pro/pisellPaymentList/example.d.ts +1 -0
  109. package/es/utils/buildCartHolderParams.d.ts +97 -0
  110. package/es/utils/buildCartHolderParams.js +200 -0
  111. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  112. package/lib/components/appointmentBooking/components/Cart/Item/index.js +70 -9
  113. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +6 -2
  114. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  115. package/lib/components/appointmentBooking/components/Header/index.js +1 -13
  116. package/lib/components/appointmentBooking/components/Voucher/index.js +10 -0
  117. package/lib/components/appointmentBooking/hooks.d.ts +1 -17
  118. package/lib/components/appointmentBooking/hooks.js +17 -91
  119. package/lib/components/appointmentBooking/utils.d.ts +1 -0
  120. package/lib/components/appointmentBooking/utils.js +24 -13
  121. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  122. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  123. package/lib/components/booking/forms/table/index.d.ts +1 -0
  124. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  125. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  126. package/lib/components/booking/info/index.d.ts +1 -0
  127. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  128. package/lib/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
  129. package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
  130. package/lib/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
  131. package/lib/components/eftpos/SettlementModal/Action.d.ts +1 -0
  132. package/lib/components/eftpos/SettlementModal/index.d.ts +1 -0
  133. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  134. package/lib/components/eftpos/form/index.d.ts +1 -0
  135. package/lib/components/eftpos/group/index.d.ts +1 -0
  136. package/lib/components/eftpos/hooks.d.ts +1 -0
  137. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  138. package/lib/components/eftpos/icon/device.d.ts +1 -0
  139. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  140. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  141. package/lib/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
  142. package/lib/components/eftposPay/app.d.ts +1 -0
  143. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  144. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  145. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  146. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  147. package/lib/components/eftposPay/device.js +4 -6
  148. package/lib/components/eftposPay/hooks.d.ts +1 -1
  149. package/lib/components/eftposPay/mx51/Action.d.ts +1 -0
  150. package/lib/components/eftposPay/store/index.d.ts +1 -1
  151. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  152. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  153. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  154. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  155. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  156. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  157. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  158. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  159. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  160. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  161. package/lib/components/eventBooking/components/progressBar/index.d.ts +1 -8
  162. package/lib/components/eventBooking/components/progressBar/index.js +9 -29
  163. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  164. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  165. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  166. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  167. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  168. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  169. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  170. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  171. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  172. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  173. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  174. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  175. package/lib/components/scanOrder/components/Check/index.js +3 -116
  176. package/lib/components/scanOrder/components/Check/index.less +0 -39
  177. package/lib/components/scanOrder/components/Content/index.js +25 -106
  178. package/lib/components/scanOrder/components/Menu/index.js +0 -2
  179. package/lib/components/scanOrder/hooks.js +0 -7
  180. package/lib/components/scanOrder/locales.d.ts +0 -75
  181. package/lib/components/scanOrder/locales.js +0 -75
  182. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  183. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  184. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  185. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  186. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  187. package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  188. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  189. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  190. package/lib/components/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +1 -0
  191. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  192. package/lib/components/venueBooking/components/Cart/index.js +93 -14
  193. package/lib/components/venueBooking/components/Voucher/index.js +1 -5
  194. package/lib/components/venueBooking/context.js +12 -2
  195. package/lib/components/venueBooking/locales.d.ts +5 -0
  196. package/lib/components/venueBooking/locales.js +10 -5
  197. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  198. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  199. package/lib/plus/clientName/index.d.ts +1 -0
  200. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
  201. package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
  202. package/lib/plus/orderList/components/QuickFilter.d.ts +1 -0
  203. package/lib/plus/orderList/components/Reset.d.ts +1 -0
  204. package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
  205. package/lib/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +1 -0
  206. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  207. package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
  208. package/lib/pro/Login2.0/locales.js +1 -1
  209. package/lib/pro/Selector/demo.d.ts +1 -0
  210. package/lib/pro/pisellPaymentList/example.d.ts +1 -0
  211. package/lib/utils/buildCartHolderParams.d.ts +97 -0
  212. package/lib/utils/buildCartHolderParams.js +172 -0
  213. 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,7 @@ 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, getSkuRelationFormId, handleCartHolderFormSuccess, isHolderConfigEnabled } from "../../../../../utils/buildCartHolderParams";
28
33
  import "./index.less";
29
34
  var CartItem = function CartItem(_ref) {
30
35
  var _businessUtils$getApp, _businessUtils$getApp2, _currentStep$step, _currentStep$step2;
@@ -55,12 +60,34 @@ var CartItem = function CartItem(_ref) {
55
60
  isLogin = _useAppointmentBookin4.isLogin;
56
61
  var utils = contextUtils();
57
62
  var businessUtils = utils.businessUtils,
58
- translation = utils.translation;
63
+ translation = utils.translation,
64
+ pisellos = utils.pisellos;
59
65
  var taxTitle = summary.taxTitle,
60
66
  totalTaxFee = summary.totalTaxFee,
61
67
  isPriceIncludeTax = summary.isPriceIncludeTax,
62
68
  total = summary.total,
63
69
  deposit = summary.deposit;
70
+ var _useState = useState({}),
71
+ _useState2 = _slicedToArray(_useState, 2),
72
+ holderMap = _useState2[0],
73
+ setHolderMap = _useState2[1];
74
+ useEffect(function () {
75
+ var _pisellos$effects;
76
+ var onHolderChanged = function onHolderChanged(res) {
77
+ if ((res === null || res === void 0 ? void 0 : res.path) === 'holderMap') {
78
+ setHolderMap(res === null || res === void 0 ? void 0 : res.value);
79
+ }
80
+ };
81
+ pisellos === null || pisellos === void 0 || (_pisellos$effects = pisellos.effects) === null || _pisellos$effects === void 0 || _pisellos$effects.on('appointmentBooking_holder:changed', onHolderChanged);
82
+ return function () {
83
+ var _pisellos$effects2;
84
+ pisellos === null || pisellos === void 0 || (_pisellos$effects2 = pisellos.effects) === null || _pisellos$effects2 === void 0 || _pisellos$effects2.off('appointmentBooking_holder:changed', onHolderChanged);
85
+ };
86
+ }, []);
87
+ useEffect(function () {
88
+ var _holderMap = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getHolderFormMap()) || {};
89
+ setHolderMap(_holderMap);
90
+ }, []);
64
91
 
65
92
  /**
66
93
  * @title: 当前客户
@@ -151,33 +178,56 @@ var CartItem = function CartItem(_ref) {
151
178
  if (type === 'add_holder') {
152
179
  // 关联的表单id
153
180
  var relationShipFormId = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.relationship_form_id;
181
+ var holderConfig = getAppointmentCartHolderConfig(e);
182
+ var formId = isHolderConfigEnabled(holderConfig) ? holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.resource_id : undefined;
183
+ var skuRelationFormId = getSkuRelationFormId(holderMap, formId);
154
184
  return openForm({
155
- form_id: relationShipFormId || (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id),
185
+ form_id: skuRelationFormId || formId || relationShipFormId || (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id),
156
186
  title: locales.getText('pisell2.event.create.form'),
157
187
  utils: utils,
158
188
  callback: function () {
159
189
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
160
- var result;
190
+ var result, _handleCartHolderForm, formRecordId, mainField;
161
191
  return _regeneratorRuntime().wrap(function _callee$(_context) {
162
192
  while (1) switch (_context.prev = _context.next) {
163
193
  case 0:
164
194
  if (!((res === null || res === void 0 ? void 0 : res.status) === 'success')) {
165
- _context.next = 12;
195
+ _context.next = 16;
166
196
  break;
167
197
  }
168
- result = undefined; // 未关联表,则将接口返回的数据作为holder数据
198
+ result = undefined;
199
+ if (!formId) {
200
+ _context.next = 6;
201
+ break;
202
+ }
203
+ _handleCartHolderForm = handleCartHolderFormSuccess({
204
+ res: res,
205
+ formId: formId,
206
+ skuRelationFormId: skuRelationFormId,
207
+ utils: utils,
208
+ module: appointmentBooking
209
+ }), formRecordId = _handleCartHolderForm.formRecordId, mainField = _handleCartHolderForm.mainField;
210
+ appointmentBooking.updateCart({
211
+ _id: e === null || e === void 0 ? void 0 : e._id,
212
+ account: {
213
+ id: formRecordId,
214
+ username: mainField
215
+ }
216
+ });
217
+ return _context.abrupt("return");
218
+ case 6:
169
219
  if (relationShipFormId) {
170
- _context.next = 8;
220
+ _context.next = 12;
171
221
  break;
172
222
  }
173
- _context.next = 5;
223
+ _context.next = 9;
174
224
  return addAccount(res === null || res === void 0 ? void 0 : res.values, 'holder');
175
- case 5:
225
+ case 9:
176
226
  result = _context.sent;
177
- _context.next = 11;
227
+ _context.next = 15;
178
228
  break;
179
- case 8:
180
- _context.next = 10;
229
+ case 12:
230
+ _context.next = 14;
181
231
  return handleAddHolder({
182
232
  res: res,
183
233
  bookingSubject: bookingSubject,
@@ -186,9 +236,9 @@ var CartItem = function CartItem(_ref) {
186
236
  getHolders: getHolders,
187
237
  appointmentBooking: appointmentBooking
188
238
  });
189
- case 10:
239
+ case 14:
190
240
  result = _context.sent;
191
- case 11:
241
+ case 15:
192
242
  // 更新购物车的holder数据
193
243
  if (result) {
194
244
  appointmentBooking.updateCart({
@@ -196,7 +246,7 @@ var CartItem = function CartItem(_ref) {
196
246
  account: result
197
247
  });
198
248
  }
199
- case 12:
249
+ case 16:
200
250
  case "end":
201
251
  return _context.stop();
202
252
  }
@@ -212,11 +262,25 @@ var CartItem = function CartItem(_ref) {
212
262
  };
213
263
  var products = useMemo(function () {
214
264
  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);
265
+ var enrichedCarts = carts.map(function (item) {
266
+ // item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(
267
+ // item?._id
268
+ // );
269
+ // 是否是普通商品,本期普通商品不支持holder
270
+ var isNormalProduct = appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
271
+ var holderConfig = getAppointmentCartHolderConfig(item);
272
+ var formData = isHolderConfigEnabled(holderConfig) ? holderMap === null || holderMap === void 0 ? void 0 : holderMap[holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.resource_id] : {};
273
+ var holderParams = buildCartHolderParams({
274
+ item: item,
275
+ holderConfig: holderConfig,
276
+ formData: formData,
277
+ translation: translation,
278
+ enabled: !isFormSubject ? false : !isNormalProduct
279
+ });
280
+ return _objectSpread(_objectSpread({}, item), holderParams);
217
281
  });
218
282
  if ((currentSelectedResources === null || currentSelectedResources === void 0 ? void 0 : currentSelectedResources.length) > 0) {
219
- var newCarts = carts.map(function (item) {
283
+ var newCarts = enrichedCarts.map(function (item) {
220
284
  var currentResourceData = currentSelectedResources.find(function (resource) {
221
285
  return (resource === null || resource === void 0 ? void 0 : resource._id) === (item === null || item === void 0 ? void 0 : item._id);
222
286
  });
@@ -225,15 +289,15 @@ var CartItem = function CartItem(_ref) {
225
289
  var multiResources = getMultiResources(item, currentResourceData === null || currentResourceData === void 0 ? void 0 : currentResourceData.currentSelectedResource, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key);
226
290
  return _objectSpread(_objectSpread({}, item), {}, {
227
291
  isMultipleResource: true,
228
- multiResources: multiResources,
229
- isErrorHolder: isErrorHolder || false
292
+ multiResources: multiResources
293
+ // isErrorHolder: isErrorHolder || false,
230
294
  });
231
295
  });
232
296
  return newCarts;
233
297
  } else {
234
- return carts;
298
+ return enrichedCarts;
235
299
  }
236
- }, [carts, currentSelectedResources, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, isErrorHolder]);
300
+ }, [carts, currentSelectedResources, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, isErrorHolder, holderMap, isFormSubject]);
237
301
 
238
302
  /**
239
303
  * @description: 结算列表数据
@@ -287,7 +351,9 @@ var CartItem = function CartItem(_ref) {
287
351
  isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-service',
288
352
  isShowPackageNote: false,
289
353
  isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
354
+ // isShowChangeHolder: isLastStep ? false : !isRetailTemplate && isLogin,
290
355
  isShowHolder: isFormSubject,
356
+ // isShowHolder: !isRetailTemplate,
291
357
  isShowAddHolderButton: true
292
358
  },
293
359
  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);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const GuestOptionsModal: (props: any) => JSX.Element;
3
4
  export default GuestOptionsModal;
@@ -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;