@pisell/private-materials 6.4.81 → 6.4.82

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 (222) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +1 -1
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  10. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  12. package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  13. package/es/components/booking/addons/index.js +1 -1
  14. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  15. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  16. package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
  17. package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
  18. package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  19. package/es/components/booking/components/footer/amount.js +48 -34
  20. package/es/components/booking/components/footer/utils.js +38 -38
  21. package/es/components/booking/components/voucher/index.js +3 -1
  22. package/es/components/booking/forms/footer.d.ts +1 -0
  23. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  24. package/es/components/booking/forms/single/index.d.ts +1 -0
  25. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  26. package/es/components/booking/hooks/useQuotation.js +4 -1
  27. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  28. package/es/components/booking/info/date/index.d.ts +1 -0
  29. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  30. package/es/components/booking/info/notes/index.d.ts +1 -0
  31. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  32. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  33. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  34. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  35. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  36. package/es/components/booking/info2/service/editNormalService/index.js +6 -0
  37. package/es/components/booking/info2/service/editService/index.js +16 -6
  38. package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
  39. package/es/components/booking/info2/service/editService/utils.js +66 -0
  40. package/es/components/booking/materiels/contacts/index.d.ts +1 -0
  41. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  42. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  43. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  44. package/es/components/checkout/components/AmountSummary/index.less +4 -5
  45. package/es/components/eftpos/index.d.ts +1 -0
  46. package/es/components/eftpos/pos.d.ts +1 -0
  47. package/es/components/eftposPay/amount.d.ts +1 -0
  48. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  49. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  50. package/es/components/eftposPay/component/fail/network.d.ts +1 -0
  51. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  52. package/es/components/eftposPay/component/manual/index.d.ts +1 -0
  53. package/es/components/eftposPay/component/signature/index.d.ts +1 -0
  54. package/es/components/eftposPay/pay.d.ts +1 -0
  55. package/es/components/eftposPay/payo/config.d.ts +1 -0
  56. package/es/components/eftposPay/tip.d.ts +1 -0
  57. package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  58. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  59. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
  60. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  61. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  62. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  63. package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  64. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  65. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  66. package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  67. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  68. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  69. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  70. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  71. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  72. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  73. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  74. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  75. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  76. package/es/components/login/index.d.ts +1 -0
  77. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  78. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  79. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  80. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  81. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  82. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  83. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  84. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  85. package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  86. package/es/components/schedules/calendar/index.d.ts +1 -0
  87. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  88. package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
  89. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  90. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  91. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  92. package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  93. package/es/components/schedules/products/list/index.d.ts +1 -0
  94. package/es/components/schedules/resources/index.d.ts +1 -0
  95. package/es/components/schedules/resources/list/index.d.ts +1 -0
  96. package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  97. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  98. package/es/components/schedules/schedules/index.d.ts +1 -0
  99. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  100. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  101. package/es/components/shoppingCart/index.d.ts +1 -0
  102. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  103. package/es/hooks/usePaymentLogger.d.ts +1 -0
  104. package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
  105. package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
  106. package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
  107. package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
  108. package/es/plus/saasRegister/components/Header.d.ts +1 -0
  109. package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
  110. package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
  111. package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  112. package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
  113. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  114. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  115. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +35 -30
  116. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  117. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  118. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  119. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  120. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  121. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  122. package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
  123. package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
  124. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  125. package/lib/components/booking/components/footer/amount.js +29 -15
  126. package/lib/components/booking/components/footer/utils.js +8 -8
  127. package/lib/components/booking/components/voucher/index.js +4 -2
  128. package/lib/components/booking/forms/footer.d.ts +1 -0
  129. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  130. package/lib/components/booking/forms/single/index.d.ts +1 -0
  131. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  132. package/lib/components/booking/hooks/useQuotation.js +2 -1
  133. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  134. package/lib/components/booking/info/date/index.d.ts +1 -0
  135. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  136. package/lib/components/booking/info/notes/index.d.ts +1 -0
  137. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  138. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  139. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  140. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  141. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  142. package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
  143. package/lib/components/booking/info2/service/editService/index.js +12 -3
  144. package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
  145. package/lib/components/booking/info2/service/editService/utils.js +40 -3
  146. package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
  147. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  148. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  149. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  150. package/lib/components/checkout/components/AmountSummary/index.less +4 -5
  151. package/lib/components/eftpos/index.d.ts +1 -0
  152. package/lib/components/eftpos/pos.d.ts +1 -0
  153. package/lib/components/eftposPay/amount.d.ts +1 -0
  154. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  155. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  156. package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
  157. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  158. package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
  159. package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
  160. package/lib/components/eftposPay/pay.d.ts +1 -0
  161. package/lib/components/eftposPay/payo/config.d.ts +1 -0
  162. package/lib/components/eftposPay/tip.d.ts +1 -0
  163. package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  164. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  165. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
  166. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  167. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  168. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  169. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  170. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  171. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  172. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  173. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  174. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  175. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  176. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  177. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  178. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  179. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  180. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  181. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  182. package/lib/components/login/index.d.ts +1 -0
  183. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  184. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  185. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  186. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  187. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  188. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  189. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  190. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  191. package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  192. package/lib/components/schedules/calendar/index.d.ts +1 -0
  193. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  194. package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
  195. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  196. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  197. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  198. package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  199. package/lib/components/schedules/products/list/index.d.ts +1 -0
  200. package/lib/components/schedules/resources/index.d.ts +1 -0
  201. package/lib/components/schedules/resources/list/index.d.ts +1 -0
  202. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  203. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  204. package/lib/components/schedules/schedules/index.d.ts +1 -0
  205. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  206. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  207. package/lib/components/shoppingCart/index.d.ts +1 -0
  208. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  209. package/lib/hooks/usePaymentLogger.d.ts +1 -0
  210. package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
  211. package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
  212. package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
  213. package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
  214. package/lib/plus/saasRegister/components/Header.d.ts +1 -0
  215. package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
  216. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
  217. package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  218. package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
  219. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  220. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  221. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +34 -39
  222. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../index.less';
2
3
  declare const VertifyEmail: (props: {
3
4
  email: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const RelationProduct: ({ value, onChange, }: {
3
4
  value?: string[] | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface IPassListProps {
2
3
  dataSource: any[];
3
4
  value?: string | number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface TimelineSectionProps {
3
4
  code: string;
@@ -22,7 +22,6 @@ import { useControllableValue } from 'ahooks';
22
22
  import { merge, omit } from 'lodash';
23
23
  //@ts-ignore
24
24
  import { locales } from '@pisell/utils';
25
- import { VirtualInput } from '@pisell/materials';
26
25
  import Shortcuts from "../shortcuts";
27
26
  import CashKeyboardSimple from "./CashKeyboardSimple";
28
27
  import { setKeyboardTheme } from "../../utils";
@@ -30,6 +29,7 @@ import "./index.less";
30
29
  import Decimal from 'decimal.js';
31
30
  import { AutoResizeText } from '@pisell/materials';
32
31
  import { formatAmountWithOptions } from '@pisell/utils';
32
+ import { Iconfont } from '@pisell/materials';
33
33
  var CashKeyboardIntact = function CashKeyboardIntact(props) {
34
34
  var _mergedDisplayField$b, _mergedDisplayField$c, _mergedDisplayField$c2;
35
35
  var amountSymbol = props.amountSymbol,
@@ -251,47 +251,52 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
251
251
  showCurrencySymbol: true
252
252
  }))))), ((_mergedDisplayField$c = mergedDisplayField.cashReceived) === null || _mergedDisplayField$c === void 0 ? void 0 : _mergedDisplayField$c.visible) && /*#__PURE__*/React.createElement("div", {
253
253
  style: _objectSpread(_objectSpread({}, getGridStyle(1)), {}, {
254
- padding: '6px 16px',
254
+ padding: '0px 16px',
255
255
  borderRadius: '8px',
256
256
  backgroundColor: 'white',
257
257
  boxShadow: 'inset 0 2px 4px rgba(16, 24, 40, 0.08), inset 0 -2px 4px rgba(16, 24, 40, 0.08), inset 2px 0 4px rgba(16, 24, 40, 0.08), inset -2px 0 4px rgba(16, 24, 40, 0.08)',
258
258
  overflow: 'hidden',
259
259
  maxWidth: 188,
260
260
  cursor: 'pointer',
261
- border: '1px solid #7f56da'
261
+ border: '1px solid #7f56da',
262
+ borderBottom: '1px solid #7f56da'
262
263
  }),
263
264
  onClick: function onClick() {
264
265
  setIsShowModal(true);
265
266
  }
266
- }, /*#__PURE__*/React.createElement(VirtualInput, {
267
- showCursor: false,
268
- focused: true,
269
- wrapperStyle: {
270
- width: '100%'
271
- },
272
- topContent: /*#__PURE__*/React.createElement("div", {
273
- style: {
274
- fontSize: '14px',
275
- color: '#667085'
276
- }
277
- }, mergedDisplayField.cashReceived.label),
278
- value: internalValue ? formatAmountWithOptions(internalValue || '', amountSymbol, {
279
- value: internalValue,
280
- hideDecimalForWholeNumbers: false,
281
- precision: 2,
282
- showCurrencySymbol: true
283
- }) : '',
284
- height: 30,
285
- fontSize: 20,
286
- placeholder: placeholder,
267
+ }, /*#__PURE__*/React.createElement("div", {
268
+ className: "pisell-cash-keyboard-intact-container-top",
269
+ style: _objectSpread(_objectSpread({}, getGridStyle(0)), {}, {
270
+ overflow: 'hidden',
271
+ padding: '5px 0'
272
+ })
273
+ }, /*#__PURE__*/React.createElement("div", {
274
+ className: "pisell-cash-keyboard-intact-container-top-label"
275
+ }, mergedDisplayField.cashReceived.label), /*#__PURE__*/React.createElement("div", {
276
+ className: "pisell-cash-keyboard-intact-container-top-value"
277
+ }, /*#__PURE__*/React.createElement(AutoResizeText, {
278
+ minFontSizePx: 10,
279
+ maxFontSizePx: 18,
280
+ fontSizePrecisionPx: 0.5,
281
+ style: {
282
+ color: '#7f56da',
283
+ textDecoration: 'underline',
284
+ textUnderlineOffset: '3px'
285
+ }
286
+ }, internalValue ? formatAmountWithOptions(internalValue || '', amountSymbol, {
287
+ value: internalValue,
288
+ hideDecimalForWholeNumbers: false,
289
+ precision: 2,
290
+ showCurrencySymbol: true
291
+ }) : ''), /*#__PURE__*/React.createElement(Iconfont, {
292
+ type: "pisell2-edit-05",
287
293
  style: {
288
- fontSize: '24px',
289
- fontWeight: 'bold',
290
- border: 'none',
291
- background: 'transparent',
292
- width: '100%'
294
+ color: '#7f56da',
295
+ fontSize: '18px',
296
+ marginLeft: '4px',
297
+ marginTop: '4px'
293
298
  }
294
- })), ((_mergedDisplayField$c2 = mergedDisplayField.changeDue) === null || _mergedDisplayField$c2 === void 0 ? void 0 : _mergedDisplayField$c2.visible) && /*#__PURE__*/React.createElement("div", {
299
+ })))), ((_mergedDisplayField$c2 = mergedDisplayField.changeDue) === null || _mergedDisplayField$c2 === void 0 ? void 0 : _mergedDisplayField$c2.visible) && /*#__PURE__*/React.createElement("div", {
295
300
  className: "pisell-cash-keyboard-intact-container-top",
296
301
  style: _objectSpread(_objectSpread({}, getGridStyle(2)), {}, {
297
302
  overflow: 'hidden'
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
3
4
  export default Total;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const CartItem: ({ onNext, renderContactInfo }: any) => JSX.Element;
3
4
  export default CartItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Cart: ({ open, onCancel, onNext }: any) => JSX.Element;
3
4
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  export declare const DepositContent: (props: {
3
4
  isAgreeDepositPolicy: boolean;
@@ -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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const SelectProductItem: ({ item, onClick, onChangeQuantity, amountSymbol, style, className, disabled, }: any) => JSX.Element;
3
4
  export default SelectProductItem;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const renderBundles: (item: any, amountSymbol: string) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 空状态
3
4
  * @description:
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const FooterMenus: ({ state, menuChange, items }: any) => JSX.Element | null;
3
4
  export default FooterMenus;
@@ -374,18 +374,14 @@ var getDiscountAmount = (discounts) => {
374
374
  }, new import_decimal.default(0)).toNumber();
375
375
  };
376
376
  var getMainProductTotal = (item) => {
377
- var _a, _b, _c, _d;
378
- let total = new import_decimal.default(item._extend.main_product_selling_price || item._extend.price || 0);
379
- if (!item._extend.main_product_selling_price) {
380
- const discountAmount = getDiscountAmount(item.discount_list);
381
- total = total.minus(discountAmount);
382
- }
383
- if (((_a = item._extend.other) == null ? void 0 : _a.option) && Array.isArray((_b = item._extend.other) == null ? void 0 : _b.option)) {
384
- total = total.add((_c = item._extend.other) == null ? void 0 : _c.option.reduce((t, option) => {
377
+ var _a, _b, _c, _d, _e, _f;
378
+ let total = new import_decimal.default(((_a = item._extend) == null ? void 0 : _a.main_product_selling_price) ?? ((_b = item == null ? void 0 : item.metadata) == null ? void 0 : _b.main_product_selling_price) ?? item._extend.price ?? 0);
379
+ if (((_c = item._extend.other) == null ? void 0 : _c.option) && Array.isArray((_d = item._extend.other) == null ? void 0 : _d.option)) {
380
+ total = total.add((_e = item._extend.other) == null ? void 0 : _e.option.reduce((t, option) => {
385
381
  return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
386
382
  }, new import_decimal.default(0)));
387
383
  }
388
- for (let bundleItem of ((_d = item._extend.other) == null ? void 0 : _d.bundle) || []) {
384
+ for (let bundleItem of ((_f = item._extend.other) == null ? void 0 : _f.bundle) || []) {
389
385
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
390
386
  const discountAmount = getDiscountAmount(bundleItem.discount_list);
391
387
  const bundleItemPrice = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
@@ -572,8 +568,12 @@ var getSurcharge = (state, options) => {
572
568
  }
573
569
  }, 0);
574
570
  let fixedTotal = new import_decimal.default(0);
571
+ let productTotalSurcharge = new import_decimal.default(0);
575
572
  if (matchedItems.length > 0) {
576
573
  let configTotal = new import_decimal.default(0);
574
+ if (fixed && new import_decimal.default(fixed).gt(0)) {
575
+ configTotal = configTotal.plus(fixed);
576
+ }
577
577
  if (percentage && new import_decimal.default(percentage).gt(0) || fixed) {
578
578
  const percentageRate = new import_decimal.default(percentage);
579
579
  for (let [index, item] of matchedItems.entries()) {
@@ -582,6 +582,7 @@ var getSurcharge = (state, options) => {
582
582
  const itemQuantity = new import_decimal.default(item.isMain ? item.quantity || 1 : item.quantity * item.mainQuantity || 1);
583
583
  const addTimeTotal = new import_decimal.default(item.addTimeTotal || 0);
584
584
  const itemTotalSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
585
+ configTotal = configTotal.plus(itemTotalSurcharge);
585
586
  const itemSurcharge = itemPrice.times(percentageRate);
586
587
  const fixedSurcharge = new import_decimal.default(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
587
588
  const quantity = item.isMain ? item.quantity : item.quantity * item.mainQuantity;
@@ -589,6 +590,7 @@ var getSurcharge = (state, options) => {
589
590
  if (isLast && fixedTotal.gt(0)) {
590
591
  const remaining = new import_decimal.default(fixed).minus(fixedTotal).toNumber();
591
592
  if (remaining > 0) {
593
+ productTotalSurcharge = productTotalSurcharge.plus(remaining);
592
594
  if (item.isMain) {
593
595
  item.item._extend.surcharge_rounding_remainder = remaining;
594
596
  } else {
@@ -599,20 +601,32 @@ var getSurcharge = (state, options) => {
599
601
  if (open_product !== 0) {
600
602
  if (item.isMain) {
601
603
  const originSurchargeFee = new import_decimal.default(item.item._extend.surcharge_fee || 0);
602
- item.item._extend.surcharge_fee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toNumber();
604
+ const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
605
+ productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
606
+ item.item._extend.surcharge_fee = surchargeFee;
603
607
  item.item._extend.relation_surcharge_ids = [...((_d = item.item._extend) == null ? void 0 : _d.relation_surcharge_ids) || [], id];
604
608
  } else {
605
609
  const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
606
- item.item.surcharge_fee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toNumber();
610
+ const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
611
+ productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
612
+ item.item.surcharge_fee = surchargeFee;
607
613
  item.item.relation_surcharge_ids = [...((_e = item.item) == null ? void 0 : _e.relation_surcharge_ids) || [], id];
608
614
  }
609
615
  }
610
- configTotal = configTotal.plus(itemTotalSurcharge);
616
+ if (isLast && configTotal.minus(productTotalSurcharge).gt(0)) {
617
+ const configTotalRounded = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
618
+ if (item.isMain) {
619
+ let newRoundingRemainder = new import_decimal.default(item.item._extend.surcharge_rounding_remainder || 0);
620
+ newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
621
+ item.item._extend.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
622
+ } else {
623
+ let newRoundingRemainder = new import_decimal.default(item.item.surcharge_rounding_remainder || 0);
624
+ newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
625
+ item.item.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
626
+ }
627
+ }
611
628
  }
612
629
  }
613
- if (fixed && new import_decimal.default(fixed).gt(0)) {
614
- configTotal = configTotal.plus(fixed);
615
- }
616
630
  finalAmount = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
617
631
  }
618
632
  const name = surchargeConfig.name || {};
@@ -129,8 +129,8 @@ var formatProductBundle = (bundle) => {
129
129
  "custom_price": (d == null ? void 0 : d.custom_price) || Math.abs(new import_decimal.default((d == null ? void 0 : d.original_price) || (d == null ? void 0 : d.product_price)).sub(option_price).toNumber()).toFixed(2),
130
130
  "custom_price_type": d == null ? void 0 : d.price_type,
131
131
  "option": option,
132
- "bundle_selling_price": d == null ? void 0 : d.price,
133
- "bundle_sum_price": (d == null ? void 0 : d.original_price) || (d == null ? void 0 : d.original_total),
132
+ "bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
133
+ // "bundle_sum_price": d?.original_price || d?.original_total,
134
134
  "metadata": {
135
135
  custom_product_bundle_map_id: d._id,
136
136
  // 子商品单数量附加费
@@ -241,7 +241,7 @@ var formatHolders = (state, item, values) => {
241
241
  var formatProductPrice = (item) => {
242
242
  var _a, _b, _c, _d;
243
243
  const other = (_a = item._extend) == null ? void 0 : _a.other;
244
- let price = Number((_b = item._extend) == null ? void 0 : _b.price);
244
+ let price = Number((item == null ? void 0 : item.price) ?? ((_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.price));
245
245
  if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_c = item == null ? void 0 : item.variant) == null ? void 0 : _c.length) > 0) {
246
246
  const variant = item.variant.find(
247
247
  (d) => d.id === (other == null ? void 0 : other.product_variant_id)
@@ -317,19 +317,19 @@ var getSourceProductPrice = (item) => {
317
317
  return price;
318
318
  };
319
319
  var getMainProductSellingPrice = (item) => {
320
- var _a, _b, _c, _d, _e;
321
- if (!(0, import_utils5.isNumber)((_a = item._extend) == null ? void 0 : _a.main_product_selling_price)) {
320
+ var _a, _b, _c, _d, _e, _f;
321
+ if (!(0, import_utils5.isNumber)((_a = item._extend) == null ? void 0 : _a.main_product_selling_price) && !(0, import_utils5.isString)((_b = item._extend) == null ? void 0 : _b.main_product_selling_price)) {
322
322
  return void 0;
323
323
  }
324
324
  let optionPrice = new import_decimal.default(0);
325
- if (((_b = item._extend.other) == null ? void 0 : _b.option) && Array.isArray((_c = item._extend.other) == null ? void 0 : _c.option)) {
326
- optionPrice = (_d = item._extend.other) == null ? void 0 : _d.option.reduce((accumulator, currentValue) => {
325
+ if (((_c = item._extend.other) == null ? void 0 : _c.option) && Array.isArray((_d = item._extend.other) == null ? void 0 : _d.option)) {
326
+ optionPrice = (_e = item._extend.other) == null ? void 0 : _e.option.reduce((accumulator, currentValue) => {
327
327
  const currentPrice = new import_decimal.default(currentValue.price || 0);
328
328
  const currentNum = new import_decimal.default(currentValue.num || 0);
329
329
  return accumulator.add(currentPrice.mul(currentNum));
330
330
  }, optionPrice);
331
331
  }
332
- return new import_decimal.default((_e = item._extend) == null ? void 0 : _e.main_product_selling_price).add(optionPrice).toNumber();
332
+ return new import_decimal.default((_f = item._extend) == null ? void 0 : _f.main_product_selling_price).add(optionPrice).toNumber();
333
333
  };
334
334
  var formatProducts = (item, quantity) => {
335
335
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
@@ -60,6 +60,8 @@ var VoucherCard = (props) => {
60
60
  const isBooking4Shop = (0, import_useIsBooking4Shop.useIsBooking4Shop)(state);
61
61
  const shopDiscount = (0, import_useShopDiscountModule.useShopDiscountModule)();
62
62
  const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
63
+ const stateRef = (0, import_react.useRef)(state);
64
+ stateRef.current = state;
63
65
  services = state.service;
64
66
  const changeCustomerToGlobalState = (0, import_ahooks.useMemoizedFn)((value) => {
65
67
  dispatch({
@@ -161,8 +163,8 @@ var VoucherCard = (props) => {
161
163
  }
162
164
  if (isBooking4Shop) {
163
165
  const val = shopDiscount.calcDiscount([
164
- ...state.service.value,
165
- ...state.addons.value
166
+ ...stateRef.current.service.value,
167
+ ...stateRef.current.addons.value
166
168
  ]);
167
169
  console.log("input: ", state.service.value);
168
170
  console.log("output: ", val);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface FooterProps {
2
3
  state: any;
3
4
  reload: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SendModalValues } from './index';
2
3
  declare const useSendModal: (bookingId?: number) => {
3
4
  open: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  /**
3
4
  * @title: 表单选择器
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useClearCart: (state: any, dispatch: any) => false | JSX.Element;
2
3
  export default useClearCart;
@@ -95,10 +95,11 @@ var setNewCartValue = (cartValue, newProducts) => {
95
95
  }
96
96
  const selectBundleInfo = item._extend.other.bundle.find((item2) => item2.id === bundle.id);
97
97
  const optionPrice = calculateTotalPrice((selectBundleInfo == null ? void 0 : selectBundleInfo.option) || []);
98
+ const isEditDiscount = item.booking_id && (bundle.discount_list || []).length;
98
99
  return {
99
100
  ...bundle,
100
101
  base_price: bundleItemMap[bundle.id].base_price,
101
- price: new import_decimal.default(bundleItemMap[bundle.id].price || 0).add(optionPrice).toNumber()
102
+ price: isEditDiscount ? bundle.price : new import_decimal.default(bundleItemMap[bundle.id].price || 0).add(optionPrice).toNumber()
102
103
  // product_price: bundleItemMap[item.id].product_price,
103
104
  };
104
105
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from '../../../model';
2
3
  interface useClientFnParams {
3
4
  state: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  export declare const updateServiceDate: (services: any[], date: any, isTime: boolean) => any[];
3
4
  declare const DateCom: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EditServiceRef } from "../service/editService";
3
2
  declare const useInfoHolder: (state: any, dispatch: any) => {
4
3
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Notes: () => JSX.Element | null;
2
3
  export default Notes;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const Actions: ({ currentService }: {
3
4
  currentService: any;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../../../info/service/actions/index.less';
2
3
  declare const Actions: ({ currentService }: {
3
4
  currentService: any;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const ContactInfoMode: () => JSX.Element;
2
3
  export default ContactInfoMode;
@@ -36,6 +36,7 @@ var import_react = __toESM(require("react"));
36
36
  var import_ahooks = require("ahooks");
37
37
  var import_skuDetailModal = __toESM(require("../../../../../pro/skuDetailModal"));
38
38
  var import_model = require("../../../info/model");
39
+ var import_utils = require("../editService/utils");
39
40
  var EditNormalService = (0, import_react.forwardRef)((props, ref) => {
40
41
  const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
41
42
  const modalRef = (0, import_react.useRef)(null);
@@ -62,7 +63,12 @@ var EditNormalService = (0, import_react.forwardRef)((props, ref) => {
62
63
  const handleConfirm = (0, import_ahooks.useMemoizedFn)((data) => {
63
64
  var _a, _b;
64
65
  const newProducts = (_b = ((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value) || []) == null ? void 0 : _b.map((item) => {
66
+ var _a2, _b2;
65
67
  if (item._id == data._id) {
68
+ data = (0, import_utils.setProductPrice)(data, {
69
+ newTotal: (_a2 = data._extend) == null ? void 0 : _a2.total,
70
+ origin_total: (_b2 = data._extend) == null ? void 0 : _b2.origin_total
71
+ });
66
72
  return data;
67
73
  }
68
74
  return item;
@@ -53,6 +53,7 @@ var import_utils5 = require("../../../info/utils");
53
53
  var import_utils6 = require("../../../utils");
54
54
  var import_utilsByBooking = require("../../utilsByBooking");
55
55
  var import_utils7 = require("../addService/utils");
56
+ var import_utils8 = require("./utils");
56
57
  var import_noteModal = __toESM(require("../../../../../plus/noteModal"));
57
58
  var import_priceKeyboard = require("../../../../../pro/priceKeyboard");
58
59
  var submitLock = false;
@@ -187,7 +188,7 @@ var Info = (_, ref) => {
187
188
  form.setFieldsValue({ discount });
188
189
  };
189
190
  const onFinish = (values) => {
190
- var _a2, _b2, _c2, _d2;
191
+ var _a2, _b2, _c2, _d2, _e2, _f2;
191
192
  let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
192
193
  if (isShowTimeAndResource && !isSuccess) {
193
194
  return;
@@ -222,19 +223,27 @@ var Info = (_, ref) => {
222
223
  _item._time = (/* @__PURE__ */ new Date()).getTime();
223
224
  _item._serviceKey = (0, import_utils3.genServiceKey)(_item);
224
225
  let _id = _item == null ? void 0 : _item._id;
226
+ _item = (0, import_utils8.setProductPrice)(_item, {
227
+ newTotal: values.total,
228
+ origin_total: (_c2 = _item._extend) == null ? void 0 : _c2.origin_total
229
+ });
225
230
  if (!_list.some((d) => d._id === _id)) {
226
231
  const detail = (0, import_utils3.addService)(_list, _item, state);
227
232
  _list = detail.list;
228
233
  } else {
229
234
  if (isChangeTotal.current) {
230
235
  delete _item.discount_list;
236
+ _item = (0, import_utils8.setProductPrice)(_item, {
237
+ newTotal: values.total,
238
+ origin_total: (_d2 = _item._extend) == null ? void 0 : _d2.origin_total
239
+ });
231
240
  }
232
241
  _list = _list.map((d) => d._id === _id ? { ..._item, new: 0 } : d);
233
242
  }
234
243
  (0, import_utils6.deleteCacheParams)();
235
244
  console.log("_onFinish", _list);
236
245
  form.resetFields();
237
- if (!!((_c2 = state.service.cacheItem) == null ? void 0 : _c2.new)) {
246
+ if (!!((_e2 = state.service.cacheItem) == null ? void 0 : _e2.new)) {
238
247
  window.dispatchEvent(
239
248
  new CustomEvent("onAddNewService", {
240
249
  detail: {
@@ -243,7 +252,7 @@ var Info = (_, ref) => {
243
252
  })
244
253
  );
245
254
  }
246
- (_d2 = window.closeBookingEditModal) == null ? void 0 : _d2.call(window);
255
+ (_f2 = window.closeBookingEditModal) == null ? void 0 : _f2.call(window);
247
256
  dispatch({
248
257
  type: "setService",
249
258
  payload: {
@@ -11,3 +11,18 @@ export declare const getAutoAllocationStorage: (id: string | number) => any;
11
11
  export declare const setAutoAllocationStorage: (data: {
12
12
  [key: string]: boolean;
13
13
  }) => void;
14
+ /**
15
+ * 手动折扣后给商品价格和子商品价格重新计算
16
+ *
17
+ * 计算逻辑:
18
+ * 1. 子商品(bundle + option)按折扣比例计算,直接截取两位小数(不四舍五入)
19
+ * 2. 主商品价格 = newTotal - 所有子商品价格总和(确保总价精确等于 newTotal)
20
+ *
21
+ * @param cacheItem - 缓存的商品项
22
+ * @param newTotal - 折扣后的新总价
23
+ * @param origin_total - 原始总价
24
+ */
25
+ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total }: {
26
+ newTotal: number;
27
+ origin_total: number;
28
+ }) => any;
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,21 +16,32 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/booking/info2/service/editService/utils.tsx
20
30
  var utils_exports = {};
21
31
  __export(utils_exports, {
22
32
  getAutoAllocationStorage: () => getAutoAllocationStorage,
23
- setAutoAllocationStorage: () => setAutoAllocationStorage
33
+ setAutoAllocationStorage: () => setAutoAllocationStorage,
34
+ setProductPrice: () => setProductPrice
24
35
  });
25
36
  module.exports = __toCommonJS(utils_exports);
26
37
  var import_utils = require("@pisell/utils");
38
+ var import_utils2 = require("@pisell/utils");
39
+ var import_decimal = __toESM(require("decimal.js"));
27
40
  var getAutoAllocationStorage = (id) => {
28
41
  const value = localStorage.getItem("resource-auto-allocation");
29
42
  if (value) {
30
43
  const valueObj = JSON.parse(value);
31
- return (0, import_utils.isBoolean)(valueObj[id]) ? valueObj[id] : true;
44
+ return (0, import_utils2.isBoolean)(valueObj[id]) ? valueObj[id] : true;
32
45
  }
33
46
  return true;
34
47
  };
@@ -41,8 +54,32 @@ var setAutoAllocationStorage = (data) => {
41
54
  localStorage.setItem("resource-auto-allocation", JSON.stringify({ ...data }));
42
55
  }
43
56
  };
57
+ var setProductPrice = (cacheItem, { newTotal, origin_total }) => {
58
+ var _a, _b, _c, _d, _e, _f, _g, _h;
59
+ const discountRatio = new import_decimal.default(newTotal).div(new import_decimal.default(origin_total));
60
+ let subTotal = new import_decimal.default(0);
61
+ if (((_a = cacheItem._extend.other) == null ? void 0 : _a.bundle) && (0, import_utils.isArr)((_b = cacheItem._extend.other) == null ? void 0 : _b.bundle)) {
62
+ (_d = (_c = cacheItem._extend.other) == null ? void 0 : _c.bundle) == null ? void 0 : _d.forEach((bundle) => {
63
+ const newPrice = new import_decimal.default(bundle.original_price || bundle.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
64
+ const quantity = bundle.num ?? bundle.quantity ?? 1;
65
+ subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
66
+ bundle.price = newPrice;
67
+ });
68
+ }
69
+ if (((_e = cacheItem._extend.other) == null ? void 0 : _e.option) && (0, import_utils.isArr)((_f = cacheItem._extend.other) == null ? void 0 : _f.option)) {
70
+ (_h = (_g = cacheItem._extend.other) == null ? void 0 : _g.option) == null ? void 0 : _h.forEach((option) => {
71
+ const newPrice = new import_decimal.default(option.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
72
+ const quantity = option.num ?? option.quantity ?? 1;
73
+ subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
74
+ option.price = newPrice;
75
+ });
76
+ }
77
+ cacheItem._extend.price = new import_decimal.default(newTotal).sub(subTotal).toNumber();
78
+ return cacheItem;
79
+ };
44
80
  // Annotate the CommonJS export names for ESM import in node:
45
81
  0 && (module.exports = {
46
82
  getAutoAllocationStorage,
47
- setAutoAllocationStorage
83
+ setAutoAllocationStorage,
84
+ setProductPrice
48
85
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare type ContactType = {
3
4
  country_calling_code: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SelectProps } from 'antd';
2
3
  interface DurationProps extends SelectProps {
3
4
  locale?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SelectProps } from "antd";
2
3
  interface StartTimeProps extends SelectProps {
3
4
  locale?: string;