@pisell/private-materials 3.4.55 → 3.4.56

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 (134) 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 +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
  12. package/es/components/booking/addons/index.js +20 -17
  13. package/es/components/booking/components/footer/utils.d.ts +6 -0
  14. package/es/components/booking/components/footer/utils.js +117 -53
  15. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  16. package/es/components/booking/components/voucher/index.js +27 -12
  17. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  18. package/es/components/booking/info/service/like/index.d.ts +1 -0
  19. package/es/components/booking/info/service2/utils.d.ts +1 -1
  20. package/es/components/booking/info/service2/utils.js +1 -0
  21. package/es/components/booking/info2/service/addService/index.js +3 -3
  22. package/es/components/booking/utils.d.ts +3 -2
  23. package/es/components/booking/utils.js +16 -2
  24. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  25. package/es/components/eftpos/form/index.d.ts +1 -0
  26. package/es/components/eftpos/group/index.d.ts +1 -0
  27. package/es/components/eftpos/hooks.d.ts +1 -0
  28. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  29. package/es/components/eftpos/icon/device.d.ts +1 -0
  30. package/es/components/eftpos/receipt/index.d.ts +1 -0
  31. package/es/components/eftposPay/amount.d.ts +1 -1
  32. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  33. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  34. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  35. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  36. package/es/components/eftposPay/device.d.ts +1 -1
  37. package/es/components/eftposPay/hooks.d.ts +2 -2
  38. package/es/components/eftposPay/store/index.d.ts +6 -6
  39. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  40. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  43. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  44. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  45. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  46. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  47. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  48. package/es/components/systemSettings/registry/components/SectionList.js +5 -1
  49. package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
  50. package/es/components/ticketBooking/utils/index.js +23 -8
  51. package/es/components/wallet/Detail/index.js +34 -2
  52. package/es/components/wallet/Detail/index.less +11 -0
  53. package/es/components/wallet/Detail/locales.d.ts +6 -0
  54. package/es/components/wallet/Detail/locales.js +14 -2
  55. package/es/components/wallet/Voucher/index.js +11 -10
  56. package/es/components/wallet/components/WalletCard.js +5 -1
  57. package/es/components/wallet/index.js +4 -2
  58. package/es/components/wallet/serve.d.ts +7 -0
  59. package/es/components/wallet/utils.d.ts +48 -0
  60. package/es/components/wallet/utils.js +342 -0
  61. package/es/index.d.ts +1 -0
  62. package/es/index.js +1 -0
  63. package/es/plus/clientName/index.d.ts +1 -0
  64. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  65. package/es/plus/walletPassGallery/components/passDetail/index.js +79 -30
  66. package/es/plus/walletPassGallery/index.js +4 -2
  67. package/es/plus/walletPassGallery/serve.d.ts +3 -0
  68. package/es/plus/walletPassGallery/serve.js +4 -2
  69. package/es/pro/Login2.0/AuthModal.js +12 -4
  70. package/es/pro/Login2.0/index.less +7 -7
  71. package/es/pro/pisellPaymentList/example.d.ts +1 -0
  72. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  73. package/lib/components/booking/addons/index.js +10 -7
  74. package/lib/components/booking/components/footer/utils.d.ts +6 -0
  75. package/lib/components/booking/components/footer/utils.js +86 -36
  76. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  77. package/lib/components/booking/components/voucher/index.js +23 -7
  78. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  79. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  80. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  81. package/lib/components/booking/info/service2/utils.js +1 -0
  82. package/lib/components/booking/info2/service/addService/index.js +2 -2
  83. package/lib/components/booking/utils.d.ts +3 -2
  84. package/lib/components/booking/utils.js +12 -0
  85. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  86. package/lib/components/eftpos/form/index.d.ts +1 -0
  87. package/lib/components/eftpos/group/index.d.ts +1 -0
  88. package/lib/components/eftpos/hooks.d.ts +1 -0
  89. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  90. package/lib/components/eftpos/icon/device.d.ts +1 -0
  91. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  92. package/lib/components/eftposPay/amount.d.ts +1 -1
  93. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  94. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  95. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  96. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  97. package/lib/components/eftposPay/device.d.ts +1 -1
  98. package/lib/components/eftposPay/hooks.d.ts +2 -2
  99. package/lib/components/eftposPay/store/index.d.ts +6 -6
  100. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  101. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  102. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  103. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  104. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  105. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  106. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  107. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  108. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  109. package/lib/components/systemSettings/registry/components/SectionList.js +4 -1
  110. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  111. package/lib/components/ticketBooking/utils/index.js +9 -4
  112. package/lib/components/wallet/Detail/index.js +31 -3
  113. package/lib/components/wallet/Detail/index.less +11 -0
  114. package/lib/components/wallet/Detail/locales.d.ts +6 -0
  115. package/lib/components/wallet/Detail/locales.js +14 -2
  116. package/lib/components/wallet/Voucher/index.js +8 -8
  117. package/lib/components/wallet/components/WalletCard.js +4 -0
  118. package/lib/components/wallet/index.js +2 -2
  119. package/lib/components/wallet/serve.d.ts +7 -0
  120. package/lib/components/wallet/utils.d.ts +48 -0
  121. package/lib/components/wallet/utils.js +287 -0
  122. package/lib/index.d.ts +1 -0
  123. package/lib/index.js +3 -0
  124. package/lib/plus/clientName/index.d.ts +1 -0
  125. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  126. package/lib/plus/walletPassGallery/components/passDetail/index.js +50 -14
  127. package/lib/plus/walletPassGallery/index.js +4 -2
  128. package/lib/plus/walletPassGallery/serve.d.ts +3 -0
  129. package/lib/plus/walletPassGallery/serve.js +3 -2
  130. package/lib/pro/Login2.0/AuthModal.js +15 -7
  131. package/lib/pro/Login2.0/index.less +7 -7
  132. package/lib/pro/pisellPaymentList/example.d.ts +1 -0
  133. package/lowcode/wallet-pass-detail/meta.ts +89 -0
  134. package/package.json +3 -3
@@ -17,6 +17,7 @@ export interface IWalletListParmsProps {
17
17
  skip?: number;
18
18
  filter_wallet_id?: string;
19
19
  available: 0 | 1;
20
+ with?: string[];
20
21
  }
21
22
  /**
22
23
  * 钱包列表项属性接口
@@ -171,6 +172,8 @@ export declare const getAssetList: (params: IAssetListProps) => Promise<{
171
172
  */
172
173
  export declare const getDetailApi: (params: {
173
174
  id: string;
175
+ order_behavior_count_customer_id: string;
176
+ apiPrefix: string;
174
177
  }) => Promise<IDetailResponse>;
175
178
  /**
176
179
  * 详情响应数据结构,供组件消费
@@ -214,10 +214,12 @@ export var getDetailApi = /*#__PURE__*/function () {
214
214
  while (1) switch (_context6.prev = _context6.next) {
215
215
  case 0:
216
216
  _context6.next = 2;
217
- return request.getRequest().get("/h5/machinecode/lowcode/detail/".concat(params.id), {
217
+ return request.getRequest().get("".concat(params.apiPrefix || '/h5', "/machinecode/lowcode/detail/").concat(params.id), {
218
218
  order_behavior_count: 1,
219
219
  // 订单行为次数
220
- order_behavior_count_customer: 1 // 客户订单行为次数
220
+ order_behavior_count_customer: 1,
221
+ // 客户订单行为次数
222
+ order_behavior_count_customer_id: params.apiPrefix === '/shop' ? params.order_behavior_count_customer_id : undefined
221
223
  }, {
222
224
  isOriginHost: true
223
225
  });
@@ -84,7 +84,7 @@ var AuthModal = function AuthModal() {
84
84
 
85
85
  // 转换配置为 Login2 所需的格式
86
86
  var login2Config = useMemo(function () {
87
- var _config$auth, _authMethods$email, _authMethods$phone, _authMethods$google, _authMethods$facebook, _authMethods$apple, _authMethods$guest, _config$page, _config$page2, _config$page3, _config$page4, _config$page5, _config$page6, _config$page7;
87
+ var _config$auth, _authMethods$email, _authMethods$phone, _authMethods$google, _authMethods$facebook, _authMethods$apple, _authMethods$guest, _config$page, _config$page2, _config$page3, _config$page4, _config$page5, _config$page6, _config$logoSize, _config$logoSize2, _config$page7;
88
88
  if (!localesInitialized) {
89
89
  return {
90
90
  loginMethods: [],
@@ -302,7 +302,11 @@ var AuthModal = function AuthModal() {
302
302
  show: config !== null && config !== void 0 && config.logo ? true : false,
303
303
  url: config === null || config === void 0 ? void 0 : config.logo,
304
304
  // 直接从 config.logo 读取
305
- position: 'center'
305
+ position: 'center',
306
+ size: {
307
+ width: (config === null || config === void 0 || (_config$logoSize = config.logoSize) === null || _config$logoSize === void 0 ? void 0 : _config$logoSize.width) || 48,
308
+ height: (config === null || config === void 0 || (_config$logoSize2 = config.logoSize) === null || _config$logoSize2 === void 0 ? void 0 : _config$logoSize2.height) || 48
309
+ }
306
310
  } : undefined,
307
311
  themeColor: (config === null || config === void 0 || (_config$page7 = config.page) === null || _config$page7 === void 0 || (_config$page7 = _config$page7.login) === null || _config$page7 === void 0 || (_config$page7 = _config$page7.ui) === null || _config$page7 === void 0 ? void 0 : _config$page7.themeColor) || '#7F56D9',
308
312
  formLabels: {
@@ -325,7 +329,7 @@ var AuthModal = function AuthModal() {
325
329
 
326
330
  // 转换配置为 Register2 所需的格式
327
331
  var register2Config = useMemo(function () {
328
- var _config$auth2, _authMethods$email2, _authMethods$phone2, _authMethods$google2, _authMethods$facebook2, _authMethods$apple2, _config$page8, _config$page9, _config$page10, _config$auth3;
332
+ var _config$auth2, _authMethods$email2, _authMethods$phone2, _authMethods$google2, _authMethods$facebook2, _authMethods$apple2, _config$page8, _config$page9, _config$logoSize3, _config$logoSize4, _config$page10, _config$auth3;
329
333
  if (!localesInitialized) {
330
334
  return {
331
335
  registrationMethods: [],
@@ -471,7 +475,11 @@ var AuthModal = function AuthModal() {
471
475
  show: config.logo ? true : false,
472
476
  url: config.logo,
473
477
  // 直接从 config.logo 读取
474
- position: 'center'
478
+ position: 'center',
479
+ size: {
480
+ width: (config === null || config === void 0 || (_config$logoSize3 = config.logoSize) === null || _config$logoSize3 === void 0 ? void 0 : _config$logoSize3.width) || 48,
481
+ height: (config === null || config === void 0 || (_config$logoSize4 = config.logoSize) === null || _config$logoSize4 === void 0 ? void 0 : _config$logoSize4.height) || 48
482
+ }
475
483
  } : undefined,
476
484
  themeColor: ((_config$page10 = config.page) === null || _config$page10 === void 0 || (_config$page10 = _config$page10.register) === null || _config$page10 === void 0 || (_config$page10 = _config$page10.ui) === null || _config$page10 === void 0 ? void 0 : _config$page10.themeColor) || '#7F56D9',
477
485
  passwordRules: transformPasswordRules((_config$auth3 = config.auth) === null || _config$auth3 === void 0 ? void 0 : _config$auth3.password),
@@ -326,21 +326,21 @@
326
326
  .login2-submit-button {
327
327
  height: 44px;
328
328
  border-radius: 8px;
329
- border: 1px solid var(--theme-color, #7f56d9);
330
- background: var(--theme-color, #7f56d9);
329
+ border: 1px solid var(--custom-button-bg-color, var(--theme-color, #7f56d9));
330
+ background: var(--custom-button-bg-color, var(--theme-color, #7f56d9));
331
331
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
332
332
  font-size: 16px;
333
333
  font-weight: 600;
334
- color: #ffffff;
334
+ color: var(--custom-button-text-color, #ffffff);
335
335
 
336
336
  &:hover:not(:disabled) {
337
- background: #6941c6;
338
- border-color: #6941c6;
337
+ background: var(--custom-button-bg-color, #6941c6);
338
+ border-color: var(--custom-button-bg-color, #6941c6);
339
339
  }
340
340
 
341
341
  &:focus {
342
- background: var(--theme-color, #7f56d9);
343
- border-color: var(--theme-color, #7f56d9);
342
+ background: var(--custom-button-bg-color, var(--theme-color, #7f56d9));
343
+ border-color: var(--custom-button-bg-color, var(--theme-color, #7f56d9));
344
344
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05),
345
345
  0px 0px 0px 4px rgba(127, 86, 217, 0.1);
346
346
  }
@@ -4,6 +4,7 @@
4
4
  * 这个文件演示了如何使用 PisellPaymentList 和 PisellPaymentListItem 组件
5
5
  * 包括如何通过 Context 访问父组件配置
6
6
  */
7
+ /// <reference types="react" />
7
8
  export declare const BasicExample: () => JSX.Element;
8
9
  export declare const ChildrenExample: () => JSX.Element;
9
10
  export declare const CustomItemExample: () => JSX.Element;
@@ -96,7 +96,7 @@ var VoucherCard = (props) => {
96
96
  return {
97
97
  _id: item._id,
98
98
  quantity: item.num,
99
- bundle: item._bundleOrigin,
99
+ bundle: item.bundle,
100
100
  options: item._optionsOrigin,
101
101
  product: {
102
102
  ...item._productOrigin
@@ -122,6 +122,7 @@ var VoucherCard = (props) => {
122
122
  );
123
123
  pisellos.effects.on("appointmentBooking_cart:onAddItem", onCartChange);
124
124
  pisellos.effects.on("appointmentBooking_cart:onUpdateQuotationPrice", onCartChange);
125
+ pisellos.effects.on("appointmentBooking_cart:onUpdateBookingDate", onCartChange);
125
126
  pisellos.effects.on("appointmentBooking_cart:onUpdateCartItemNums", onCartChange);
126
127
  pisellos.effects.on("appointmentBooking_cart:onRemoveItem", onCartChange);
127
128
  pisellos.effects.on(
@@ -51,23 +51,26 @@ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext")
51
51
  var formatProducts = (values) => {
52
52
  let arr = [];
53
53
  arr = values.map((item) => {
54
- var _a, _b, _c, _d, _e, _f, _g;
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
55
+ const bundleDiscountList = (0, import_utils.getBundleDiscountList)(((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle) || []);
56
+ const discount_list = [...(item == null ? void 0 : item.discount_list) || []];
57
+ discount_list.push(...bundleDiscountList);
55
58
  return {
56
59
  order_detail_id: item.order_detail_id || 0,
57
60
  num: item._extend.quantity,
58
61
  price: (0, import_utils.formatProductPrice)(item),
59
62
  product_id: item.id,
60
- discount_list: (item == null ? void 0 : item.discount_list) || [],
63
+ discount_list: discount_list || [],
61
64
  discount_amount: 0,
62
65
  product_discount_reason: "",
63
66
  is_charge_tax: item.is_charge_tax,
64
67
  note: "",
65
68
  discountway: "num",
66
69
  discount_type: "discount",
67
- bundle_edit: (_a = item._extend) == null ? void 0 : _a.bundle_edit,
68
- product_bundle: (0, import_utils.formatProductBundle)((_c = (_b = item._extend) == null ? void 0 : _b.other) == null ? void 0 : _c.bundle),
69
- "product_option_item": (0, import_utils.formatProductOption)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.option),
70
- "product_variant_id": ((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.product_variant_id) || 0
70
+ bundle_edit: (_c = item._extend) == null ? void 0 : _c.bundle_edit,
71
+ product_bundle: (0, import_utils.formatProductBundle)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle),
72
+ "product_option_item": (0, import_utils.formatProductOption)((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
73
+ "product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0
71
74
  };
72
75
  });
73
76
  return arr;
@@ -241,12 +244,12 @@ var Addons = (0, import_model.Provider)((props) => {
241
244
  isAddons: true,
242
245
  _key: e.key,
243
246
  _extend: {
244
- price: _detail.price,
245
247
  other: e,
246
248
  quantity: (e == null ? void 0 : e.quantity) || 1
247
249
  },
248
250
  quantity: (e == null ? void 0 : e.quantity) || 1
249
251
  };
252
+ product._extend.price = (0, import_utils2.getMainPrice)(product, _detail.price);
250
253
  let _total = (0, import_utils2.getProductTotalPrice)(product);
251
254
  product._extend.total = _total;
252
255
  product._extend.origin_total = _total;
@@ -16,6 +16,11 @@ export declare const formatProductOption: (option: any) => any;
16
16
  * @Date: 2024-02-19 09:26
17
17
  */
18
18
  export declare const formatProductBundle: (bundle: any) => any;
19
+ /**
20
+ * 获取子商品折扣信息
21
+ * @param item
22
+ */
23
+ export declare const getBundleDiscountList: (bundle: any[]) => any[];
19
24
  export interface ResourceItem {
20
25
  [key: string]: any;
21
26
  }
@@ -37,5 +42,6 @@ export declare const checkResourcesFormat: (resources: any[], service: any, isCh
37
42
  * @Date: 2024-12-23 12:05
38
43
  */
39
44
  export declare const formatProductPrice: (item: any) => number;
45
+ export declare const getMainProductSellingPrice: (item: any) => number | undefined;
40
46
  export declare const formatValues: (state: any) => any;
41
47
  export declare const checkHolderIsError: (state: any) => any;
@@ -35,7 +35,9 @@ __export(utils_exports, {
35
35
  formatProductBundle: () => formatProductBundle,
36
36
  formatProductOption: () => formatProductOption,
37
37
  formatProductPrice: () => formatProductPrice,
38
- formatValues: () => formatValues
38
+ formatValues: () => formatValues,
39
+ getBundleDiscountList: () => getBundleDiscountList,
40
+ getMainProductSellingPrice: () => getMainProductSellingPrice
39
41
  });
40
42
  module.exports = __toCommonJS(utils_exports);
41
43
  var import_dayjs = __toESM(require("dayjs"));
@@ -47,6 +49,7 @@ var import_status = require("../../info/service2/status");
47
49
  var import_utils4 = require("../../info/service2/utils");
48
50
  var import_utils5 = require("@pisell/utils");
49
51
  var import_materials = require("@pisell/materials");
52
+ var import_decimal = __toESM(require("decimal.js"));
50
53
  var formatNote = (data) => {
51
54
  var _a;
52
55
  return ((_a = data.notes) == null ? void 0 : _a.orderNote) || "";
@@ -71,10 +74,10 @@ var formatProductOption = (option) => {
71
74
  }
72
75
  return option.map((d) => {
73
76
  return {
74
- num: d.num,
75
- option_group_item_id: d.product_option_item_id || d.option_group_item_id,
76
- option_group_id: d.option_group_id
77
- // "add_price": Number(d?.add_price),
77
+ "num": d.num,
78
+ "option_group_item_id": d.product_option_item_id || d.option_group_item_id,
79
+ "option_group_id": d.option_group_id,
80
+ "custom_add_price": Number(d == null ? void 0 : d.add_price)
78
81
  };
79
82
  });
80
83
  };
@@ -101,20 +104,44 @@ var formatProductBundle = (bundle) => {
101
104
  } catch (error) {
102
105
  }
103
106
  return bundle.map((d) => {
107
+ const option = formatProductOption(d.option);
108
+ const option_price = option.reduce((temp, item) => {
109
+ return temp + Number(item.num) * item.custom_add_price;
110
+ }, 0);
104
111
  return {
105
- bundle_group_id: d.group_id,
106
- bundle_id: d.id,
107
- bundle_product_id: (d == null ? void 0 : d._bundle_product_id) || (d == null ? void 0 : d.product_id),
108
- bundle_variant_id: d.bundle_variant_id,
109
- num: d.num,
110
- extension_id: d.extension_id,
111
- extension_type: d.extension_type,
112
- // "price": Number(d?.price),
113
- // "price_type": d?.price_type,
114
- option: formatProductOption(d.option)
112
+ "bundle_group_id": d.group_id,
113
+ "bundle_id": d.id,
114
+ "bundle_product_id": (d == null ? void 0 : d._bundle_product_id) || (d == null ? void 0 : d.product_id),
115
+ "bundle_variant_id": d.bundle_variant_id,
116
+ "num": d.num,
117
+ "extension_id": d.extension_id,
118
+ "extension_type": d.extension_type,
119
+ "price": Number(d == null ? void 0 : d.product_price),
120
+ "price_type": d == null ? void 0 : d.price_type,
121
+ "price_type_ext": d == null ? void 0 : d.price_type_ext,
122
+ "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),
123
+ "custom_price_type": d == null ? void 0 : d.price_type,
124
+ "option": option,
125
+ "bundle_selling_price": d == null ? void 0 : d.price,
126
+ "bundle_sum_price": (d == null ? void 0 : d.original_price) || (d == null ? void 0 : d.original_total),
127
+ metadata: {
128
+ custom_product_bundle_map_id: d._id
129
+ }
115
130
  };
116
131
  });
117
132
  };
133
+ var getBundleDiscountList = (bundle) => {
134
+ if (!bundle) {
135
+ return [];
136
+ }
137
+ let discountList = [];
138
+ bundle.forEach((d) => {
139
+ if (d.discount_list && (0, import_utils5.isArr)(d.discount_list)) {
140
+ discountList.push(...d.discount_list.filter((item) => !item.id));
141
+ }
142
+ });
143
+ return discountList;
144
+ };
118
145
  var getSubType = (item) => {
119
146
  var _a;
120
147
  const _type = (_a = item.duration) == null ? void 0 : _a.type;
@@ -219,7 +246,7 @@ var formatProductPrice = (item) => {
219
246
  return price;
220
247
  };
221
248
  var formatMetaData = (item, isMultiDayPrices) => {
222
- var _a, _b, _c, _d, _e;
249
+ var _a, _b, _c, _d, _e, _f, _g;
223
250
  let metadata = {};
224
251
  if ((_a = item._extend) == null ? void 0 : _a.capacity) {
225
252
  metadata.capacity = item._extend.capacity;
@@ -233,6 +260,9 @@ var formatMetaData = (item, isMultiDayPrices) => {
233
260
  if (isMultiDayPrices && ((_d = item._extend) == null ? void 0 : _d.multiDayPrices)) {
234
261
  metadata.multiDayPrices = (_e = item._extend) == null ? void 0 : _e.multiDayPrices;
235
262
  }
263
+ if ((_f = item._extend) == null ? void 0 : _f.unique_identification_number) {
264
+ metadata.unique_identification_number = (_g = item._extend) == null ? void 0 : _g.unique_identification_number;
265
+ }
236
266
  return metadata;
237
267
  };
238
268
  var getSourceProductPrice = (item) => {
@@ -249,34 +279,52 @@ var getSourceProductPrice = (item) => {
249
279
  }
250
280
  return price;
251
281
  };
282
+ var getMainProductSellingPrice = (item) => {
283
+ var _a, _b, _c, _d, _e;
284
+ if (!(0, import_utils5.isNumber)((_a = item._extend) == null ? void 0 : _a.main_product_selling_price)) {
285
+ return void 0;
286
+ }
287
+ let optionPrice = new import_decimal.default(0);
288
+ if (((_b = item._extend.other) == null ? void 0 : _b.option) && Array.isArray((_c = item._extend.other) == null ? void 0 : _c.option)) {
289
+ optionPrice = (_d = item._extend.other) == null ? void 0 : _d.option.reduce((accumulator, currentValue) => {
290
+ const currentPrice = new import_decimal.default(currentValue.price || 0);
291
+ const currentNum = new import_decimal.default(currentValue.num || 0);
292
+ return accumulator.add(currentPrice.mul(currentNum));
293
+ }, optionPrice);
294
+ }
295
+ return new import_decimal.default((_e = item._extend) == null ? void 0 : _e.main_product_selling_price).add(optionPrice).toNumber();
296
+ };
252
297
  var formatProducts = (item, quantity) => {
253
- var _a, _b, _c, _d, _e, _f;
298
+ var _a, _b, _c, _d, _e, _f, _g, _h;
254
299
  const total = Number(item._extend.total);
255
300
  const origin_total = Number(item._extend.origin_total);
256
301
  const discount_amount = origin_total - total;
257
- const discount_list = (item == null ? void 0 : item.discount_list) || [];
302
+ const bundleDiscountList = getBundleDiscountList(((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle) || []);
303
+ const discount_list = [...(item == null ? void 0 : item.discount_list) || []];
304
+ discount_list.push(...bundleDiscountList);
258
305
  const discount_type = discount_amount < 0 ? "change_price" : "discount";
259
306
  const notManualDiscount = discount_list.filter(
260
307
  (item2) => item2.type !== "product"
261
308
  );
262
309
  return {
263
- num: quantity || item._extend.quantity,
264
- price: formatProductPrice(item),
265
- source_product_price: getSourceProductPrice(item),
266
- product_id: (item == null ? void 0 : item.product_id) || item.id,
267
- discount_amount: notManualDiscount.length > 0 ? 0 : discount_amount,
268
- product_discount_reason: item._extend.discount_reason || "",
269
- is_charge_tax: item.is_charge_tax,
270
- note: (item == null ? void 0 : item.note) || "",
271
- discountway: item._extend.discountway || "num",
272
- discount_per: item._extend.discount_per,
273
- discount_type: item._extend.discount_type || discount_type,
274
- order_detail_id: item._extend.order_detail_id || 0,
275
- product_bundle: formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
276
- bundle_edit: item._extend.bundle_edit,
277
- product_option_item: formatProductOption((_d = (_c = item._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.option),
278
- product_variant_id: ((_f = (_e = item._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.product_variant_id) || 0,
279
- discount_list: notManualDiscount,
310
+ "num": quantity || item._extend.quantity,
311
+ "price": formatProductPrice(item),
312
+ "main_product_selling_price": getMainProductSellingPrice(item) ?? formatProductPrice(item),
313
+ "source_product_price": getSourceProductPrice(item),
314
+ "product_id": (item == null ? void 0 : item.product_id) || item.id,
315
+ "discount_amount": notManualDiscount.length > 0 ? 0 : discount_amount,
316
+ "product_discount_reason": item._extend.discount_reason || "",
317
+ "is_charge_tax": item.is_charge_tax,
318
+ "note": (item == null ? void 0 : item.note) || "",
319
+ "discountway": item._extend.discountway || "num",
320
+ "discount_per": item._extend.discount_per,
321
+ "discount_type": item._extend.discount_type || discount_type,
322
+ "order_detail_id": item._extend.order_detail_id || 0,
323
+ "product_bundle": formatProductBundle((_d = (_c = item._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.bundle),
324
+ "bundle_edit": item._extend.bundle_edit || bundleDiscountList.length ? 1 : 0,
325
+ "product_option_item": formatProductOption((_f = (_e = item._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.option),
326
+ "product_variant_id": ((_h = (_g = item._extend) == null ? void 0 : _g.other) == null ? void 0 : _h.product_variant_id) || 0,
327
+ "discount_list": notManualDiscount,
280
328
  metadata: formatMetaData(item, false)
281
329
  };
282
330
  };
@@ -537,5 +585,7 @@ var checkHolderIsError = (state) => {
537
585
  formatProductBundle,
538
586
  formatProductOption,
539
587
  formatProductPrice,
540
- formatValues
588
+ formatValues,
589
+ getBundleDiscountList,
590
+ getMainProductSellingPrice
541
591
  });
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
2
3
  export default FormItemChildrenWrap;
@@ -96,11 +96,19 @@ var VoucherCard = (props) => {
96
96
  price: value.price,
97
97
  total: (_a3 = value == null ? void 0 : value._extend) == null ? void 0 : _a3.total,
98
98
  discount_list: value.discount_list,
99
- origin_total: (_b2 = value == null ? void 0 : value._extend) == null ? void 0 : _b2.origin_total
99
+ origin_total: (_b2 = value == null ? void 0 : value._extend) == null ? void 0 : _b2.origin_total,
100
+ quantity: value._extend.quantity,
101
+ startDate: value._extend.startDate,
102
+ quantity: value._extend.quantity
100
103
  };
101
104
  });
102
105
  return val;
103
106
  }, [state.service.value]);
107
+ const serviceTotal = (0, import_react.useMemo)(() => {
108
+ return serviceMemo.reduce((total, item) => {
109
+ return total + (item.total || 0);
110
+ }, 0);
111
+ }, [serviceMemo]);
104
112
  const addonsMemo = (0, import_react.useMemo)(() => {
105
113
  var _a2;
106
114
  const val = (_a2 = state.addons.value || []) == null ? void 0 : _a2.map((value) => {
@@ -192,6 +200,12 @@ var VoucherCard = (props) => {
192
200
  }, [state.bookingId, isBooking4Shop, fn]);
193
201
  const productListToValue = (0, import_ahooks.useMemoizedFn)((list, edit) => {
194
202
  const { serviceList, addonsList } = (0, import_utils2.getServiceAddons)(list);
203
+ const newTotal = serviceList.reduce((total, item) => {
204
+ return total + (item._extend.total || 0);
205
+ }, 0);
206
+ if (newTotal !== serviceTotal) {
207
+ edit = true;
208
+ }
195
209
  serviceValueRef.current = serviceList;
196
210
  addonsValueRef.current = addonsList;
197
211
  let other = {};
@@ -207,12 +221,14 @@ var VoucherCard = (props) => {
207
221
  ...other
208
222
  }
209
223
  });
210
- dispatch({
211
- type: "setAddons",
212
- payload: {
213
- value: addonsList,
214
- ...other
215
- }
224
+ setTimeout(() => {
225
+ dispatch({
226
+ type: "setAddons",
227
+ payload: {
228
+ value: addonsList,
229
+ ...other
230
+ }
231
+ });
216
232
  });
217
233
  });
218
234
  const onScanCode = async () => {
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
2
3
  export default useIsLowSpeedNetwork;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const Like: ({ status, onChange, className, style, }: {
3
4
  style?: any;
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
244
244
  * @Author: WangHan
245
245
  * @Date: 2024-12-24 11:32
246
246
  */
247
- export declare const updateServicePrice: (state: any) => Promise<any> | never[];
247
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -367,6 +367,7 @@ var formatBundle = (bundle) => {
367
367
  num: item == null ? void 0 : item.num,
368
368
  price: item == null ? void 0 : item.price,
369
369
  total: item == null ? void 0 : item.price,
370
+ origin_total: item.original_total,
370
371
  price_type: item == null ? void 0 : item.price_type,
371
372
  bundle_sum_price: item == null ? void 0 : item.bundle_sum_price,
372
373
  bundle_sum_type: item == null ? void 0 : item.bundle_sum_type,
@@ -229,16 +229,16 @@ var Info = (props) => {
229
229
  _extend: {
230
230
  start_date: state.date.value,
231
231
  quantity: (e == null ? void 0 : e.quantity) || 1,
232
- price: _detail.price,
233
232
  product_name: item.title,
234
233
  other
235
234
  },
236
235
  new: 1
237
236
  };
238
- console.log(cacheItem, "cacheItem", e);
237
+ cacheItem._extend.price = (0, import_utils3.getMainPrice)(_detail, _detail.price);
239
238
  let _total = (0, import_utils3.getProductTotalPrice)(cacheItem);
240
239
  cacheItem._extend.total = _total;
241
240
  cacheItem._extend.origin_total = _total;
241
+ debugger;
242
242
  const _isEdit = !!state.service.cacheItem;
243
243
  if (_isEdit) {
244
244
  cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
@@ -153,6 +153,7 @@ export declare const getIsOnlySession: (item: any) => boolean;
153
153
  * @Date: 2024-01-26 14:09
154
154
  */
155
155
  export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
156
+ export declare const getMainPrice: (item: any, price?: number) => number;
156
157
  export declare const getProductTotalPrice: (item: any) => number;
157
158
  /**
158
159
  * @title: 判断 duration
@@ -165,10 +166,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
166
  export declare const getDuration: (duration: number | {
166
167
  type: string;
167
168
  value: number;
168
- }) => number | {
169
+ }) => number | "flexible" | {
169
170
  type: string;
170
171
  value: number;
171
- } | "flexible";
172
+ };
172
173
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
174
  export declare const getIsEdit: (state: any) => boolean;
174
175
  export {};
@@ -46,6 +46,7 @@ __export(utils_exports, {
46
46
  getIsEject: () => getIsEject,
47
47
  getIsOnlySession: () => getIsOnlySession,
48
48
  getLastServer: () => getLastServer,
49
+ getMainPrice: () => getMainPrice,
49
50
  getNowTime: () => getNowTime,
50
51
  getProductTotalPrice: () => getProductTotalPrice,
51
52
  getResourceTimeIsUsable: () => getResourceTimeIsUsable,
@@ -66,6 +67,7 @@ var import_utils = require("@pisell/utils");
66
67
  var import_utils2 = require("./info/service2/utils");
67
68
  var import_lodash = require("lodash");
68
69
  var import_utilsByBooking = require("./info2/utilsByBooking");
70
+ var import_decimal = __toESM(require("decimal.js"));
69
71
  var Request = class {
70
72
  request = {};
71
73
  constructor() {
@@ -609,6 +611,15 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
609
611
  }
610
612
  return _extend;
611
613
  };
614
+ var getMainPrice = (item, price) => {
615
+ var _a;
616
+ let newPrice = new import_decimal.default(price || item._extend.price || 0);
617
+ let other = (_a = item._extend) == null ? void 0 : _a.other;
618
+ if (other == null ? void 0 : other.product_variant_id) {
619
+ newPrice = new import_decimal.default((other == null ? void 0 : other.price) || 0);
620
+ }
621
+ return newPrice.toNumber();
622
+ };
612
623
  var getProductTotalPrice = (item) => {
613
624
  var _a;
614
625
  let price = Number(item._extend.price);
@@ -698,6 +709,7 @@ var getIsEdit = (state) => {
698
709
  getIsEject,
699
710
  getIsOnlySession,
700
711
  getLastServer,
712
+ getMainPrice,
701
713
  getNowTime,
702
714
  getProductTotalPrice,
703
715
  getResourceTimeIsUsable,
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ input, ...formItemProps }: any) => JSX.Element;
2
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 递归循环表单数据
3
4
  * @Author: hongbing.wang
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RadioGroupProps } from 'antd';
2
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => JSX.Element;
3
4
  export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Eftpos } from './const';
2
3
  /**
3
4
  * @title: tyro 设备连接
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ color }: {
2
3
  color?: string | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ color }: {
2
3
  color?: string | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 自定义组件设置
3
4
  * @description: 自定义组件设置
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: () => JSX.Element;
2
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './titlebar.less';
2
3
  declare enum EPopupTitleBarVariantType {
3
4
  BackTitleClose = "back-title-cancel",
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { StatusType } from '../../const';
2
3
  declare const _default: (props: {
3
4
  status: StatusType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: (props: {
2
3
  status: string;
3
4
  pedding?: string;