@pisell/private-materials 6.2.16 → 6.2.17

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 (242) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/businessModel/SalesModel/index.d.ts +1 -0
  8. package/es/components/Sales/Checkout/utils.d.ts +40 -0
  9. package/es/components/Sales/Summary/utils.d.ts +1 -1
  10. package/es/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
  11. package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
  12. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
  15. package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  16. package/es/components/appointmentBooking/hooks.d.ts +106 -0
  17. package/es/components/appointmentBooking/index.d.ts +3 -0
  18. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  19. package/es/components/booking/components/customSelect/index.js +1 -0
  20. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  21. package/es/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  22. package/es/components/booking/components/voucher/index.d.ts +3 -0
  23. package/es/components/booking/forms/table/index.d.ts +1 -0
  24. package/es/components/booking/hooks/useClearCart.js +11 -8
  25. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  26. package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
  27. package/es/components/booking/info/client/index.js +3 -2
  28. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  29. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  30. package/es/components/booking/info/hooks/useInfoHolder.js +16 -9
  31. package/es/components/booking/info/index.d.ts +4 -0
  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/service2/Lists.d.ts +1 -0
  37. package/es/components/booking/info/service2/utils.js +20 -21
  38. package/es/components/booking/info/utils.d.ts +50 -0
  39. package/es/components/booking/info2/index.d.ts +12 -0
  40. package/es/components/booking/info2/index.js +1 -0
  41. package/es/components/booking/info2/service/addService/index.d.ts +11 -0
  42. package/es/components/booking/info2/service/addService/utils.d.ts +98 -0
  43. package/es/components/booking/info2/service/addService/utils.js +6 -3
  44. package/es/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  45. package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
  46. package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
  47. package/es/components/booking/info2/service/editService/index.js +258 -165
  48. package/es/components/booking/info2/service/index.js +19 -15
  49. package/es/components/booking/locales.d.ts +828 -0
  50. package/es/components/booking/materiels/duration/index.js +9 -2
  51. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  52. package/es/components/booking/model.d.ts +108 -0
  53. package/es/components/booking/utils.d.ts +2 -2
  54. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  55. package/es/components/eftpos/form/index.d.ts +1 -0
  56. package/es/components/eftpos/group/index.d.ts +1 -0
  57. package/es/components/eftpos/hooks.d.ts +1 -0
  58. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  59. package/es/components/eftpos/icon/device.d.ts +1 -0
  60. package/es/components/eftpos/receipt/index.d.ts +1 -0
  61. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  62. package/es/components/eftposPay/amount.d.ts +1 -1
  63. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  64. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  65. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  66. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  67. package/es/components/eftposPay/const.d.ts +184 -0
  68. package/es/components/eftposPay/device.d.ts +1 -1
  69. package/es/components/eftposPay/hooks.d.ts +35 -0
  70. package/es/components/eftposPay/index.d.ts +4 -0
  71. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  72. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  73. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  74. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  75. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  76. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  77. package/es/components/eftposPay/manufacturer.d.ts +7 -0
  78. package/es/components/eftposPay/pay.d.ts +20 -0
  79. package/es/components/eftposPay/store/index.d.ts +355 -0
  80. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  81. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  82. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  83. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  84. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  85. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  86. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  87. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  88. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  89. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  90. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  91. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  92. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  93. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  94. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  95. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  96. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  97. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  98. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  99. package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  100. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  101. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  102. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  103. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  104. package/es/components/productSelect/components/TabProduct/index.d.ts +2 -0
  105. package/es/components/productSelect/index.d.ts +26 -0
  106. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  107. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  108. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  109. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  110. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  111. package/es/components/schedules/products/index.d.ts +1 -0
  112. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  113. package/es/components/shoppingCart/components/Cart/Product.js +48 -41
  114. package/es/components/shoppingCart/components/Cart/index.js +21 -18
  115. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  116. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  117. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  118. package/es/components/ticketBooking/components/addServiceVariant/addService.js +177 -157
  119. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  120. package/es/components/ticketBooking/components/timeBar/index.js +78 -71
  121. package/es/components/ticketBooking/index.d.ts +7 -0
  122. package/es/components/walletList/index.d.ts +28 -0
  123. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  124. package/es/utils/index.d.ts +23 -0
  125. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  126. package/lib/components/Sales/Checkout/utils.d.ts +40 -0
  127. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  128. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
  129. package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
  130. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  131. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  132. package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
  133. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  134. package/lib/components/appointmentBooking/hooks.d.ts +106 -0
  135. package/lib/components/appointmentBooking/index.d.ts +3 -0
  136. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  137. package/lib/components/booking/components/customSelect/index.js +1 -0
  138. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  139. package/lib/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  140. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  141. package/lib/components/booking/forms/table/index.d.ts +1 -0
  142. package/lib/components/booking/hooks/useClearCart.js +16 -13
  143. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  144. package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
  145. package/lib/components/booking/info/client/index.js +5 -4
  146. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  147. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  148. package/lib/components/booking/info/hooks/useInfoHolder.js +10 -9
  149. package/lib/components/booking/info/index.d.ts +4 -0
  150. package/lib/components/booking/info/service/Lists.js +35 -23
  151. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  152. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  153. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  154. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  155. package/lib/components/booking/info/service2/utils.js +17 -17
  156. package/lib/components/booking/info/utils.d.ts +50 -0
  157. package/lib/components/booking/info2/index.d.ts +12 -0
  158. package/lib/components/booking/info2/service/addService/index.d.ts +11 -0
  159. package/lib/components/booking/info2/service/addService/utils.d.ts +98 -0
  160. package/lib/components/booking/info2/service/addService/utils.js +4 -2
  161. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  162. package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
  163. package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
  164. package/lib/components/booking/info2/service/editService/index.js +132 -70
  165. package/lib/components/booking/info2/service/index.js +13 -9
  166. package/lib/components/booking/locales.d.ts +828 -0
  167. package/lib/components/booking/materiels/duration/index.js +7 -2
  168. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  169. package/lib/components/booking/model.d.ts +108 -0
  170. package/lib/components/booking/utils.d.ts +2 -2
  171. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  172. package/lib/components/eftpos/form/index.d.ts +1 -0
  173. package/lib/components/eftpos/group/index.d.ts +1 -0
  174. package/lib/components/eftpos/hooks.d.ts +1 -0
  175. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  176. package/lib/components/eftpos/icon/device.d.ts +1 -0
  177. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  178. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  179. package/lib/components/eftposPay/amount.d.ts +1 -1
  180. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  181. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  182. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  183. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  184. package/lib/components/eftposPay/const.d.ts +184 -0
  185. package/lib/components/eftposPay/device.d.ts +1 -1
  186. package/lib/components/eftposPay/hooks.d.ts +35 -0
  187. package/lib/components/eftposPay/index.d.ts +4 -0
  188. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  189. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  190. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  191. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  192. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  193. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  194. package/lib/components/eftposPay/manufacturer.d.ts +7 -0
  195. package/lib/components/eftposPay/pay.d.ts +20 -0
  196. package/lib/components/eftposPay/store/index.d.ts +355 -0
  197. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  198. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  199. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  200. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  201. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  202. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  203. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  204. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  205. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  206. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  207. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  208. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  209. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  210. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  211. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  212. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  213. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  214. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  215. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  216. package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  217. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  218. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  219. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  220. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  221. package/lib/components/productSelect/components/TabProduct/index.d.ts +2 -0
  222. package/lib/components/productSelect/index.d.ts +26 -0
  223. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  224. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  225. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  226. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  227. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  228. package/lib/components/schedules/products/index.d.ts +1 -0
  229. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  230. package/lib/components/shoppingCart/components/Cart/Product.js +31 -21
  231. package/lib/components/shoppingCart/components/Cart/index.js +18 -15
  232. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  233. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  234. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  235. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +145 -127
  236. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  237. package/lib/components/ticketBooking/components/timeBar/index.js +95 -88
  238. package/lib/components/ticketBooking/index.d.ts +7 -0
  239. package/lib/components/walletList/index.d.ts +28 -0
  240. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  241. package/lib/utils/index.d.ts +23 -0
  242. package/package.json +2 -2
@@ -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;
@@ -0,0 +1,9 @@
1
+ import './index.less';
2
+ interface AddServiceProps {
3
+ onEdit?: any;
4
+ dispatch?: any;
5
+ state?: any;
6
+ renderMode?: 'current' | 'drawer';
7
+ }
8
+ declare const AddSerivce: (props: AddServiceProps) => JSX.Element | null;
9
+ export default AddSerivce;
@@ -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,184 @@ 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
+ if (!isSession) {
286
+ cacheValues = {
287
+ bundle: [],
288
+ key: item.id,
289
+ option: [],
290
+ product_id: item.id,
291
+ product_variant_id: 0,
292
+ quantity: 1,
293
+ rowKey: item.id,
294
+ session: null,
295
+ unique: '08974625397'
296
+ };
297
+ }
298
+ }
299
+ var callback = /*#__PURE__*/function () {
300
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
301
+ var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
302
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
303
+ while (1) switch (_context3.prev = _context3.next) {
304
+ case 0:
305
+ setCurrentProduct(null);
306
+ // 防止选择商品弹窗多次触发callback
307
+ if (!lock) {
308
+ _context3.next = 3;
309
+ break;
310
+ }
311
+ return _context3.abrupt("return");
312
+ case 3:
313
+ lock = true;
314
+
315
+ // 2秒后解除
316
+ setTimeout(function () {
317
+ lock = false;
318
+ }, 2000);
319
+ if (isBooking4) {
320
+ _context3.next = 11;
321
+ break;
322
+ }
323
+ _context3.next = 8;
324
+ return createBookingData({
325
+ product: _objectSpread(_objectSpread({}, detail || item), {}, {
326
+ _params: e
327
+ })
328
+ });
329
+ case 8:
330
+ data = _context3.sent;
331
+ // 创建预约
332
+ createBooking({
333
+ booking: data
334
+ });
335
+ return _context3.abrupt("return");
336
+ case 11:
337
+ // info2 addService 逻辑
338
+ _detail = detail || item;
339
+ other = JSON.parse(JSON.stringify(e));
340
+ other.session = e.session;
341
+ cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
342
+ product_id: item.id,
343
+ _id: getUniqueId(),
344
+ _key: e.key,
345
+ _extend: {
346
+ start_date: state.date.value,
347
+ quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
348
+ price: _detail.price,
349
+ product_name: item.title,
350
+ other: other
351
+ },
352
+ new: 1
353
+ });
354
+ _total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
355
+ cacheItem._extend.total = _total;
356
+ // 用于储存原价
357
+ cacheItem._extend.origin_total = _total;
358
+ _isEdit = !!state.service.cacheItem;
359
+ if (_isEdit) {
360
+ cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
361
+ cacheItem.new = 0;
362
+ }
363
+ // 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
364
+ if (renderMode === 'current') {
365
+ // cacheItem._extend.resource = 0;
366
+ cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
367
+ }
368
+ cacheItem = getProductExtend({
369
+ cacheItem: cacheItem,
370
+ state: state,
371
+ isDisabledTime: true
372
+ });
373
+ if (state.renderType === 'eventBooking') {
374
+ cacheItem.autoClose = false;
375
+ }
376
+ if (cacheItem.autoClose) {
377
+ cacheItem.autoClose = false;
378
+ cacheItem._serviceKey = genServiceKey(cacheItem);
379
+ _addService = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService.list, quantity = _addService.quantity;
380
+ Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
381
+ className: "add-toast-wrap"
382
+ }, /*#__PURE__*/React.createElement("div", {
383
+ className: "add-toast-title"
384
+ }, cacheItem.title), /*#__PURE__*/React.createElement("div", {
385
+ className: "add-toast-quantity"
386
+ }, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
387
+ addServiceScroll(e.rowKey, cacheItem);
388
+ try {
389
+ 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) {
390
+ val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
391
+ return {
392
+ product_id: s === null || s === void 0 ? void 0 : s.product_id,
393
+ detailId: s === null || s === void 0 ? void 0 : s.id,
394
+ detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
395
+ product_name: s === null || s === void 0 ? void 0 : s.title,
396
+ price: s === null || s === void 0 ? void 0 : s.price,
397
+ _id: s === null || s === void 0 ? void 0 : s._id,
398
+ _key: s === null || s === void 0 ? void 0 : s._key,
399
+ _serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
400
+ };
401
+ });
402
+ sendData = {
403
+ product_id: item === null || item === void 0 ? void 0 : item.id,
404
+ detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
405
+ detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
406
+ product_name: item === null || item === void 0 ? void 0 : item.title,
407
+ price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
408
+ serviceVal: val
409
+ };
410
+ sendWarningLog({
411
+ title: 'addService',
412
+ content: [{
413
+ key: '添加数据',
414
+ value: JSON.stringify(sendData)
415
+ }, {
416
+ key: '日期',
417
+ value: dayjs().format('YYYY-MM-DD HH:mm:ss')
418
+ }]
419
+ });
420
+ }
421
+ } catch (error) {}
422
+ dispatch({
423
+ type: 'setService',
424
+ payload: {
425
+ addModal: false,
426
+ value: _list,
427
+ edit: true,
428
+ changeService: false
429
+ }
430
+ });
431
+ } else {
432
+ dispatch({
433
+ type: 'setService',
434
+ payload: {
435
+ editModal: true,
436
+ cacheItem: cacheItem,
437
+ addModal: !cacheItem.autoClose,
438
+ changeService: false
439
+ }
440
+ });
441
+ onEdit === null || onEdit === void 0 || onEdit(cacheItem);
442
+ }
443
+ case 24:
444
+ case "end":
445
+ return _context3.stop();
446
+ }
447
+ }, _callee3);
448
+ }));
449
+ return function callback(_x3, _x4, _x5) {
450
+ return _ref3.apply(this, arguments);
451
+ };
452
+ }();
453
+ // 如果不需要打开弹窗, 直接添加数据
454
+ if (cacheValues) {
455
+ callback(cacheValues, '', item);
456
+ return;
283
457
  }
284
458
  state.action({
285
459
  type: 'pisell1.handleOpenProductModal',
@@ -301,161 +475,7 @@ var AddSerivce = function AddSerivce(props) {
301
475
  onCancel: function onCancel() {
302
476
  setCurrentProduct(null);
303
477
  },
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
- }()
478
+ callback: callback
459
479
  });
460
480
  });
461
481
  var renderList = useMemo(function () {
@@ -513,6 +533,6 @@ var AddSerivce = function AddSerivce(props) {
513
533
  }));
514
534
  }
515
535
  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]);
536
+ }, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
517
537
  };
518
538
  export default AddSerivce;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AddServiceVariantProps {
2
3
  globalState: any;
3
4
  setGlobalState: any;