@pisell/private-materials 6.6.26 → 6.6.27

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 (88) hide show
  1. package/build/lowcode/meta.js +2 -2
  2. package/build/lowcode/render/default/view.css +1 -1
  3. package/build/lowcode/render/default/view.js +1 -1
  4. package/build/lowcode/view.css +1 -1
  5. package/build/lowcode/view.js +1 -1
  6. package/es/components/appointmentBooking/components/Voucher/index.js +7 -22
  7. package/es/components/booking/addons/index.js +2 -3
  8. package/es/components/booking/components/footer/amount.js +1 -1
  9. package/es/components/booking/components/footer/index.js +20 -12
  10. package/es/components/booking/components/footer/utils.d.ts +1 -1
  11. package/es/components/booking/components/footer/utils.js +5 -7
  12. package/es/components/booking/components/voucher/index.js +0 -6
  13. package/es/components/booking/components/voucher/index.less +1 -4
  14. package/es/components/booking/components/voucherModal/index.less +0 -1
  15. package/es/components/booking/info2/service/editService/index.js +2 -33
  16. package/es/components/checkout/components/WalletPassModule/components/WalletPassCardDisplay/index.js +8 -4
  17. package/es/components/checkout/components/WalletPassModule/index.js +0 -1
  18. package/es/components/checkout/components/WalletPassModule/utils.d.ts +0 -1
  19. package/es/components/checkout/components/WalletPassModule/utils.js +3 -17
  20. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  21. package/es/components/checkout/hooks/useWalletPass.js +192 -316
  22. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
  23. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +145 -166
  24. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
  25. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
  26. package/es/components/pay/toC/WalletPassBlock/index.js +1 -3
  27. package/es/components/pay/toC/index.js +27 -66
  28. package/es/components/pay/toC/model.d.ts +0 -1
  29. package/es/components/pay/toC/serve.d.ts +0 -18
  30. package/es/components/pay/toC/serve.js +1 -29
  31. package/es/components/pay/toC/utils.d.ts +2 -2
  32. package/es/components/pay/toC/utils.js +0 -4
  33. package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -7
  34. package/es/components/ticketBooking/components/menuBar/index.js +13 -11
  35. package/es/components/ticketBooking/utils/index.d.ts +1 -0
  36. package/es/components/ticketBooking/utils/index.js +13 -0
  37. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -10
  38. package/lib/components/booking/addons/index.js +2 -3
  39. package/lib/components/booking/components/footer/amount.js +1 -1
  40. package/lib/components/booking/components/footer/index.js +28 -21
  41. package/lib/components/booking/components/footer/utils.d.ts +1 -1
  42. package/lib/components/booking/components/footer/utils.js +3 -5
  43. package/lib/components/booking/components/voucher/index.js +0 -6
  44. package/lib/components/booking/components/voucher/index.less +1 -4
  45. package/lib/components/booking/components/voucherModal/index.less +0 -1
  46. package/lib/components/booking/info2/service/editService/index.js +24 -48
  47. package/lib/components/checkout/components/WalletPassModule/components/WalletPassCardDisplay/index.js +8 -4
  48. package/lib/components/checkout/components/WalletPassModule/index.js +0 -1
  49. package/lib/components/checkout/components/WalletPassModule/utils.d.ts +0 -1
  50. package/lib/components/checkout/components/WalletPassModule/utils.js +2 -18
  51. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  52. package/lib/components/checkout/hooks/useWalletPass.js +108 -157
  53. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
  54. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +103 -90
  55. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
  56. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
  57. package/lib/components/pay/toC/WalletPassBlock/index.js +1 -3
  58. package/lib/components/pay/toC/index.js +11 -52
  59. package/lib/components/pay/toC/model.d.ts +0 -1
  60. package/lib/components/pay/toC/serve.d.ts +0 -18
  61. package/lib/components/pay/toC/serve.js +0 -6
  62. package/lib/components/pay/toC/utils.d.ts +2 -2
  63. package/lib/components/pay/toC/utils.js +0 -4
  64. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -11
  65. package/lib/components/ticketBooking/components/menuBar/index.js +2 -0
  66. package/lib/components/ticketBooking/utils/index.d.ts +1 -0
  67. package/lib/components/ticketBooking/utils/index.js +13 -0
  68. package/package.json +4 -4
  69. package/es/components/systemSettings/registry/components/docs/images/image-1.png +0 -0
  70. package/es/components/systemSettings/registry/components/docs/images/image-2.png +0 -0
  71. package/es/components/systemSettings/registry/components/docs/images/image-3.png +0 -0
  72. package/es/components/systemSettings/registry/components/docs/images/image-4.png +0 -0
  73. package/es/components/systemSettings/registry/components/docs/images/image-5.png +0 -0
  74. package/es/components/systemSettings/registry/components/docs/images/image-6.png +0 -0
  75. package/es/components/systemSettings/registry/components/docs/images/image-7.png +0 -0
  76. package/es/components/systemSettings/registry/components/docs/images/image-8.png +0 -0
  77. package/es/components/systemSettings/registry/components/docs/images/image.png +0 -0
  78. package/lib/components/systemSettings/registry/components/docs/images/image-1.png +0 -0
  79. package/lib/components/systemSettings/registry/components/docs/images/image-2.png +0 -0
  80. package/lib/components/systemSettings/registry/components/docs/images/image-3.png +0 -0
  81. package/lib/components/systemSettings/registry/components/docs/images/image-4.png +0 -0
  82. package/lib/components/systemSettings/registry/components/docs/images/image-5.png +0 -0
  83. package/lib/components/systemSettings/registry/components/docs/images/image-6.png +0 -0
  84. package/lib/components/systemSettings/registry/components/docs/images/image-7.png +0 -0
  85. package/lib/components/systemSettings/registry/components/docs/images/image-8.png +0 -0
  86. package/lib/components/systemSettings/registry/components/docs/images/image.png +0 -0
  87. package/lowcode/eco-cup-list/meta.ts +0 -63
  88. package/lowcode/eco-customer-list/meta.ts +0 -63
@@ -54,7 +54,6 @@ var import_noteModal = __toESM(require("../../../../plus/noteModal"));
54
54
  var import_confirmHolderModal = require("../../utils/confirmHolderModal");
55
55
  var import__ = require("../../../../index");
56
56
  var import_useIsBooking4Shop = require("../../hooks/useIsBooking4Shop");
57
- var import_utils4 = require("@pisell/utils");
58
57
  var import_dayjs = __toESM(require("dayjs"));
59
58
  var import_useScanManager = __toESM(require("../../../ticketBooking/hooks/pisellos/useScanManager"));
60
59
  var import_materials = require("@pisell/materials");
@@ -62,9 +61,9 @@ var import_useCustomer = require("../../../ticketBooking/hooks/pisellos/useCusto
62
61
  var import_ahooks = require("ahooks");
63
62
  var import_lodash = require("lodash");
64
63
  var import_useShopDiscountModule = require("../../../ticketBooking/hooks/pisellos/useShopDiscountModule");
65
- var import_utils5 = require("../../utils");
64
+ var import_utils4 = require("../../utils");
66
65
  var Footer = (props) => {
67
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
66
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
68
67
  const { state, buttons, dispatch, source } = props;
69
68
  const [showDetail, setShowDetail] = (0, import_react.useState)(false);
70
69
  const [loading, setLoading] = (0, import_react.useState)(false);
@@ -270,15 +269,23 @@ var Footer = (props) => {
270
269
  ...getDataFromHost()
271
270
  });
272
271
  }, [state, isEdit]);
273
- (0, import_react.useEffect)(() => {
274
- window.dispatchEvent(
275
- new CustomEvent("onOriginExpectAmountWithoutDiscountChange", {
276
- detail: {
277
- originExpectAmountWithoutDiscount: total == null ? void 0 : total.originExpectAmountWithoutDiscount
278
- }
279
- })
280
- );
281
- }, [total == null ? void 0 : total.originExpectAmountWithoutDiscount]);
272
+ (0, import_ahooks.useDebounceEffect)(() => {
273
+ var _a2;
274
+ if ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.addTimeModal) {
275
+ try {
276
+ (0, import_utils.sendWarningLog)({
277
+ title: "加时商品变更",
278
+ content: [
279
+ {
280
+ key: "params",
281
+ value: JSON.stringify(total)
282
+ }
283
+ ]
284
+ });
285
+ } catch (e) {
286
+ }
287
+ }
288
+ }, [total, (_i = state == null ? void 0 : state.service) == null ? void 0 : _i.addTimeModal], { wait: 300 });
282
289
  const orderTotalList = (0, import_react.useMemo)(() => {
283
290
  return [
284
291
  // 订单已付金额
@@ -312,7 +319,7 @@ var Footer = (props) => {
312
319
  label: import_utils.locales.getText("pisell2.text.refunded-amount")
313
320
  }
314
321
  ];
315
- }, [total, (_i = state.bookingDetail) == null ? void 0 : _i.surcharge, state.bookingId]);
322
+ }, [total, (_j = state.bookingDetail) == null ? void 0 : _j.surcharge, state.bookingId]);
316
323
  const subTotalList = (0, import_react.useMemo)(() => {
317
324
  return [
318
325
  // 小计
@@ -353,7 +360,7 @@ var Footer = (props) => {
353
360
  label: import_utils.locales.getText("pisell1.text.rounding")
354
361
  }
355
362
  ];
356
- }, [total, (_j = state.bookingDetail) == null ? void 0 : _j.surcharge, state.bookingId]);
363
+ }, [total, (_k = state.bookingDetail) == null ? void 0 : _k.surcharge, state.bookingId]);
357
364
  const isDisabled = (0, import_react.useMemo)(() => {
358
365
  var _a2;
359
366
  const isClient = state.client.value;
@@ -475,7 +482,7 @@ var Footer = (props) => {
475
482
  JSON.stringify(total),
476
483
  JSON.stringify(orderTotalList),
477
484
  JSON.stringify(subTotalList),
478
- (_l = (_k = state.client) == null ? void 0 : _k.value) == null ? void 0 : _l.id
485
+ (_m = (_l = state.client) == null ? void 0 : _l.value) == null ? void 0 : _m.id
479
486
  ]);
480
487
  const handleCheckoutInternal = async () => {
481
488
  var _a2, _b2, _c2;
@@ -624,7 +631,7 @@ var Footer = (props) => {
624
631
  var _a3, _b3, _c3;
625
632
  return (!((_a3 = item._extend) == null ? void 0 : _a3.holder_id) || ((_c3 = (_b3 = item._extend) == null ? void 0 : _b3.holder_id) == null ? void 0 : _c3.length) === 0) && !(0, import_utils2.isNormalProductByDurationSchedule)(item);
626
633
  });
627
- if (!(0, import_utils5.isWalkIn)((_f2 = (_e2 = state.client) == null ? void 0 : _e2.value) == null ? void 0 : _f2.id) && (0, import_utils2.getIsSubjectRequire)(state) && hasUnspecifiedHolderProduct) {
634
+ if (!(0, import_utils4.isWalkIn)((_f2 = (_e2 = state.client) == null ? void 0 : _e2.value) == null ? void 0 : _f2.id) && (0, import_utils2.getIsSubjectRequire)(state) && hasUnspecifiedHolderProduct) {
628
635
  await (0, import_confirmHolderModal.showConfirmHolderModal)(state, dispatch);
629
636
  }
630
637
  if (isBooking4Shop && (0, import_utils2.getIsSubjectRequire)(state) && (0, import_utils3.checkHolderIsError)(state)) {
@@ -676,7 +683,7 @@ var Footer = (props) => {
676
683
  }
677
684
  }
678
685
  let api = state.bookingId ? editApi : createApi;
679
- (0, import_utils4.sendWarningLog)({
686
+ (0, import_utils.sendWarningLog)({
680
687
  title: "saveBooking",
681
688
  content: [
682
689
  { key: "下单前数据", value: JSON.stringify(values) },
@@ -1007,7 +1014,7 @@ var Footer = (props) => {
1007
1014
  var _a2;
1008
1015
  const note = ((_a2 = state == null ? void 0 : state.notes) == null ? void 0 : _a2.orderNote) || "";
1009
1016
  return note.trim().length > 0;
1010
- }, [(_m = state == null ? void 0 : state.notes) == null ? void 0 : _m.orderNote]);
1017
+ }, [(_n = state == null ? void 0 : state.notes) == null ? void 0 : _n.orderNote]);
1011
1018
  const noteButton = (0, import_react.useMemo)(() => {
1012
1019
  return /* @__PURE__ */ import_react.default.createElement(
1013
1020
  import_antd.ConfigProvider,
@@ -1180,7 +1187,7 @@ var Footer = (props) => {
1180
1187
  isShowPaymentLink,
1181
1188
  source,
1182
1189
  _buttons.length,
1183
- (_n = state == null ? void 0 : state.bookingDetail) == null ? void 0 : _n.payment_status
1190
+ (_o = state == null ? void 0 : state.bookingDetail) == null ? void 0 : _o.payment_status
1184
1191
  ]);
1185
1192
  const totalText = (0, import_react.useMemo)(() => {
1186
1193
  var _a2;
@@ -1234,7 +1241,7 @@ var Footer = (props) => {
1234
1241
  }, [
1235
1242
  state.bookingId,
1236
1243
  state.bookingDetail,
1237
- (_o = state.addons) == null ? void 0 : _o.load,
1244
+ (_p = state.addons) == null ? void 0 : _p.load,
1238
1245
  state.renderType
1239
1246
  ]);
1240
1247
  const menuChange = (e) => {
@@ -1437,7 +1444,7 @@ var Footer = (props) => {
1437
1444
  {
1438
1445
  open: noteModalOpen,
1439
1446
  title: import_utils.locales.getText("pisell2.text.add-order-notes"),
1440
- value: ((_p = state.notes) == null ? void 0 : _p.orderNote) || "",
1447
+ value: ((_q = state.notes) == null ? void 0 : _q.orderNote) || "",
1441
1448
  onConfirm: handleNoteConfirm,
1442
1449
  onDelete: handleNoteDelete,
1443
1450
  onCancel: handleNoteCancel
@@ -15,7 +15,7 @@ export declare const formatProductOption: (option: any) => any;
15
15
  * @Author: zhiwei.Wang
16
16
  * @Date: 2024-02-19 09:26
17
17
  */
18
- export declare const formatProductBundle: (bundle: any, is_price_include_tax: number) => any;
18
+ export declare const formatProductBundle: (bundle: any) => any;
19
19
  /**
20
20
  * 获取子商品折扣信息
21
21
  * @param item
@@ -96,7 +96,7 @@ var log = (data) => {
96
96
  ]
97
97
  });
98
98
  };
99
- var formatProductBundle = (bundle, is_price_include_tax) => {
99
+ var formatProductBundle = (bundle) => {
100
100
  if (!bundle) {
101
101
  return;
102
102
  }
@@ -136,7 +136,6 @@ var formatProductBundle = (bundle, is_price_include_tax) => {
136
136
  "option": option,
137
137
  "bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
138
138
  // "bundle_sum_price": d?.original_price || d?.original_total,
139
- is_price_include_tax,
140
139
  "metadata": {
141
140
  custom_product_bundle_map_id: d._id,
142
141
  // 子商品单数量附加费
@@ -400,7 +399,7 @@ var formatProducts = (item, quantity) => {
400
399
  "discount_per": item._extend.discount_per,
401
400
  "discount_type": item._extend.discount_type || discount_type,
402
401
  "order_detail_id": item._extend.order_detail_id || 0,
403
- "product_bundle": formatProductBundle((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle, item.is_price_include_tax),
402
+ "product_bundle": formatProductBundle((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle),
404
403
  "bundle_edit": item._extend.bundle_edit || bundleDiscountList.length ? 1 : 0,
405
404
  "product_option_item": formatProductOption((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
406
405
  "product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0,
@@ -410,8 +409,7 @@ var formatProducts = (item, quantity) => {
410
409
  "calculated_original_price": formatOriginalPrice(item),
411
410
  "calculated_selling_price": formatSellingPrice(item),
412
411
  "tax_fee": item._extend.tax_fee,
413
- "custom_deposit_data": item.custom_deposit_data,
414
- is_price_include_tax: item.is_price_include_tax
412
+ "custom_deposit_data": item.custom_deposit_data
415
413
  };
416
414
  };
417
415
  var formatAppointmentProductLists = (data) => {
@@ -135,17 +135,11 @@ var VoucherCard = (props) => {
135
135
  }
136
136
  onScanCode(e.detail.code);
137
137
  });
138
- const onOriginExpectAmountWithoutDiscountChange = (0, import_ahooks.useMemoizedFn)((e) => {
139
- var _a2;
140
- (_a2 = shopDiscount == null ? void 0 : shopDiscount.setOriginTotalAmount) == null ? void 0 : _a2.call(shopDiscount, e.detail.originExpectAmountWithoutDiscount);
141
- });
142
138
  (0, import_react.useEffect)(() => {
143
139
  const wrappedOnScanWallPassCode = executeIfActive(onScanWallPassCode);
144
140
  window.addEventListener("onScanWallPassCode", wrappedOnScanWallPassCode);
145
- window.addEventListener("onOriginExpectAmountWithoutDiscountChange", onOriginExpectAmountWithoutDiscountChange);
146
141
  return () => {
147
142
  window.removeEventListener("onScanWallPassCode", wrappedOnScanWallPassCode);
148
- window.removeEventListener("onOriginExpectAmountWithoutDiscountChange", onOriginExpectAmountWithoutDiscountChange);
149
143
  };
150
144
  }, []);
151
145
  const addonsMemo = (0, import_react.useMemo)(() => {
@@ -1,8 +1,5 @@
1
1
  .pisell-lowcode__booking-footer-voucher-container {
2
2
  margin-bottom: 8px;
3
- width: 100%;
4
- display: flex;
5
- flex-direction: column;
6
3
  .voucher-title {
7
4
  display: flex;
8
5
  align-items: center;
@@ -50,9 +47,9 @@
50
47
  width: 100%;
51
48
  transition: 0.2s;
52
49
  max-height: 0;
50
+ overflow: hidden;
53
51
  display: flex;
54
52
  flex-direction: column;
55
- overflow: auto;
56
53
 
57
54
  &.show {
58
55
  max-height: unset;
@@ -6,7 +6,6 @@
6
6
  .pisell-voucher-modal-content {
7
7
  max-height: 70vh;
8
8
  overflow-y: auto;
9
- display: flex;
10
9
  }
11
10
 
12
11
  // 隐藏状态下的样式优化
@@ -61,11 +61,9 @@ var import_EditTabs = __toESM(require("../../../info/service/editService/EditTab
61
61
  var import_BookingList = __toESM(require("../../../info/service/editService/BookingList"));
62
62
  var import_dayjs = __toESM(require("dayjs"));
63
63
  var import_utils9 = require("../../../info/service2/Group/utils");
64
- var import_decimal = __toESM(require("decimal.js"));
65
- var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
66
64
  var submitLock = false;
67
65
  var Info = (_, ref) => {
68
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
66
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
69
67
  const [form] = import_antd.Form.useForm();
70
68
  const useTotal = import_antd.Form.useWatch("total", form);
71
69
  const useResource = import_antd.Form.useWatch("resource", form);
@@ -82,10 +80,6 @@ var Info = (_, ref) => {
82
80
  const [noteModalOpen, setNoteModalOpen] = (0, import_react.useState)(false);
83
81
  const [open, setOpen] = (0, import_react.useState)(false);
84
82
  const [currentTab, setCurrentTab] = (0, import_react.useState)("batch_edit");
85
- const context = (0, import_useEngineContext.default)();
86
- const {
87
- getData
88
- } = (_a = context.appHelper) == null ? void 0 : _a.utils;
89
83
  (0, import_react.useEffect)(() => {
90
84
  window.openBookingEditModal = () => {
91
85
  setOpen(true);
@@ -100,7 +94,7 @@ var Info = (_, ref) => {
100
94
  return true;
101
95
  }
102
96
  return ((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem) && (0, import_utils4.isNormalProductByDurationSchedule)((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.cacheItem);
103
- }, [(_b = state == null ? void 0 : state.service) == null ? void 0 : _b.cacheItem]);
97
+ }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem]);
104
98
  const getCurrentCacheItem = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
105
99
  let values = form.getFieldsValue();
106
100
  let _item = _cacheItem || state.service.cacheItem;
@@ -130,7 +124,7 @@ var Info = (_, ref) => {
130
124
  state.service.cacheItem,
131
125
  useStartTime,
132
126
  useResource,
133
- (_e = (_d = (_c = state.bookingConfig) == null ? void 0 : _c.config) == null ? void 0 : _d.basic) == null ? void 0 : _e.service_time
127
+ (_d = (_c = (_b = state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.service_time
134
128
  ]);
135
129
  const flexibleOption = (0, import_react.useMemo)(() => {
136
130
  const op = (0, import_utils7.getFlexibleOption)({
@@ -152,7 +146,7 @@ var Info = (_, ref) => {
152
146
  durationProps,
153
147
  useStartTime,
154
148
  currentResource,
155
- (_h = (_g = (_f = state.bookingConfig) == null ? void 0 : _f.config) == null ? void 0 : _g.basic) == null ? void 0 : _h.service_time,
149
+ (_g = (_f = (_e = state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.service_time,
156
150
  useDuration
157
151
  ]);
158
152
  (0, import_react.useEffect)(() => {
@@ -205,7 +199,7 @@ var Info = (_, ref) => {
205
199
  form.setFieldsValue({ discount });
206
200
  };
207
201
  const onFinish = (values) => {
208
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
202
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
209
203
  let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
210
204
  if (isShowTimeAndResource && !isSuccess) {
211
205
  return;
@@ -219,7 +213,6 @@ var Info = (_, ref) => {
219
213
  }, 1500);
220
214
  let _list = [...state.service.value];
221
215
  let _item = {
222
- is_price_include_tax: getData("is_price_include_tax"),
223
216
  ...state.service.cacheItem,
224
217
  autoClose: false
225
218
  };
@@ -240,23 +233,6 @@ var Info = (_, ref) => {
240
233
  _extend.startDate = startDate;
241
234
  _extend.endDate = endDate;
242
235
  }
243
- if (isChangeTotal.current) {
244
- const discountRatio = new import_decimal.default(values.total).div(_item._extend.origin_total);
245
- const bundles2 = ((_c2 = _extend == null ? void 0 : _extend.other) == null ? void 0 : _c2.bundle) || [];
246
- let childProductsTotal = new import_decimal.default(0);
247
- if (bundles2.length > 0) {
248
- bundles2.forEach((bundle) => {
249
- const discountedPrice = new import_decimal.default(bundle.original_price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
250
- bundle.bundle_selling_price = discountedPrice.toNumber();
251
- childProductsTotal = childProductsTotal.add(
252
- discountedPrice.mul(bundle.quantity)
253
- );
254
- });
255
- }
256
- const mainProductTotal = new import_decimal.default(values.total).sub(childProductsTotal);
257
- const mainProductQuantity = ((_d2 = _extend.other) == null ? void 0 : _d2.quantity) || _extend.quantity || 1;
258
- _extend.main_product_selling_price = mainProductTotal.div(mainProductQuantity).toNumber();
259
- }
260
236
  if (_extend.bundle_edit !== void 0) {
261
237
  _extend.bundle_edit = 1;
262
238
  }
@@ -264,7 +240,7 @@ var Info = (_, ref) => {
264
240
  _item._time = (/* @__PURE__ */ new Date()).getTime();
265
241
  _item._serviceKey = (0, import_utils3.genServiceKey)(_item);
266
242
  _item._holderKey = (0, import_utils3.genHolderKey)(_item);
267
- if (((_f2 = (_e2 = _item._extend) == null ? void 0 : _e2.holder_id) == null ? void 0 : _f2.length) > 1 || ((_g2 = _item._extend) == null ? void 0 : _g2.quantity) > 1 && ((_i2 = (_h2 = _item._extend) == null ? void 0 : _h2.holder_id) == null ? void 0 : _i2.length) >= 1) {
243
+ if (((_d2 = (_c2 = _item._extend) == null ? void 0 : _c2.holder_id) == null ? void 0 : _d2.length) > 1 || ((_e2 = _item._extend) == null ? void 0 : _e2.quantity) > 1 && ((_g2 = (_f2 = _item._extend) == null ? void 0 : _f2.holder_id) == null ? void 0 : _g2.length) >= 1) {
268
244
  let holder_ids = _item._extend.holder_id;
269
245
  _item._extend.holder_id = holder_ids[0];
270
246
  holder_ids = holder_ids.slice(1);
@@ -283,10 +259,10 @@ var Info = (_, ref) => {
283
259
  }
284
260
  }
285
261
  let _id = _item == null ? void 0 : _item._id;
286
- let groupId = (_j2 = _item == null ? void 0 : _item._extend) == null ? void 0 : _j2.groupId;
262
+ let groupId = (_h2 = _item == null ? void 0 : _item._extend) == null ? void 0 : _h2.groupId;
287
263
  _item = (0, import_utils8.setProductPrice)(_item, {
288
264
  newTotal: values.total,
289
- origin_total: (_k2 = _item._extend) == null ? void 0 : _k2.origin_total
265
+ origin_total: (_i2 = _item._extend) == null ? void 0 : _i2.origin_total
290
266
  });
291
267
  if (groupId) {
292
268
  _list = _list.filter((d) => {
@@ -308,7 +284,7 @@ var Info = (_, ref) => {
308
284
  (0, import_utils6.deleteCacheParams)();
309
285
  console.log("_onFinish", _list);
310
286
  form.resetFields();
311
- if (!!((_l2 = state.service.cacheItem) == null ? void 0 : _l2.new)) {
287
+ if (!!((_j2 = state.service.cacheItem) == null ? void 0 : _j2.new)) {
312
288
  window.dispatchEvent(
313
289
  new CustomEvent("onAddNewService", {
314
290
  detail: {
@@ -317,7 +293,7 @@ var Info = (_, ref) => {
317
293
  })
318
294
  );
319
295
  }
320
- (_m2 = window.closeBookingEditModal) == null ? void 0 : _m2.call(window);
296
+ (_k2 = window.closeBookingEditModal) == null ? void 0 : _k2.call(window);
321
297
  _list.sort((a, b) => {
322
298
  var _a3, _b3;
323
299
  const aHasHolderId = ((_a3 = a._extend) == null ? void 0 : _a3.holder_id) && (Array.isArray(a._extend.holder_id) ? a._extend.holder_id.length > 0 : true);
@@ -394,7 +370,7 @@ var Info = (_, ref) => {
394
370
  let oPrice = Number(((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend.origin_total) || 0);
395
371
  let cPrice = Number(useTotal || 0);
396
372
  return cPrice !== oPrice;
397
- }, [useTotal, (_j = (_i = state.service.cacheItem) == null ? void 0 : _i._extend) == null ? void 0 : _j.origin_total]);
373
+ }, [useTotal, (_i = (_h = state.service.cacheItem) == null ? void 0 : _h._extend) == null ? void 0 : _i.origin_total]);
398
374
  const getResources = () => {
399
375
  var _a2, _b2;
400
376
  let res = (0, import_utils7.formatResources)({
@@ -458,11 +434,11 @@ var Info = (_, ref) => {
458
434
  }, [state.service.editModal, state.isBookingCreatePage]);
459
435
  (0, import_react.useEffect)(() => {
460
436
  getDiscount();
461
- }, [useTotal, (_l = (_k = state.service.cacheItem) == null ? void 0 : _k._extend) == null ? void 0 : _l.origin_total]);
437
+ }, [useTotal, (_k = (_j = state.service.cacheItem) == null ? void 0 : _j._extend) == null ? void 0 : _k.origin_total]);
462
438
  const bundles = (0, import_react.useMemo)(() => {
463
439
  var _a2, _b2, _c2, _d2;
464
440
  return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
465
- }, [(_p = (_o = (_n = (_m = state.service) == null ? void 0 : _m.cacheItem) == null ? void 0 : _n._extend) == null ? void 0 : _o.other) == null ? void 0 : _p.bundle]);
441
+ }, [(_o = (_n = (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.other) == null ? void 0 : _o.bundle]);
466
442
  const handleEdit = (0, import_ahooks.useMemoizedFn)((e) => {
467
443
  var _a2, _b2, _c2, _d2, _e2;
468
444
  const item = state.service.cacheItem;
@@ -581,7 +557,7 @@ var Info = (_, ref) => {
581
557
  }
582
558
  return false;
583
559
  }, [state.renderType, isNormalProduct]);
584
- const SelectTime = (_q = window.BaseMaterials) == null ? void 0 : _q.SelectTime;
560
+ const SelectTime = (_p = window.BaseMaterials) == null ? void 0 : _p.SelectTime;
585
561
  const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(state.service.cacheItem);
586
562
  const items = (0, import_react.useMemo)(() => {
587
563
  var _a2, _b2;
@@ -618,7 +594,7 @@ var Info = (_, ref) => {
618
594
  }
619
595
  ))));
620
596
  }, [
621
- (_t = (_s = (_r = state.service) == null ? void 0 : _r.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.product_name,
597
+ (_s = (_r = (_q = state.service) == null ? void 0 : _q.cacheItem) == null ? void 0 : _r._extend) == null ? void 0 : _s.product_name,
622
598
  bundles,
623
599
  state.amountSymbol,
624
600
  state.isBookingCreatePage
@@ -663,7 +639,7 @@ var Info = (_, ref) => {
663
639
  ));
664
640
  }, [
665
641
  useTotal,
666
- (_v = (_u = state.service.cacheItem) == null ? void 0 : _u._extend) == null ? void 0 : _v.origin_total,
642
+ (_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total,
667
643
  state.amountSymbol,
668
644
  state.channelDisabledEdit
669
645
  ]);
@@ -711,7 +687,7 @@ var Info = (_, ref) => {
711
687
  }
712
688
  ) : null
713
689
  ));
714
- }, [SelectTime, (_z = (_y = (_x = (_w = state.bookingConfig) == null ? void 0 : _w.config) == null ? void 0 : _x.basic) == null ? void 0 : _y.service_time) == null ? void 0 : _z.value, isEditGroup]);
690
+ }, [SelectTime, (_y = (_x = (_w = (_v = state.bookingConfig) == null ? void 0 : _v.config) == null ? void 0 : _w.basic) == null ? void 0 : _x.service_time) == null ? void 0 : _y.value, isEditGroup]);
715
691
  const endTime = (0, import_react.useMemo)(() => {
716
692
  if (!isEditGroup) {
717
693
  return null;
@@ -750,8 +726,8 @@ var Info = (_, ref) => {
750
726
  ));
751
727
  }, [
752
728
  state.renderType,
753
- (_B = (_A = state.service.cacheItem) == null ? void 0 : _A._data) == null ? void 0 : _B.resources,
754
- (_D = (_C = state.service.cacheItem) == null ? void 0 : _C._data) == null ? void 0 : _D.resourceMaps
729
+ (_A = (_z = state.service.cacheItem) == null ? void 0 : _z._data) == null ? void 0 : _A.resources,
730
+ (_C = (_B = state.service.cacheItem) == null ? void 0 : _B._data) == null ? void 0 : _C.resourceMaps
755
731
  ]);
756
732
  const holder = (0, import_react.useMemo)(() => {
757
733
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
@@ -789,7 +765,7 @@ var Info = (_, ref) => {
789
765
  }, [
790
766
  state.locale,
791
767
  state.isTerminal,
792
- (_G = (_F = (_E = state.service) == null ? void 0 : _E.cacheItem) == null ? void 0 : _F._data) == null ? void 0 : _G.capacitys
768
+ (_F = (_E = (_D = state.service) == null ? void 0 : _D.cacheItem) == null ? void 0 : _E._data) == null ? void 0 : _F.capacitys
793
769
  ]);
794
770
  const hiddenQuantity = (0, import_react.useMemo)(() => {
795
771
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null));
@@ -869,10 +845,10 @@ var Info = (_, ref) => {
869
845
  import_utils.locales.getText("pisell2.text.apply")
870
846
  )
871
847
  );
872
- }, [(_H = state.service.resourcesOrigin) == null ? void 0 : _H.length, isNormalProduct]);
848
+ }, [(_G = state.service.resourcesOrigin) == null ? void 0 : _G.length, isNormalProduct]);
873
849
  console.log("render edit");
874
850
  console.log(
875
- state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
851
+ state.service.editModal && !((_H = state.service.cacheItem) == null ? void 0 : _H.autoClose),
876
852
  performance.now() - window.pp1,
877
853
  "打开商品1"
878
854
  );
@@ -978,7 +954,7 @@ var Info = (_, ref) => {
978
954
  zIndex: state.service.changeService ? 999 : 1e3,
979
955
  forceRender: true,
980
956
  mask: state.drawerMask,
981
- open: !isNoSpecAndPackage && state.service.editModal && !((_J = state.service.cacheItem) == null ? void 0 : _J.autoClose),
957
+ open: !isNoSpecAndPackage && state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
982
958
  title: import_utils.locales.getText("pisell2.text.edit-service"),
983
959
  onClose: () => {
984
960
  var _a2;
@@ -1004,7 +980,7 @@ var Info = (_, ref) => {
1004
980
  display: currentTab === "batch_edit" ? "block" : "none"
1005
981
  }
1006
982
  },
1007
- /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, endTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity, !(0, import_utils4.isNormalProductByDurationSchedule)(state.service.cacheItem) && !(0, import_utils6.isWalkIn)((_L = (_K = state.client) == null ? void 0 : _K.value) == null ? void 0 : _L.id) && holder),
983
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, endTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity, !(0, import_utils4.isNormalProductByDurationSchedule)(state.service.cacheItem) && !(0, import_utils6.isWalkIn)((_K = (_J = state.client) == null ? void 0 : _J.value) == null ? void 0 : _K.id) && holder),
1008
984
  /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { noStyle: true, name: "note" }, noteModalOpen && /* @__PURE__ */ import_react.default.createElement(
1009
985
  import_noteModal.default,
1010
986
  {
@@ -81,20 +81,24 @@ var WalletPassCardDisplay = ({
81
81
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
82
82
  Amount,
83
83
  {
84
- className: "pisell-card-amount-item-value",
84
+ className: "pisell-card-amount-item-value testtest",
85
85
  useThousandsSeparator: true,
86
86
  value: balance ? balance - (((_f = option == null ? void 0 : option.data) == null ? void 0 : _f.redeem) || 0) : 0,
87
- showCurrencySymbol: true
87
+ showCurrencySymbol: true,
88
+ hideDecimalForWholeNumbers: false,
89
+ precision: 2
88
90
  }
89
91
  ));
90
92
  }
91
93
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
92
94
  Amount,
93
95
  {
94
- className: "pisell-card-amount-item-value",
96
+ className: "pisell-card-amount-item-value testtest",
95
97
  useThousandsSeparator: true,
96
98
  value: balance,
97
- showCurrencySymbol: true
99
+ showCurrencySymbol: true,
100
+ hideDecimalForWholeNumbers: false,
101
+ precision: 2
98
102
  }
99
103
  ));
100
104
  };
@@ -68,7 +68,6 @@ var WalletPassModule = (0, import_react.forwardRef)(
68
68
  } = (0, import_useWalletPass.useWalletPass)({
69
69
  onSelectChange,
70
70
  customAmount,
71
- totalAmount: Number(orderInfo == null ? void 0 : orderInfo.totalAmount) || 0,
72
71
  clientId
73
72
  });
74
73
  const [expiredModalVisible, setExpiredModalVisible] = (0, import_react.useState)(false);
@@ -1,7 +1,6 @@
1
1
  declare type WalletPassDataType = Record<string, any>;
2
2
  export declare const getAvailableMaxAmount: (data: WalletPassDataType) => any;
3
3
  export declare const voucherTime: (data: WalletPassDataType, key?: string) => any;
4
- export declare const getVoucherAvailableStatus: (item: any) => boolean;
5
4
  export declare const formatMachineCodeServer2CardList: (data: WalletPassDataType[], selectId?: number[], otherProps?: Record<string, any>) => any;
6
5
  export declare const formatDiscountWalletData: (data: any, selectId?: number[]) => any;
7
6
  export interface WalletPassUsageUnit {
@@ -33,7 +33,6 @@ __export(utils_exports, {
33
33
  formatMachineCodeServer2CardList: () => formatMachineCodeServer2CardList,
34
34
  getAvailableMaxAmount: () => getAvailableMaxAmount,
35
35
  getPointCardAmount: () => getPointCardAmount,
36
- getVoucherAvailableStatus: () => getVoucherAvailableStatus,
37
36
  isSameContent: () => isSameContent,
38
37
  voucherTime: () => voucherTime
39
38
  });
@@ -44,9 +43,6 @@ var import_materials = require("@pisell/materials");
44
43
  var import_decimal = __toESM(require("decimal.js"));
45
44
  var Amount = import_materials.PisellText.Amount;
46
45
  var getAvailableMaxAmount = (data) => {
47
- if ((0, import_utils.isNumber)(data._available_max_amount)) {
48
- return data._available_max_amount;
49
- }
50
46
  return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
51
47
  };
52
48
  var voucherTime = (data, key = "expire_date") => {
@@ -59,20 +55,9 @@ var voucherTime = (data, key = "expire_date") => {
59
55
  }
60
56
  return import_utils.locales.getText("pisell2.text.walletPassPermanent");
61
57
  };
62
- var getVoucherAvailableStatus = (item) => {
63
- return item.unified_available_status === 1 && ((0, import_utils.isNumber)(item._unified_available_status) ? !!item._unified_available_status : true);
64
- };
65
58
  var formatMachineCodeServer2CardList = (data, selectId = [], otherProps = {}) => {
66
59
  return (data || []).map((item) => {
67
60
  var _a, _b;
68
- let disabled = false;
69
- if (item.unified_available_status === 0) {
70
- disabled = true;
71
- } else {
72
- if ((0, import_utils.isNumber)(item._unified_available_status)) {
73
- disabled = !item._unified_available_status;
74
- }
75
- }
76
61
  return {
77
62
  id: item.id,
78
63
  name: item.product_name,
@@ -89,8 +74,8 @@ var formatMachineCodeServer2CardList = (data, selectId = [], otherProps = {}) =>
89
74
  showQrCode: false,
90
75
  showStatus: true,
91
76
  code: item.code,
92
- disabled,
93
- disabledReason: (0, import_utils.isNumber)(item._unified_available_status) && item._unified_available_status !== 1 ? item.reason : (_a = item.unified_messages) == null ? void 0 : _a.title,
77
+ disabled: !item.unified_available_status,
78
+ disabledReason: (_a = item.unified_messages) == null ? void 0 : _a.title,
94
79
  cover: (_b = item.product) == null ? void 0 : _b.cover,
95
80
  qrCode: item.code,
96
81
  validDate: voucherTime(item),
@@ -168,7 +153,6 @@ var isSameContent = (arr1, arr2) => {
168
153
  formatMachineCodeServer2CardList,
169
154
  getAvailableMaxAmount,
170
155
  getPointCardAmount,
171
- getVoucherAvailableStatus,
172
156
  isSameContent,
173
157
  voucherTime
174
158
  });
@@ -9,7 +9,6 @@ export declare const useWalletPass: (props: {
9
9
  }[]) => void) | undefined;
10
10
  customAmount?: string | undefined;
11
11
  clientId?: number | undefined;
12
- totalAmount?: number | undefined;
13
12
  }) => {
14
13
  walletRecommendList: any[];
15
14
  userIdentificationCodes: any[];
@@ -30,6 +29,7 @@ export declare const useWalletPass: (props: {
30
29
  selectedDiscountList: any;
31
30
  handleSelectDiscount: (value: number[], option: any) => void;
32
31
  customerName: any;
32
+ fetchWalletRecommendList: (params: any) => Promise<any>;
33
33
  fetchUserIdentificationCodes: (params: any) => Promise<any>;
34
34
  getCachedWalletRecommendList: () => any;
35
35
  getCachedUserIdentificationCodes: () => any;