@pisell/private-materials 6.3.111 → 6.3.113

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 (111) 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 +4 -4
  7. package/build/lowcode/render/default/view.js +4 -4
  8. package/build/lowcode/view.js +4 -4
  9. package/es/components/booking/addons/model.d.ts +10 -1
  10. package/es/components/booking/components/footer/utils.js +4 -4
  11. package/es/components/booking/forms/model.d.ts +10 -1
  12. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  13. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  14. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  15. package/es/components/booking/info/model.d.ts +10 -1
  16. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  18. package/es/components/booking/info2/service/editService/index.js +36 -6
  19. package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
  20. package/es/components/booking/info2/service/editService/utils.js +76 -0
  21. package/es/components/booking/model.d.ts +9 -1
  22. package/es/components/booking/notes/model.d.ts +10 -1
  23. package/es/components/booking/payments/model.d.ts +10 -1
  24. package/es/components/booking/utils.d.ts +2 -2
  25. package/es/components/eftpos/hooks.d.ts +0 -1
  26. package/es/components/eftposPay/amount.d.ts +1 -1
  27. package/es/components/eftposPay/device.d.ts +1 -1
  28. package/es/components/eftposPay/hooks.d.ts +1 -1
  29. package/es/components/eftposPay/store/index.d.ts +4 -4
  30. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  31. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  32. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  33. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  34. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  35. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  36. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  37. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  38. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  39. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  40. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  41. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  43. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +165 -142
  44. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  45. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
  46. package/es/components/pay/toC/WalletPassBlock/index.js +3 -1
  47. package/es/components/pay/toC/index.js +65 -31
  48. package/es/components/pay/toC/model.d.ts +10 -1
  49. package/es/components/pay/toC/serve.d.ts +18 -0
  50. package/es/components/pay/toC/serve.js +42 -15
  51. package/es/components/pay/toC/utils.d.ts +2 -2
  52. package/es/components/pay/toC/utils.js +4 -0
  53. package/es/components/schedules/model.d.ts +9 -1
  54. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  55. package/es/hooks/usePaymentLogger.d.ts +0 -1
  56. package/es/plus/pisellSalesManagement/config/booking.d.ts +6 -7
  57. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  58. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  59. package/es/pro/Selector/Selector.d.ts +1 -1
  60. package/lib/components/booking/addons/model.d.ts +10 -1
  61. package/lib/components/booking/components/footer/utils.js +2 -2
  62. package/lib/components/booking/forms/model.d.ts +10 -1
  63. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  64. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  65. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  66. package/lib/components/booking/info/model.d.ts +10 -1
  67. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  68. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  69. package/lib/components/booking/info2/service/editService/index.js +24 -1
  70. package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
  71. package/lib/components/booking/info2/service/editService/utils.js +38 -2
  72. package/lib/components/booking/model.d.ts +9 -1
  73. package/lib/components/booking/notes/model.d.ts +10 -1
  74. package/lib/components/booking/payments/model.d.ts +10 -1
  75. package/lib/components/booking/utils.d.ts +2 -2
  76. package/lib/components/eftpos/hooks.d.ts +0 -1
  77. package/lib/components/eftposPay/amount.d.ts +1 -1
  78. package/lib/components/eftposPay/device.d.ts +1 -1
  79. package/lib/components/eftposPay/hooks.d.ts +1 -1
  80. package/lib/components/eftposPay/store/index.d.ts +4 -4
  81. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  82. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  83. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  84. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  85. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  86. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  87. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  88. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  89. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  90. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  91. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  92. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  93. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  94. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +90 -100
  95. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  96. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
  97. package/lib/components/pay/toC/WalletPassBlock/index.js +3 -1
  98. package/lib/components/pay/toC/index.js +52 -19
  99. package/lib/components/pay/toC/model.d.ts +10 -1
  100. package/lib/components/pay/toC/serve.d.ts +18 -0
  101. package/lib/components/pay/toC/serve.js +6 -0
  102. package/lib/components/pay/toC/utils.d.ts +2 -2
  103. package/lib/components/pay/toC/utils.js +6 -2
  104. package/lib/components/schedules/model.d.ts +9 -1
  105. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  106. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  107. package/lib/plus/pisellSalesManagement/config/booking.d.ts +6 -7
  108. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  109. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  110. package/lib/pro/Selector/Selector.d.ts +1 -1
  111. package/package.json +4 -4
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -270,9 +270,9 @@ var formatHolders = function formatHolders(state, item, values) {
270
270
  * @Date: 2024-12-23 12:05
271
271
  */
272
272
  export var formatProductPrice = function formatProductPrice(item) {
273
- var _item$_extend6, _item$_extend7, _item$variant;
273
+ var _item$_extend6, _item$price, _item$_extend7, _item$variant;
274
274
  var other = (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.other;
275
- var price = Number((_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.price);
275
+ var price = Number((_item$price = item === null || item === void 0 ? void 0 : item.price) !== null && _item$price !== void 0 ? _item$price : item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.price);
276
276
 
277
277
  // 组合规格: 根据当前选择的组合规格id 和商品的组合规格列表 获取当前商品的价格
278
278
  if ((other === null || other === void 0 ? void 0 : other.product_variant_id) > 0 && (item === null || item === void 0 || (_item$variant = item.variant) === null || _item$variant === void 0 ? void 0 : _item$variant.length) > 0) {
@@ -341,9 +341,9 @@ var formatMetaData = function formatMetaData(item, isMultiDayPrices) {
341
341
 
342
342
  // 获取商品价格 包含组合规格
343
343
  var getSourceProductPrice = function getSourceProductPrice(item) {
344
- var _item$_extend14, _item$_extend15, _item$variant2;
344
+ var _item$_extend14, _item$price2, _item$_extend15, _item$variant2;
345
345
  var other = (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.other;
346
- var price = Number((_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.price);
346
+ var price = Number((_item$price2 = item === null || item === void 0 ? void 0 : item.price) !== null && _item$price2 !== void 0 ? _item$price2 : (_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.price);
347
347
 
348
348
  // 组合规格: 根据当前选择的组合规格id 和商品的组合规格列表 获取当前商品的价格
349
349
  if ((other === null || other === void 0 ? void 0 : other.product_variant_id) > 0 && (item === null || item === void 0 || (_item$variant2 = item.variant) === null || _item$variant2 === void 0 ? void 0 : _item$variant2.length) > 0) {
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SendModalValues } from './index';
3
2
  declare const useSendModal: (bookingId?: number) => {
4
3
  open: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -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,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -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;
@@ -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;
@@ -36,6 +36,8 @@ import { PisellAdjustPriceInputNumber } from '@pisell/materials';
36
36
  import { editSessionProduct } from "../../../info/utils";
37
37
  import { isNormalProductByDurationSchedule } from "../../../info/service2/utils";
38
38
  import { addService, genServiceKey, getIsShowNumber } from "../../../../ticketBooking/utils";
39
+ import { Decimal } from "decimal.js";
40
+ import { setProductPrice } from "./utils";
39
41
  var submitLock = false;
40
42
  var Info = function Info(_, ref) {
41
43
  var _state$service4, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI4, _state$service$cacheI5, _state$service6, _window$BaseMaterials, _state$service8, _state$service$cacheI10, _state$bookingConfig5, _state$service$cacheI11, _state$service$cacheI12, _state$service9, _state$service$resour2, _state$service$cacheI13, _state$service$cacheI14;
@@ -218,7 +220,7 @@ var Info = function Info(_, ref) {
218
220
  * @Date: 2024-01-09 14:04
219
221
  */
220
222
  var onFinish = function onFinish(values) {
221
- var _resourcesRef$current, _item$_extend;
223
+ var _resourcesRef$current, _item$_extend, _item2, _item$_extend2;
222
224
  var isSuccess = (_resourcesRef$current = resourcesRef.current) === null || _resourcesRef$current === void 0 ? void 0 : _resourcesRef$current.check();
223
225
  if (isShowTimeAndResource && !isSuccess) {
224
226
  return;
@@ -249,13 +251,41 @@ var Info = function Info(_, ref) {
249
251
  endDate = _getServiceTimes.endDate;
250
252
  _extend.startDate = startDate;
251
253
  _extend.endDate = endDate;
254
+ if (isChangeTotal.current) {
255
+ var _extend$other, _extend$other2;
256
+ // 计算折扣比例
257
+ var discountRatio = new Decimal(values.total).div(_item._extend.origin_total);
258
+
259
+ // 处理子商品
260
+ var _bundles = (_extend === null || _extend === void 0 || (_extend$other = _extend.other) === null || _extend$other === void 0 ? void 0 : _extend$other.bundle) || [];
261
+ var childProductsTotal = new Decimal(0);
262
+ if (_bundles.length > 0) {
263
+ _bundles.forEach(function (bundle) {
264
+ // 计算子商品折扣后的单价(保留两位小数)
265
+ var discountedPrice = new Decimal(bundle.original_price).mul(discountRatio).toDecimalPlaces(2, Decimal.ROUND_HALF_UP);
266
+ bundle.bundle_selling_price = discountedPrice.toNumber();
267
+
268
+ // 累计子商品折扣后总价
269
+ childProductsTotal = childProductsTotal.add(discountedPrice.mul(bundle.quantity));
270
+ });
271
+ }
272
+
273
+ // 计算主商品折扣后的单价
274
+ var mainProductTotal = new Decimal(values.total).sub(childProductsTotal);
275
+ var mainProductQuantity = ((_extend$other2 = _extend.other) === null || _extend$other2 === void 0 ? void 0 : _extend$other2.quantity) || _extend.quantity || 1;
276
+ _extend.main_product_selling_price = mainProductTotal.div(mainProductQuantity).toNumber();
277
+ }
252
278
  if (_extend.bundle_edit !== undefined) {
253
279
  _extend.bundle_edit = 1;
254
280
  }
255
281
  _item._extend = _extend;
256
282
  _item._time = new Date().getTime();
257
283
  _item._serviceKey = genServiceKey(_item);
258
- var _id = _item === null || _item === void 0 ? void 0 : _item._id;
284
+ var _id = (_item2 = _item) === null || _item2 === void 0 ? void 0 : _item2._id;
285
+ _item = setProductPrice(_item, {
286
+ newTotal: values.total,
287
+ origin_total: (_item$_extend2 = _item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.origin_total
288
+ });
259
289
 
260
290
  // 判断是新增还是编辑
261
291
  if (!_list.some(function (d) {
@@ -453,11 +483,11 @@ var Info = function Info(_, ref) {
453
483
  var isSession = isSessionProduct(item);
454
484
  var sessionValue = {};
455
485
  if (isSession) {
456
- var _item$_extend2, _item$_extend3, _item$_extend4;
486
+ var _item$_extend3, _item$_extend4, _item$_extend5;
457
487
  sessionValue.startEndTime = {
458
- startDate: item === null || item === void 0 || (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.start_date,
459
- endDate: item === null || item === void 0 || (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.end_date,
460
- duration: item === null || item === void 0 || (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.duration
488
+ startDate: item === null || item === void 0 || (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.start_date,
489
+ endDate: item === null || item === void 0 || (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.end_date,
490
+ duration: item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.duration
461
491
  };
462
492
  }
463
493
 
@@ -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;
@@ -15,6 +15,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
15
15
  */
16
16
 
17
17
  import { isBoolean } from "@pisell/utils";
18
+ import { getTimeObj } from "../addService/utils";
19
+ import { Decimal } from "decimal.js";
20
+ import { isArr } from "@pisell/utils";
18
21
  var isNewService = function isNewService(service) {
19
22
  return !service.new && service._extend.endDate;
20
23
  };
@@ -52,4 +55,77 @@ export var setAutoAllocationStorage = function setAutoAllocationStorage(data) {
52
55
  } else {
53
56
  localStorage.setItem('resource-auto-allocation', JSON.stringify(_objectSpread({}, data)));
54
57
  }
58
+ };
59
+
60
+ /**
61
+ * 手动折扣后给商品价格和子商品价格重新计算
62
+ *
63
+ * 计算逻辑:
64
+ * 1. 子商品(bundle + option)按折扣比例计算,直接截取两位小数(不四舍五入)
65
+ * 2. 主商品价格 = newTotal - 所有子商品价格总和(确保总价精确等于 newTotal)
66
+ *
67
+ * @param cacheItem - 缓存的商品项
68
+ * @param newTotal - 折扣后的新总价
69
+ * @param origin_total - 原始总价
70
+ */
71
+ export var setProductPrice = function setProductPrice(cacheItem, _ref2) {
72
+ var _cacheItem$discount_l, _cacheItem$_extend$ot, _cacheItem$_extend$ot2, _cacheItem$_extend$ot4, _cacheItem$_extend$ot5;
73
+ var newTotal = _ref2.newTotal,
74
+ origin_total = _ref2.origin_total;
75
+ if (cacheItem !== null && cacheItem !== void 0 && (_cacheItem$discount_l = cacheItem.discount_list) !== null && _cacheItem$discount_l !== void 0 && _cacheItem$discount_l.length && ((cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.discount_list) || []).some(function (item) {
76
+ return ['good_pass', 'discount_card', 'product_discount_card'].includes(item.type);
77
+ })) {
78
+ return cacheItem;
79
+ }
80
+ if (cacheItem.discount_amount) {
81
+ return cacheItem;
82
+ }
83
+
84
+ // 计算折扣比例
85
+ var discountRatio = new Decimal(newTotal).div(new Decimal(origin_total));
86
+
87
+ // 用于累加子商品总价c
88
+ var subTotal = new Decimal(0);
89
+
90
+ // 处理 bundle 子商品
91
+ if ((_cacheItem$_extend$ot = cacheItem._extend.other) !== null && _cacheItem$_extend$ot !== void 0 && _cacheItem$_extend$ot.bundle && isArr((_cacheItem$_extend$ot2 = cacheItem._extend.other) === null || _cacheItem$_extend$ot2 === void 0 ? void 0 : _cacheItem$_extend$ot2.bundle)) {
92
+ var _cacheItem$_extend$ot3;
93
+ (_cacheItem$_extend$ot3 = cacheItem._extend.other) === null || _cacheItem$_extend$ot3 === void 0 || (_cacheItem$_extend$ot3 = _cacheItem$_extend$ot3.bundle) === null || _cacheItem$_extend$ot3 === void 0 || _cacheItem$_extend$ot3.forEach(function (bundle) {
94
+ var _ref3, _bundle$num;
95
+ // 计算新价格,直接截取两位小数(不四舍五入)
96
+ var newPrice = new Decimal(bundle.original_price || bundle.price).mul(discountRatio).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber();
97
+
98
+ // 获取数量,优先取 num,再取 quantity,默认为 1
99
+ var quantity = (_ref3 = (_bundle$num = bundle.num) !== null && _bundle$num !== void 0 ? _bundle$num : bundle.quantity) !== null && _ref3 !== void 0 ? _ref3 : 1;
100
+
101
+ // 累加到子商品总价
102
+ subTotal = subTotal.add(new Decimal(newPrice).mul(quantity));
103
+
104
+ // 设置新价格
105
+ bundle.price = newPrice;
106
+ });
107
+ }
108
+
109
+ // 处理 option 子商品
110
+ if ((_cacheItem$_extend$ot4 = cacheItem._extend.other) !== null && _cacheItem$_extend$ot4 !== void 0 && _cacheItem$_extend$ot4.option && isArr((_cacheItem$_extend$ot5 = cacheItem._extend.other) === null || _cacheItem$_extend$ot5 === void 0 ? void 0 : _cacheItem$_extend$ot5.option)) {
111
+ var _cacheItem$_extend$ot6;
112
+ (_cacheItem$_extend$ot6 = cacheItem._extend.other) === null || _cacheItem$_extend$ot6 === void 0 || (_cacheItem$_extend$ot6 = _cacheItem$_extend$ot6.option) === null || _cacheItem$_extend$ot6 === void 0 || _cacheItem$_extend$ot6.forEach(function (option) {
113
+ var _ref4, _option$num;
114
+ // 计算新价格,直接截取两位小数(不四舍五入)
115
+ var newPrice = new Decimal(option.price).mul(discountRatio).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber();
116
+
117
+ // 获取数量,优先取 num,再取 quantity,默认为 1
118
+ var quantity = (_ref4 = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref4 !== void 0 ? _ref4 : 1;
119
+
120
+ // 累加到子商品总价
121
+ subTotal = subTotal.add(new Decimal(newPrice).mul(quantity));
122
+
123
+ // 设置新价格
124
+ option.price = newPrice;
125
+ });
126
+ }
127
+
128
+ // 主商品价格 = newTotal - 子商品总价(让主商品吸收精度误差,确保总价精确)
129
+ cacheItem._extend.price = new Decimal(newTotal).sub(subTotal).toNumber();
130
+ return cacheItem;
55
131
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -109,4 +110,11 @@ export declare const walkInData: {
109
110
  id: number;
110
111
  nickname: string;
111
112
  };
112
- export declare const Provider: any, Context: any;
113
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
114
+ state: FormState;
115
+ } & {
116
+ dispatch: (params: {
117
+ type: string;
118
+ payload: any;
119
+ }) => void;
120
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -166,10 +166,10 @@ export declare const getProductTotalPrice: (item: any) => number;
166
166
  export declare const getDuration: (duration: number | {
167
167
  type: string;
168
168
  value: number;
169
- }) => number | {
169
+ }) => number | "flexible" | {
170
170
  type: string;
171
171
  value: number;
172
- } | "flexible";
172
+ };
173
173
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
174
174
  export declare const getIsEdit: (state: any) => boolean;
175
175
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Eftpos } from './const';
3
2
  /**
4
3
  * @title: tyro 设备连接
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -197,7 +197,7 @@ export declare const updateComponent: (component: string, render?: boolean) => {
197
197
  } | {
198
198
  readonly type: "step";
199
199
  readonly render: boolean;
200
- readonly component?: undefined;
200
+ component?: undefined;
201
201
  };
202
202
  };
203
203
  /**
@@ -297,10 +297,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  name?: string | undefined;
298
298
  symbol?: string | undefined;
299
299
  amount?: string | number | undefined;
300
- mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
300
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
301
301
  order_id?: string | number | undefined;
302
- eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
303
- action?: "pay" | "amount" | "deviceList" | undefined;
302
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
303
+ action?: "amount" | "pay" | "deviceList" | undefined;
304
304
  key?: number | undefined;
305
305
  step?: number | undefined;
306
306
  title?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @title: 获取 Tyro 资源
4
3
  * @description:
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ErrorTip: ({ text }: any) => import("react").JSX.Element;
4
3
  export default ErrorTip;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => import("react").JSX.Element;
4
3
  export default Status;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type CallToBookProps = {
3
2
  show: boolean;
4
3
  type: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const WeekItem: (props: any) => import("react").JSX.Element;
4
3
  export default WeekItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type CalenDateWeekProps = {
4
3
  currentDate: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const DayItem: (props: any) => import("react").JSX.Element;
4
3
  export default DayItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { CalendarItemProps } from '../../../../../type';
4
3
  declare const Item: (props: CalendarItemProps) => import("react").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => import("react").JSX.Element;
4
3
  export default Status;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const StripePayment: () => import("react").JSX.Element;
3
2
  export default StripePayment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
3
2
  public_key: string;
4
3
  client_secret?: string | undefined;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PageLoading: () => import("react").JSX.Element;
3
2
  export default PageLoading;
@@ -15,11 +15,16 @@ export interface WalletPassProps {
15
15
  walletPass: {
16
16
  cards: WalletPassDataType[];
17
17
  amount: number;
18
+ recommended?: WalletPassDataType[];
19
+ transformList?: WalletPassDataType[];
20
+ noApplicableVoucher?: WalletPassDataType[];
18
21
  };
19
22
  walletSetting: {
20
23
  name: string;
21
24
  popup_status: 0 | 1;
22
25
  };
26
+ orderDetail: any;
27
+ total_amount: number;
23
28
  }
24
29
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WalletPassProps & React.RefAttributes<WalletPassRef>>>;
25
30
  export default _default;