@pisell/private-materials 3.3.26 → 3.3.27

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 (205) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/Sales/Customer/index.js +3 -1
  12. package/es/components/Sales/Event/Detail.js +5 -1
  13. package/es/components/Sales/Event/serve.d.ts +3 -0
  14. package/es/components/Sales/Init/index.d.ts +1 -0
  15. package/es/components/Sales/Init/index.js +3 -2
  16. package/es/components/Sales/Step/index.d.ts +2 -0
  17. package/es/components/Sales/Step/index.js +13 -4
  18. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  19. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +5 -5
  20. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  21. package/es/components/appointmentBooking/components/Services/index.js +2 -0
  22. package/es/components/appointmentBooking/deposit/index.js +2 -2
  23. package/es/components/appointmentBooking/index.d.ts +1 -0
  24. package/es/components/booking/components/footer/utils.js +16 -15
  25. package/es/components/booking/hooks/useQuotation.d.ts +4 -0
  26. package/es/components/booking/hooks/useQuotation.js +256 -0
  27. package/es/components/booking/info/index.d.ts +0 -1
  28. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  29. package/es/components/booking/info/service/addService/index.js +4 -4
  30. package/es/components/booking/info/service/editService/index.js +6 -3
  31. package/es/components/booking/info/service/index.js +4 -1
  32. package/es/components/booking/info/service2/Group/utils.js +1 -1
  33. package/es/components/booking/info/service2/hooks/useSelectPet.js +6 -4
  34. package/es/components/booking/info/service2/index.js +4 -1
  35. package/es/components/booking/info2/service/addService/index.d.ts +1 -0
  36. package/es/components/booking/info2/service/addService/index.js +29 -9
  37. package/es/components/booking/info2/service/editService/index.js +2 -0
  38. package/es/components/booking/info2/service/index.js +4 -1
  39. package/es/components/booking/locales.d.ts +6 -0
  40. package/es/components/booking/locales.js +9 -3
  41. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  42. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  43. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  44. package/es/components/eftposPay/hooks.d.ts +1 -1
  45. package/es/components/eftposPay/index.d.ts +1 -0
  46. package/es/components/eftposPay/pay.d.ts +1 -0
  47. package/es/components/eftposPay/store/index.d.ts +1 -1
  48. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +122 -31
  49. package/es/components/eventBooking/components/Provider/Event/index.js +20 -4
  50. package/es/components/eventBooking/components/Provider/Resource/index.js +26 -5
  51. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.d.ts +2 -2
  52. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.js +1 -1
  53. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  54. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.js +5 -2
  55. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  56. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.js +7 -2
  57. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +3 -0
  58. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.js +60 -0
  59. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.less +63 -0
  60. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.d.ts +9 -0
  61. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.js +59 -0
  62. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.less +7 -0
  63. package/es/components/eventBooking/components/scheduleCalendar/index.d.ts +1 -0
  64. package/es/components/eventBooking/components/scheduleCalendar/index.js +30 -21
  65. package/es/components/eventBooking/components/scheduleCalendar/index.less +2 -0
  66. package/es/components/eventBooking/index.d.ts +1 -0
  67. package/es/components/eventBooking/index.js +2 -2
  68. package/es/components/eventBooking/locales.d.ts +6 -0
  69. package/es/components/eventBooking/locales.js +166 -160
  70. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +3 -0
  71. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.js +3 -2
  72. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  73. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +73 -20
  74. package/es/components/pay/toC/PaymentMethods/WalletPass/index.less +30 -0
  75. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +2 -0
  76. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -1
  77. package/es/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.d.ts +16 -0
  78. package/es/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.js +60 -0
  79. package/es/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.less +38 -0
  80. package/es/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.d.ts +17 -0
  81. package/es/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.js +98 -0
  82. package/es/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.less +133 -0
  83. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +7 -0
  84. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.js +34 -0
  85. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.less +23 -0
  86. package/es/components/pay/toC/WalletPassBlock/index.d.ts +9 -2
  87. package/es/components/pay/toC/WalletPassBlock/index.js +119 -21
  88. package/es/components/pay/toC/WalletPassBlock/index.less +82 -13
  89. package/es/components/pay/toC/index.js +138 -89
  90. package/es/components/pay/toC/locales.d.ts +69 -3
  91. package/es/components/pay/toC/locales.js +132 -6
  92. package/es/components/pay/toC/model.d.ts +4 -0
  93. package/es/components/pay/toC/model.js +9 -0
  94. package/es/components/pay/toC/serve.d.ts +23 -0
  95. package/es/components/pay/toC/serve.js +34 -2
  96. package/es/components/pay/toC/utils.d.ts +3 -1
  97. package/es/components/pay/toC/utils.js +8 -3
  98. package/es/components/productSelect/components/productGroup/index.less +4 -12
  99. package/es/components/productSelect/index.less +1 -1
  100. package/es/components/ruleSetting/index.d.ts +1 -0
  101. package/es/components/ticketBooking/components/addServiceVariant/addService.js +15 -20
  102. package/es/components/ticketBooking/components/menuBar/index.less +0 -1
  103. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -4
  104. package/es/hooks/useLocale.d.ts +2 -0
  105. package/es/hooks/useLocale.js +7 -0
  106. package/es/hooks/useLoginUser.d.ts +2 -0
  107. package/es/hooks/useLoginUser.js +19 -0
  108. package/lib/components/Sales/Customer/index.js +3 -1
  109. package/lib/components/Sales/Event/Detail.js +5 -1
  110. package/lib/components/Sales/Event/serve.d.ts +3 -0
  111. package/lib/components/Sales/Init/index.d.ts +1 -0
  112. package/lib/components/Sales/Init/index.js +3 -2
  113. package/lib/components/Sales/Step/index.d.ts +2 -0
  114. package/lib/components/Sales/Step/index.js +13 -4
  115. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  116. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +2 -2
  117. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  118. package/lib/components/appointmentBooking/components/Services/index.js +2 -0
  119. package/lib/components/appointmentBooking/deposit/index.js +2 -2
  120. package/lib/components/appointmentBooking/index.d.ts +1 -0
  121. package/lib/components/booking/components/footer/utils.js +5 -4
  122. package/lib/components/booking/hooks/useQuotation.d.ts +4 -0
  123. package/lib/components/booking/hooks/useQuotation.js +210 -0
  124. package/lib/components/booking/info/index.d.ts +0 -1
  125. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  126. package/lib/components/booking/info/service/addService/index.js +2 -3
  127. package/lib/components/booking/info/service/editService/index.js +5 -2
  128. package/lib/components/booking/info/service/index.js +3 -1
  129. package/lib/components/booking/info/service2/Group/utils.js +2 -2
  130. package/lib/components/booking/info/service2/hooks/useSelectPet.js +5 -3
  131. package/lib/components/booking/info/service2/index.js +3 -1
  132. package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
  133. package/lib/components/booking/info2/service/addService/index.js +25 -17
  134. package/lib/components/booking/info2/service/editService/index.js +2 -1
  135. package/lib/components/booking/info2/service/index.js +3 -1
  136. package/lib/components/booking/locales.d.ts +6 -0
  137. package/lib/components/booking/locales.js +9 -3
  138. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  139. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  140. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  141. package/lib/components/eftposPay/hooks.d.ts +1 -1
  142. package/lib/components/eftposPay/index.d.ts +1 -0
  143. package/lib/components/eftposPay/pay.d.ts +1 -0
  144. package/lib/components/eftposPay/store/index.d.ts +1 -1
  145. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +52 -4
  146. package/lib/components/eventBooking/components/Provider/Event/index.js +15 -3
  147. package/lib/components/eventBooking/components/Provider/Resource/index.js +16 -3
  148. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.d.ts +2 -2
  149. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.js +7 -7
  150. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  151. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.js +3 -1
  152. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  153. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.js +6 -5
  154. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +3 -0
  155. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.js +75 -0
  156. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.less +63 -0
  157. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.d.ts +9 -0
  158. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.js +64 -0
  159. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.less +7 -0
  160. package/lib/components/eventBooking/components/scheduleCalendar/index.d.ts +1 -0
  161. package/lib/components/eventBooking/components/scheduleCalendar/index.js +17 -11
  162. package/lib/components/eventBooking/components/scheduleCalendar/index.less +2 -0
  163. package/lib/components/eventBooking/index.d.ts +1 -0
  164. package/lib/components/eventBooking/index.js +2 -2
  165. package/lib/components/eventBooking/locales.d.ts +6 -0
  166. package/lib/components/eventBooking/locales.js +10 -4
  167. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +3 -0
  168. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.js +2 -2
  169. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  170. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +52 -11
  171. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.less +30 -0
  172. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +2 -0
  173. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -1
  174. package/lib/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.d.ts +16 -0
  175. package/lib/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.js +87 -0
  176. package/lib/components/pay/toC/WalletPassBlock/components/WalletAvailable/index.less +38 -0
  177. package/lib/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.d.ts +17 -0
  178. package/lib/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.js +103 -0
  179. package/lib/components/pay/toC/WalletPassBlock/components/WalletBestValueFound/index.less +133 -0
  180. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +7 -0
  181. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.js +52 -0
  182. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.less +23 -0
  183. package/lib/components/pay/toC/WalletPassBlock/index.d.ts +9 -2
  184. package/lib/components/pay/toC/WalletPassBlock/index.js +115 -20
  185. package/lib/components/pay/toC/WalletPassBlock/index.less +82 -13
  186. package/lib/components/pay/toC/index.js +35 -9
  187. package/lib/components/pay/toC/locales.d.ts +69 -3
  188. package/lib/components/pay/toC/locales.js +72 -6
  189. package/lib/components/pay/toC/model.d.ts +4 -0
  190. package/lib/components/pay/toC/model.js +10 -0
  191. package/lib/components/pay/toC/serve.d.ts +23 -0
  192. package/lib/components/pay/toC/serve.js +12 -6
  193. package/lib/components/pay/toC/utils.d.ts +3 -1
  194. package/lib/components/pay/toC/utils.js +8 -3
  195. package/lib/components/productSelect/components/productGroup/index.less +4 -12
  196. package/lib/components/productSelect/index.less +1 -1
  197. package/lib/components/ruleSetting/index.d.ts +1 -0
  198. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +13 -16
  199. package/lib/components/ticketBooking/components/menuBar/index.less +0 -1
  200. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -4
  201. package/lib/hooks/useLocale.d.ts +2 -0
  202. package/lib/hooks/useLocale.js +41 -0
  203. package/lib/hooks/useLoginUser.d.ts +2 -0
  204. package/lib/hooks/useLoginUser.js +50 -0
  205. package/package.json +3 -3
@@ -1,4 +1,9 @@
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
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
2
7
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
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); } }
4
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); }); }; }
@@ -15,9 +20,12 @@ import { useCart, useHolder, useStep, useCheckout, useSales, useCustomer } from
15
20
  import { formatValues } from "../../../../../Sales/Checkout/utils";
16
21
  import OrderProductModal from "../../OrderProductModal/index";
17
22
  import EmptyHolderModal from "../../EmptyHolderModal";
23
+ import { getEventDetailBookingOptionsApi } from "../../../../../Sales/Event/serve";
24
+ import { useRequest } from 'ahooks';
25
+ import useEngineContext from "../../../../../../hooks/useEngineContext";
18
26
  import "./index.less";
19
27
  var ContinueButton = function ContinueButton() {
20
- var _cartData$cartItems;
28
+ var _context$appHelper, _cartData$cartItems;
21
29
  var _useSales = useSales(),
22
30
  data = _useSales.data;
23
31
  var _useHolder = useHolder(),
@@ -55,7 +63,11 @@ var ContinueButton = function ContinueButton() {
55
63
  openEmptyHolder = _useState6[0],
56
64
  setOpenEmptyHolder = _useState6[1];
57
65
  var _useSales2 = useSales(),
66
+ setData = _useSales2.setData,
58
67
  removeSessionStorage = _useSales2.removeSessionStorage;
68
+ var context = useEngineContext();
69
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
70
+ store = _ref.store;
59
71
 
60
72
  /**
61
73
  * @title: 下单
@@ -65,7 +77,7 @@ var ContinueButton = function ContinueButton() {
65
77
  * @Date: 2025-02-10 17:54
66
78
  */
67
79
  var handleCheckout = /*#__PURE__*/function () {
68
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
80
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
69
81
  var value, result, _result$err;
70
82
  return _regeneratorRuntime().wrap(function _callee$(_context) {
71
83
  while (1) switch (_context.prev = _context.next) {
@@ -90,7 +102,67 @@ var ContinueButton = function ContinueButton() {
90
102
  }, _callee);
91
103
  }));
92
104
  return function handleCheckout() {
93
- return _ref.apply(this, arguments);
105
+ return _ref2.apply(this, arguments);
106
+ };
107
+ }();
108
+
109
+ /**
110
+ * 登录后根据返回商品价格更新cartItem price
111
+ */
112
+ var getEventDetailBookingOptions = useRequest(getEventDetailBookingOptionsApi, {
113
+ manual: true,
114
+ onSuccess: function onSuccess(res) {
115
+ var _res$data;
116
+ var list = ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [];
117
+ var productById = list.reduce(function (pre, cur) {
118
+ pre[cur.id] = cur;
119
+ return pre;
120
+ }, {});
121
+ var newCartItems = cartData.cartItems.map(function (item) {
122
+ var _ref3 = item._originData || {},
123
+ product = _ref3.product;
124
+ var newProduct = productById[product.product_id];
125
+ item.price = newProduct.price;
126
+ item.total = newProduct.price;
127
+ return item;
128
+ });
129
+ setData({
130
+ cartData: _objectSpread(_objectSpread({}, cartData), {}, {
131
+ cartItems: newCartItems
132
+ })
133
+ });
134
+ }
135
+ });
136
+ var getCartItemProductsWithQuotation = /*#__PURE__*/function () {
137
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
138
+ var _store$getState;
139
+ var ids, customer;
140
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
141
+ while (1) switch (_context2.prev = _context2.next) {
142
+ case 0:
143
+ ids = cartData.cartItems.map(function (item) {
144
+ var _ref5 = item._originData || {},
145
+ product = _ref5.product;
146
+ return product === null || product === void 0 ? void 0 : product.product_id;
147
+ }).filter(function (id) {
148
+ return !!id;
149
+ });
150
+ customer = store === null || store === void 0 || (_store$getState = store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 ? void 0 : _store$getState.userInfo;
151
+ getEventDetailBookingOptions.run({
152
+ ids: ids,
153
+ num: 100,
154
+ skip: 1,
155
+ customer_id: customer === null || customer === void 0 ? void 0 : customer.id,
156
+ open_quotation: 1
157
+ });
158
+ case 3:
159
+ case "end":
160
+ return _context2.stop();
161
+ }
162
+ }, _callee2);
163
+ }));
164
+ return function getCartItemProductsWithQuotation() {
165
+ return _ref4.apply(this, arguments);
94
166
  };
95
167
  }();
96
168
 
@@ -102,29 +174,29 @@ var ContinueButton = function ContinueButton() {
102
174
  * @Date: 2025-02-08 18:57
103
175
  */
104
176
  var handleNextStep = /*#__PURE__*/function () {
105
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
106
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
107
- while (1) switch (_context2.prev = _context2.next) {
177
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
178
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
179
+ while (1) switch (_context3.prev = _context3.next) {
108
180
  case 0:
109
181
  onCloseCart();
110
182
  setOpenEmptyHolder(false);
111
183
 
112
184
  // 如果当前是确认信息页面,则到结算页面
113
185
  if (!isLastStep) {
114
- _context2.next = 4;
186
+ _context3.next = 4;
115
187
  break;
116
188
  }
117
- return _context2.abrupt("return", handleCheckout());
189
+ return _context3.abrupt("return", handleCheckout());
118
190
  case 4:
119
191
  nextStep();
120
192
  case 5:
121
193
  case "end":
122
- return _context2.stop();
194
+ return _context3.stop();
123
195
  }
124
- }, _callee2);
196
+ }, _callee3);
125
197
  }));
126
198
  return function handleNextStep() {
127
- return _ref2.apply(this, arguments);
199
+ return _ref6.apply(this, arguments);
128
200
  };
129
201
  }();
130
202
 
@@ -159,62 +231,81 @@ var ContinueButton = function ContinueButton() {
159
231
  * @Date: 2025-01-16 16:30
160
232
  */
161
233
  var handleContinue = /*#__PURE__*/function () {
162
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
234
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
163
235
  var value, checkRes, emptyHolders;
164
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
165
- while (1) switch (_context3.prev = _context3.next) {
236
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
237
+ while (1) switch (_context5.prev = _context5.next) {
166
238
  case 0:
167
239
  if (!isLastStep) {
168
- _context3.next = 14;
240
+ _context5.next = 14;
169
241
  break;
170
242
  }
171
243
  value = formatValues(data); // 检测商品是否可以下单
172
- _context3.next = 4;
244
+ _context5.next = 4;
173
245
  return onCheckBeforeBooking(value);
174
246
  case 4:
175
- checkRes = _context3.sent;
247
+ checkRes = _context5.sent;
176
248
  if (!((checkRes === null || checkRes === void 0 ? void 0 : checkRes.result) === false)) {
177
- _context3.next = 9;
249
+ _context5.next = 9;
178
250
  break;
179
251
  }
180
252
  setCheckedNumber(checkRes === null || checkRes === void 0 ? void 0 : checkRes.num);
181
253
  setOpenCheckout(true);
182
- return _context3.abrupt("return");
254
+ return _context5.abrupt("return");
183
255
  case 9:
184
256
  // 验证holder是否为空
185
257
  emptyHolders = getWithoutCartItemsHolderNames();
186
258
  if (!((emptyHolders === null || emptyHolders === void 0 ? void 0 : emptyHolders.length) > 0)) {
187
- _context3.next = 12;
259
+ _context5.next = 12;
188
260
  break;
189
261
  }
190
- return _context3.abrupt("return", setOpenEmptyHolder(true));
262
+ return _context5.abrupt("return", setOpenEmptyHolder(true));
191
263
  case 12:
192
264
  // 关闭购物车弹窗
193
265
  onCloseCart();
194
- return _context3.abrupt("return", handleCheckout());
266
+ return _context5.abrupt("return", handleCheckout());
195
267
  case 14:
196
268
  if (isLogin()) {
197
- _context3.next = 17;
269
+ _context5.next = 17;
198
270
  break;
199
271
  }
200
272
  onCloseCart();
201
- return _context3.abrupt("return", openLoginModal({
202
- callback: function callback(status) {
203
- if (status === 'success') {
204
- handleHolder();
273
+ return _context5.abrupt("return", openLoginModal({
274
+ callback: function () {
275
+ var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(status) {
276
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
277
+ while (1) switch (_context4.prev = _context4.next) {
278
+ case 0:
279
+ if (!(status === 'success')) {
280
+ _context4.next = 4;
281
+ break;
282
+ }
283
+ _context4.next = 3;
284
+ return getCartItemProductsWithQuotation();
285
+ case 3:
286
+ handleHolder();
287
+ case 4:
288
+ case "end":
289
+ return _context4.stop();
290
+ }
291
+ }, _callee4);
292
+ }));
293
+ function callback(_x) {
294
+ return _callback.apply(this, arguments);
205
295
  }
206
- }
296
+ return callback;
297
+ }()
207
298
  }));
208
299
  case 17:
209
300
  handleHolder();
210
301
  case 18:
211
302
  case "end":
212
- return _context3.stop();
303
+ return _context5.stop();
213
304
  }
214
- }, _callee3);
305
+ }, _callee5);
215
306
  }));
216
307
  return function handleContinue() {
217
- return _ref3.apply(this, arguments);
308
+ return _ref7.apply(this, arguments);
218
309
  };
219
310
  }();
220
311
 
@@ -7,10 +7,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useState } from 'react';
8
8
  import { isMobile, locales } from '@pisell/utils';
9
9
  import { Skeleton } from 'antd';
10
- import { useEvent, useSales, useEventDetail } from "../../../../Sales";
10
+ import { useEvent, useSales, useEventDetail, useStep } from "../../../../Sales";
11
11
  import BookingServiceList from "../../bookingServiceList";
12
12
  import BookingDetailModal from "../../bookingDetailModal";
13
13
  import "./index.less";
14
+ import useLoginUser from "../../../../../hooks/useLoginUser";
14
15
  var Event = function Event() {
15
16
  var _data$resourceData2;
16
17
  var _useEvent = useEvent(),
@@ -20,6 +21,8 @@ var Event = function Event() {
20
21
  getEventListByTitle = _useEvent.getEventListByTitle;
21
22
  var _useSales = useSales(),
22
23
  data = _useSales.data;
24
+ var _useStep = useStep(),
25
+ changeAutoOperate = _useStep.changeAutoOperate;
23
26
  var _useEventDetail = useEventDetail(),
24
27
  onOpenEventDetail = _useEventDetail.onOpenEventDetail,
25
28
  open = _useEventDetail.open;
@@ -27,8 +30,19 @@ var Event = function Event() {
27
30
  _useState2 = _slicedToArray(_useState, 2),
28
31
  lists = _useState2[0],
29
32
  setLists = _useState2[1];
33
+ var customer = useLoginUser();
30
34
  useEffect(function () {
31
- setLists((eventData === null || eventData === void 0 ? void 0 : eventData.eventList) || []);
35
+ var _data$stepData;
36
+ var eventList = (eventData === null || eventData === void 0 ? void 0 : eventData.eventList) || [];
37
+ setLists(eventList);
38
+
39
+ // 如果只有一个event,则直接选择并打开详情
40
+ if ((eventList === null || eventList === void 0 ? void 0 : eventList.length) === 1 && data !== null && data !== void 0 && (_data$stepData = data.stepData) !== null && _data$stepData !== void 0 && _data$stepData.isAutoOperate) {
41
+ selectEvent(eventList[0]);
42
+ onOpenEventDetail(eventList[0]);
43
+ // 自动操作结束,防止刷新再次弹出来
44
+ changeAutoOperate(false);
45
+ }
32
46
  }, [eventData === null || eventData === void 0 ? void 0 : eventData.eventList]);
33
47
  useEffect(function () {
34
48
  var _data$resourceData;
@@ -37,9 +51,11 @@ var Event = function Event() {
37
51
  getEventList.run({
38
52
  event_item_resource_id: id,
39
53
  skip: 1,
40
- num: 100
54
+ num: 100,
55
+ customer_id: customer === null || customer === void 0 ? void 0 : customer.id,
56
+ open_quotation: 1
41
57
  });
42
- }, [data === null || data === void 0 || (_data$resourceData2 = data.resourceData) === null || _data$resourceData2 === void 0 || (_data$resourceData2 = _data$resourceData2.currentResourceItem) === null || _data$resourceData2 === void 0 ? void 0 : _data$resourceData2.id]);
58
+ }, [data === null || data === void 0 || (_data$resourceData2 = data.resourceData) === null || _data$resourceData2 === void 0 || (_data$resourceData2 = _data$resourceData2.currentResourceItem) === null || _data$resourceData2 === void 0 ? void 0 : _data$resourceData2.id, customer]);
43
59
 
44
60
  /**
45
61
  * @title: 点击选择event
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- import { PisellViewGrid } from '@pisell/materials';
1
+ import React, { useEffect } from 'react';
2
+ import { PisellViewGrid, Skeleton } from '@pisell/materials';
3
3
  import { isMobile, locales } from '@pisell/utils';
4
4
  import { useResource, useSales, useCart, useStep } from "../../../../Sales";
5
5
  import ResourceDisplay from "../../resourceDisplay";
6
6
  import { resourceTitle } from "../../../utils";
7
7
  import "./index.less";
8
8
  var Resource = function Resource() {
9
- var _data$resourceData;
9
+ var _data$resourceData2, _data$resourceData3, _data$resourceData4;
10
10
  var _useSales = useSales(),
11
11
  data = _useSales.data;
12
12
  var _useResource = useResource(),
@@ -16,6 +16,21 @@ var Resource = function Resource() {
16
16
  createCartItem = _useCart.createCartItem;
17
17
  var _useStep = useStep(),
18
18
  nextStep = _useStep.nextStep;
19
+ useEffect(function () {
20
+ var _data$resourceData, _resourceList$, _data$stepData;
21
+ var resourceList = (data === null || data === void 0 || (_data$resourceData = data.resourceData) === null || _data$resourceData === void 0 ? void 0 : _data$resourceData.resourceList) || [];
22
+ if ((resourceList === null || resourceList === void 0 ? void 0 : resourceList.length) <= 0) {
23
+ return;
24
+ }
25
+
26
+ // 如果只有一个资源,则直接选中并进入下一步
27
+ var resourceListChildren = (resourceList === null || resourceList === void 0 || (_resourceList$ = resourceList[0]) === null || _resourceList$ === void 0 ? void 0 : _resourceList$.children) || [];
28
+ if ((resourceList === null || resourceList === void 0 ? void 0 : resourceList.length) === 1 && (resourceListChildren === null || resourceListChildren === void 0 ? void 0 : resourceListChildren.length) === 1 && data !== null && data !== void 0 && (_data$stepData = data.stepData) !== null && _data$stepData !== void 0 && _data$stepData.isAutoOperate) {
29
+ createCartItem();
30
+ selectResource(resourceListChildren[0]);
31
+ nextStep();
32
+ }
33
+ }, [data === null || data === void 0 || (_data$resourceData2 = data.resourceData) === null || _data$resourceData2 === void 0 ? void 0 : _data$resourceData2.resourceList]);
19
34
 
20
35
  /**
21
36
  * @title: 选择资源
@@ -59,7 +74,13 @@ var Resource = function Resource() {
59
74
  className: "title"
60
75
  }, locales.getText('pisell2.event.select.campus')(resourceTitle(data))), /*#__PURE__*/React.createElement("div", {
61
76
  className: "content"
62
- }, data === null || data === void 0 || (_data$resourceData = data.resourceData) === null || _data$resourceData === void 0 || (_data$resourceData = _data$resourceData.resourceList) === null || _data$resourceData === void 0 ? void 0 : _data$resourceData.map(function (item, index) {
77
+ }, !(data !== null && data !== void 0 && (_data$resourceData3 = data.resourceData) !== null && _data$resourceData3 !== void 0 && (_data$resourceData3 = _data$resourceData3.resourceList) !== null && _data$resourceData3 !== void 0 && _data$resourceData3.length) ? /*#__PURE__*/React.createElement(Skeleton, {
78
+ loading: true,
79
+ active: true,
80
+ paragraph: {
81
+ rows: 3
82
+ }
83
+ }) : data === null || data === void 0 || (_data$resourceData4 = data.resourceData) === null || _data$resourceData4 === void 0 || (_data$resourceData4 = _data$resourceData4.resourceList) === null || _data$resourceData4 === void 0 ? void 0 : _data$resourceData4.map(function (item, index) {
63
84
  return /*#__PURE__*/React.createElement("div", {
64
85
  key: index,
65
86
  className: "content-item"
@@ -70,7 +91,7 @@ var Resource = function Resource() {
70
91
  columns: isMobile() ? 1 : 3,
71
92
  verticalGap: 20,
72
93
  horizontalGap: 20,
73
- loading: getResourceList.loading,
94
+ loading: false,
74
95
  renderItem: renderItem,
75
96
  className: "content-grid"
76
97
  }));
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import './index.less';
3
- declare const _default: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
4
  export default _default;
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  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; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { forwardRef, useImperativeHandle, useState, useRef } from 'react';
7
+ import React, { forwardRef, useImperativeHandle, useState, useRef } from 'react';
8
8
  import classNames from 'classnames';
9
9
  import dayjs from 'dayjs';
10
10
  import { Iconfont } from '@pisell/materials';
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Schedule: () => JSX.Element;
2
3
  export default Schedule;
@@ -2,9 +2,11 @@ import React from 'react';
2
2
  import OpenCard from "../../OpenCard";
3
3
  import { locales } from '@pisell/utils';
4
4
  import ScheduleCalendar from "../../scheduleCalendar";
5
- import { useEventDetail } from "../../../../Sales";
5
+ import { useEventDetail, useInit } from "../../../../Sales";
6
6
  var Schedule = function Schedule() {
7
7
  var _detail$selectDate;
8
+ var _useInit = useInit(),
9
+ initData = _useInit.initData;
8
10
  var _useEventDetail = useEventDetail(),
9
11
  detail = _useEventDetail.detail,
10
12
  getEventDetailSelectDate = _useEventDetail.getEventDetailSelectDate;
@@ -24,7 +26,8 @@ var Schedule = function Schedule() {
24
26
  days: 366,
25
27
  start_date: "".concat(e, "-01")
26
28
  });
27
- }
29
+ },
30
+ type: initData === null || initData === void 0 ? void 0 : initData.scheduleDisplayType
28
31
  }));
29
32
  };
30
33
  export default Schedule;
@@ -6,6 +6,7 @@ declare type CalendarItemProps = {
6
6
  onSelect: (date: string, item?: CalendarDataItem) => void;
7
7
  onChange: (date: string, type: string) => void;
8
8
  isEdit: boolean;
9
+ type?: 'calendarView' | 'textList';
9
10
  };
10
11
  declare const CalendarItem: (props: CalendarItemProps) => JSX.Element;
11
12
  export default CalendarItem;
@@ -6,6 +6,7 @@ import { formatBackgroundColors, formatMonthDisplay } from "../../utils";
6
6
  import useEngineContext from "../../../../hooks/useEngineContext";
7
7
  import zhCN from 'antd/es/date-picker/locale/zh_CN';
8
8
  import enUS from 'antd/es/date-picker/locale/en_US';
9
+ import ScheduleTimes from "./components/ScheduleTimes";
9
10
  var CalendarItem = function CalendarItem(props) {
10
11
  var _utils$storage;
11
12
  var month = props.month,
@@ -13,7 +14,8 @@ var CalendarItem = function CalendarItem(props) {
13
14
  selectDate = props.selectDate,
14
15
  onSelect = props.onSelect,
15
16
  isEdit = props.isEdit,
16
- onChange = props.onChange;
17
+ onChange = props.onChange,
18
+ type = props.type;
17
19
  var context = useEngineContext();
18
20
  var utils = context.appHelper.utils || {};
19
21
  var locale = utils !== null && utils !== void 0 && (_utils$storage = utils.storage) !== null && _utils$storage !== void 0 && (_utils$storage = _utils$storage.get('umi_locale')) !== null && _utils$storage !== void 0 && _utils$storage.includes('zh') ? zhCN : enUS;
@@ -60,7 +62,10 @@ var CalendarItem = function CalendarItem(props) {
60
62
  className: "calendar-month-icon"
61
63
  }, /*#__PURE__*/React.createElement(Iconfont, {
62
64
  type: "pisell2-chevron-right"
63
- }))), /*#__PURE__*/React.createElement(Calendar, {
65
+ }))), type === 'textList' ? /*#__PURE__*/React.createElement(ScheduleTimes, {
66
+ month: month,
67
+ schedulesData: schedulesData
68
+ }) : /*#__PURE__*/React.createElement(Calendar, {
64
69
  locale: locale,
65
70
  headerRender: function headerRender() {
66
71
  return null;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const ScheduleTimeItem: ({ timeList }: any) => JSX.Element;
3
+ export default ScheduleTimeItem;
@@ -0,0 +1,60 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useEffect, useState } from 'react';
8
+ import { Iconfont, PisellEmpty } from '@pisell/materials';
9
+ import { isMobile, locales } from '@pisell/utils';
10
+ import dayjs from 'dayjs';
11
+ import "./index.less";
12
+ var ScheduleTimeItem = function ScheduleTimeItem(_ref) {
13
+ var timeList = _ref.timeList;
14
+ var _useState = useState([]),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ times = _useState2[0],
17
+ setTimes = _useState2[1];
18
+ var _useState3 = useState(false),
19
+ _useState4 = _slicedToArray(_useState3, 2),
20
+ isExpand = _useState4[0],
21
+ setIsExpand = _useState4[1];
22
+ useEffect(function () {
23
+ // 如果times的长度大于4,则只取前4个,然后显示折叠按钮
24
+ if ((timeList === null || timeList === void 0 ? void 0 : timeList.length) > 4) {
25
+ setTimes(timeList === null || timeList === void 0 ? void 0 : timeList.slice(0, 4));
26
+ } else {
27
+ setTimes(timeList);
28
+ }
29
+ }, [timeList]);
30
+ var handleExpand = function handleExpand() {
31
+ var nextExpandStatus = !isExpand;
32
+ if (nextExpandStatus) {
33
+ setTimes(timeList);
34
+ } else {
35
+ setTimes(timeList === null || timeList === void 0 ? void 0 : timeList.slice(0, 4));
36
+ }
37
+ setIsExpand(nextExpandStatus);
38
+ };
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ className: "schedule-time-item"
41
+ }, /*#__PURE__*/React.createElement("div", {
42
+ className: "schedule-time-item-content-wrapper"
43
+ }, (times === null || times === void 0 ? void 0 : times.length) > 0 ? times === null || times === void 0 ? void 0 : times.map(function (item) {
44
+ return /*#__PURE__*/React.createElement("div", {
45
+ className: isMobile() ? 'schedule-time-item-content-mobile' : 'schedule-time-item-content',
46
+ key: (item.start_at || '') + (item.end_at || '')
47
+ }, /*#__PURE__*/React.createElement("div", {
48
+ className: "schedule-time-item-content-time"
49
+ }, (item === null || item === void 0 ? void 0 : item.start_date) || ''), /*#__PURE__*/React.createElement("div", {
50
+ className: "schedule-time-item-content-time"
51
+ }, dayjs((item === null || item === void 0 ? void 0 : item.start_at) || '').format('HH:mm'), ' - ', dayjs((item === null || item === void 0 ? void 0 : item.end_at) || '').format('HH:mm')));
52
+ }) : /*#__PURE__*/React.createElement(PisellEmpty, null)), (timeList === null || timeList === void 0 ? void 0 : timeList.length) > 4 && /*#__PURE__*/React.createElement("div", {
53
+ className: "schedule-time-item-expand-btn",
54
+ onClick: handleExpand
55
+ }, isExpand ? locales.getText('pisell2.event.schedule.item.collapse') : locales.getText('pisell2.event.schedule.item.expand'), /*#__PURE__*/React.createElement(Iconfont, {
56
+ type: isExpand ? 'pisell2-chevron-up-double' : 'pisell2-chevron-down-double',
57
+ className: "schedule-time-item-expand-btn-icon"
58
+ })));
59
+ };
60
+ export default ScheduleTimeItem;
@@ -0,0 +1,63 @@
1
+ .schedule-time-item {
2
+ width: 100%;
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 16px;
6
+
7
+ .schedule-time-item-content-wrapper {
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ gap: 16px;
11
+ }
12
+
13
+ .schedule-time-item-content-mobile {
14
+ width: 100%;
15
+ padding: 14px 16px;
16
+ display: flex;
17
+ flex-direction: row;
18
+ align-items: center;
19
+ justify-content: flex-start;
20
+ border-radius: 8px;
21
+ border: 1px solid #f5f5f5;
22
+ background: #fff;
23
+ gap: 8px;
24
+ }
25
+
26
+ .schedule-time-item-content {
27
+ width: calc(50% - 8px);
28
+ padding: 14px 16px;
29
+ display: flex;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ justify-content: center;
33
+ border-radius: 8px;
34
+ border: 1px solid #f5f5f5;
35
+ background: #fff;
36
+
37
+ .schedule-time-item-content-time {
38
+ color: #141414;
39
+ text-align: center;
40
+ font-size: 14px;
41
+ font-weight: 600;
42
+ }
43
+ }
44
+
45
+ .schedule-time-item-expand-btn {
46
+ display: flex;
47
+ flex: 1 0 0;
48
+ height: 48px;
49
+ padding: 14px 16px;
50
+ justify-content: center;
51
+ align-items: center;
52
+ gap: 8px;
53
+ border-radius: 8px;
54
+ border: 1px solid #f5f5f5;
55
+ background: #fff;
56
+ cursor: pointer;
57
+
58
+ .schedule-time-item-expand-btn-icon {
59
+ margin-top: 2px;
60
+ font-size: 20px;
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ import { CalendarDataItem } from '../../../../type';
4
+ interface ScheduleTimesProps {
5
+ month: string;
6
+ schedulesData: CalendarDataItem[];
7
+ }
8
+ declare const ScheduleTimes: React.FC<ScheduleTimesProps>;
9
+ export default ScheduleTimes;