@pisell/private-materials 6.2.9 → 6.2.11

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 (240) 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 +2 -2
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/businessModel/SalesModel/index.d.ts +1 -0
  12. package/es/components/appointmentBooking/components/Cart/utils.js +8 -13
  13. package/es/components/appointmentBooking/components/Content/index.js +87 -8
  14. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  16. package/es/components/appointmentBooking/components/Services/index.js +7 -2
  17. package/es/components/appointmentBooking/components/Voucher/index.js +10 -10
  18. package/es/components/appointmentBooking/hooks.js +28 -30
  19. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  20. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  21. package/es/components/booking/components/browserSelect/index.js +1 -1
  22. package/es/components/booking/components/customSelect/index.js +1 -0
  23. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  24. package/es/components/booking/forms/model.js +5 -5
  25. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  26. package/es/components/booking/forms/table/index.d.ts +1 -0
  27. package/es/components/booking/hooks/useClearCart.js +11 -8
  28. package/es/components/booking/info/client/index.js +3 -2
  29. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  30. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  31. package/es/components/booking/info/hooks/useInfoHolder.js +16 -9
  32. package/es/components/booking/info/service/Lists.js +36 -26
  33. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  34. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  35. package/es/components/booking/info/service/like/index.d.ts +1 -0
  36. package/es/components/booking/info/service/like/index.js +1 -1
  37. package/es/components/booking/info/service2/utils.js +20 -21
  38. package/es/components/booking/info2/index.js +1 -0
  39. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  40. package/es/components/booking/info2/service/addService/utils.js +6 -3
  41. package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
  42. package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
  43. package/es/components/booking/info2/service/editService/index.js +258 -165
  44. package/es/components/booking/info2/service/index.js +19 -15
  45. package/es/components/booking/materiels/duration/index.js +9 -2
  46. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  47. package/es/components/booking/materiels/startTime/index.js +1 -1
  48. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  49. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  50. package/es/components/booking/notes/model.js +5 -5
  51. package/es/components/booking/payments/model.js +5 -5
  52. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  53. package/es/components/eftpos/form/index.d.ts +1 -0
  54. package/es/components/eftpos/group/index.d.ts +1 -0
  55. package/es/components/eftpos/hooks.d.ts +1 -0
  56. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  57. package/es/components/eftpos/icon/device.d.ts +1 -0
  58. package/es/components/eftpos/receipt/index.d.ts +1 -0
  59. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  60. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  61. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  62. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  63. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  64. package/es/components/eftposPay/hooks.d.ts +2 -2
  65. package/es/components/eftposPay/store/index.d.ts +3 -3
  66. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  67. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  68. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  69. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  70. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  71. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  72. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  73. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  74. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  76. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  77. package/es/components/listComponent/index.js +5 -5
  78. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  79. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  80. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  81. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  82. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  83. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  84. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  85. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  86. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  87. package/es/components/productExtension/card/index.js +3 -3
  88. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  89. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  90. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  91. package/es/components/productExtension/fields/Forms/index.js +12 -12
  92. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  93. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  94. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  95. package/es/components/productExtension/server.js +2 -2
  96. package/es/components/productSelect/components/TabProduct/index.js +103 -39
  97. package/es/components/productSelect/components/TabProduct/tabs/index.less +1 -0
  98. package/es/components/productSelect/index.d.ts +2 -0
  99. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  100. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  101. package/es/components/schedules/calendar/index.js +4 -4
  102. package/es/components/schedules/calendar/serve.js +2 -2
  103. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  104. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  105. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  106. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  107. package/es/components/schedules/components/ResourceList/index.js +1 -1
  108. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  109. package/es/components/schedules/components/Search/index.js +5 -5
  110. package/es/components/schedules/model.js +5 -5
  111. package/es/components/schedules/openHours/index.js +1 -1
  112. package/es/components/schedules/openHours/serve.js +2 -2
  113. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  114. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  115. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  116. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  117. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  118. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  119. package/es/components/schedules/products/index.d.ts +1 -0
  120. package/es/components/schedules/products/serve.js +2 -2
  121. package/es/components/schedules/products/utils.js +5 -5
  122. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  123. package/es/components/schedules/resources/detail/index.js +10 -10
  124. package/es/components/schedules/resources/list/index.js +2 -2
  125. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  126. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  127. package/es/components/schedules/resources/serve.js +2 -2
  128. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  129. package/es/components/schedules/utils.js +4 -4
  130. package/es/components/selectModal/index.js +2 -2
  131. package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  132. package/es/components/shoppingCart/components/Cart/Product.js +48 -41
  133. package/es/components/shoppingCart/components/Cart/index.js +21 -18
  134. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  135. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  136. package/es/components/ticketBooking/components/addServiceVariant/addService.js +175 -157
  137. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  138. package/es/components/ticketBooking/components/menuBar/index.js +38 -2
  139. package/es/components/ticketBooking/components/menuBar/index.less +8 -0
  140. package/es/components/ticketBooking/components/timeBar/index.js +78 -71
  141. package/es/components/ticketBooking/locales.d.ts +3 -0
  142. package/es/components/ticketBooking/locales.js +6 -3
  143. package/es/components/walletList/index.js +4 -4
  144. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  145. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  146. package/es/hooks/useComponents.js +1 -1
  147. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  148. package/lib/components/appointmentBooking/components/Cart/utils.js +0 -10
  149. package/lib/components/appointmentBooking/components/Content/index.js +44 -7
  150. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  151. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  152. package/lib/components/appointmentBooking/components/Services/index.js +6 -1
  153. package/lib/components/appointmentBooking/components/Voucher/index.js +0 -11
  154. package/lib/components/appointmentBooking/hooks.js +5 -16
  155. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  156. package/lib/components/booking/components/customSelect/index.js +1 -0
  157. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  158. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  159. package/lib/components/booking/forms/table/index.d.ts +1 -0
  160. package/lib/components/booking/hooks/useClearCart.js +16 -13
  161. package/lib/components/booking/info/client/index.js +5 -4
  162. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  163. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  164. package/lib/components/booking/info/hooks/useInfoHolder.js +10 -9
  165. package/lib/components/booking/info/service/Lists.js +35 -23
  166. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  167. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  168. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  169. package/lib/components/booking/info/service2/utils.js +17 -17
  170. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  171. package/lib/components/booking/info2/service/addService/utils.js +4 -2
  172. package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
  173. package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
  174. package/lib/components/booking/info2/service/editService/index.js +132 -70
  175. package/lib/components/booking/info2/service/index.js +13 -9
  176. package/lib/components/booking/materiels/duration/index.js +7 -2
  177. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  178. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  179. package/lib/components/eftpos/form/index.d.ts +1 -0
  180. package/lib/components/eftpos/group/index.d.ts +1 -0
  181. package/lib/components/eftpos/hooks.d.ts +1 -0
  182. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  183. package/lib/components/eftpos/icon/device.d.ts +1 -0
  184. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  185. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  186. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  187. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  188. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  189. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  190. package/lib/components/eftposPay/hooks.d.ts +2 -2
  191. package/lib/components/eftposPay/store/index.d.ts +3 -3
  192. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  193. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  194. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  195. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  196. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  197. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  198. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  199. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  200. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  201. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  202. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  203. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  204. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  205. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  206. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  207. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  208. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  209. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  210. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  211. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  212. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  213. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  214. package/lib/components/productSelect/components/TabProduct/index.js +74 -37
  215. package/lib/components/productSelect/components/TabProduct/tabs/index.less +1 -0
  216. package/lib/components/productSelect/index.d.ts +2 -0
  217. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  218. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  219. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  220. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  221. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  222. package/lib/components/schedules/products/index.d.ts +1 -0
  223. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  224. package/lib/components/schedules/utils.js +1 -1
  225. package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  226. package/lib/components/shoppingCart/components/Cart/Product.js +31 -21
  227. package/lib/components/shoppingCart/components/Cart/index.js +18 -15
  228. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  229. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  230. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +143 -127
  231. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  232. package/lib/components/ticketBooking/components/menuBar/index.js +42 -2
  233. package/lib/components/ticketBooking/components/menuBar/index.less +8 -0
  234. package/lib/components/ticketBooking/components/timeBar/index.js +95 -88
  235. package/lib/components/ticketBooking/locales.d.ts +3 -0
  236. package/lib/components/ticketBooking/locales.js +6 -3
  237. package/lib/components/walletList/index.js +3 -3
  238. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  239. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  240. package/package.json +3 -3
@@ -5,6 +5,7 @@ import { ProductCard } from '@pisell/materials';
5
5
  import useClearCart from "../../hooks/useClearCart";
6
6
  import { useContext } from "../../hooks/useContext";
7
7
  import useAddService from "../../hooks/useAddService";
8
+ import { useMemoizedFn, useTrackedEffect } from "ahooks";
8
9
  var Product = function Product(props) {
9
10
  var id = props.id,
10
11
  lists = props.lists,
@@ -35,10 +36,10 @@ var Product = function Product(props) {
35
36
  * @Author: WangHan
36
37
  * @Date: 2024-11-28 22:02
37
38
  */
38
- var handleChange = function handleChange(item, type, other) {
39
+ var handleChange = useMemoizedFn(function (item, type, other) {
39
40
  if (disabledEdit && !(other !== null && other !== void 0 && other.disabled)) return;
40
41
  onChange(item, type, other);
41
- };
42
+ });
42
43
  var productParams = useMemo(function () {
43
44
  return {
44
45
  isShowNote: isShowNote,
@@ -52,44 +53,50 @@ var Product = function Product(props) {
52
53
  isShowEditProduct: isShowEditProduct
53
54
  };
54
55
  }, [isShowNote, isShowPackageNote, disabledEdit, isShowChangeResource, isShowDelete, isShowHolder, isShowAddHolderButton, isShowChangeHolder, isShowEditProduct]);
55
- return /*#__PURE__*/React.createElement("div", {
56
- className: "pisell-lowcode__shopping-cart-content"
57
- }, clearCart, lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
58
- return /*#__PURE__*/React.createElement(ProductCard, _extends({
59
- key: item._id,
60
- dataSource: item,
61
- onAction: function onAction(e) {
62
- return _onAction === null || _onAction === void 0 ? void 0 : _onAction(e);
63
- },
64
- onDelete: function onDelete(e) {
65
- return handleChange(e, 'delete', item);
66
- },
67
- onNote: function onNote(e) {
68
- return handleChange(e, 'note', {
69
- note: e.note
70
- });
71
- },
72
- onLike: function onLike(e) {
73
- return handleChange(e, 'like', {
74
- like_status: e.like_status
75
- });
76
- },
77
- onEditProduct: function onEditProduct(e) {
78
- return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'edit_product');
79
- },
80
- onCard: function onCard(e) {
81
- return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'view');
82
- },
83
- onChangeResource: function onChangeResource(e) {
84
- return handleChange(item, 'change_resource', e);
85
- },
86
- onChangeHolder: function onChangeHolder(e) {
87
- return handleChange(item, 'change_holder', e);
88
- },
89
- onAddHolder: function onAddHolder(e) {
90
- return handleChange(item, 'add_holder', e);
91
- }
92
- }, productParams));
93
- }), !hideAddBtn && platform !== 'h5' && isAdd ? useAddService(id, 'more') : null);
56
+ useTrackedEffect(function (changes) {
57
+ console.log('Index of changed dependencies: ', changes);
58
+ }, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
59
+ return useMemo(function () {
60
+ console.log('render cart');
61
+ return /*#__PURE__*/React.createElement("div", {
62
+ className: "pisell-lowcode__shopping-cart-content"
63
+ }, clearCart, lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
64
+ return /*#__PURE__*/React.createElement(ProductCard, _extends({
65
+ key: item._id,
66
+ dataSource: item,
67
+ onAction: function onAction(e) {
68
+ return _onAction === null || _onAction === void 0 ? void 0 : _onAction(e);
69
+ },
70
+ onDelete: function onDelete(e) {
71
+ return handleChange(e, 'delete', item);
72
+ },
73
+ onNote: function onNote(e) {
74
+ return handleChange(e, 'note', {
75
+ note: e.note
76
+ });
77
+ },
78
+ onLike: function onLike(e) {
79
+ return handleChange(e, 'like', {
80
+ like_status: e.like_status
81
+ });
82
+ },
83
+ onEditProduct: function onEditProduct(e) {
84
+ return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'edit_product');
85
+ },
86
+ onCard: function onCard(e) {
87
+ return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'view');
88
+ },
89
+ onChangeResource: function onChangeResource(e) {
90
+ return handleChange(item, 'change_resource', e);
91
+ },
92
+ onChangeHolder: function onChangeHolder(e) {
93
+ return handleChange(item, 'change_holder', e);
94
+ },
95
+ onAddHolder: function onAddHolder(e) {
96
+ return handleChange(item, 'add_holder', e);
97
+ }
98
+ }, productParams));
99
+ }), !hideAddBtn && platform !== 'h5' && isAdd ? useAddService(id, 'more') : null);
100
+ }, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
94
101
  };
95
102
  export default Product;
@@ -51,23 +51,26 @@ var Cart = function Cart() {
51
51
  });
52
52
  });
53
53
  }, [carts, platform]);
54
- return /*#__PURE__*/React.createElement("div", {
55
- className: classNames('pisell-lowcode__shopping-cart')
56
- }, isProductList ? /*#__PURE__*/React.createElement(Product, {
57
- id: undefined,
58
- lists: state === null || state === void 0 ? void 0 : state.products
59
- }) : /*#__PURE__*/React.createElement(Collapse, _extends({
60
- items: cartsMap,
61
- showHeader: true,
62
- panelBackground: "#ffffff",
63
- collapsible: platform !== 'shop' ? 'disabled' : '-',
64
- accordion: platform === 'shop',
65
- onChange: function onChange(key) {
66
- updateState({
67
- activeKey: key
68
- });
69
- onActiveKey(key);
70
- }
71
- }, collapseParams)));
54
+ return useMemo(function () {
55
+ console.log('render cart 22222');
56
+ return /*#__PURE__*/React.createElement("div", {
57
+ className: classNames('pisell-lowcode__shopping-cart')
58
+ }, isProductList ? /*#__PURE__*/React.createElement(Product, {
59
+ id: undefined,
60
+ lists: state === null || state === void 0 ? void 0 : state.products
61
+ }) : /*#__PURE__*/React.createElement(Collapse, _extends({
62
+ items: cartsMap,
63
+ showHeader: true,
64
+ panelBackground: "#ffffff",
65
+ collapsible: platform !== 'shop' ? 'disabled' : '-',
66
+ accordion: platform === 'shop',
67
+ onChange: function onChange(key) {
68
+ updateState({
69
+ activeKey: key
70
+ });
71
+ onActiveKey(key);
72
+ }
73
+ }, collapseParams)));
74
+ }, [isProductList, cartsMap, platform, collapseParams, state === null || state === void 0 ? void 0 : state.products]);
72
75
  };
73
76
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Empty: (props: any) => JSX.Element;
3
4
  export default Empty;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Content: () => JSX.Element;
3
4
  export default Content;
@@ -33,7 +33,7 @@ import { addService, addServiceScroll, genServiceKey, getIsShowNumber } from "..
33
33
  import NotAvailable from "../notAvailable";
34
34
  import dayjs from 'dayjs';
35
35
  var AddSerivce = function AddSerivce(props) {
36
- var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$client2, _state$service4, _state$service5;
36
+ var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$client2, _state$service4;
37
37
  var onEdit = props.onEdit,
38
38
  state = props.state,
39
39
  dispatch = props.dispatch,
@@ -276,10 +276,182 @@ var AddSerivce = function AddSerivce(props) {
276
276
  var isEject = getIsEject(item, type);
277
277
  var isOnlySession = getIsOnlySession(item);
278
278
  var lock = false;
279
+ // 对于不需要打开弹窗的商品, 直接模拟数据, 不走弹窗
280
+ var cacheValues = null;
279
281
  if (isEject) {
280
282
  setCurrentProduct(item);
281
283
  } else {
282
284
  setCurrentProduct(null);
285
+ cacheValues = {
286
+ bundle: [],
287
+ key: item.id,
288
+ option: [],
289
+ product_id: item.id,
290
+ product_variant_id: 0,
291
+ quantity: 1,
292
+ rowKey: item.id,
293
+ session: null,
294
+ unique: '08974625397'
295
+ };
296
+ }
297
+ var callback = /*#__PURE__*/function () {
298
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
299
+ var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
300
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
301
+ while (1) switch (_context3.prev = _context3.next) {
302
+ case 0:
303
+ setCurrentProduct(null);
304
+ // 防止选择商品弹窗多次触发callback
305
+ if (!lock) {
306
+ _context3.next = 3;
307
+ break;
308
+ }
309
+ return _context3.abrupt("return");
310
+ case 3:
311
+ lock = true;
312
+
313
+ // 2秒后解除
314
+ setTimeout(function () {
315
+ lock = false;
316
+ }, 2000);
317
+ if (isBooking4) {
318
+ _context3.next = 11;
319
+ break;
320
+ }
321
+ _context3.next = 8;
322
+ return createBookingData({
323
+ product: _objectSpread(_objectSpread({}, detail || item), {}, {
324
+ _params: e
325
+ })
326
+ });
327
+ case 8:
328
+ data = _context3.sent;
329
+ // 创建预约
330
+ createBooking({
331
+ booking: data
332
+ });
333
+ return _context3.abrupt("return");
334
+ case 11:
335
+ // info2 addService 逻辑
336
+ _detail = detail || item;
337
+ other = JSON.parse(JSON.stringify(e));
338
+ other.session = e.session;
339
+ cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
340
+ product_id: item.id,
341
+ _id: getUniqueId(),
342
+ _key: e.key,
343
+ _extend: {
344
+ start_date: state.date.value,
345
+ quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
346
+ price: _detail.price,
347
+ product_name: item.title,
348
+ other: other
349
+ },
350
+ new: 1
351
+ });
352
+ _total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
353
+ cacheItem._extend.total = _total;
354
+ // 用于储存原价
355
+ cacheItem._extend.origin_total = _total;
356
+ _isEdit = !!state.service.cacheItem;
357
+ if (_isEdit) {
358
+ cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
359
+ cacheItem.new = 0;
360
+ }
361
+ // 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
362
+ if (renderMode === 'current') {
363
+ // cacheItem._extend.resource = 0;
364
+ cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
365
+ }
366
+ cacheItem = getProductExtend({
367
+ cacheItem: cacheItem,
368
+ state: state,
369
+ isDisabledTime: true
370
+ });
371
+ if (state.renderType === 'eventBooking') {
372
+ cacheItem.autoClose = false;
373
+ }
374
+ if (cacheItem.autoClose) {
375
+ cacheItem.autoClose = false;
376
+ cacheItem._serviceKey = genServiceKey(cacheItem);
377
+ _addService = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService.list, quantity = _addService.quantity;
378
+ Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
379
+ className: "add-toast-wrap"
380
+ }, /*#__PURE__*/React.createElement("div", {
381
+ className: "add-toast-title"
382
+ }, cacheItem.title), /*#__PURE__*/React.createElement("div", {
383
+ className: "add-toast-quantity"
384
+ }, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
385
+ addServiceScroll(e.rowKey, cacheItem);
386
+ try {
387
+ if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
388
+ val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
389
+ return {
390
+ product_id: s === null || s === void 0 ? void 0 : s.product_id,
391
+ detailId: s === null || s === void 0 ? void 0 : s.id,
392
+ detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
393
+ product_name: s === null || s === void 0 ? void 0 : s.title,
394
+ price: s === null || s === void 0 ? void 0 : s.price,
395
+ _id: s === null || s === void 0 ? void 0 : s._id,
396
+ _key: s === null || s === void 0 ? void 0 : s._key,
397
+ _serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
398
+ };
399
+ });
400
+ sendData = {
401
+ product_id: item === null || item === void 0 ? void 0 : item.id,
402
+ detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
403
+ detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
404
+ product_name: item === null || item === void 0 ? void 0 : item.title,
405
+ price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
406
+ serviceVal: val
407
+ };
408
+ sendWarningLog({
409
+ title: 'addService',
410
+ content: [{
411
+ key: '添加数据',
412
+ value: JSON.stringify(sendData)
413
+ }, {
414
+ key: '日期',
415
+ value: dayjs().format('YYYY-MM-DD HH:mm:ss')
416
+ }]
417
+ });
418
+ }
419
+ } catch (error) {}
420
+ dispatch({
421
+ type: 'setService',
422
+ payload: {
423
+ addModal: false,
424
+ value: _list,
425
+ edit: true,
426
+ changeService: false
427
+ }
428
+ });
429
+ } else {
430
+ dispatch({
431
+ type: 'setService',
432
+ payload: {
433
+ editModal: true,
434
+ cacheItem: cacheItem,
435
+ addModal: !cacheItem.autoClose,
436
+ changeService: false
437
+ }
438
+ });
439
+ onEdit === null || onEdit === void 0 || onEdit(cacheItem);
440
+ }
441
+ case 24:
442
+ case "end":
443
+ return _context3.stop();
444
+ }
445
+ }, _callee3);
446
+ }));
447
+ return function callback(_x3, _x4, _x5) {
448
+ return _ref3.apply(this, arguments);
449
+ };
450
+ }();
451
+ // 如果不需要打开弹窗, 直接添加数据
452
+ if (cacheValues) {
453
+ callback(cacheValues, '', item);
454
+ return;
283
455
  }
284
456
  state.action({
285
457
  type: 'pisell1.handleOpenProductModal',
@@ -301,161 +473,7 @@ var AddSerivce = function AddSerivce(props) {
301
473
  onCancel: function onCancel() {
302
474
  setCurrentProduct(null);
303
475
  },
304
- callback: function () {
305
- var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
306
- var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
307
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
308
- while (1) switch (_context3.prev = _context3.next) {
309
- case 0:
310
- setCurrentProduct(null);
311
- // 防止选择商品弹窗多次触发callback
312
- if (!lock) {
313
- _context3.next = 3;
314
- break;
315
- }
316
- return _context3.abrupt("return");
317
- case 3:
318
- lock = true;
319
-
320
- // 2秒后解除
321
- setTimeout(function () {
322
- lock = false;
323
- }, 2000);
324
- if (isBooking4) {
325
- _context3.next = 11;
326
- break;
327
- }
328
- _context3.next = 8;
329
- return createBookingData({
330
- product: _objectSpread(_objectSpread({}, detail || item), {}, {
331
- _params: e
332
- })
333
- });
334
- case 8:
335
- data = _context3.sent;
336
- // 创建预约
337
- createBooking({
338
- booking: data
339
- });
340
- return _context3.abrupt("return");
341
- case 11:
342
- // info2 addService 逻辑
343
- _detail = detail || item;
344
- other = JSON.parse(JSON.stringify(e));
345
- other.session = e.session;
346
- cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
347
- product_id: item.id,
348
- _id: getUniqueId(),
349
- _key: e.key,
350
- _extend: {
351
- start_date: state.date.value,
352
- quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
353
- price: _detail.price,
354
- product_name: item.title,
355
- other: other
356
- },
357
- new: 1
358
- });
359
- _total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
360
- cacheItem._extend.total = _total;
361
- // 用于储存原价
362
- cacheItem._extend.origin_total = _total;
363
- _isEdit = !!state.service.cacheItem;
364
- if (_isEdit) {
365
- cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
366
- cacheItem.new = 0;
367
- }
368
- // 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
369
- if (renderMode === 'current') {
370
- // cacheItem._extend.resource = 0;
371
- cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
372
- }
373
- cacheItem = getProductExtend({
374
- cacheItem: cacheItem,
375
- state: state,
376
- isDisabledTime: true
377
- });
378
- if (state.renderType === 'eventBooking') {
379
- cacheItem.autoClose = false;
380
- }
381
- if (cacheItem.autoClose) {
382
- cacheItem.autoClose = false;
383
- cacheItem._serviceKey = genServiceKey(cacheItem);
384
- _addService = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService.list, quantity = _addService.quantity;
385
- Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
386
- className: "add-toast-wrap"
387
- }, /*#__PURE__*/React.createElement("div", {
388
- className: "add-toast-title"
389
- }, cacheItem.title), /*#__PURE__*/React.createElement("div", {
390
- className: "add-toast-quantity"
391
- }, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
392
- addServiceScroll(e.rowKey, cacheItem);
393
- try {
394
- if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
395
- val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
396
- return {
397
- product_id: s === null || s === void 0 ? void 0 : s.product_id,
398
- detailId: s === null || s === void 0 ? void 0 : s.id,
399
- detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
400
- product_name: s === null || s === void 0 ? void 0 : s.title,
401
- price: s === null || s === void 0 ? void 0 : s.price,
402
- _id: s === null || s === void 0 ? void 0 : s._id,
403
- _key: s === null || s === void 0 ? void 0 : s._key,
404
- _serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
405
- };
406
- });
407
- sendData = {
408
- product_id: item === null || item === void 0 ? void 0 : item.id,
409
- detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
410
- detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
411
- product_name: item === null || item === void 0 ? void 0 : item.title,
412
- price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
413
- serviceVal: val
414
- };
415
- sendWarningLog({
416
- title: 'addService',
417
- content: [{
418
- key: '添加数据',
419
- value: JSON.stringify(sendData)
420
- }, {
421
- key: '日期',
422
- value: dayjs().format('YYYY-MM-DD HH:mm:ss')
423
- }]
424
- });
425
- }
426
- } catch (error) {}
427
- dispatch({
428
- type: 'setService',
429
- payload: {
430
- addModal: false,
431
- value: _list,
432
- edit: true,
433
- changeService: false
434
- }
435
- });
436
- } else {
437
- dispatch({
438
- type: 'setService',
439
- payload: {
440
- editModal: true,
441
- cacheItem: cacheItem,
442
- addModal: !cacheItem.autoClose,
443
- changeService: false
444
- }
445
- });
446
- onEdit === null || onEdit === void 0 || onEdit(cacheItem);
447
- }
448
- case 24:
449
- case "end":
450
- return _context3.stop();
451
- }
452
- }, _callee3);
453
- }));
454
- function callback(_x3, _x4, _x5) {
455
- return _callback.apply(this, arguments);
456
- }
457
- return callback;
458
- }()
476
+ callback: callback
459
477
  });
460
478
  });
461
479
  var renderList = useMemo(function () {
@@ -513,6 +531,6 @@ var AddSerivce = function AddSerivce(props) {
513
531
  }));
514
532
  }
515
533
  return null;
516
- }, [(_state$service5 = state.service) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.cacheItem) === null || _state$service5 === void 0 ? void 0 : _state$service5.autoClose, state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
534
+ }, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
517
535
  };
518
536
  export default AddSerivce;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AddServiceVariantProps {
2
3
  globalState: any;
3
4
  setGlobalState: any;
@@ -1,8 +1,20 @@
1
1
  import React from 'react';
2
2
  import { useNetworkStatus, NetworkStatus, NetworkStatusColor } from "../../hooks/useNetworkStatus";
3
3
  import "./index.less";
4
+ import { Menu } from 'antd';
5
+ import { SettingOutlined } from '@ant-design/icons';
6
+ import { locales } from "@pisell/utils";
7
+ import { ConfigProvider } from "@pisell/materials";
4
8
  var index = function index() {
5
9
  var status = useNetworkStatus();
10
+ var items = [{
11
+ key: '1',
12
+ icon: /*#__PURE__*/React.createElement(SettingOutlined, null),
13
+ children: [{
14
+ key: 'reload',
15
+ label: locales.getText('pisell2.ticket-booking.reload')
16
+ }]
17
+ }];
6
18
  var getStatusText = function getStatusText(status) {
7
19
  switch (status) {
8
20
  case NetworkStatus.GOOD:
@@ -13,9 +25,15 @@ var index = function index() {
13
25
  return 'Offline';
14
26
  }
15
27
  };
28
+ var handleClick = function handleClick(_ref) {
29
+ var key = _ref.key;
30
+ if (key === 'reload') {
31
+ window.location.reload();
32
+ }
33
+ };
16
34
  return /*#__PURE__*/React.createElement("div", {
17
35
  className: "pisell-ticket-booking-menu-bar"
18
- }, /*#__PURE__*/React.createElement("div", {
36
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
19
37
  className: "logo-wrapper"
20
38
  }, /*#__PURE__*/React.createElement("svg", {
21
39
  xmlns: "http://www.w3.org/2000/svg",
@@ -42,7 +60,25 @@ var index = function index() {
42
60
  "stroke-width": "1.5",
43
61
  "stroke-linecap": "round",
44
62
  "stroke-linejoin": "round"
45
- })))), /*#__PURE__*/React.createElement("div", {
63
+ }))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ConfigProvider, {
64
+ theme: {
65
+ components: {
66
+ Menu: {
67
+ collapsedIconSize: 32,
68
+ itemHeight: 48,
69
+ groupTitleFontSize: 16,
70
+ fontSize: 16
71
+ }
72
+ }
73
+ }
74
+ }, /*#__PURE__*/React.createElement(Menu, {
75
+ className: "pisell-ticket-booking-menu",
76
+ mode: "inline",
77
+ theme: "dark",
78
+ inlineCollapsed: true,
79
+ items: items,
80
+ onClick: handleClick
81
+ }))), /*#__PURE__*/React.createElement("div", {
46
82
  className: "status-wrapper"
47
83
  }, /*#__PURE__*/React.createElement("div", {
48
84
  className: "network-status",
@@ -3,6 +3,14 @@
3
3
  padding-left: 6px;
4
4
  width: 86px;
5
5
  position: relative;
6
+ display: flex;
7
+ flex-direction: column;
8
+ justify-content: space-between;
9
+ padding-bottom: 44px;
10
+
11
+ .pisell-ticket-booking-menu {
12
+ background-color: transparent;
13
+ }
6
14
 
7
15
  .logo-wrapper {
8
16
  margin-top: 24px;