@pisell/private-materials 6.1.15 → 6.1.17
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +144 -144
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/booking/components/actionButtons/index.d.ts +2 -0
- package/es/components/booking/components/actionButtons/index.js +93 -12
- package/es/components/booking/components/actionButtons/index.less +71 -4
- package/es/components/booking/components/footer/index.js +1 -1
- package/es/components/booking/components/footer/index.less +3 -2
- package/es/components/booking/components/footer/utils.js +1 -0
- package/es/components/booking/components/tabPane/index.js +6 -20
- package/es/components/booking/components/tabPane/index.less +1 -1
- package/es/components/booking/components/voucher/index.js +7 -4
- package/es/components/booking/components/voucherModal/index.d.ts +19 -0
- package/es/components/booking/components/voucherModal/index.js +47 -0
- package/es/components/booking/components/voucherModal/index.less +23 -0
- package/es/components/booking/forms/forms.js +1 -1
- package/es/components/booking/info/index.less +1 -1
- package/es/components/booking/info/pet/index.less +1 -1
- package/es/components/booking/info/service/index.less +1 -1
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +12 -6
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/productSelect/components/productGroup/index.js +20 -4
- package/es/components/productSelect/components/productGroup/index.less +17 -0
- package/es/components/shoppingCart/components/Cart/Product.js +5 -3
- package/es/components/shoppingCart/components/Cart/index.less +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.less +1 -1
- package/es/components/ticketBooking/locales.d.ts +3 -0
- package/es/components/ticketBooking/locales.js +3 -0
- package/es/plus/clientCard/index.less +3 -6
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/booking/components/actionButtons/index.d.ts +2 -0
- package/lib/components/booking/components/actionButtons/index.js +64 -12
- package/lib/components/booking/components/actionButtons/index.less +71 -4
- package/lib/components/booking/components/footer/index.js +1 -1
- package/lib/components/booking/components/footer/index.less +3 -2
- package/lib/components/booking/components/footer/utils.js +1 -0
- package/lib/components/booking/components/tabPane/index.js +5 -26
- package/lib/components/booking/components/tabPane/index.less +1 -1
- package/lib/components/booking/components/voucher/index.js +5 -4
- package/lib/components/booking/components/voucherModal/index.d.ts +19 -0
- package/lib/components/booking/components/voucherModal/index.js +83 -0
- package/lib/components/booking/components/voucherModal/index.less +23 -0
- package/lib/components/booking/forms/forms.js +1 -1
- package/lib/components/booking/info/index.less +1 -1
- package/lib/components/booking/info/pet/index.less +1 -1
- package/lib/components/booking/info/service/index.less +1 -1
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +12 -6
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/productSelect/components/productGroup/index.js +16 -3
- package/lib/components/productSelect/components/productGroup/index.less +17 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +5 -4
- package/lib/components/shoppingCart/components/Cart/index.less +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.less +1 -1
- package/lib/components/ticketBooking/locales.d.ts +3 -0
- package/lib/components/ticketBooking/locales.js +3 -0
- package/lib/plus/clientCard/index.less +3 -6
- package/package.json +1 -1
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
30
30
|
* @return {*}
|
31
31
|
* @Author: xiangfeng.xue
|
32
32
|
*/
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
34
34
|
/**
|
35
35
|
* 计算所有价格明细
|
36
36
|
* @param items - 购物车商品数组
|
@@ -11,12 +11,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useMemo, useState, useEffect } from 'react';
|
12
12
|
import { createPortal } from 'react-dom';
|
13
13
|
import { Button } from 'antd';
|
14
|
-
import { Trash01, Calculator, PlusCircle } from '@pisell/icon';
|
14
|
+
import { Trash01, Calculator, PlusCircle, Sale03 } from '@pisell/icon';
|
15
15
|
import { locales } from '@pisell/utils';
|
16
16
|
import { PisellAdjustPrice } from '@pisell/materials';
|
17
17
|
import dayjs from 'dayjs';
|
18
18
|
import ClearCartModal from "../clearCartModal";
|
19
19
|
import CustomiseItemModal from "../customiseItemModal";
|
20
|
+
import VoucherModal from "../voucherModal";
|
20
21
|
import { getSumTotal } from "../footer/amount";
|
21
22
|
import { formatAmount } from '@pisell/utils';
|
22
23
|
import "./index.less";
|
@@ -30,11 +31,12 @@ var createToastContent = function createToastContent(text) {
|
|
30
31
|
}, text);
|
31
32
|
};
|
32
33
|
var ActionButtons = function ActionButtons(_ref) {
|
33
|
-
var _context$appHelper, _state$service2, _state$addons2, _context$
|
34
|
+
var _context$appHelper, _state$service2, _state$addons2, _context$appHelper3, _context$appHelper4, _context$appHelper4$g;
|
34
35
|
var state = _ref.state,
|
35
36
|
dispatch = _ref.dispatch,
|
36
37
|
_ref$disabled = _ref.disabled,
|
37
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
38
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
39
|
+
source = _ref.source;
|
38
40
|
var _useState = useState(false),
|
39
41
|
_useState2 = _slicedToArray(_useState, 2),
|
40
42
|
showClearModal = _useState2[0],
|
@@ -47,6 +49,10 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
47
49
|
_useState6 = _slicedToArray(_useState5, 2),
|
48
50
|
showCustomiseModal = _useState6[0],
|
49
51
|
setShowCustomiseModal = _useState6[1];
|
52
|
+
var _useState7 = useState(false),
|
53
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
54
|
+
showVoucherModal = _useState8[0],
|
55
|
+
setShowVoucherModal = _useState8[1];
|
50
56
|
var context = useEngineContext();
|
51
57
|
var Toast = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.Toast;
|
52
58
|
var pisellOS = usePisellOS();
|
@@ -120,6 +126,55 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
120
126
|
return originExpectAmount;
|
121
127
|
}, [state, hasCartItems]);
|
122
128
|
|
129
|
+
// 折扣券列表状态
|
130
|
+
var _useState9 = useState([]),
|
131
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
132
|
+
discountList = _useState10[0],
|
133
|
+
setDiscountList = _useState10[1];
|
134
|
+
|
135
|
+
// 计算已使用的券数量
|
136
|
+
var usedVouchersCount = useMemo(function () {
|
137
|
+
try {
|
138
|
+
// 直接从全局折扣券列表中计算被选中的数量,避免重复计数
|
139
|
+
return discountList.filter(function (discount) {
|
140
|
+
return discount.isSelected;
|
141
|
+
}).length;
|
142
|
+
} catch (error) {
|
143
|
+
console.error('计算已使用券数量失败:', error);
|
144
|
+
return 0;
|
145
|
+
}
|
146
|
+
}, [discountList]);
|
147
|
+
|
148
|
+
// 判断是否有券可用但手动取消使用(显示红色感叹号)
|
149
|
+
var shouldShowWarning = useMemo(function () {
|
150
|
+
try {
|
151
|
+
// 条件:discountList 长度大于 0,且没有 isSelected 的优惠券,且有 isManualSelect 的优惠券
|
152
|
+
return discountList.length > 0 && !discountList.some(function (discount) {
|
153
|
+
return discount.isSelected;
|
154
|
+
}) && discountList.some(function (discount) {
|
155
|
+
return discount.isManualSelect;
|
156
|
+
});
|
157
|
+
} catch (error) {
|
158
|
+
console.error('判断警告状态失败:', error);
|
159
|
+
return false;
|
160
|
+
}
|
161
|
+
}, [discountList]);
|
162
|
+
|
163
|
+
// 监听折扣券列表变化
|
164
|
+
useEffect(function () {
|
165
|
+
var _context$appHelper2;
|
166
|
+
var _ref2 = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils) || {},
|
167
|
+
pisellos = _ref2.pisellos;
|
168
|
+
if (!pisellos) return;
|
169
|
+
var onDiscountListChange = function onDiscountListChange(discount) {
|
170
|
+
setDiscountList(discount);
|
171
|
+
};
|
172
|
+
pisellos.effects.on('shopDiscount:onDiscountListChange', onDiscountListChange);
|
173
|
+
return function () {
|
174
|
+
pisellos.effects.off('shopDiscount:onDiscountListChange', onDiscountListChange);
|
175
|
+
};
|
176
|
+
}, [(_context$appHelper3 = context.appHelper) === null || _context$appHelper3 === void 0 ? void 0 : _context$appHelper3.utils]);
|
177
|
+
|
123
178
|
// 清空购物车按钮点击
|
124
179
|
var handleClear = function handleClear() {
|
125
180
|
setShowClearModal(true);
|
@@ -272,6 +327,11 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
272
327
|
setShowCustomiseModal(true);
|
273
328
|
};
|
274
329
|
|
330
|
+
// GoodPass 券码管理
|
331
|
+
var handleGoodPassClick = function handleGoodPassClick() {
|
332
|
+
setShowVoucherModal(true);
|
333
|
+
};
|
334
|
+
|
275
335
|
// 处理自定义商品保存
|
276
336
|
var handleCustomiseItemSave = function handleCustomiseItemSave(data) {
|
277
337
|
var _state$service3;
|
@@ -344,7 +404,15 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
344
404
|
onClick: handleClear,
|
345
405
|
type: "text",
|
346
406
|
disabled: isDisabledEdit
|
347
|
-
}
|
407
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
408
|
+
className: "action-button customise-button",
|
409
|
+
icon: /*#__PURE__*/React.createElement(PlusCircle, {
|
410
|
+
size: 22
|
411
|
+
}),
|
412
|
+
onClick: handleCustomiseItem,
|
413
|
+
type: "text",
|
414
|
+
disabled: isDisabledEdit
|
415
|
+
}, locales.getText('pisell2.action-buttons.customise-item')), /*#__PURE__*/React.createElement(Button, {
|
348
416
|
className: "action-button manuel-button",
|
349
417
|
icon: /*#__PURE__*/React.createElement(Calculator, {
|
350
418
|
size: 22
|
@@ -352,15 +420,20 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
352
420
|
onClick: handleManuelOrder,
|
353
421
|
type: "text",
|
354
422
|
disabled: isDisabledEdit
|
355
|
-
}, locales.getText('pisell2.action-buttons.manuel-order')), /*#__PURE__*/React.createElement(
|
356
|
-
className: "action-button
|
357
|
-
|
423
|
+
}, locales.getText('pisell2.action-buttons.manuel-order')), /*#__PURE__*/React.createElement("div", {
|
424
|
+
className: "action-button-wrapper"
|
425
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
426
|
+
className: "action-button goodpass-button",
|
427
|
+
icon: /*#__PURE__*/React.createElement(Sale03, {
|
358
428
|
size: 22
|
359
429
|
}),
|
360
|
-
onClick:
|
361
|
-
type: "text"
|
362
|
-
|
363
|
-
|
430
|
+
onClick: handleGoodPassClick,
|
431
|
+
type: "text"
|
432
|
+
}, locales.getText('pisell2.text.goodpass')), usedVouchersCount > 0 && /*#__PURE__*/React.createElement("div", {
|
433
|
+
className: "voucher-badge"
|
434
|
+
}, usedVouchersCount), shouldShowWarning && /*#__PURE__*/React.createElement("div", {
|
435
|
+
className: "voucher-warning-icon"
|
436
|
+
}, "!"))), /*#__PURE__*/React.createElement(ClearCartModal, {
|
364
437
|
visible: showClearModal,
|
365
438
|
onCancel: function onCancel() {
|
366
439
|
return setShowClearModal(false);
|
@@ -388,8 +461,16 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
388
461
|
return setShowCustomiseModal(false);
|
389
462
|
},
|
390
463
|
onSave: handleCustomiseItemSave,
|
391
|
-
currencySymbol: ((_context$
|
464
|
+
currencySymbol: ((_context$appHelper4 = context.appHelper) === null || _context$appHelper4 === void 0 || (_context$appHelper4 = _context$appHelper4.utils) === null || _context$appHelper4 === void 0 || (_context$appHelper4$g = _context$appHelper4.getSymbolic) === null || _context$appHelper4$g === void 0 ? void 0 : _context$appHelper4$g.call(_context$appHelper4)) || "$",
|
392
465
|
disabled: isDisabledEdit
|
466
|
+
}), /*#__PURE__*/React.createElement(VoucherModal, {
|
467
|
+
visible: showVoucherModal,
|
468
|
+
onClose: function onClose() {
|
469
|
+
return setShowVoucherModal(false);
|
470
|
+
},
|
471
|
+
state: state,
|
472
|
+
dispatch: dispatch,
|
473
|
+
source: source
|
393
474
|
}));
|
394
475
|
};
|
395
476
|
export 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:
|
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
|
-
|
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
|
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
|
// 图标样式
|
@@ -977,7 +977,7 @@ var Footer = function Footer(props) {
|
|
977
977
|
className: "pisell-lowcode__booking-footer-buttons-item",
|
978
978
|
type: "primary",
|
979
979
|
onClick: handleNote
|
980
|
-
}, locales.getText('pisell2.ticket-booking.
|
980
|
+
}, locales.getText('pisell2.ticket-booking.note')));
|
981
981
|
}, []);
|
982
982
|
var buttonMap = {
|
983
983
|
checkout: checkoutButton,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.pisell-lowcode__booking-footer-total {
|
2
2
|
width: 100%;
|
3
|
-
padding-bottom:
|
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;
|
@@ -620,6 +620,7 @@ export var formatValues = function formatValues(state) {
|
|
620
620
|
type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
|
621
621
|
platform: state.isBookingTicket2 ? "pos" : "shop",
|
622
622
|
sales_channel: "my_pisel",
|
623
|
+
order_sales_channel: state.isBookingTicket2 ? "pos" : "online_store",
|
623
624
|
bookings: [],
|
624
625
|
customer_id: 1,
|
625
626
|
customer_name: "",
|
@@ -13,7 +13,7 @@ import useEngineContext from "../../../../hooks/useEngineContext";
|
|
13
13
|
import VoucherCard from "../voucher";
|
14
14
|
import ActionButtons from "../actionButtons";
|
15
15
|
var TabPane = function TabPane(_ref) {
|
16
|
-
var _context$appHelper, _businessUtils$getApp, _businessUtils$getApp2, _state$service, _state$addons, _state$client
|
16
|
+
var _context$appHelper, _businessUtils$getApp, _businessUtils$getApp2, _state$service, _state$addons, _state$client;
|
17
17
|
var children = _ref.children,
|
18
18
|
header = _ref.header,
|
19
19
|
footer = _ref.footer,
|
@@ -73,23 +73,9 @@ var TabPane = function TabPane(_ref) {
|
|
73
73
|
style: {
|
74
74
|
padding: 20
|
75
75
|
}
|
76
|
-
}, children)), /*#__PURE__*/React.createElement("div", {
|
76
|
+
}, children)), state && dispatch && (state === null || state === void 0 ? void 0 : state.isBookingTicket2) && /*#__PURE__*/React.createElement("div", {
|
77
77
|
className: "pisell-lowcode__booking-tab-pane-voucher-section"
|
78
|
-
},
|
79
|
-
state: _objectSpread(_objectSpread({}, state), {}, {
|
80
|
-
service: _objectSpread(_objectSpread({}, state.service || {}), {}, {
|
81
|
-
value: ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || []
|
82
|
-
}),
|
83
|
-
addons: _objectSpread(_objectSpread({}, state.addons || {}), {}, {
|
84
|
-
value: ((_state$addons = state.addons) === null || _state$addons === void 0 ? void 0 : _state$addons.value) || []
|
85
|
-
}),
|
86
|
-
client: _objectSpread(_objectSpread({}, state.client || {}), {}, {
|
87
|
-
value: ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value) || {}
|
88
|
-
})
|
89
|
-
}),
|
90
|
-
dispatch: dispatch,
|
91
|
-
source: source
|
92
|
-
}), /*#__PURE__*/React.createElement(ActionButtons, {
|
78
|
+
}, /*#__PURE__*/React.createElement(ActionButtons, {
|
93
79
|
state: state,
|
94
80
|
dispatch: dispatch
|
95
81
|
})), /*#__PURE__*/React.createElement(AuthWrap, {
|
@@ -99,13 +85,13 @@ var TabPane = function TabPane(_ref) {
|
|
99
85
|
}, shouldShowFooterVoucher && state && dispatch && /*#__PURE__*/React.createElement(VoucherCard, {
|
100
86
|
state: _objectSpread(_objectSpread({}, state), {}, {
|
101
87
|
service: _objectSpread(_objectSpread({}, state.service || {}), {}, {
|
102
|
-
value: ((_state$
|
88
|
+
value: ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || []
|
103
89
|
}),
|
104
90
|
addons: _objectSpread(_objectSpread({}, state.addons || {}), {}, {
|
105
|
-
value: ((_state$
|
91
|
+
value: ((_state$addons = state.addons) === null || _state$addons === void 0 ? void 0 : _state$addons.value) || []
|
106
92
|
}),
|
107
93
|
client: _objectSpread(_objectSpread({}, state.client || {}), {}, {
|
108
|
-
value: ((_state$
|
94
|
+
value: ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value) || {}
|
109
95
|
})
|
110
96
|
}),
|
111
97
|
dispatch: dispatch,
|
@@ -45,8 +45,10 @@ var VoucherCard = function VoucherCard(props) {
|
|
45
45
|
var context = useEngineContext();
|
46
46
|
var state = props.state,
|
47
47
|
dispatch = props.dispatch,
|
48
|
-
source = props.source
|
49
|
-
|
48
|
+
source = props.source,
|
49
|
+
_props$isInModal = props.isInModal,
|
50
|
+
isInModal = _props$isInModal === void 0 ? false : _props$isInModal;
|
51
|
+
var _useState = useState(isInModal ? true : false),
|
50
52
|
_useState2 = _slicedToArray(_useState, 2),
|
51
53
|
showDetail = _useState2[0],
|
52
54
|
setShowDetail = _useState2[1];
|
@@ -268,7 +270,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
268
270
|
className: "voucher-title"
|
269
271
|
}, /*#__PURE__*/React.createElement("span", {
|
270
272
|
className: "voucher-title-left"
|
271
|
-
}, locales.getText('pisell2.text.goodpass')), /*#__PURE__*/React.createElement("span", {
|
273
|
+
}, locales.getText('pisell2.text.goodpass')), !isInModal && /*#__PURE__*/React.createElement("span", {
|
272
274
|
className: "voucher-title-right",
|
273
275
|
onClick: function onClick() {
|
274
276
|
console.log('showDetail: ', showDetail);
|
@@ -280,12 +282,13 @@ var VoucherCard = function VoucherCard(props) {
|
|
280
282
|
})
|
281
283
|
}))), /*#__PURE__*/React.createElement("div", {
|
282
284
|
className: classNames('voucher-detail', {
|
283
|
-
show: showDetail
|
285
|
+
show: showDetail || isInModal
|
284
286
|
})
|
285
287
|
}, (availableData === null || availableData === void 0 ? void 0 : availableData.length) > 0 ? /*#__PURE__*/React.createElement(PisellGoodPassCard, {
|
286
288
|
style: {
|
287
289
|
width: '100%'
|
288
290
|
},
|
291
|
+
isInModal: isInModal || false,
|
289
292
|
dataSource: (_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length ? availableData : [],
|
290
293
|
mixedSort: mixedSort,
|
291
294
|
onChange: function 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,47 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
+
import React from 'react';
|
8
|
+
import { Modal } from 'antd';
|
9
|
+
import VoucherCard from "../voucher";
|
10
|
+
import "./index.less";
|
11
|
+
var VoucherModal = function VoucherModal(_ref) {
|
12
|
+
var _state$service, _state$addons, _state$client;
|
13
|
+
var visible = _ref.visible,
|
14
|
+
onClose = _ref.onClose,
|
15
|
+
state = _ref.state,
|
16
|
+
dispatch = _ref.dispatch,
|
17
|
+
source = _ref.source;
|
18
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
19
|
+
title: null,
|
20
|
+
open: visible,
|
21
|
+
onCancel: onClose,
|
22
|
+
footer: null,
|
23
|
+
width: 600,
|
24
|
+
className: "pisell-voucher-modal ".concat(!visible ? 'pisell-voucher-modal--hidden' : '')
|
25
|
+
// 移除 destroyOnClose,让内容始终渲染
|
26
|
+
,
|
27
|
+
forceRender: true
|
28
|
+
}, /*#__PURE__*/React.createElement("div", {
|
29
|
+
className: "pisell-voucher-modal-content"
|
30
|
+
}, /*#__PURE__*/React.createElement(VoucherCard, {
|
31
|
+
state: _objectSpread(_objectSpread({}, state), {}, {
|
32
|
+
service: _objectSpread(_objectSpread({}, state.service || {}), {}, {
|
33
|
+
value: ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || []
|
34
|
+
}),
|
35
|
+
addons: _objectSpread(_objectSpread({}, state.addons || {}), {}, {
|
36
|
+
value: ((_state$addons = state.addons) === null || _state$addons === void 0 ? void 0 : _state$addons.value) || []
|
37
|
+
}),
|
38
|
+
client: _objectSpread(_objectSpread({}, state.client || {}), {}, {
|
39
|
+
value: ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value) || {}
|
40
|
+
})
|
41
|
+
}),
|
42
|
+
dispatch: dispatch,
|
43
|
+
source: source,
|
44
|
+
isInModal: true
|
45
|
+
})));
|
46
|
+
};
|
47
|
+
export 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
|
+
}
|
@@ -168,7 +168,7 @@ var Forms = Provider(function (props) {
|
|
168
168
|
return /*#__PURE__*/React.createElement("div", {
|
169
169
|
className: "pisell-lowcode__booking-field-wrap",
|
170
170
|
style: {
|
171
|
-
padding: hideTitle ? 0 : '
|
171
|
+
padding: hideTitle ? 0 : '0'
|
172
172
|
},
|
173
173
|
key: d.form_id
|
174
174
|
}, hideTitle ? null : /*#__PURE__*/React.createElement("div", {
|
@@ -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;
|
@@ -280,8 +280,8 @@ export default {
|
|
280
280
|
'pisell2.text.cancel': 'Cancel',
|
281
281
|
// Action Buttons
|
282
282
|
'pisell2.action-buttons.clear': 'Clear',
|
283
|
-
'pisell2.action-buttons.manuel-order':
|
284
|
-
'pisell2.action-buttons.customise-item': '
|
283
|
+
'pisell2.action-buttons.manuel-order': "Manual\nOrder\xA0$",
|
284
|
+
'pisell2.action-buttons.customise-item': 'Cust. \nItem',
|
285
285
|
'pisell2.action-buttons.no-items-to-adjust': 'No items in cart to adjust price.',
|
286
286
|
'pisell2.action-buttons.adjust-order-price': 'Adjust Order Price',
|
287
287
|
'pisell2.action-buttons.price-adjusted-success': 'Order price adjusted successfully.',
|
@@ -307,6 +307,8 @@ export default {
|
|
307
307
|
'pisell2.clear-cart-modal.clear-items-only': 'Clear Items Only',
|
308
308
|
'pisell2.clear-cart-modal.clear-all-reset': 'Clear All &\nReset Cart',
|
309
309
|
'pisell2.clear-cart-modal.empty-cart-tip': 'Cart is empty',
|
310
|
+
// Voucher Modal
|
311
|
+
'pisell2.voucher-modal.title': 'Vouchers & Discounts',
|
310
312
|
'pisell2.text.change.pet.title': 'You have changed the holder information. Do you want to keep the items under their name?',
|
311
313
|
'pisell2.text.change.pet.content': 'Selecting “Keep” will move the items to Open Items. Selecting “Discard” will clear all items under the holder’s name.',
|
312
314
|
'pisell2.text.change.pet.content1': 'Reservation-type items cannot be added to the Open Items cart and will be removed.',
|
@@ -634,8 +636,8 @@ export default {
|
|
634
636
|
'pisell2.text.cancel': '取消',
|
635
637
|
// Action Buttons
|
636
638
|
'pisell2.action-buttons.clear': '清空',
|
637
|
-
'pisell2.action-buttons.manuel-order':
|
638
|
-
'pisell2.action-buttons.customise-item': '
|
639
|
+
'pisell2.action-buttons.manuel-order': "\u624B\u52A8\n\u8BA2\u5355\xA0$",
|
640
|
+
'pisell2.action-buttons.customise-item': '自定义\n商品',
|
639
641
|
'pisell2.action-buttons.no-items-to-adjust': '购物车中没有商品可调整价格。',
|
640
642
|
'pisell2.action-buttons.adjust-order-price': '调整订单价格',
|
641
643
|
'pisell2.action-buttons.price-adjusted-success': '订单价格调整成功。',
|
@@ -661,6 +663,8 @@ export default {
|
|
661
663
|
'pisell2.clear-cart-modal.clear-items-only': '仅清空商品',
|
662
664
|
'pisell2.clear-cart-modal.clear-all-reset': '清空所有内容\n并重置购物车',
|
663
665
|
'pisell2.clear-cart-modal.empty-cart-tip': '当前购物车为空',
|
666
|
+
// Voucher Modal
|
667
|
+
'pisell2.voucher-modal.title': '券码管理',
|
664
668
|
'pisell2.text.change.pet.title': '您已变更持有人信息,是否保留该持有人名下的商品?',
|
665
669
|
'pisell2.text.change.pet.content': '选择“保留”将商品添加到未分配商品(公共购物车)中;选择“不保留”将清空该持有人名下的所有商品。',
|
666
670
|
'pisell2.text.change.pet.content1': '预约类商品无法添加到公共购物车,将会被删除。',
|
@@ -988,8 +992,8 @@ export default {
|
|
988
992
|
'pisell2.text.cancel': '取消',
|
989
993
|
// Action Buttons
|
990
994
|
'pisell2.action-buttons.clear': '清空',
|
991
|
-
'pisell2.action-buttons.manuel-order':
|
992
|
-
'pisell2.action-buttons.customise-item': '
|
995
|
+
'pisell2.action-buttons.manuel-order': "\u624B\u52D5\n\u8A02\u55AE\xA0$",
|
996
|
+
'pisell2.action-buttons.customise-item': '自定義\n商品',
|
993
997
|
'pisell2.action-buttons.no-items-to-adjust': '購物車中沒有商品可調整價格。',
|
994
998
|
'pisell2.action-buttons.adjust-order-price': '調整訂單價格',
|
995
999
|
'pisell2.action-buttons.price-adjusted-success': '訂單價格調整成功。',
|
@@ -1015,6 +1019,8 @@ export default {
|
|
1015
1019
|
'pisell2.clear-cart-modal.clear-items-only': '僅清空商品',
|
1016
1020
|
'pisell2.clear-cart-modal.clear-all-reset': '清空所有內容\n並重置購物車',
|
1017
1021
|
'pisell2.clear-cart-modal.empty-cart-tip': '當前購物車為空',
|
1022
|
+
// Voucher Modal
|
1023
|
+
'pisell2.voucher-modal.title': '券碼管理',
|
1018
1024
|
'pisell2.text.change.pet.title': '您已變更持有人信息,是否保留該持有人名下的商品?',
|
1019
1025
|
'pisell2.text.change.pet.content': '選擇“保留”將商品添加到未分配商品(公共購物車)中;選擇“不保留”將清空該持有人名下的所有商品。',
|
1020
1026
|
'pisell2.text.change.pet.content1': '預約類商品無法添加到公共購物車,將會被刪除。',
|