@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.
- 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 +164 -148
- 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/booking/components/actionButtons/index.d.ts +2 -0
- package/es/components/booking/components/actionButtons/index.js +105 -14
- package/es/components/booking/components/actionButtons/index.less +71 -4
- package/es/components/booking/components/footer/index.js +8 -4
- 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 +13 -7
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/productSelect/components/productGroup/index.js +20 -4
- package/es/components/productSelect/components/productGroup/index.less +17 -0
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/components/Cart/index.less +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +6 -1
- package/es/components/ticketBooking/components/ticketBooking/index.less +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +5 -2
- package/es/components/ticketBooking/hooks/pisellos/useScanManager.d.ts +6 -0
- package/es/components/ticketBooking/hooks/pisellos/useScanManager.js +20 -0
- 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/es/pro/pisellNumberSelector/index.js +40 -21
- package/es/utils/index.d.ts +1 -1
- package/lib/components/booking/components/actionButtons/index.d.ts +2 -0
- package/lib/components/booking/components/actionButtons/index.js +73 -12
- package/lib/components/booking/components/actionButtons/index.less +71 -4
- package/lib/components/booking/components/footer/index.js +4 -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 +13 -7
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/productSelect/components/productGroup/index.js +16 -3
- package/lib/components/productSelect/components/productGroup/index.less +17 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +6 -4
- package/lib/components/shoppingCart/components/Cart/index.less +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +5 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.less +1 -1
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +5 -2
- package/lib/components/ticketBooking/hooks/pisellos/useScanManager.d.ts +6 -0
- package/lib/components/ticketBooking/hooks/pisellos/useScanManager.js +44 -0
- 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/lib/pro/pisellNumberSelector/index.js +27 -17
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
@@ -11,18 +11,20 @@ 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";
|
23
24
|
import { useCustomer } from "../../../ticketBooking/hooks/pisellos/useCustomer";
|
24
25
|
import { useMemoizedFn } from 'ahooks';
|
25
26
|
import useEngineContext, { usePisellOS } from "../../../../hooks/useEngineContext";
|
27
|
+
import useScanManager from "../../../ticketBooking/hooks/pisellos/useScanManager";
|
26
28
|
// Toast 内容包装器,统一设置行高
|
27
29
|
var createToastContent = function createToastContent(text) {
|
28
30
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -30,11 +32,12 @@ var createToastContent = function createToastContent(text) {
|
|
30
32
|
}, text);
|
31
33
|
};
|
32
34
|
var ActionButtons = function ActionButtons(_ref) {
|
33
|
-
var _context$appHelper, _state$service2, _state$addons2, _context$
|
35
|
+
var _context$appHelper, _state$service2, _state$addons2, _state$service4, _state$service6, _context$appHelper3, _context$appHelper4, _context$appHelper4$g;
|
34
36
|
var state = _ref.state,
|
35
37
|
dispatch = _ref.dispatch,
|
36
38
|
_ref$disabled = _ref.disabled,
|
37
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
39
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
40
|
+
source = _ref.source;
|
38
41
|
var _useState = useState(false),
|
39
42
|
_useState2 = _slicedToArray(_useState, 2),
|
40
43
|
showClearModal = _useState2[0],
|
@@ -47,6 +50,10 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
47
50
|
_useState6 = _slicedToArray(_useState5, 2),
|
48
51
|
showCustomiseModal = _useState6[0],
|
49
52
|
setShowCustomiseModal = _useState6[1];
|
53
|
+
var _useState7 = useState(false),
|
54
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
55
|
+
showVoucherModal = _useState8[0],
|
56
|
+
setShowVoucherModal = _useState8[1];
|
50
57
|
var context = useEngineContext();
|
51
58
|
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
59
|
var pisellOS = usePisellOS();
|
@@ -65,6 +72,8 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
65
72
|
changeCustomerToGlobalState: changeCustomerToGlobalState
|
66
73
|
}),
|
67
74
|
selectCustomer = _useCustomer.selectCustomer;
|
75
|
+
var _useScanManager = useScanManager(),
|
76
|
+
clearAllScanListenersTaskQueue = _useScanManager.clearAllScanListenersTaskQueue;
|
68
77
|
|
69
78
|
// 监听客户选择变化,清空手动折扣
|
70
79
|
useEffect(function () {
|
@@ -120,6 +129,60 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
120
129
|
return originExpectAmount;
|
121
130
|
}, [state, hasCartItems]);
|
122
131
|
|
132
|
+
// 折扣券列表状态
|
133
|
+
var _useState9 = useState([]),
|
134
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
135
|
+
discountList = _useState10[0],
|
136
|
+
setDiscountList = _useState10[1];
|
137
|
+
|
138
|
+
// 计算已使用的券数量
|
139
|
+
var usedVouchersCount = useMemo(function () {
|
140
|
+
try {
|
141
|
+
var _state$service3;
|
142
|
+
if (!((_state$service3 = state.service) !== null && _state$service3 !== void 0 && (_state$service3 = _state$service3.value) !== null && _state$service3 !== void 0 && _state$service3.length)) {
|
143
|
+
return 0;
|
144
|
+
}
|
145
|
+
// 直接从全局折扣券列表中计算被选中的数量,避免重复计数
|
146
|
+
return discountList.filter(function (discount) {
|
147
|
+
return discount.isSelected;
|
148
|
+
}).length;
|
149
|
+
} catch (error) {
|
150
|
+
console.error('计算已使用券数量失败:', error);
|
151
|
+
return 0;
|
152
|
+
}
|
153
|
+
}, [discountList, (_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : _state$service4.value]);
|
154
|
+
|
155
|
+
// 判断是否有券可用但手动取消使用(显示红色感叹号)
|
156
|
+
var shouldShowWarning = useMemo(function () {
|
157
|
+
try {
|
158
|
+
var _state$service5;
|
159
|
+
// 条件:购物车不为空 && discountList 长度大于 0,且没有 isSelected 的优惠券,且有 isManualSelect 的优惠券
|
160
|
+
return ((_state$service5 = state.service) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.value) === null || _state$service5 === void 0 ? void 0 : _state$service5.length) > 0 && discountList.length > 0 && !discountList.some(function (discount) {
|
161
|
+
return discount.isSelected;
|
162
|
+
}) && discountList.some(function (discount) {
|
163
|
+
return discount.isManualSelect;
|
164
|
+
});
|
165
|
+
} catch (error) {
|
166
|
+
console.error('判断警告状态失败:', error);
|
167
|
+
return false;
|
168
|
+
}
|
169
|
+
}, [discountList, (_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : _state$service6.value]);
|
170
|
+
|
171
|
+
// 监听折扣券列表变化
|
172
|
+
useEffect(function () {
|
173
|
+
var _context$appHelper2;
|
174
|
+
var _ref2 = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils) || {},
|
175
|
+
pisellos = _ref2.pisellos;
|
176
|
+
if (!pisellos) return;
|
177
|
+
var onDiscountListChange = function onDiscountListChange(discount) {
|
178
|
+
setDiscountList(discount);
|
179
|
+
};
|
180
|
+
pisellos.effects.on('shopDiscount:onDiscountListChange', onDiscountListChange);
|
181
|
+
return function () {
|
182
|
+
pisellos.effects.off('shopDiscount:onDiscountListChange', onDiscountListChange);
|
183
|
+
};
|
184
|
+
}, [(_context$appHelper3 = context.appHelper) === null || _context$appHelper3 === void 0 ? void 0 : _context$appHelper3.utils]);
|
185
|
+
|
123
186
|
// 清空购物车按钮点击
|
124
187
|
var handleClear = function handleClear() {
|
125
188
|
setShowClearModal(true);
|
@@ -127,6 +190,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
127
190
|
|
128
191
|
// 仅清空商品
|
129
192
|
var handleClearItemsOnly = function handleClearItemsOnly() {
|
193
|
+
clearAllScanListenersTaskQueue();
|
130
194
|
if (!hasCartItems) {
|
131
195
|
// 购物车为空时显示Toast提示
|
132
196
|
Toast === null || Toast === void 0 || Toast.info(createToastContent(locales.getText('pisell2.clear-cart-modal.empty-cart-tip')));
|
@@ -161,6 +225,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
161
225
|
|
162
226
|
// 清空所有内容并重置购物车
|
163
227
|
var handleClearAllAndReset = function handleClearAllAndReset() {
|
228
|
+
clearAllScanListenersTaskQueue();
|
164
229
|
// 清空服务项目
|
165
230
|
dispatch({
|
166
231
|
type: 'setService',
|
@@ -272,9 +337,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
272
337
|
setShowCustomiseModal(true);
|
273
338
|
};
|
274
339
|
|
340
|
+
// GoodPass 券码管理
|
341
|
+
var handleGoodPassClick = function handleGoodPassClick() {
|
342
|
+
setShowVoucherModal(true);
|
343
|
+
};
|
344
|
+
|
275
345
|
// 处理自定义商品保存
|
276
346
|
var handleCustomiseItemSave = function handleCustomiseItemSave(data) {
|
277
|
-
var _state$
|
347
|
+
var _state$service7;
|
278
348
|
console.log('保存自定义商品:', data);
|
279
349
|
|
280
350
|
// 创建自定义商品项,按照标准商品结构
|
@@ -318,7 +388,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
318
388
|
};
|
319
389
|
|
320
390
|
// 添加到购物车(使用 service 来存储自定义商品)
|
321
|
-
var currentServices = (state === null || state === void 0 || (_state$
|
391
|
+
var currentServices = (state === null || state === void 0 || (_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : _state$service7.value) || [];
|
322
392
|
|
323
393
|
// 直接添加自定义商品,不检查重复
|
324
394
|
var updatedServices = [customItem].concat(_toConsumableArray(currentServices));
|
@@ -344,7 +414,15 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
344
414
|
onClick: handleClear,
|
345
415
|
type: "text",
|
346
416
|
disabled: isDisabledEdit
|
347
|
-
}
|
417
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
418
|
+
className: "action-button customise-button",
|
419
|
+
icon: /*#__PURE__*/React.createElement(PlusCircle, {
|
420
|
+
size: 22
|
421
|
+
}),
|
422
|
+
onClick: handleCustomiseItem,
|
423
|
+
type: "text",
|
424
|
+
disabled: isDisabledEdit
|
425
|
+
}, locales.getText('pisell2.action-buttons.customise-item')), /*#__PURE__*/React.createElement(Button, {
|
348
426
|
className: "action-button manuel-button",
|
349
427
|
icon: /*#__PURE__*/React.createElement(Calculator, {
|
350
428
|
size: 22
|
@@ -352,15 +430,20 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
352
430
|
onClick: handleManuelOrder,
|
353
431
|
type: "text",
|
354
432
|
disabled: isDisabledEdit
|
355
|
-
}, locales.getText('pisell2.action-buttons.manuel-order')), /*#__PURE__*/React.createElement(
|
356
|
-
className: "action-button
|
357
|
-
|
433
|
+
}, locales.getText('pisell2.action-buttons.manuel-order')), /*#__PURE__*/React.createElement("div", {
|
434
|
+
className: "action-button-wrapper"
|
435
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
436
|
+
className: "action-button goodpass-button",
|
437
|
+
icon: /*#__PURE__*/React.createElement(Sale03, {
|
358
438
|
size: 22
|
359
439
|
}),
|
360
|
-
onClick:
|
361
|
-
type: "text"
|
362
|
-
|
363
|
-
|
440
|
+
onClick: handleGoodPassClick,
|
441
|
+
type: "text"
|
442
|
+
}, locales.getText('pisell2.text.goodpass')), usedVouchersCount > 0 && /*#__PURE__*/React.createElement("div", {
|
443
|
+
className: "voucher-badge"
|
444
|
+
}, usedVouchersCount), shouldShowWarning && /*#__PURE__*/React.createElement("div", {
|
445
|
+
className: "voucher-warning-icon"
|
446
|
+
}, "!"))), /*#__PURE__*/React.createElement(ClearCartModal, {
|
364
447
|
visible: showClearModal,
|
365
448
|
onCancel: function onCancel() {
|
366
449
|
return setShowClearModal(false);
|
@@ -388,8 +471,16 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
388
471
|
return setShowCustomiseModal(false);
|
389
472
|
},
|
390
473
|
onSave: handleCustomiseItemSave,
|
391
|
-
currencySymbol: ((_context$
|
474
|
+
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
475
|
disabled: isDisabledEdit
|
476
|
+
}), /*#__PURE__*/React.createElement(VoucherModal, {
|
477
|
+
visible: showVoucherModal,
|
478
|
+
onClose: function onClose() {
|
479
|
+
return setShowVoucherModal(false);
|
480
|
+
},
|
481
|
+
state: state,
|
482
|
+
dispatch: dispatch,
|
483
|
+
source: source
|
393
484
|
}));
|
394
485
|
};
|
395
486
|
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
|
// 图标样式
|
@@ -38,6 +38,7 @@ import { SubTotal } from "../../../../index";
|
|
38
38
|
import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
|
39
39
|
import { sendWarningLog } from '@pisell/utils';
|
40
40
|
import dayjs from 'dayjs';
|
41
|
+
import useScanManager from "../../../ticketBooking/hooks/pisellos/useScanManager";
|
41
42
|
/**
|
42
43
|
* @title: 底部
|
43
44
|
* @description:
|
@@ -79,6 +80,8 @@ var Footer = function Footer(props) {
|
|
79
80
|
var isBooking4Shop = useIsBooking4Shop(state);
|
80
81
|
var appointmentProductRef = useRef(null);
|
81
82
|
var context = useEngineContext();
|
83
|
+
var _useScanManager = useScanManager(),
|
84
|
+
disableAllScanListeners = _useScanManager.disableAllScanListeners;
|
82
85
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
83
86
|
isTerminal = _context$appHelper$ut.isTerminal,
|
84
87
|
interaction = _context$appHelper$ut.interaction,
|
@@ -267,9 +270,10 @@ var Footer = function Footer(props) {
|
|
267
270
|
return _context.abrupt("return");
|
268
271
|
case 2:
|
269
272
|
if (!(isTerminal !== null && isTerminal !== void 0 && isTerminal())) {
|
270
|
-
_context.next =
|
273
|
+
_context.next = 5;
|
271
274
|
break;
|
272
275
|
}
|
276
|
+
disableAllScanListeners();
|
273
277
|
return _context.abrupt("return", interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 ? void 0 : _interaction$utils$po.call(_interaction$utils, {
|
274
278
|
module: 'booking',
|
275
279
|
key: 'booking_checkout',
|
@@ -280,7 +284,7 @@ var Footer = function Footer(props) {
|
|
280
284
|
newOrder: isNewOrder
|
281
285
|
}
|
282
286
|
}));
|
283
|
-
case
|
287
|
+
case 5:
|
284
288
|
state.action({
|
285
289
|
type: 'pisell1.handlePayment',
|
286
290
|
data: {
|
@@ -290,7 +294,7 @@ var Footer = function Footer(props) {
|
|
290
294
|
state === null || state === void 0 || state.callback();
|
291
295
|
}
|
292
296
|
});
|
293
|
-
case
|
297
|
+
case 6:
|
294
298
|
case "end":
|
295
299
|
return _context.stop();
|
296
300
|
}
|
@@ -953,7 +957,7 @@ var Footer = function Footer(props) {
|
|
953
957
|
className: "pisell-lowcode__booking-footer-buttons-item",
|
954
958
|
type: "primary",
|
955
959
|
onClick: handleNote
|
956
|
-
}, locales.getText('pisell2.ticket-booking.
|
960
|
+
}, locales.getText('pisell2.ticket-booking.note')));
|
957
961
|
}, []);
|
958
962
|
var buttonMap = {
|
959
963
|
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)),
|
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
|
-
}, /*#__PURE__*/React.createElement(
|
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", {
|