@pisell/private-materials 3.2.21 → 3.2.22

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 (249) 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 +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/appointmentBooking/components/Cart/Item/index.js +7 -2
  12. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Date/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  16. package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  17. package/es/components/appointmentBooking/components/Voucher/index.js +228 -0
  18. package/es/components/appointmentBooking/components/Voucher/index.less +26 -0
  19. package/es/components/appointmentBooking/hooks.d.ts +1 -0
  20. package/es/components/appointmentBooking/hooks.js +4 -0
  21. package/es/components/appointmentBooking/index.d.ts +1 -0
  22. package/es/components/appointmentBooking/locales.d.ts +27 -0
  23. package/es/components/appointmentBooking/locales.js +30 -3
  24. package/es/components/appointmentBooking/utils.js +3 -1
  25. package/es/components/booking/addons/index.js +1 -0
  26. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  27. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  28. package/es/components/booking/components/footer/index.js +5 -1
  29. package/es/components/booking/components/footer/utils.js +18 -2
  30. package/es/components/booking/components/voucher/index.d.ts +3 -0
  31. package/es/components/booking/components/voucher/index.js +237 -0
  32. package/es/components/booking/components/voucher/index.less +88 -0
  33. package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
  34. package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +115 -0
  35. package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
  36. package/es/components/booking/deposit/index.d.ts +1 -0
  37. package/es/components/booking/forms/single/index.d.ts +1 -0
  38. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  39. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  40. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  41. package/es/components/booking/info/date/index.d.ts +1 -0
  42. package/es/components/booking/info/header/index.d.ts +1 -0
  43. package/es/components/booking/info/index.d.ts +1 -0
  44. package/es/components/booking/info/notes/index.d.ts +1 -0
  45. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  46. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  47. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  48. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  49. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  50. package/es/components/booking/info/service2/utils.d.ts +1 -1
  51. package/es/components/booking/info/utils.js +1 -1
  52. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  53. package/es/components/booking/info2/service/addService/index.d.ts +1 -0
  54. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  55. package/es/components/booking/info2/service/editService/index.js +9 -0
  56. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  57. package/es/components/booking/locales.d.ts +18 -0
  58. package/es/components/booking/locales.js +21 -3
  59. package/es/components/booking/materiels/contacts/index.d.ts +1 -0
  60. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  61. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  62. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  63. package/es/components/booking/payments/index.js +1 -0
  64. package/es/components/eftpos/form/index.d.ts +1 -0
  65. package/es/components/eftpos/hooks.d.ts +1 -0
  66. package/es/components/eftpos/index.d.ts +1 -0
  67. package/es/components/eftpos/pos.d.ts +1 -0
  68. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  69. package/es/components/eftposPay/amount.d.ts +1 -1
  70. package/es/components/eftposPay/app.d.ts +1 -0
  71. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  72. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  73. package/es/components/eftposPay/component/fail/network.d.ts +1 -0
  74. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  75. package/es/components/eftposPay/component/manual/index.d.ts +1 -0
  76. package/es/components/eftposPay/component/signature/index.d.ts +1 -0
  77. package/es/components/eftposPay/device.d.ts +1 -1
  78. package/es/components/eftposPay/hooks.d.ts +1 -1
  79. package/es/components/eftposPay/index.d.ts +1 -0
  80. package/es/components/eftposPay/pay.d.ts +1 -0
  81. package/es/components/eftposPay/store/index.d.ts +3 -3
  82. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  83. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  84. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  85. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  86. package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
  87. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  88. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  89. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  90. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  91. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  92. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  93. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  94. package/es/components/eventBooking/index.d.ts +1 -0
  95. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  96. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  97. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  98. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  99. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  100. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  101. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  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/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  105. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  106. package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  109. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  110. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  111. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  112. package/es/components/schedules/products/index.d.ts +1 -0
  113. package/es/components/schedules/resources/index.d.ts +1 -0
  114. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  115. package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  116. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  117. package/es/components/schedules/schedules/index.d.ts +1 -0
  118. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  119. package/es/components/shoppingCart/index.d.ts +1 -0
  120. package/es/components/taxSelect/index.d.ts +1 -0
  121. package/es/components/wallet/Detail/index.js +20 -14
  122. package/es/components/wallet/Voucher/index.js +1 -0
  123. package/es/components/wallet/index.js +15 -1
  124. package/es/components/wallet/locales.d.ts +3 -0
  125. package/es/components/wallet/locales.js +3 -0
  126. package/es/components/wallet/model.d.ts +1 -1
  127. package/es/components/wallet/utils/formatUtils.js +1 -1
  128. package/es/components/walletList/index.js +5 -1
  129. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  130. package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -2
  131. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  132. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  133. package/lib/components/appointmentBooking/components/Date/index.d.ts +1 -0
  134. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  135. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  136. package/lib/components/appointmentBooking/components/Voucher/index.js +209 -0
  137. package/lib/components/appointmentBooking/components/Voucher/index.less +26 -0
  138. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  139. package/lib/components/appointmentBooking/hooks.js +8 -2
  140. package/lib/components/appointmentBooking/index.d.ts +1 -0
  141. package/lib/components/appointmentBooking/locales.d.ts +27 -0
  142. package/lib/components/appointmentBooking/locales.js +30 -3
  143. package/lib/components/appointmentBooking/utils.js +3 -1
  144. package/lib/components/booking/addons/index.js +1 -1
  145. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  146. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  147. package/lib/components/booking/components/footer/index.js +2 -1
  148. package/lib/components/booking/components/footer/utils.js +18 -1
  149. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  150. package/lib/components/booking/components/voucher/index.js +211 -0
  151. package/lib/components/booking/components/voucher/index.less +88 -0
  152. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
  153. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +109 -0
  154. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
  155. package/lib/components/booking/deposit/index.d.ts +1 -0
  156. package/lib/components/booking/forms/single/index.d.ts +1 -0
  157. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  158. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  159. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  160. package/lib/components/booking/info/date/index.d.ts +1 -0
  161. package/lib/components/booking/info/header/index.d.ts +1 -0
  162. package/lib/components/booking/info/index.d.ts +1 -0
  163. package/lib/components/booking/info/notes/index.d.ts +1 -0
  164. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  165. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  166. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  167. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  168. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  169. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  170. package/lib/components/booking/info/utils.js +1 -1
  171. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  172. package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
  173. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  174. package/lib/components/booking/info2/service/editService/index.js +8 -0
  175. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  176. package/lib/components/booking/locales.d.ts +18 -0
  177. package/lib/components/booking/locales.js +21 -3
  178. package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
  179. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  180. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  181. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  182. package/lib/components/booking/payments/index.js +1 -1
  183. package/lib/components/eftpos/form/index.d.ts +1 -0
  184. package/lib/components/eftpos/hooks.d.ts +1 -0
  185. package/lib/components/eftpos/index.d.ts +1 -0
  186. package/lib/components/eftpos/pos.d.ts +1 -0
  187. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  188. package/lib/components/eftposPay/amount.d.ts +1 -1
  189. package/lib/components/eftposPay/app.d.ts +1 -0
  190. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  191. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  192. package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
  193. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  194. package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
  195. package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
  196. package/lib/components/eftposPay/device.d.ts +1 -1
  197. package/lib/components/eftposPay/hooks.d.ts +1 -1
  198. package/lib/components/eftposPay/index.d.ts +1 -0
  199. package/lib/components/eftposPay/pay.d.ts +1 -0
  200. package/lib/components/eftposPay/store/index.d.ts +3 -3
  201. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  202. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  203. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  204. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  205. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
  206. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  207. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  208. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  209. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  210. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  211. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  212. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  213. package/lib/components/eventBooking/index.d.ts +1 -0
  214. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  215. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  216. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  217. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  218. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  219. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  220. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  221. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  222. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  223. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  224. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  225. package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
  226. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  227. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  228. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  229. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  230. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  231. package/lib/components/schedules/products/index.d.ts +1 -0
  232. package/lib/components/schedules/resources/index.d.ts +1 -0
  233. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  234. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  235. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  236. package/lib/components/schedules/schedules/index.d.ts +1 -0
  237. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  238. package/lib/components/shoppingCart/index.d.ts +1 -0
  239. package/lib/components/taxSelect/index.d.ts +1 -0
  240. package/lib/components/wallet/Detail/index.js +6 -1
  241. package/lib/components/wallet/Voucher/index.js +1 -0
  242. package/lib/components/wallet/index.js +15 -1
  243. package/lib/components/wallet/locales.d.ts +3 -0
  244. package/lib/components/wallet/locales.js +3 -0
  245. package/lib/components/wallet/model.d.ts +1 -1
  246. package/lib/components/wallet/utils/formatUtils.js +1 -1
  247. package/lib/components/walletList/index.js +6 -2
  248. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  249. package/package.json +3 -3
@@ -6,6 +6,7 @@ import { useAppointmentBookingAccount, useAppointmentBooking } from "../../../ho
6
6
  import { useAppointmentBookingContext } from "../../../context";
7
7
  import Total from "./Total";
8
8
  import { formatHolder, formatCarts } from "../../../utils";
9
+ import VoucherCard from "../../Voucher";
9
10
  import "./index.less";
10
11
  var CartItem = function CartItem() {
11
12
  var _currentStep$step, _currentStep$step2;
@@ -17,7 +18,8 @@ var CartItem = function CartItem() {
17
18
  isLastStep = _useAppointmentBookin.isLastStep,
18
19
  currentStep = _useAppointmentBookin.currentStep,
19
20
  resources = _useAppointmentBookin.resources;
20
- var accountLists = appointmentBookingAccount.accountLists;
21
+ var accountLists = appointmentBookingAccount.accountLists,
22
+ currentUser = appointmentBookingAccount.currentUser;
21
23
  console.log(summary, carts, formatCarts(carts, resources), 'accountLists');
22
24
  var holderIds = useMemo(function () {
23
25
  return accountLists.map(function (item) {
@@ -72,6 +74,9 @@ var CartItem = function CartItem() {
72
74
  }
73
75
  })), /*#__PURE__*/React.createElement("div", {
74
76
  className: "event-footer"
75
- }, /*#__PURE__*/React.createElement(Total, null), /*#__PURE__*/React.createElement(ContinueButton, null))));
77
+ }, /*#__PURE__*/React.createElement(VoucherCard, {
78
+ currentUser: currentUser,
79
+ products: carts
80
+ }), /*#__PURE__*/React.createElement(Total, null), /*#__PURE__*/React.createElement(ContinueButton, null))));
76
81
  };
77
82
  export default CartItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Cart: ({ open, onCancel }: any) => JSX.Element;
4
3
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Layout: () => JSX.Element;
3
4
  export default Layout;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const CalendarDate: (props: any) => JSX.Element;
3
4
  export default CalendarDate;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Header: () => JSX.Element;
3
4
  export default Header;
@@ -0,0 +1,4 @@
1
+ import '../../../booking/components/voucher/index.less';
2
+ import './index.less';
3
+ declare const VoucherCard: (props: any) => JSX.Element;
4
+ export default VoucherCard;
@@ -0,0 +1,228 @@
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 _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
+ 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
+ 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); }); }; }
5
+ 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; }
6
+ 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; }
7
+ 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; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ 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); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ 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); }
13
+ 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; }
14
+ 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; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
17
+ import ChevronDown from '@pisell/icon/es/ChevronDown';
18
+ import UserCircle from '@pisell/icon/es/UserCircle';
19
+ import classNames from 'classnames';
20
+ import { Button } from 'antd';
21
+ import { locales } from '@pisell/utils';
22
+ import useEngineContext from "../../../../hooks/useEngineContext";
23
+ import { PisellInput, PisellTooltip, PisellGoodPassCard, PisellText, PisellToast } from '@pisell/materials';
24
+ import { QuestionCircleOutlined } from '@ant-design/icons';
25
+ import { useAppointmentBooking, useShopDiscount } from "../../hooks";
26
+ import "../../../booking/components/voucher/index.less";
27
+ import "./index.less";
28
+ var ShopDiscountHooks = {
29
+ onInited: 'shopDiscount:onInited',
30
+ onDestroy: 'shopDiscount:onDestroy',
31
+ onLoadDiscountList: 'shopDiscount:onLoadDiscountList',
32
+ onCustomerChange: 'shopDiscount:onCustomerChange',
33
+ onDiscountListChange: 'shopDiscount:onDiscountListChange',
34
+ onRulesListChange: 'shopDiscount:onRulesListChange',
35
+ onLoadPrepareCalcResult: 'shopDiscount:onLoadPrepareCalcResult'
36
+ };
37
+ var VoucherCard = function VoucherCard(props) {
38
+ var _context$appHelper, _appointmentBooking$s;
39
+ var products = props.products,
40
+ currentUser = props.currentUser;
41
+ var context = useEngineContext();
42
+ var appointmentBooking = useAppointmentBooking();
43
+ var shopDiscount = useShopDiscount();
44
+ var _useState = useState(true),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ showDetail = _useState2[0],
47
+ setShowDetail = _useState2[1];
48
+ // const { state, dispatch } = props;
49
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
50
+ pisellos = _context$appHelper$ut.pisellos,
51
+ action = _context$appHelper$ut.action,
52
+ token = _context$appHelper$ut.token,
53
+ store = _context$appHelper$ut.store;
54
+ var _ref = context.appHelper || {},
55
+ utils = _ref.utils;
56
+ var _useState3 = useState(''),
57
+ _useState4 = _slicedToArray(_useState3, 2),
58
+ code = _useState4[0],
59
+ setCode = _useState4[1];
60
+ var _useState5 = useState([]),
61
+ _useState6 = _slicedToArray(_useState5, 2),
62
+ discountList = _useState6[0],
63
+ setDisCountList = _useState6[1];
64
+ var productRef = useRef(products);
65
+ var cart = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.cart;
66
+ var isUserLoggedIn = useMemo(function () {
67
+ var _utils$token, _utils$token$get;
68
+ return !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token)) || false;
69
+ }, [store]);
70
+ var availableData = useMemo(function () {
71
+ return discountList.filter(function (item) {
72
+ return !!item.isAvailable;
73
+ }).map(function (discount) {
74
+ return _objectSpread(_objectSpread({}, discount), {}, {
75
+ savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
76
+ });
77
+ });
78
+ }, [discountList]);
79
+ useEffect(function () {
80
+ var shopDiscount = pisellos.getModule('shopDiscount');
81
+ shopDiscount.setCustomer(currentUser);
82
+ }, [currentUser.id]);
83
+
84
+ // // 设置productList
85
+ useEffect(function () {
86
+ shopDiscount.setProductList(products);
87
+ }, [products]);
88
+
89
+ // // 更新productList
90
+ useEffect(function () {
91
+ if (productRef.current === products) {
92
+ return;
93
+ }
94
+ var val = shopDiscount.calcDiscount(products);
95
+ console.log('input: ', products);
96
+ console.log('output: ', val);
97
+ productRef.current = val.productList;
98
+ cart === null || cart === void 0 || cart.batchSetItems(val.productList);
99
+ }, [products]);
100
+
101
+ // // 监听customer变化
102
+ useEffect(function () {
103
+ pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, function (result) {
104
+ cart === null || cart === void 0 || cart.batchSetItems(result.productList);
105
+ });
106
+ pisellos.effects.on(ShopDiscountHooks.onDiscountListChange, function (discount) {
107
+ console.log(discount, 'discountChange');
108
+ setDisCountList(discount);
109
+ });
110
+ }, []);
111
+
112
+ // // apply code
113
+ var onScanCode = /*#__PURE__*/function () {
114
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
115
+ var val;
116
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
117
+ while (1) switch (_context.prev = _context.next) {
118
+ case 0:
119
+ _context.next = 2;
120
+ return shopDiscount.scanCode(code);
121
+ case 2:
122
+ val = _context.sent;
123
+ if (val !== null && val !== void 0 && val.isAvailable) {
124
+ cart === null || cart === void 0 || cart.batchSetItems(val.productList);
125
+ } else {
126
+ PisellToast({
127
+ content: locales.getText('pisell2.text.goodpass.code-invalid')
128
+ });
129
+ }
130
+ case 4:
131
+ case "end":
132
+ return _context.stop();
133
+ }
134
+ }, _callee);
135
+ }));
136
+ return function onScanCode() {
137
+ return _ref2.apply(this, arguments);
138
+ };
139
+ }();
140
+ var renderLoginCard = function renderLoginCard() {
141
+ return /*#__PURE__*/React.createElement("div", {
142
+ className: "login-card"
143
+ }, /*#__PURE__*/React.createElement(UserCircle, {
144
+ style: {
145
+ fontSize: 28
146
+ }
147
+ }), /*#__PURE__*/React.createElement("div", {
148
+ className: "text-wrapper"
149
+ }, /*#__PURE__*/React.createElement(PisellText, {
150
+ className: "login-btn",
151
+ onClick: function onClick() {
152
+ if (!action) return;
153
+ action({
154
+ type: 'pisell1.login',
155
+ data: {},
156
+ callback: function callback(status) {
157
+ if (status === 'success') {}
158
+ }
159
+ });
160
+ }
161
+ }, locales.getText('pisell2.text.goodpass.login')), /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.goodpass.login-tip'))));
162
+ };
163
+ var renderVoucherInfo = function renderVoucherInfo() {
164
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
165
+ className: "voucher-title"
166
+ }, /*#__PURE__*/React.createElement("span", {
167
+ className: "voucher-title-left"
168
+ }, locales.getText('pisell2.text.goodpass')), /*#__PURE__*/React.createElement("span", {
169
+ className: "voucher-title-right",
170
+ onClick: function onClick() {
171
+ console.log('showDetail: ', showDetail);
172
+ setShowDetail(!showDetail);
173
+ }
174
+ }, locales.getText('pisell2.text.details'), ' ', /*#__PURE__*/React.createElement(ChevronDown, {
175
+ className: classNames('voucher-right-icon', {
176
+ show: showDetail
177
+ })
178
+ }))), /*#__PURE__*/React.createElement("div", {
179
+ className: classNames('voucher-detail', {
180
+ show: showDetail
181
+ })
182
+ }, (availableData === null || availableData === void 0 ? void 0 : availableData.length) > 0 ? /*#__PURE__*/React.createElement(PisellGoodPassCard, {
183
+ style: {
184
+ width: '100%'
185
+ },
186
+ dataSource: availableData,
187
+ onChange: function onChange(val) {
188
+ var _appointmentBooking$s2;
189
+ var detail = shopDiscount.setDiscountSelected({
190
+ discountId: val.id,
191
+ isSelected: val.isSelected
192
+ });
193
+ appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.cart) === null || _appointmentBooking$s2 === void 0 || _appointmentBooking$s2.batchSetItems(detail.productList);
194
+ }
195
+ }) : null, /*#__PURE__*/React.createElement("div", {
196
+ className: "voucher-code-input-wrapper"
197
+ }, /*#__PURE__*/React.createElement("div", {
198
+ className: "voucher-code-input"
199
+ }, /*#__PURE__*/React.createElement("div", {
200
+ style: {
201
+ whiteSpace: 'nowrap'
202
+ }
203
+ }, locales.getText('pisell2.text.goodpass.code'), ":"), /*#__PURE__*/React.createElement(PisellInput, {
204
+ value: code,
205
+ onChange: function onChange(e) {
206
+ var _e$target;
207
+ setCode((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
208
+ },
209
+ size: "small",
210
+ placeholder: locales.getText('pisell2.text.goodpass.enter-code'),
211
+ suffix: /*#__PURE__*/React.createElement(PisellTooltip, {
212
+ title: ""
213
+ }, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
214
+ style: {
215
+ color: 'rgba(0,0,0,.45)'
216
+ }
217
+ }))
218
+ })), /*#__PURE__*/React.createElement(Button, {
219
+ size: "small",
220
+ onClick: onScanCode,
221
+ disabled: !code
222
+ }, locales.getText('pisell2.text.apply')))));
223
+ };
224
+ return /*#__PURE__*/React.createElement("div", {
225
+ className: "pisell-lowcode__booking-footer-voucher-container"
226
+ }, isUserLoggedIn ? renderVoucherInfo() : renderLoginCard());
227
+ };
228
+ export default VoucherCard;
@@ -0,0 +1,26 @@
1
+ .pisell-lowcode__booking-footer-voucher-container {
2
+ .login-card {
3
+ border-radius: 8px;
4
+ border: 1px solid var(--Gray-300, #d0d5dd);
5
+ background: #fff;
6
+ display: flex;
7
+ padding: 12px;
8
+ justify-content: center;
9
+ align-items: center;
10
+ gap: 10px;
11
+ color: var(--Gray-500, #667085);
12
+ font-family: Inter;
13
+ font-size: 14px;
14
+ font-style: normal;
15
+ font-weight: 600;
16
+
17
+ .text-wrapper {
18
+ max-width: 200px;
19
+ }
20
+
21
+ .login-btn {
22
+ cursor: pointer;
23
+ color: #8157d5;
24
+ }
25
+ }
26
+ }
@@ -1,4 +1,5 @@
1
1
  export declare const useAppointmentBooking: () => any;
2
+ export declare const useShopDiscount: () => any;
2
3
  export declare const useAppointmentBookingStep: () => void;
3
4
  export declare const useAppointmentBookingProduct: () => void;
4
5
  export declare const useAppointmentBookingCart: () => {
@@ -23,6 +23,10 @@ export var useAppointmentBooking = function useAppointmentBooking() {
23
23
  var pisellOS = usePisellOS();
24
24
  return pisellOS.getModule('appointmentBooking');
25
25
  };
26
+ export var useShopDiscount = function useShopDiscount() {
27
+ var pisellOS = usePisellOS();
28
+ return pisellOS.getModule('shopDiscount');
29
+ };
26
30
  export var useAppointmentBookingStep = function useAppointmentBookingStep() {
27
31
  var _appointmentBooking$s;
28
32
  var pisellOS = usePisellOS();
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AppointmentBooking: () => JSX.Element;
3
4
  export default AppointmentBooking;
@@ -75,6 +75,15 @@ declare const _default: {
75
75
  'pisell2.appointment.edit.service': string;
76
76
  'pisell2.appointment.remove.guest': string;
77
77
  'pisell2.appointment.no.available.service': string;
78
+ 'pisell2.text.apply': string;
79
+ 'pisell2.text.goodpass': string;
80
+ 'pisell2.text.goodpass.product-vouchers': string;
81
+ 'pisell2.text.goodpass.view-more': string;
82
+ 'pisell2.text.goodpass.code': string;
83
+ 'pisell2.text.goodpass.enter-code': string;
84
+ 'pisell2.text.goodpass.code-invalid': string;
85
+ 'pisell2.text.goodpass.login': string;
86
+ 'pisell2.text.goodpass.login-tip': string;
78
87
  };
79
88
  'zh-CN': {
80
89
  'pisell2.event.calendar.limit.unavailable': string;
@@ -152,6 +161,15 @@ declare const _default: {
152
161
  'pisell2.appointment.edit.service': string;
153
162
  'pisell2.appointment.remove.guest': string;
154
163
  'pisell2.appointment.no.available.service': string;
164
+ 'pisell2.text.apply': string;
165
+ 'pisell2.text.goodpass': string;
166
+ 'pisell2.text.goodpass.product-vouchers': string;
167
+ 'pisell2.text.goodpass.view-more': string;
168
+ 'pisell2.text.goodpass.code': string;
169
+ 'pisell2.text.goodpass.enter-code': string;
170
+ 'pisell2.text.goodpass.code-invalid': string;
171
+ 'pisell2.text.goodpass.login': string;
172
+ 'pisell2.text.goodpass.login-tip': string;
155
173
  };
156
174
  'zh-HK': {
157
175
  'pisell2.event.calendar.limit.unavailable': string;
@@ -229,6 +247,15 @@ declare const _default: {
229
247
  'pisell2.appointment.edit.service': string;
230
248
  'pisell2.appointment.remove.guest': string;
231
249
  'pisell2.appointment.no.available.service': string;
250
+ 'pisell2.text.apply': string;
251
+ 'pisell2.text.goodpass': string;
252
+ 'pisell2.text.goodpass.product-vouchers': string;
253
+ 'pisell2.text.goodpass.view-more': string;
254
+ 'pisell2.text.goodpass.code': string;
255
+ 'pisell2.text.goodpass.enter-code': string;
256
+ 'pisell2.text.goodpass.code-invalid': string;
257
+ 'pisell2.text.goodpass.login': string;
258
+ 'pisell2.text.goodpass.login-tip': string;
232
259
  };
233
260
  };
234
261
  export default _default;
@@ -88,7 +88,16 @@ export default {
88
88
  'pisell2.appointment.add.guest': "Add guest",
89
89
  'pisell2.appointment.edit.service': "Edit services",
90
90
  'pisell2.appointment.remove.guest': "Remove guest",
91
- 'pisell2.appointment.no.available.service': "No available times for this service. Please choose another."
91
+ 'pisell2.appointment.no.available.service': "No available times for this service. Please choose another.",
92
+ 'pisell2.text.apply': 'Apply',
93
+ 'pisell2.text.goodpass': "GoodPass",
94
+ 'pisell2.text.goodpass.product-vouchers': "Product Vouchers",
95
+ 'pisell2.text.goodpass.view-more': "View More",
96
+ 'pisell2.text.goodpass.code': "Code",
97
+ 'pisell2.text.goodpass.enter-code': "Enter Code",
98
+ 'pisell2.text.goodpass.code-invalid': "Current code is invalid",
99
+ 'pisell2.text.goodpass.login': 'Login',
100
+ 'pisell2.text.goodpass.login-tip': ' for member benefit Or use account credit'
92
101
  },
93
102
  'zh-CN': {
94
103
  'pisell2.event.calendar.limit.unavailable': "不可预约",
@@ -179,7 +188,16 @@ export default {
179
188
  'pisell2.appointment.add.guest': "添加预约人",
180
189
  'pisell2.appointment.edit.service': "编辑服务",
181
190
  'pisell2.appointment.remove.guest': "移除预约人",
182
- 'pisell2.appointment.no.available.service': "此服务无可用时间,请选择其他服务。"
191
+ 'pisell2.appointment.no.available.service': "此服务无可用时间,请选择其他服务。",
192
+ 'pisell2.text.apply': '应用',
193
+ 'pisell2.text.goodpass': "商品券",
194
+ 'pisell2.text.goodpass.product-vouchers': "商品兑换券",
195
+ 'pisell2.text.goodpass.view-more': "查看更多",
196
+ 'pisell2.text.goodpass.code': "券码",
197
+ 'pisell2.text.goodpass.enter-code': "请输入券码",
198
+ 'pisell2.text.goodpass.code-invalid': "当前券码不可用",
199
+ 'pisell2.text.goodpass.login': '登录',
200
+ 'pisell2.text.goodpass.login-tip': '以获取会员福利或使用账户积分'
183
201
  },
184
202
  'zh-HK': {
185
203
  'pisell2.event.calendar.limit.unavailable': "不可預約",
@@ -270,6 +288,15 @@ export default {
270
288
  'pisell2.appointment.add.guest': "添加預約人",
271
289
  'pisell2.appointment.edit.service': "編輯服務",
272
290
  'pisell2.appointment.remove.guest': "移除預約人",
273
- 'pisell2.appointment.no.available.service': "此服务无可用时间,请选择其他服务。"
291
+ 'pisell2.appointment.no.available.service': "此服务无可用时间,请选择其他服务。",
292
+ 'pisell2.text.apply': '應用',
293
+ 'pisell2.text.goodpass': "商品券",
294
+ 'pisell2.text.goodpass.product-vouchers': "商品兌換券",
295
+ 'pisell2.text.goodpass.view-more': "查看更多",
296
+ 'pisell2.text.goodpass.code': "券碼",
297
+ 'pisell2.text.goodpass.enter-code': "請輸入券碼",
298
+ 'pisell2.text.goodpass.code-invalid': "當前券碼不可用",
299
+ 'pisell2.text.goodpass.login': '登錄',
300
+ 'pisell2.text.goodpass.login-tip': '以獲取會員福利或使用賬戶積分'
274
301
  }
275
302
  };
@@ -152,7 +152,9 @@ export var formatCarts = function formatCarts(data, resources) {
152
152
  duration_type: d.duration.type,
153
153
  locale: locale,
154
154
  symbol: symbol,
155
- resources: currentResources
155
+ resources: currentResources,
156
+ is_hide_like: true,
157
+ holder_title: ''
156
158
  });
157
159
  });
158
160
  };
@@ -474,6 +474,7 @@ var Addons = Provider(function (props) {
474
474
  }
475
475
  return /*#__PURE__*/React.createElement(Footer, {
476
476
  state: state,
477
+ dispatch: dispatch,
477
478
  buttons: _footer,
478
479
  source: "addons"
479
480
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  interface TabProductProps {
3
4
  list: any[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
3
4
  export default ProductItem;
@@ -34,6 +34,7 @@ import { getSumTotal, is_price_include_tax } from "./amount";
34
34
  import "./index.less";
35
35
  import { createEventBooking, editEventBooking } from "./serve";
36
36
  import { formatValues } from "./utils";
37
+ import VoucherCard from "../voucher";
37
38
 
38
39
  /**
39
40
  * @title: 底部
@@ -1167,7 +1168,10 @@ var Footer = function Footer(props) {
1167
1168
  round: true,
1168
1169
  loading: showFooter,
1169
1170
  active: true
1170
- }, /*#__PURE__*/React.createElement("div", {
1171
+ }, /*#__PURE__*/React.createElement(VoucherCard, {
1172
+ state: state,
1173
+ dispatch: dispatch
1174
+ }), /*#__PURE__*/React.createElement("div", {
1171
1175
  className: "pisell-lowcode__booking-footer-total"
1172
1176
  }, /*#__PURE__*/React.createElement("span", {
1173
1177
  className: "pisell-lowcode__booking-footer-left"
@@ -222,6 +222,20 @@ var formatMetaData = function formatMetaData(item) {
222
222
  }
223
223
  return metadata;
224
224
  };
225
+ var formatDiscountList = function formatDiscountList(list) {
226
+ return list.map(function (item) {
227
+ var _item$discount, _item$discount2, _item$discount3, _item$discount4;
228
+ return {
229
+ amount: item.amount,
230
+ product_id: item.product_id || ((_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.product_id),
231
+ resource_id: item.resource_id || ((_item$discount2 = item.discount) === null || _item$discount2 === void 0 ? void 0 : _item$discount2.resource_id),
232
+ title: item.title || ((_item$discount3 = item.discount) === null || _item$discount3 === void 0 ? void 0 : _item$discount3.title),
233
+ original_amount: item.original_amount || ((_item$discount4 = item.discount) === null || _item$discount4 === void 0 ? void 0 : _item$discount4.original_amount),
234
+ id: item.id,
235
+ type: item.type
236
+ };
237
+ });
238
+ };
225
239
 
226
240
  /**
227
241
  * @title: 格式化商品数据
@@ -236,6 +250,7 @@ var formatProducts = function formatProducts(item) {
236
250
  var total = Number(item._extend.total);
237
251
  var origin_total = Number(item._extend.origin_total);
238
252
  var discount_amount = origin_total - total;
253
+ var discount_list = formatDiscountList((item === null || item === void 0 ? void 0 : item.discount_list) || []);
239
254
 
240
255
  // 加价时type使用change_price
241
256
  var discount_type = discount_amount < 0 ? 'change_price' : 'discount';
@@ -243,7 +258,7 @@ var formatProducts = function formatProducts(item) {
243
258
  "num": item._extend.quantity,
244
259
  "price": formatProductPrice(item),
245
260
  "product_id": (item === null || item === void 0 ? void 0 : item.product_id) || item.id,
246
- "discount_amount": discount_amount,
261
+ "discount_amount": discount_list.length > 0 ? 0 : discount_amount,
247
262
  "product_discount_reason": item._extend.discount_reason || '',
248
263
  "is_charge_tax": item.is_charge_tax,
249
264
  "note": (item === null || item === void 0 ? void 0 : item.note) || '',
@@ -255,6 +270,7 @@ var formatProducts = function formatProducts(item) {
255
270
  "bundle_edit": item._extend.bundle_edit,
256
271
  "product_option_item": formatProductOption((_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 || (_item$_extend10 = _item$_extend10.other) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.option),
257
272
  "product_variant_id": ((_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 || (_item$_extend11 = _item$_extend11.other) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.product_variant_id) || 0,
273
+ "discount_list": discount_list,
258
274
  metadata: formatMetaData(item)
259
275
  };
260
276
  };
@@ -513,7 +529,7 @@ export var formatValues = function formatValues(state) {
513
529
  // 客户
514
530
  var customer = formatCustomer(state);
515
531
  values = _objectSpread(_objectSpread({}, values), customer);
516
-
532
+ debugger;
517
533
  // 主体
518
534
  values.holder = formatHolder(state, values);
519
535
  if (isDay) {
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const VoucherCard: (props: any) => JSX.Element;
3
+ export default VoucherCard;