@pisell/private-materials 6.2.28 → 6.2.30

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 (85) 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 +164 -148
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +8 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/components/actionButtons/index.d.ts +2 -0
  12. package/es/components/booking/components/actionButtons/index.js +105 -14
  13. package/es/components/booking/components/actionButtons/index.less +71 -4
  14. package/es/components/booking/components/footer/index.js +8 -4
  15. package/es/components/booking/components/footer/index.less +3 -2
  16. package/es/components/booking/components/footer/utils.js +1 -0
  17. package/es/components/booking/components/tabPane/index.js +6 -20
  18. package/es/components/booking/components/tabPane/index.less +1 -1
  19. package/es/components/booking/components/voucher/index.js +7 -4
  20. package/es/components/booking/components/voucherModal/index.d.ts +19 -0
  21. package/es/components/booking/components/voucherModal/index.js +47 -0
  22. package/es/components/booking/components/voucherModal/index.less +23 -0
  23. package/es/components/booking/forms/forms.js +1 -1
  24. package/es/components/booking/info/index.less +1 -1
  25. package/es/components/booking/info/pet/index.less +1 -1
  26. package/es/components/booking/info/service/index.less +1 -1
  27. package/es/components/booking/locales.d.ts +3 -0
  28. package/es/components/booking/locales.js +13 -7
  29. package/es/components/eftposPay/amount.d.ts +1 -1
  30. package/es/components/eftposPay/device.d.ts +1 -1
  31. package/es/components/eftposPay/hooks.d.ts +2 -2
  32. package/es/components/eftposPay/store/index.d.ts +6 -6
  33. package/es/components/productSelect/components/productGroup/index.js +20 -4
  34. package/es/components/productSelect/components/productGroup/index.less +17 -0
  35. package/es/components/schedules/utils.d.ts +1 -1
  36. package/es/components/shoppingCart/components/Cart/Product.js +6 -3
  37. package/es/components/shoppingCart/components/Cart/index.less +1 -1
  38. package/es/components/ticketBooking/components/ticketBooking/index.js +6 -1
  39. package/es/components/ticketBooking/components/ticketBooking/index.less +1 -1
  40. package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +5 -2
  41. package/es/components/ticketBooking/hooks/pisellos/useScanManager.d.ts +6 -0
  42. package/es/components/ticketBooking/hooks/pisellos/useScanManager.js +20 -0
  43. package/es/components/ticketBooking/locales.d.ts +3 -0
  44. package/es/components/ticketBooking/locales.js +3 -0
  45. package/es/plus/clientCard/index.less +3 -6
  46. package/es/pro/pisellNumberSelector/index.js +40 -21
  47. package/es/utils/index.d.ts +1 -1
  48. package/lib/components/booking/components/actionButtons/index.d.ts +2 -0
  49. package/lib/components/booking/components/actionButtons/index.js +73 -12
  50. package/lib/components/booking/components/actionButtons/index.less +71 -4
  51. package/lib/components/booking/components/footer/index.js +4 -1
  52. package/lib/components/booking/components/footer/index.less +3 -2
  53. package/lib/components/booking/components/footer/utils.js +1 -0
  54. package/lib/components/booking/components/tabPane/index.js +5 -26
  55. package/lib/components/booking/components/tabPane/index.less +1 -1
  56. package/lib/components/booking/components/voucher/index.js +5 -4
  57. package/lib/components/booking/components/voucherModal/index.d.ts +19 -0
  58. package/lib/components/booking/components/voucherModal/index.js +83 -0
  59. package/lib/components/booking/components/voucherModal/index.less +23 -0
  60. package/lib/components/booking/forms/forms.js +1 -1
  61. package/lib/components/booking/info/index.less +1 -1
  62. package/lib/components/booking/info/pet/index.less +1 -1
  63. package/lib/components/booking/info/service/index.less +1 -1
  64. package/lib/components/booking/locales.d.ts +3 -0
  65. package/lib/components/booking/locales.js +13 -7
  66. package/lib/components/eftposPay/amount.d.ts +1 -1
  67. package/lib/components/eftposPay/device.d.ts +1 -1
  68. package/lib/components/eftposPay/hooks.d.ts +2 -2
  69. package/lib/components/eftposPay/store/index.d.ts +6 -6
  70. package/lib/components/productSelect/components/productGroup/index.js +16 -3
  71. package/lib/components/productSelect/components/productGroup/index.less +17 -0
  72. package/lib/components/schedules/utils.d.ts +1 -1
  73. package/lib/components/shoppingCart/components/Cart/Product.js +6 -4
  74. package/lib/components/shoppingCart/components/Cart/index.less +1 -1
  75. package/lib/components/ticketBooking/components/ticketBooking/index.js +5 -1
  76. package/lib/components/ticketBooking/components/ticketBooking/index.less +1 -1
  77. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +5 -2
  78. package/lib/components/ticketBooking/hooks/pisellos/useScanManager.d.ts +6 -0
  79. package/lib/components/ticketBooking/hooks/pisellos/useScanManager.js +44 -0
  80. package/lib/components/ticketBooking/locales.d.ts +3 -0
  81. package/lib/components/ticketBooking/locales.js +3 -0
  82. package/lib/plus/clientCard/index.less +3 -6
  83. package/lib/pro/pisellNumberSelector/index.js +27 -17
  84. package/lib/utils/index.d.ts +1 -1
  85. package/package.json +4 -4
@@ -41,22 +41,26 @@ var import_materials = require("@pisell/materials");
41
41
  var import_dayjs = __toESM(require("dayjs"));
42
42
  var import_clearCartModal = __toESM(require("../clearCartModal"));
43
43
  var import_customiseItemModal = __toESM(require("../customiseItemModal"));
44
+ var import_voucherModal = __toESM(require("../voucherModal"));
44
45
  var import_amount = require("../footer/amount");
45
46
  var import_utils2 = require("@pisell/utils");
46
47
  var import_index = require("./index.less");
47
48
  var import_useCustomer = require("../../../ticketBooking/hooks/pisellos/useCustomer");
48
49
  var import_ahooks = require("ahooks");
49
50
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
51
+ var import_useScanManager = __toESM(require("../../../ticketBooking/hooks/pisellos/useScanManager"));
50
52
  var createToastContent = (text) => /* @__PURE__ */ import_react.default.createElement("div", { className: "action-buttons-toast-content" }, text);
51
53
  var ActionButtons = ({
52
54
  state,
53
55
  dispatch,
54
- disabled = false
56
+ disabled = false,
57
+ source
55
58
  }) => {
56
- var _a, _b, _c, _d, _e, _f, _g;
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
57
60
  const [showClearModal, setShowClearModal] = (0, import_react.useState)(false);
58
61
  const [showPriceAdjustModal, setShowPriceAdjustModal] = (0, import_react.useState)(false);
59
62
  const [showCustomiseModal, setShowCustomiseModal] = (0, import_react.useState)(false);
63
+ const [showVoucherModal, setShowVoucherModal] = (0, import_react.useState)(false);
60
64
  const context = (0, import_useEngineContext.default)();
61
65
  const Toast = (_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.Toast;
62
66
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
@@ -72,6 +76,7 @@ var ActionButtons = ({
72
76
  const { selectCustomer } = (0, import_useCustomer.useCustomer)({
73
77
  changeCustomerToGlobalState
74
78
  });
79
+ const { clearAllScanListenersTaskQueue } = (0, import_useScanManager.default)();
75
80
  (0, import_react.useEffect)(() => {
76
81
  if (!pisellOS) return;
77
82
  const handleCustomerSelected = () => {
@@ -109,10 +114,45 @@ var ActionButtons = ({
109
114
  const { originExpectAmount } = (0, import_amount.getSumTotal)(state, true);
110
115
  return originExpectAmount;
111
116
  }, [state, hasCartItems]);
117
+ const [discountList, setDiscountList] = (0, import_react.useState)([]);
118
+ const usedVouchersCount = (0, import_react.useMemo)(() => {
119
+ var _a2, _b2;
120
+ try {
121
+ if (!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
122
+ return 0;
123
+ }
124
+ return discountList.filter((discount) => discount.isSelected).length;
125
+ } catch (error) {
126
+ console.error("计算已使用券数量失败:", error);
127
+ return 0;
128
+ }
129
+ }, [discountList, (_e = state.service) == null ? void 0 : _e.value]);
130
+ const shouldShowWarning = (0, import_react.useMemo)(() => {
131
+ var _a2, _b2;
132
+ try {
133
+ return ((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) > 0 && discountList.length > 0 && !discountList.some((discount) => discount.isSelected) && discountList.some((discount) => discount.isManualSelect);
134
+ } catch (error) {
135
+ console.error("判断警告状态失败:", error);
136
+ return false;
137
+ }
138
+ }, [discountList, (_f = state.service) == null ? void 0 : _f.value]);
139
+ (0, import_react.useEffect)(() => {
140
+ var _a2;
141
+ const { pisellos } = ((_a2 = context.appHelper) == null ? void 0 : _a2.utils) || {};
142
+ if (!pisellos) return;
143
+ const onDiscountListChange = (discount) => {
144
+ setDiscountList(discount);
145
+ };
146
+ pisellos.effects.on("shopDiscount:onDiscountListChange", onDiscountListChange);
147
+ return () => {
148
+ pisellos.effects.off("shopDiscount:onDiscountListChange", onDiscountListChange);
149
+ };
150
+ }, [(_g = context.appHelper) == null ? void 0 : _g.utils]);
112
151
  const handleClear = () => {
113
152
  setShowClearModal(true);
114
153
  };
115
154
  const handleClearItemsOnly = () => {
155
+ clearAllScanListenersTaskQueue();
116
156
  if (!hasCartItems) {
117
157
  Toast == null ? void 0 : Toast.info(createToastContent(import_utils.locales.getText("pisell2.clear-cart-modal.empty-cart-tip")));
118
158
  return;
@@ -139,6 +179,7 @@ var ActionButtons = ({
139
179
  Toast == null ? void 0 : Toast.success(createToastContent(import_utils.locales.getText("pisell2.action-buttons.clear-success")));
140
180
  };
141
181
  const handleClearAllAndReset = () => {
182
+ clearAllScanListenersTaskQueue();
142
183
  dispatch({
143
184
  type: "setService",
144
185
  payload: {
@@ -201,6 +242,9 @@ var ActionButtons = ({
201
242
  const handleCustomiseItem = () => {
202
243
  setShowCustomiseModal(true);
203
244
  };
245
+ const handleGoodPassClick = () => {
246
+ setShowVoucherModal(true);
247
+ };
204
248
  const handleCustomiseItemSave = (data) => {
205
249
  var _a2;
206
250
  console.log("保存自定义商品:", data);
@@ -261,8 +305,17 @@ var ActionButtons = ({
261
305
  onClick: handleClear,
262
306
  type: "text",
263
307
  disabled: isDisabledEdit
308
+ }
309
+ ), /* @__PURE__ */ import_react.default.createElement(
310
+ import_antd.Button,
311
+ {
312
+ className: "action-button customise-button",
313
+ icon: /* @__PURE__ */ import_react.default.createElement(import_icon.PlusCircle, { size: 22 }),
314
+ onClick: handleCustomiseItem,
315
+ type: "text",
316
+ disabled: isDisabledEdit
264
317
  },
265
- import_utils.locales.getText("pisell2.action-buttons.clear")
318
+ import_utils.locales.getText("pisell2.action-buttons.customise-item")
266
319
  ), /* @__PURE__ */ import_react.default.createElement(
267
320
  import_antd.Button,
268
321
  {
@@ -273,17 +326,16 @@ var ActionButtons = ({
273
326
  disabled: isDisabledEdit
274
327
  },
275
328
  import_utils.locales.getText("pisell2.action-buttons.manuel-order")
276
- ), /* @__PURE__ */ import_react.default.createElement(
329
+ ), /* @__PURE__ */ import_react.default.createElement("div", { className: "action-button-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
277
330
  import_antd.Button,
278
331
  {
279
- className: "action-button customise-button",
280
- icon: /* @__PURE__ */ import_react.default.createElement(import_icon.PlusCircle, { size: 22 }),
281
- onClick: handleCustomiseItem,
282
- type: "text",
283
- disabled: isDisabledEdit
332
+ className: "action-button goodpass-button",
333
+ icon: /* @__PURE__ */ import_react.default.createElement(import_icon.Sale03, { size: 22 }),
334
+ onClick: handleGoodPassClick,
335
+ type: "text"
284
336
  },
285
- import_utils.locales.getText("pisell2.action-buttons.customise-item")
286
- )), /* @__PURE__ */ import_react.default.createElement(
337
+ import_utils.locales.getText("pisell2.text.goodpass")
338
+ ), usedVouchersCount > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-badge" }, usedVouchersCount), shouldShowWarning && /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-warning-icon" }, "!"))), /* @__PURE__ */ import_react.default.createElement(
287
339
  import_clearCartModal.default,
288
340
  {
289
341
  visible: showClearModal,
@@ -317,9 +369,18 @@ var ActionButtons = ({
317
369
  visible: showCustomiseModal,
318
370
  onClose: () => setShowCustomiseModal(false),
319
371
  onSave: handleCustomiseItemSave,
320
- currencySymbol: ((_g = (_f = (_e = context.appHelper) == null ? void 0 : _e.utils) == null ? void 0 : _f.getSymbolic) == null ? void 0 : _g.call(_f)) || "$",
372
+ currencySymbol: ((_j = (_i = (_h = context.appHelper) == null ? void 0 : _h.utils) == null ? void 0 : _i.getSymbolic) == null ? void 0 : _j.call(_i)) || "$",
321
373
  disabled: isDisabledEdit
322
374
  }
375
+ ), /* @__PURE__ */ import_react.default.createElement(
376
+ import_voucherModal.default,
377
+ {
378
+ visible: showVoucherModal,
379
+ onClose: () => setShowVoucherModal(false),
380
+ state,
381
+ dispatch,
382
+ source
383
+ }
323
384
  ));
324
385
  };
325
386
  var actionButtons_default = ActionButtons;
@@ -6,6 +6,52 @@
6
6
  margin-top: 8px;
7
7
  padding: 0;
8
8
 
9
+ .action-button-wrapper {
10
+ position: relative;
11
+ flex: 1.4;
12
+ display: flex;
13
+
14
+ .voucher-badge {
15
+ position: absolute;
16
+ top: -8px;
17
+ right: -8px;
18
+ width: 20px;
19
+ height: 20px;
20
+ border-radius: 50%;
21
+ background-color: #7F56DA;
22
+ color: white;
23
+ font-size: 12px;
24
+ font-weight: 600;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ z-index: 10;
29
+ min-width: 20px;
30
+ padding: 0 4px;
31
+ box-sizing: border-box;
32
+ }
33
+
34
+ .voucher-warning-icon {
35
+ position: absolute;
36
+ top: -6px;
37
+ right: -6px;
38
+ width: 18px;
39
+ height: 18px;
40
+ border-radius: 50%;
41
+ background-color: #ff4d4f;
42
+ color: white;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ z-index: 10;
47
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
48
+
49
+ .anticon {
50
+ font-size: 10px;
51
+ }
52
+ }
53
+ }
54
+
9
55
  .action-button {
10
56
  display: flex;
11
57
  justify-content: center;
@@ -18,7 +64,7 @@
18
64
  color: white;
19
65
  background: #2C2C2C;
20
66
  border: 1px solid #2C2C2C;
21
- border-radius: 4px;
67
+ border-radius: 8px;
22
68
  font-size: 12px;
23
69
  font-weight: 500;
24
70
  transition: all 0.2s ease;
@@ -44,9 +90,10 @@
44
90
  }
45
91
  }
46
92
 
47
- // Clear 按钮更小
93
+ // Clear 按钮固定宽度
48
94
  &.clear-button {
49
- flex: 0.8;
95
+ width: 44px;
96
+ flex: none;
50
97
  border-color: #FF4D4F;
51
98
 
52
99
  &:hover:not(:disabled) {
@@ -59,6 +106,7 @@
59
106
  flex: 1;
60
107
  border-color: #CC8E50;
61
108
  align-items: center;
109
+ padding: 0 4px;
62
110
 
63
111
  &:hover:not(:disabled) {
64
112
  border-color: #CC8E50;
@@ -82,12 +130,31 @@
82
130
 
83
131
  // Customise 按钮更大一些
84
132
  &.customise-button {
85
- flex: 1.3;
133
+ flex: 1;
86
134
  border-color: #8157D5;
87
135
 
88
136
  &:hover:not(:disabled) {
89
137
  border-color: #8157D5;
90
138
  }
139
+
140
+ // Customise按钮文本支持换行,保持与图标水平对齐
141
+ span {
142
+ white-space: pre-line !important;
143
+ line-height: 1.15;
144
+ text-align: center;
145
+ display: flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ }
149
+ }
150
+
151
+ &.goodpass-button {
152
+ flex: 1.4;
153
+ border-color: #CC8E50;
154
+
155
+ &:hover:not(:disabled) {
156
+ border-color: #CC8E50;
157
+ }
91
158
  }
92
159
 
93
160
  // 图标样式
@@ -53,6 +53,7 @@ var import__ = require("../../../../index");
53
53
  var import_useIsBooking4Shop = require("../../hooks/useIsBooking4Shop");
54
54
  var import_utils4 = require("@pisell/utils");
55
55
  var import_dayjs = __toESM(require("dayjs"));
56
+ var import_useScanManager = __toESM(require("../../../ticketBooking/hooks/pisellos/useScanManager"));
56
57
  var Footer = (props) => {
57
58
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
58
59
  const { state, buttons, dispatch, source } = props;
@@ -64,6 +65,7 @@ var Footer = (props) => {
64
65
  const isBooking4Shop = (0, import_useIsBooking4Shop.useIsBooking4Shop)(state);
65
66
  const appointmentProductRef = (0, import_react.useRef)(null);
66
67
  const context = (0, import_useEngineContext.default)();
68
+ const { disableAllScanListeners } = (0, import_useScanManager.default)();
67
69
  const { isTerminal, interaction, store, storage, businessUtils } = (_a = context.appHelper) == null ? void 0 : _a.utils;
68
70
  (0, import_react.useEffect)(() => {
69
71
  store == null ? void 0 : store.dispatch({
@@ -201,6 +203,7 @@ var Footer = (props) => {
201
203
  var _a2, _b2;
202
204
  if (!order_id) return;
203
205
  if (isTerminal == null ? void 0 : isTerminal()) {
206
+ disableAllScanListeners();
204
207
  return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
205
208
  module: "booking",
206
209
  key: "booking_checkout",
@@ -629,7 +632,7 @@ var Footer = (props) => {
629
632
  type: "primary",
630
633
  onClick: handleNote
631
634
  },
632
- import_utils.locales.getText("pisell2.ticket-booking.notes")
635
+ import_utils.locales.getText("pisell2.ticket-booking.note")
633
636
  )
634
637
  );
635
638
  }, []);
@@ -1,6 +1,6 @@
1
1
  .pisell-lowcode__booking-footer-total {
2
2
  width: 100%;
3
- padding-bottom: 16px;
3
+ padding-bottom: 8px;
4
4
  display: flex;
5
5
  align-items: flex-start;
6
6
  justify-content: space-between;
@@ -15,7 +15,8 @@
15
15
  display: flex;
16
16
  flex-direction: column;
17
17
 
18
- .pisell-lowcode__booking-footer-left-total {}
18
+ .pisell-lowcode__booking-footer-left-total {
19
+ }
19
20
 
20
21
  .pisell-lowcode__booking-footer-left-arrears {
21
22
  font-size: 14px;
@@ -432,6 +432,7 @@ var formatValues = (state) => {
432
432
  type: state.renderType === "eventBooking" ? "event_booking_v2" : "appointment_booking",
433
433
  platform: state.isBookingTicket2 ? "pos" : "shop",
434
434
  sales_channel: "my_pisel",
435
+ order_sales_channel: state.isBookingTicket2 ? "pos" : "online_store",
435
436
  bookings: [],
436
437
  customer_id: 1,
437
438
  customer_name: "",
@@ -52,7 +52,7 @@ var TabPane = ({
52
52
  dispatch,
53
53
  source
54
54
  }) => {
55
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
55
+ var _a, _b, _c, _d, _e, _f;
56
56
  const context = (0, import_useEngineContext.default)();
57
57
  const { businessUtils } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
58
58
  const hasGoodPassApp = !!((_b = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _b.call(businessUtils, "goodpass"));
@@ -102,28 +102,7 @@ var TabPane = ({
102
102
  },
103
103
  children
104
104
  )
105
- ), shouldShowTerminalVoucher && state && dispatch && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-tab-pane-voucher-section" }, /* @__PURE__ */ import_react.default.createElement(
106
- import_voucher.default,
107
- {
108
- state: {
109
- ...state,
110
- service: {
111
- ...state.service || {},
112
- value: ((_d = state.service) == null ? void 0 : _d.value) || []
113
- },
114
- addons: {
115
- ...state.addons || {},
116
- value: ((_e = state.addons) == null ? void 0 : _e.value) || []
117
- },
118
- client: {
119
- ...state.client || {},
120
- value: ((_f = state.client) == null ? void 0 : _f.value) || {}
121
- }
122
- },
123
- dispatch,
124
- source
125
- }
126
- ), /* @__PURE__ */ import_react.default.createElement(import_actionButtons.default, { state, dispatch })), /* @__PURE__ */ import_react.default.createElement(
105
+ ), state && dispatch && (state == null ? void 0 : state.isBookingTicket2) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-tab-pane-voucher-section" }, /* @__PURE__ */ import_react.default.createElement(import_actionButtons.default, { state, dispatch })), /* @__PURE__ */ import_react.default.createElement(
127
106
  import_authWrap.default,
128
107
  {
129
108
  show: !!footer || shouldShowFooterVoucher,
@@ -134,15 +113,15 @@ var TabPane = ({
134
113
  ...state,
135
114
  service: {
136
115
  ...state.service || {},
137
- value: ((_g = state.service) == null ? void 0 : _g.value) || []
116
+ value: ((_d = state.service) == null ? void 0 : _d.value) || []
138
117
  },
139
118
  addons: {
140
119
  ...state.addons || {},
141
- value: ((_h = state.addons) == null ? void 0 : _h.value) || []
120
+ value: ((_e = state.addons) == null ? void 0 : _e.value) || []
142
121
  },
143
122
  client: {
144
123
  ...state.client || {},
145
- value: ((_i = state.client) == null ? void 0 : _i.value) || {}
124
+ value: ((_f = state.client) == null ? void 0 : _f.value) || {}
146
125
  }
147
126
  },
148
127
  dispatch,
@@ -50,7 +50,7 @@
50
50
  .pisell-lowcode__booking-tab-pane-voucher-section {
51
51
  display: flex;
52
52
  flex-direction: column;
53
- padding: 8px 16px;
53
+ padding: 10px;
54
54
  position: relative;
55
55
  z-index: 3;
56
56
  background-color: #1b1b1b;
@@ -58,8 +58,8 @@ var services = {};
58
58
  var VoucherCard = (props) => {
59
59
  var _a, _b, _c, _d;
60
60
  const context = (0, import_useEngineContext.default)();
61
- const { state, dispatch, source } = props;
62
- const [showDetail, setShowDetail] = (0, import_react.useState)(false);
61
+ const { state, dispatch, source, isInModal = false } = props;
62
+ const [showDetail, setShowDetail] = (0, import_react.useState)(isInModal ? true : false);
63
63
  const { pisellos } = (_a = context.appHelper) == null ? void 0 : _a.utils;
64
64
  const [code, setCode] = (0, import_react.useState)("");
65
65
  const [discountList, setDisCountList] = (0, import_react.useState)([]);
@@ -255,7 +255,7 @@ var VoucherCard = (props) => {
255
255
  return Number(b == null ? void 0 : b.isSelected) - Number(a == null ? void 0 : a.isSelected);
256
256
  });
257
257
  };
258
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-voucher-container" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-title" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "voucher-title-left" }, import_utils.locales.getText("pisell2.text.goodpass")), /* @__PURE__ */ import_react.default.createElement(
258
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-voucher-container" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-title" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "voucher-title-left" }, import_utils.locales.getText("pisell2.text.goodpass")), !isInModal && /* @__PURE__ */ import_react.default.createElement(
259
259
  "span",
260
260
  {
261
261
  className: "voucher-title-right",
@@ -278,13 +278,14 @@ var VoucherCard = (props) => {
278
278
  "div",
279
279
  {
280
280
  className: (0, import_classnames.default)("voucher-detail", {
281
- show: showDetail
281
+ show: showDetail || isInModal
282
282
  })
283
283
  },
284
284
  (availableData == null ? void 0 : availableData.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(
285
285
  import_materials.PisellGoodPassCard,
286
286
  {
287
287
  style: { width: "100%" },
288
+ isInModal: isInModal || false,
288
289
  dataSource: ((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length) ? availableData : [],
289
290
  mixedSort,
290
291
  onChange: (val) => {
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface VoucherModalProps {
4
+ /** 是否显示弹窗 */
5
+ visible: boolean;
6
+ /** 关闭弹窗回调 */
7
+ onClose: () => void;
8
+ /** booking 状态对象 */
9
+ state: any;
10
+ /** dispatch 函数 */
11
+ dispatch: (action: {
12
+ type: string;
13
+ payload?: any;
14
+ }) => void;
15
+ /** 数据源 */
16
+ source?: any;
17
+ }
18
+ declare const VoucherModal: React.FC<VoucherModalProps>;
19
+ export default VoucherModal;
@@ -0,0 +1,83 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/components/voucherModal/index.tsx
30
+ var voucherModal_exports = {};
31
+ __export(voucherModal_exports, {
32
+ default: () => voucherModal_default
33
+ });
34
+ module.exports = __toCommonJS(voucherModal_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_voucher = __toESM(require("../voucher"));
38
+ var import_index = require("./index.less");
39
+ var VoucherModal = ({
40
+ visible,
41
+ onClose,
42
+ state,
43
+ dispatch,
44
+ source
45
+ }) => {
46
+ var _a, _b, _c;
47
+ return /* @__PURE__ */ import_react.default.createElement(
48
+ import_antd.Modal,
49
+ {
50
+ title: null,
51
+ open: visible,
52
+ onCancel: onClose,
53
+ footer: null,
54
+ width: 600,
55
+ className: `pisell-voucher-modal ${!visible ? "pisell-voucher-modal--hidden" : ""}`,
56
+ forceRender: true
57
+ },
58
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-voucher-modal-content" }, /* @__PURE__ */ import_react.default.createElement(
59
+ import_voucher.default,
60
+ {
61
+ state: {
62
+ ...state,
63
+ service: {
64
+ ...state.service || {},
65
+ value: ((_a = state.service) == null ? void 0 : _a.value) || []
66
+ },
67
+ addons: {
68
+ ...state.addons || {},
69
+ value: ((_b = state.addons) == null ? void 0 : _b.value) || []
70
+ },
71
+ client: {
72
+ ...state.client || {},
73
+ value: ((_c = state.client) == null ? void 0 : _c.value) || {}
74
+ }
75
+ },
76
+ dispatch,
77
+ source,
78
+ isInModal: true
79
+ }
80
+ ))
81
+ );
82
+ };
83
+ var voucherModal_default = VoucherModal;
@@ -0,0 +1,23 @@
1
+ .pisell-voucher-modal {
2
+ .ant-modal-body {
3
+ padding: 0;
4
+ }
5
+
6
+ .pisell-voucher-modal-content {
7
+ max-height: 70vh;
8
+ overflow-y: auto;
9
+ }
10
+
11
+ // 隐藏状态下的样式优化
12
+ &.pisell-voucher-modal--hidden {
13
+ // 当弹窗隐藏时,可以通过一些样式来优化性能
14
+ // 例如暂停动画、降低 GPU 使用等
15
+ .pisell-voucher-modal-content {
16
+ // 暂停内容中的动画和过渡效果
17
+ * {
18
+ animation-play-state: paused !important;
19
+ transition: none !important;
20
+ }
21
+ }
22
+ }
23
+ }
@@ -147,7 +147,7 @@ var Forms = (0, import_model.Provider)((props) => {
147
147
  "div",
148
148
  {
149
149
  className: "pisell-lowcode__booking-field-wrap",
150
- style: { padding: hideTitle ? 0 : "12px 0 0" },
150
+ style: { padding: hideTitle ? 0 : "0" },
151
151
  key: d.form_id
152
152
  },
153
153
  hideTitle ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-field-title" }, d.form.title),
@@ -42,7 +42,7 @@
42
42
  }
43
43
  .create-booking-page-info-wrap {
44
44
  position: initial !important;
45
- padding: 0 16px !important;
45
+ padding: 0 10px !important;
46
46
  .booking-info-create-new {
47
47
  margin-top: 10px;
48
48
  color: var(--Base-Black, #000);
@@ -146,5 +146,5 @@
146
146
  }
147
147
 
148
148
  .pisell-lowcode__booking-pet-wraps {
149
- margin-top: 16px;
149
+ margin-top: 12px;
150
150
  }
@@ -1,5 +1,5 @@
1
1
  .pisell-lowcode__booking-service-wrap {
2
- margin-top: 16px;
2
+ margin-top: 12px;
3
3
  .pisell-lowcode__booking-service-clear-btn {
4
4
  cursor: pointer;
5
5
  margin-top: -12px;
@@ -264,6 +264,7 @@ declare const _default: {
264
264
  'pisell2.clear-cart-modal.clear-items-only': string;
265
265
  'pisell2.clear-cart-modal.clear-all-reset': string;
266
266
  'pisell2.clear-cart-modal.empty-cart-tip': string;
267
+ 'pisell2.voucher-modal.title': string;
267
268
  'pisell2.text.change.pet.title': string;
268
269
  'pisell2.text.change.pet.content': string;
269
270
  'pisell2.text.change.pet.content1': string;
@@ -564,6 +565,7 @@ declare const _default: {
564
565
  'pisell2.clear-cart-modal.clear-items-only': string;
565
566
  'pisell2.clear-cart-modal.clear-all-reset': string;
566
567
  'pisell2.clear-cart-modal.empty-cart-tip': string;
568
+ 'pisell2.voucher-modal.title': string;
567
569
  'pisell2.text.change.pet.title': string;
568
570
  'pisell2.text.change.pet.content': string;
569
571
  'pisell2.text.change.pet.content1': string;
@@ -864,6 +866,7 @@ declare const _default: {
864
866
  'pisell2.clear-cart-modal.clear-items-only': string;
865
867
  'pisell2.clear-cart-modal.clear-all-reset': string;
866
868
  'pisell2.clear-cart-modal.empty-cart-tip': string;
869
+ 'pisell2.voucher-modal.title': string;
867
870
  'pisell2.text.change.pet.title': string;
868
871
  'pisell2.text.change.pet.content': string;
869
872
  'pisell2.text.change.pet.content1': string;