@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
@@ -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;
|
@@ -43,7 +43,7 @@ export default {
|
|
43
43
|
'pisell2.text.holder': 'Holder',
|
44
44
|
'pisell2.text.warnings': 'Warnings',
|
45
45
|
'pisell2.text.order-notes': 'Order notes',
|
46
|
-
'pisell2.text.add-order-notes': 'Add Order
|
46
|
+
'pisell2.text.add-order-notes': 'Add Order Note',
|
47
47
|
'pisell2.text.add-internal-notes': 'Add Internal note',
|
48
48
|
'pisell2.text.add-notes': 'Add Notes',
|
49
49
|
'pisell2.text.notes': 'Notes',
|
@@ -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': '預約類商品無法添加到公共購物車,將會被刪除。',
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
8
8
|
*/
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
10
10
|
className?: string | undefined;
|
11
|
-
onChange?: ((status: "success" | "page" | "
|
11
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
12
12
|
[keys: string]: unknown;
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
14
14
|
onClose: () => void;
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
11
11
|
api: PayProps['api'];
|
12
12
|
className?: string | undefined;
|
13
|
-
onChange?: ((status: "success" | "page" | "
|
13
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
14
14
|
[keys: string]: unknown;
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
16
16
|
onClose: () => void;
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
18
|
-
readonly statusRef: React.MutableRefObject<"success" | "
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo" | "linkly">;
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
25
25
|
};
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
175
175
|
type: EActionTypes;
|
176
176
|
payload: {
|
177
|
-
status: "success" | "
|
177
|
+
status: "success" | "loading" | "warn" | "fail" | "question";
|
178
178
|
};
|
179
179
|
};
|
180
180
|
/**
|
@@ -295,20 +295,20 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
295
295
|
name?: string | undefined;
|
296
296
|
symbol?: string | undefined;
|
297
297
|
amount?: string | number | undefined;
|
298
|
-
mode?: "
|
298
|
+
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
|
-
eftpos?: "
|
301
|
-
action?: "amount" | "
|
300
|
+
eftpos?: "tyro" | "windcave" | "stripe" | "payo" | "linkly" | undefined;
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
304
304
|
title?: string | undefined;
|
305
305
|
subTitle?: string | undefined;
|
306
|
-
type?: "
|
306
|
+
type?: "unset" | "step" | undefined;
|
307
307
|
render?: boolean | undefined;
|
308
308
|
net?: boolean | undefined;
|
309
309
|
component?: string | undefined;
|
310
310
|
form?: string | undefined;
|
311
|
-
status?: "success" | "
|
311
|
+
status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
312
312
|
warn?: string | undefined;
|
313
313
|
steps?: {
|
314
314
|
/** 用于重置当前步骤 */
|
@@ -55,6 +55,17 @@ var ProductGroup = function ProductGroup(_ref) {
|
|
55
55
|
}
|
56
56
|
return "".concat(locales.getText('pisell2.product-select.stock'), "\uFF1A").concat(item.stock_quantity);
|
57
57
|
};
|
58
|
+
|
59
|
+
// 获取商品名称的前两个字符作为文字封面
|
60
|
+
var getTextCover = function getTextCover(title) {
|
61
|
+
if (!title) return '';
|
62
|
+
// 移除首尾空格并取前两个字符
|
63
|
+
var cleanTitle = title.trim();
|
64
|
+
if (cleanTitle.length === 0) return '';
|
65
|
+
|
66
|
+
// 取前两个字符(无论是中文、英文还是其他字符)
|
67
|
+
return cleanTitle.substring(0, 2).toUpperCase();
|
68
|
+
};
|
58
69
|
var renderPrice = function renderPrice(item) {
|
59
70
|
var _price = item.price,
|
60
71
|
_original_price = item.original_price,
|
@@ -86,22 +97,27 @@ var ProductGroup = function ProductGroup(_ref) {
|
|
86
97
|
className: classNames('product-card', {
|
87
98
|
selected: currentProductId && item.id === currentProductId
|
88
99
|
}),
|
89
|
-
|
100
|
+
onPointerUp: function onPointerUp() {
|
90
101
|
onSelectProduct === null || onSelectProduct === void 0 || onSelectProduct(item);
|
91
102
|
}
|
92
|
-
}, isProductCover
|
103
|
+
}, isProductCover ? /*#__PURE__*/React.createElement("div", {
|
93
104
|
className: "card-left",
|
94
105
|
style: {
|
95
106
|
width: imgWidth || 'auto',
|
96
107
|
height: imgHeight || 'auto'
|
97
108
|
}
|
98
|
-
}, /*#__PURE__*/React.createElement("img", {
|
109
|
+
}, item.cover ? /*#__PURE__*/React.createElement("img", {
|
99
110
|
loading: "lazy",
|
100
111
|
src: item.cover,
|
101
112
|
style: {
|
102
113
|
borderRadius: radius
|
103
114
|
}
|
104
|
-
})
|
115
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
116
|
+
className: "text-cover",
|
117
|
+
style: {
|
118
|
+
borderRadius: radius
|
119
|
+
}
|
120
|
+
}, getTextCover(item.title))) : null, /*#__PURE__*/React.createElement("div", {
|
105
121
|
className: "card-right"
|
106
122
|
}, !!isTitle ? /*#__PURE__*/React.createElement("div", {
|
107
123
|
className: "title"
|
@@ -106,6 +106,23 @@
|
|
106
106
|
height: 100%;
|
107
107
|
object-fit: cover;
|
108
108
|
}
|
109
|
+
|
110
|
+
.text-cover {
|
111
|
+
width: 100%;
|
112
|
+
height: 100%;
|
113
|
+
display: flex;
|
114
|
+
align-items: center;
|
115
|
+
justify-content: center;
|
116
|
+
background: #dedede;
|
117
|
+
color: #6c6c6c;
|
118
|
+
font-size: 60px;
|
119
|
+
font-weight: 600;
|
120
|
+
text-align: center;
|
121
|
+
line-height: 1;
|
122
|
+
letter-spacing: 1px;
|
123
|
+
border-radius: 8px;
|
124
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
125
|
+
}
|
109
126
|
}
|
110
127
|
|
111
128
|
.card-right {
|
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
|
|
17
17
|
export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
|
18
18
|
export declare const saveConfirm: () => Promise<{
|
19
19
|
destroy: () => void;
|
20
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
20
|
+
update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
|
21
21
|
}>;
|
22
22
|
export { modal };
|
@@ -1,7 +1,7 @@
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
2
|
import React, { useMemo } from 'react';
|
3
|
-
|
4
|
-
import ProductCard from
|
3
|
+
import { ProductCard } from '@pisell/materials';
|
4
|
+
// import ProductCard from '../../../../../../materials/src/components/productCard';
|
5
5
|
import useClearCart from "../../hooks/useClearCart";
|
6
6
|
import { useContext } from "../../hooks/useContext";
|
7
7
|
import useAddService from "../../hooks/useAddService";
|
@@ -98,6 +98,7 @@ var Product = function Product(props) {
|
|
98
98
|
}),
|
99
99
|
color: '#667085'
|
100
100
|
}],
|
101
|
+
escapeDom: ".pisell-number-selector-popover",
|
101
102
|
key: item._id,
|
102
103
|
dataSource: item,
|
103
104
|
onAction: function onAction(e) {
|
@@ -131,7 +132,9 @@ var Product = function Product(props) {
|
|
131
132
|
onAddHolder: function onAddHolder(e) {
|
132
133
|
return handleChange(item, 'add_holder', e);
|
133
134
|
}
|
134
|
-
}, productParams, getProductCardStyleProps(isRetail ? 'retail' : 'appointment')
|
135
|
+
}, productParams, getProductCardStyleProps(isRetail ? 'retail' : 'appointment'), {
|
136
|
+
scenario: state.scenario
|
137
|
+
}));
|
135
138
|
}), !hideAddBtn && platform !== 'h5' && isAdd ? useAddService(id, 'more') : null);
|
136
139
|
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
137
140
|
};
|
@@ -47,6 +47,7 @@ import "./index.less";
|
|
47
47
|
import { getBookingType } from "../bookingDataPanel/bookingList/utils";
|
48
48
|
import { useCustomer } from "../../hooks/pisellos";
|
49
49
|
import { useMemoizedFn } from "ahooks";
|
50
|
+
import useScanManager from "../../hooks/pisellos/useScanManager";
|
50
51
|
export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
|
51
52
|
var _bookings$list, _bookings$list2;
|
52
53
|
var customer_id = data.customer_id,
|
@@ -250,6 +251,8 @@ var TicketBooking = function TicketBooking() {
|
|
250
251
|
openScan = _useScanGlobal.openScan,
|
251
252
|
closeScan = _useScanGlobal.closeScan;
|
252
253
|
var handleScan = useScanGlobalHandle();
|
254
|
+
var _useScanManager = useScanManager(),
|
255
|
+
enableAllScanListeners = _useScanManager.enableAllScanListeners;
|
253
256
|
var changeCustomerToGlobalState = useMemoizedFn(function () {});
|
254
257
|
var _useCustomer = useCustomer({
|
255
258
|
changeCustomerToGlobalState: changeCustomerToGlobalState
|
@@ -302,11 +305,13 @@ var TicketBooking = function TicketBooking() {
|
|
302
305
|
// 支付成功后清空状态
|
303
306
|
_initFn(function () {});
|
304
307
|
selectCustomer(null);
|
308
|
+
enableAllScanListeners();
|
305
309
|
});
|
306
310
|
|
307
311
|
// 作废预约
|
308
312
|
interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || _interaction$utils2.mountFunction('booking', 'voidBooking', function (orderId) {
|
309
313
|
voidAppointment(orderId);
|
314
|
+
enableAllScanListeners();
|
310
315
|
});
|
311
316
|
return function () {
|
312
317
|
off === null || off === void 0 || off();
|
@@ -1078,7 +1083,7 @@ var TicketBooking = function TicketBooking() {
|
|
1078
1083
|
})), /*#__PURE__*/React.createElement("div", {
|
1079
1084
|
style: {
|
1080
1085
|
flexShrink: 0,
|
1081
|
-
width:
|
1086
|
+
width: 400
|
1082
1087
|
}
|
1083
1088
|
}, /*#__PURE__*/React.createElement(BookingInfo, {
|
1084
1089
|
key: state.createCount,
|
@@ -208,12 +208,15 @@ export var useCustomer = function useCustomer(props) {
|
|
208
208
|
|
209
209
|
// 选择客户
|
210
210
|
var selectCustomer = useMemoizedFn(function (customer) {
|
211
|
-
|
211
|
+
var _bookingTicket$setAct, _props$changeCustomer2;
|
212
|
+
bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$setAct = bookingTicket.setActiveCustomer) === null || _bookingTicket$setAct === void 0 || _bookingTicket$setAct.call(bookingTicket, customer);
|
213
|
+
(_props$changeCustomer2 = props.changeCustomerToGlobalState) === null || _props$changeCustomer2 === void 0 || _props$changeCustomer2.call(props, customer);
|
212
214
|
});
|
213
215
|
|
214
216
|
// 新增客户到第一个
|
215
217
|
var addCustomerToFirst = useMemoizedFn(function (customer) {
|
216
|
-
|
218
|
+
var _bookingTicket$addCus;
|
219
|
+
bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$addCus = bookingTicket.addCustomerToFirst) === null || _bookingTicket$addCus === void 0 || _bookingTicket$addCus.call(bookingTicket, customer);
|
217
220
|
});
|
218
221
|
return {
|
219
222
|
// 客户列表
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { useBookingTicket } from "./bookingTicket";
|
2
|
+
import { useMemoizedFn } from "ahooks";
|
3
|
+
var useScanManager = function useScanManager() {
|
4
|
+
var bookingTicket = useBookingTicket();
|
5
|
+
var disableAllScanListeners = useMemoizedFn(function () {
|
6
|
+
bookingTicket.disableAllScanListeners();
|
7
|
+
});
|
8
|
+
var enableAllScanListeners = useMemoizedFn(function () {
|
9
|
+
bookingTicket.enableAllScanListeners();
|
10
|
+
});
|
11
|
+
var clearAllScanListenersTaskQueue = useMemoizedFn(function () {
|
12
|
+
bookingTicket.clearAllScanListenersTaskQueue();
|
13
|
+
});
|
14
|
+
return {
|
15
|
+
disableAllScanListeners: disableAllScanListeners,
|
16
|
+
enableAllScanListeners: enableAllScanListeners,
|
17
|
+
clearAllScanListenersTaskQueue: clearAllScanListenersTaskQueue
|
18
|
+
};
|
19
|
+
};
|
20
|
+
export default useScanManager;
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
2
2
|
en: {
|
3
3
|
'pisell2.ticket-booking.info': string;
|
4
4
|
'pisell2.ticket-booking.notes': string;
|
5
|
+
'pisell2.ticket-booking.note': string;
|
5
6
|
'pisell2.ticket-booking.forms': string;
|
6
7
|
'pisell2.ticket-booking.sales': string;
|
7
8
|
'pisell2.ticket-booking.payment': string;
|
@@ -60,6 +61,7 @@ declare const _default: {
|
|
60
61
|
'zh-CN': {
|
61
62
|
'pisell2.ticket-booking.info': string;
|
62
63
|
'pisell2.ticket-booking.notes': string;
|
64
|
+
'pisell2.ticket-booking.note': string;
|
63
65
|
'pisell2.ticket-booking.forms': string;
|
64
66
|
'pisell2.ticket-booking.sales': string;
|
65
67
|
'pisell2.ticket-booking.payment': string;
|
@@ -118,6 +120,7 @@ declare const _default: {
|
|
118
120
|
'zh-HK': {
|
119
121
|
'pisell2.ticket-booking.info': string;
|
120
122
|
'pisell2.ticket-booking.notes': string;
|
123
|
+
'pisell2.ticket-booking.note': string;
|
121
124
|
'pisell2.ticket-booking.forms': string;
|
122
125
|
'pisell2.ticket-booking.sales': string;
|
123
126
|
'pisell2.ticket-booking.payment': string;
|
@@ -2,6 +2,7 @@ export default {
|
|
2
2
|
en: {
|
3
3
|
'pisell2.ticket-booking.info': 'Info',
|
4
4
|
'pisell2.ticket-booking.notes': 'Notes',
|
5
|
+
'pisell2.ticket-booking.note': 'Note',
|
5
6
|
'pisell2.ticket-booking.forms': 'Forms',
|
6
7
|
'pisell2.ticket-booking.sales': 'Sales',
|
7
8
|
'pisell2.ticket-booking.payment': 'Payment',
|
@@ -72,6 +73,7 @@ export default {
|
|
72
73
|
'zh-CN': {
|
73
74
|
'pisell2.ticket-booking.info': '信息',
|
74
75
|
'pisell2.ticket-booking.notes': '备注',
|
76
|
+
'pisell2.ticket-booking.note': '备注',
|
75
77
|
'pisell2.ticket-booking.forms': '表单',
|
76
78
|
'pisell2.ticket-booking.sales': '销售',
|
77
79
|
'pisell2.ticket-booking.payment': '付款',
|
@@ -142,6 +144,7 @@ export default {
|
|
142
144
|
'zh-HK': {
|
143
145
|
'pisell2.ticket-booking.info': '資訊',
|
144
146
|
'pisell2.ticket-booking.notes': '備註',
|
147
|
+
'pisell2.ticket-booking.note': '備註',
|
145
148
|
'pisell2.ticket-booking.forms': '表单',
|
146
149
|
'pisell2.ticket-booking.sales': '銷售',
|
147
150
|
'pisell2.ticket-booking.payment': '付款',
|
@@ -411,12 +411,6 @@
|
|
411
411
|
text-align: center;
|
412
412
|
}
|
413
413
|
|
414
|
-
.pisell-client-card__name-tags {
|
415
|
-
justify-content: center;
|
416
|
-
flex-direction: column;
|
417
|
-
gap: 8px;
|
418
|
-
}
|
419
|
-
|
420
414
|
.pisell-client-card__fields {
|
421
415
|
align-items: center;
|
422
416
|
}
|
@@ -470,6 +464,9 @@
|
|
470
464
|
font-size: 12px;
|
471
465
|
color: #8c8c8c;
|
472
466
|
margin-top: 2px;
|
467
|
+
overflow: hidden;
|
468
|
+
text-overflow: ellipsis;
|
469
|
+
white-space: nowrap;
|
473
470
|
}
|
474
471
|
|
475
472
|
.pisell-client-card__plugin-icon {
|
@@ -45,6 +45,11 @@ var PisellNumberSelector = function PisellNumberSelector(_ref) {
|
|
45
45
|
_useState4 = _slicedToArray(_useState3, 2),
|
46
46
|
inputValue = _useState4[0],
|
47
47
|
setInputValue = _useState4[1];
|
48
|
+
var _useState5 = useState(value.toString()),
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
50
|
+
tempValue = _useState6[0],
|
51
|
+
setTempValue = _useState6[1]; // 添加临时值状态
|
52
|
+
|
48
53
|
var KeyboardItems = useMemo(function () {
|
49
54
|
return [{
|
50
55
|
value: 1,
|
@@ -128,22 +133,24 @@ var PisellNumberSelector = function PisellNumberSelector(_ref) {
|
|
128
133
|
};
|
129
134
|
var handleChange = function handleChange(e) {
|
130
135
|
if (!e) {
|
131
|
-
|
136
|
+
setTempValue(min.toString());
|
132
137
|
return;
|
133
138
|
}
|
134
139
|
if (e === 'delete') {
|
135
|
-
//
|
136
|
-
|
140
|
+
// 删除最后一位数字
|
141
|
+
var newTempValue = tempValue.slice(0, -1);
|
142
|
+
setTempValue(newTempValue || '0');
|
137
143
|
return;
|
138
144
|
} else if (e === 'verify') {
|
139
|
-
|
145
|
+
// 确认时提交暂存的值
|
146
|
+
var newValue = parseInt(tempValue) || 0;
|
140
147
|
var clampedValue = Math.max(min, Math.min(max, newValue));
|
141
148
|
onChange === null || onChange === void 0 || onChange(clampedValue);
|
142
149
|
setOpen(false); // 手动关闭弹窗
|
143
150
|
return;
|
144
151
|
} else {
|
145
|
-
//
|
146
|
-
|
152
|
+
// 更新暂存值,不直接触发onChange
|
153
|
+
setTempValue(e);
|
147
154
|
}
|
148
155
|
};
|
149
156
|
|
@@ -151,22 +158,43 @@ var PisellNumberSelector = function PisellNumberSelector(_ref) {
|
|
151
158
|
var adjustPriceContent = useMemo(function () {
|
152
159
|
if (!enablePriceAdjust) return null;
|
153
160
|
return /*#__PURE__*/React.createElement(NumberKeyBoard, {
|
154
|
-
|
155
|
-
|
161
|
+
value: tempValue // 使用临时值
|
162
|
+
,
|
156
163
|
max: max,
|
157
164
|
onChange: handleChange,
|
158
165
|
onOk: function onOk() {
|
166
|
+
var newValue = parseInt(tempValue) || 0;
|
167
|
+
var clampedValue = Math.max(min, Math.min(max, newValue));
|
168
|
+
onChange === null || onChange === void 0 || onChange(clampedValue);
|
159
169
|
setOpen(false);
|
160
170
|
}
|
161
171
|
});
|
162
|
-
}, [enablePriceAdjust,
|
172
|
+
}, [enablePriceAdjust, tempValue, max, handleChange]);
|
163
173
|
|
164
174
|
// 点击数字的处理
|
165
175
|
var handleNumberClick = function handleNumberClick() {
|
166
176
|
if (disabled) return;
|
167
177
|
if (enablePriceAdjust) {
|
168
178
|
// Popover 会自动处理打开,我们只需要设置初始值
|
169
|
-
|
179
|
+
setTempValue(value.toString()); // 设置临时值为当前值
|
180
|
+
}
|
181
|
+
};
|
182
|
+
|
183
|
+
// 处理弹窗开关时的值同步
|
184
|
+
var handleOpenChange = function handleOpenChange(visible) {
|
185
|
+
setOpen(visible);
|
186
|
+
if (visible) {
|
187
|
+
// 打开时设置临时值为当前值
|
188
|
+
setTempValue(value.toString());
|
189
|
+
} else {
|
190
|
+
// 关闭时检查是否需要提交值
|
191
|
+
var tempNumber = parseInt(tempValue) || 0;
|
192
|
+
var clampedValue = Math.max(min, Math.min(max, tempNumber));
|
193
|
+
if (clampedValue !== value) {
|
194
|
+
onChange === null || onChange === void 0 || onChange(clampedValue);
|
195
|
+
}
|
196
|
+
// 重置临时值为当前值,确保下次打开时显示正确的值
|
197
|
+
setTempValue(value.toString());
|
170
198
|
}
|
171
199
|
};
|
172
200
|
|
@@ -193,22 +221,13 @@ var PisellNumberSelector = function PisellNumberSelector(_ref) {
|
|
193
221
|
overlayInnerStyle: {
|
194
222
|
padding: 0
|
195
223
|
},
|
196
|
-
onOpenChange: function onOpenChange(visible) {
|
197
|
-
setOpen(visible);
|
198
|
-
if (visible) {
|
199
|
-
// 打开时设置初始输入值
|
200
|
-
setInputValue(value.toString());
|
201
|
-
} else {
|
202
|
-
// 关闭时重置输入值
|
203
|
-
setInputValue(value.toString());
|
204
|
-
}
|
205
|
-
},
|
206
224
|
destroyTooltipOnHide: true,
|
207
225
|
arrow: false,
|
208
226
|
align: {
|
209
227
|
offset: [0, 0]
|
210
228
|
},
|
211
|
-
overlayClassName: "pisell-number-selector-popover"
|
229
|
+
overlayClassName: "pisell-number-selector-popover",
|
230
|
+
onOpenChange: handleOpenChange
|
212
231
|
}, numberDisplayElement) : numberDisplayElement;
|
213
232
|
return /*#__PURE__*/React.createElement("div", {
|
214
233
|
className: classNames('pisell-number-selector-new', className, _defineProperty(_defineProperty({}, "pisell-number-selector-".concat(size), size), 'pisell-number-selector-disabled', disabled))
|
package/es/utils/index.d.ts
CHANGED
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
18
18
|
export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
|
19
19
|
export declare const saveConfirm: () => Promise<{
|
20
20
|
destroy: () => void;
|
21
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
21
|
+
update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
|
22
22
|
}>;
|
23
23
|
export { modal };
|