@pisell/private-materials 6.2.32 → 6.2.33
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 +11 -11
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/booking/components/footer/index.js +15 -5
- package/es/components/booking/components/footer/index.less +23 -0
- package/es/components/booking/components/tabPane/index.less +3 -3
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/Lists.js +1 -1
- package/es/components/booking/info/service2/utils.js +18 -17
- package/es/components/booking/info2/cartClientCard/index.js +60 -67
- package/es/components/booking/info2/service/editService/index.js +71 -11
- package/es/components/booking/info2/service/editService/index.less +47 -11
- package/es/components/booking/locales.js +4 -4
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/productSelect/components/productGroup/index.js +2 -2
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +4 -3
- package/es/components/ticketBooking/components/timeBar/index.js +4 -1
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +23 -18
- package/es/components/ticketBooking/locales.js +3 -0
- package/es/plus/clientCard/locales.js +2 -2
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/es/plus/clinetSearch/index.d.ts +0 -1
- package/es/plus/clinetSearch/index.js +6 -6
- package/es/plus/clinetSearch/index.less +4 -0
- package/es/pro/comprehensiveSearch/index.d.ts +1 -3
- package/es/pro/comprehensiveSearch/index.js +18 -49
- package/es/pro/comprehensiveSearch/index.less +1 -6
- package/es/pro/comprehensiveSearch/types.d.ts +2 -1
- package/es/pro/skuDetailModal/index.js +21 -7
- package/es/pro/skuDetailModal/index.less +40 -0
- package/lib/components/booking/components/footer/index.js +16 -9
- package/lib/components/booking/components/footer/index.less +23 -0
- package/lib/components/booking/components/tabPane/index.less +3 -3
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.js +1 -1
- package/lib/components/booking/info/service2/utils.js +12 -11
- package/lib/components/booking/info2/cartClientCard/index.js +23 -31
- package/lib/components/booking/info2/service/editService/index.js +71 -18
- package/lib/components/booking/info2/service/editService/index.less +47 -11
- package/lib/components/booking/locales.js +4 -4
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/productSelect/components/productGroup/index.js +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +4 -3
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -1
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +23 -12
- package/lib/components/ticketBooking/locales.js +12 -3
- package/lib/plus/clientCard/locales.js +2 -2
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/lib/plus/clinetSearch/index.d.ts +0 -1
- package/lib/plus/clinetSearch/index.js +6 -7
- package/lib/plus/clinetSearch/index.less +4 -0
- package/lib/pro/comprehensiveSearch/index.d.ts +1 -3
- package/lib/pro/comprehensiveSearch/index.js +12 -23
- package/lib/pro/comprehensiveSearch/index.less +1 -6
- package/lib/pro/comprehensiveSearch/types.d.ts +2 -1
- package/lib/pro/skuDetailModal/index.js +22 -6
- package/lib/pro/skuDetailModal/index.less +40 -0
- package/package.json +2 -2
- package/es/pro/comprehensiveSearch/camera.svg +0 -4
- package/lib/pro/comprehensiveSearch/camera.svg +0 -4
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
padding: 24px 32px 100px !important;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
.pisell-lowcode__booking-service-body-edit-footer {
|
|
7
6
|
position: absolute;
|
|
8
7
|
bottom: 0;
|
|
9
8
|
left: 0;
|
|
10
9
|
width: 100%;
|
|
11
|
-
border-top: 1px solid #
|
|
10
|
+
border-top: 1px solid #e7e8e9;
|
|
12
11
|
padding: 20px 32px;
|
|
13
12
|
display: flex;
|
|
14
13
|
align-items: center;
|
|
@@ -16,12 +15,19 @@
|
|
|
16
15
|
gap: 12px;
|
|
17
16
|
background-color: #fff;
|
|
18
17
|
|
|
18
|
+
.pisell-lowcode__booking-service-body-edit-footer-left {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 12px;
|
|
22
|
+
width: fit-content;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
.pisell-lowcode__booking-service-delete-wrap {
|
|
20
26
|
height: 48px;
|
|
21
27
|
width: 48px;
|
|
22
28
|
border-radius: 8px;
|
|
23
|
-
border: 1px solid var(--gray-300, #
|
|
24
|
-
background: var(--base-white, #
|
|
29
|
+
border: 1px solid var(--gray-300, #d0d5dd);
|
|
30
|
+
background: var(--base-white, #fff);
|
|
25
31
|
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
26
32
|
cursor: pointer;
|
|
27
33
|
display: flex;
|
|
@@ -29,11 +35,42 @@
|
|
|
29
35
|
justify-content: center;
|
|
30
36
|
|
|
31
37
|
.pisell-lowcode__booking-service-delete-icon {
|
|
32
|
-
color: #
|
|
38
|
+
color: #b42318;
|
|
33
39
|
font-size: 20px;
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
|
|
43
|
+
.pisell-lowcode__booking-service-buttons-item {
|
|
44
|
+
height: 48px;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
flex: 1;
|
|
49
|
+
position: relative;
|
|
50
|
+
|
|
51
|
+
&.note-button {
|
|
52
|
+
.note-indicator {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 0; // 不使用负数偏移
|
|
55
|
+
right: 0; // 不使用负数偏移
|
|
56
|
+
transform: translate(12%, -12%); // 向外溢出约 2-3px
|
|
57
|
+
width: 24px;
|
|
58
|
+
height: 24px;
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
background-color: #7f56da; // 紫色
|
|
61
|
+
color: #fff;
|
|
62
|
+
font-weight: 700;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
line-height: 1;
|
|
67
|
+
font-size: 30px;
|
|
68
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
37
74
|
.pisell-lowcode__booking-service-body-edit-footer-apple {
|
|
38
75
|
flex: 1;
|
|
39
76
|
height: 48px;
|
|
@@ -46,14 +83,12 @@
|
|
|
46
83
|
.pisell-lowcode-select-selection-item {
|
|
47
84
|
.resource-option {
|
|
48
85
|
padding-left: 0;
|
|
49
|
-
|
|
50
86
|
}
|
|
51
87
|
}
|
|
52
88
|
|
|
53
89
|
.pisell-lowcode-select-item-option-content {
|
|
54
90
|
.resource-option {
|
|
55
91
|
padding-left: 0;
|
|
56
|
-
|
|
57
92
|
}
|
|
58
93
|
}
|
|
59
94
|
|
|
@@ -63,7 +98,7 @@
|
|
|
63
98
|
gap: 8px;
|
|
64
99
|
|
|
65
100
|
.resource-option-alert-icon {
|
|
66
|
-
color: #
|
|
101
|
+
color: #b42318;
|
|
67
102
|
cursor: pointer;
|
|
68
103
|
}
|
|
69
104
|
}
|
|
@@ -72,7 +107,7 @@
|
|
|
72
107
|
min-height: 40px;
|
|
73
108
|
cursor: pointer;
|
|
74
109
|
background-color: #ffffff;
|
|
75
|
-
border: 1px solid #
|
|
110
|
+
border: 1px solid #d0d5dd;
|
|
76
111
|
border-radius: 10px;
|
|
77
112
|
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
78
113
|
overflow: hidden;
|
|
@@ -90,10 +125,11 @@
|
|
|
90
125
|
flex: 1;
|
|
91
126
|
}
|
|
92
127
|
|
|
93
|
-
.current-service-info-change-btn {
|
|
128
|
+
.current-service-info-change-btn {
|
|
129
|
+
}
|
|
94
130
|
}
|
|
95
131
|
|
|
96
132
|
&:hover {
|
|
97
133
|
border-color: #7f56d9;
|
|
98
134
|
}
|
|
99
|
-
}
|
|
135
|
+
}
|
|
@@ -85,7 +85,7 @@ var locales_default = {
|
|
|
85
85
|
"pisell2.text.enroll.detail": "Details",
|
|
86
86
|
"pisell2.text.add-products-successfully": "Add products successfully",
|
|
87
87
|
"pisell2.text.add": "Add",
|
|
88
|
-
"pisell2.text.created-successfully": "
|
|
88
|
+
"pisell2.text.created-successfully": "Order saved. You can find it in Order List.",
|
|
89
89
|
"pisell2.text.edit-successfully": "Edited successfully",
|
|
90
90
|
"pisell2.text.updated": " updated",
|
|
91
91
|
"pisell2.text.appointment-updated": "Appointment updated",
|
|
@@ -304,7 +304,7 @@ var locales_default = {
|
|
|
304
304
|
"pisell2.action-buttons.no-items-to-adjust": "No items in cart to adjust price.",
|
|
305
305
|
"pisell2.action-buttons.adjust-order-price": "Adjust Order Price",
|
|
306
306
|
"pisell2.action-buttons.price-adjusted-success": "Order price adjusted successfully.",
|
|
307
|
-
"pisell2.action-buttons.clear-success": "
|
|
307
|
+
"pisell2.action-buttons.clear-success": "Cart Cleared",
|
|
308
308
|
"pisell2.text.manual-price-adjustment": "Discount",
|
|
309
309
|
// Customise Item Modal
|
|
310
310
|
"pisell2.customise-item.modal-title": "Create and Add Customise (Once-off) Item",
|
|
@@ -427,7 +427,7 @@ var locales_default = {
|
|
|
427
427
|
"pisell2.text.refund-amount": "退款金额",
|
|
428
428
|
//
|
|
429
429
|
"pisell2.text.add": "添加",
|
|
430
|
-
"pisell2.text.created-successfully": "
|
|
430
|
+
"pisell2.text.created-successfully": "订单已保存。您可以在订单列表中找到它。",
|
|
431
431
|
"pisell2.text.edit-successfully": "编辑成功",
|
|
432
432
|
"pisell2.text.appointment-updated": "预约已更新",
|
|
433
433
|
"pisell2.text.updated": "已更新",
|
|
@@ -764,7 +764,7 @@ var locales_default = {
|
|
|
764
764
|
"pisell2.text.add-products-successfully": "添加商品成功",
|
|
765
765
|
//
|
|
766
766
|
"pisell2.text.add": "添加",
|
|
767
|
-
"pisell2.text.created-successfully": "
|
|
767
|
+
"pisell2.text.created-successfully": "訂單已保存。 您可以在訂單清單中找到它。",
|
|
768
768
|
"pisell2.text.edit-successfully": "編輯成功",
|
|
769
769
|
"pisell2.text.appointment-updated": "預約已更新",
|
|
770
770
|
"pisell2.text.updated": "已更新",
|
|
@@ -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;
|
|
@@ -295,7 +295,7 @@ 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
300
|
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
@@ -89,7 +89,8 @@ var Product = (props) => {
|
|
|
89
89
|
const conf = productCardStyleConfig[`${type}_product_card_style`];
|
|
90
90
|
return {
|
|
91
91
|
isShowImage: conf == null ? void 0 : conf.show_product_image,
|
|
92
|
-
isShowDelete: conf == null ? void 0 : conf.show_remove_button
|
|
92
|
+
isShowDelete: conf == null ? void 0 : conf.show_remove_button,
|
|
93
|
+
disabledEdit: true
|
|
93
94
|
};
|
|
94
95
|
});
|
|
95
96
|
return (0, import_react.useMemo)(() => {
|
|
@@ -99,12 +100,12 @@ var Product = (props) => {
|
|
|
99
100
|
let isRetail;
|
|
100
101
|
if (state.scenario === "booking2") {
|
|
101
102
|
isRetail = (0, import_utils.isNormalProductByDurationSchedule)(item == null ? void 0 : item._origin);
|
|
102
|
-
Comp =
|
|
103
|
+
Comp = import_materials.ProductCard.V2;
|
|
103
104
|
}
|
|
104
105
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
105
106
|
Comp,
|
|
106
107
|
{
|
|
107
|
-
type: isRetail ? "a2" :
|
|
108
|
+
type: isRetail ? "a2" : "a5",
|
|
108
109
|
rightActions: [
|
|
109
110
|
{
|
|
110
111
|
key: "update_number",
|
|
@@ -78,7 +78,7 @@ var TimeBar = (props) => {
|
|
|
78
78
|
});
|
|
79
79
|
return (0, import_react.useMemo)(() => {
|
|
80
80
|
var _a2, _b2, _c, _d;
|
|
81
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-time-bar" }, /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-time-bar", style: { backgroundColor: state.isDateChange ? "#F79009" : "" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
82
82
|
import_antd.Button,
|
|
83
83
|
{
|
|
84
84
|
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null),
|
|
@@ -30,7 +30,9 @@ var useCustomer = (props) => {
|
|
|
30
30
|
const bookingTicket = (0, import_bookingTicket.useBookingTicket)();
|
|
31
31
|
const pisellos = (0, import_useEngineContext.usePisellOS)();
|
|
32
32
|
const [customers, setCustomers] = (0, import_react.useState)([]);
|
|
33
|
-
const [selectedCustomer, setSelectedCustomer] = (0, import_react.useState)(
|
|
33
|
+
const [selectedCustomer, setSelectedCustomer] = (0, import_react.useState)(
|
|
34
|
+
null
|
|
35
|
+
);
|
|
34
36
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
35
37
|
const [error, setError] = (0, import_react.useState)(null);
|
|
36
38
|
const [pagination, setPagination] = (0, import_react.useState)({
|
|
@@ -59,41 +61,50 @@ var useCustomer = (props) => {
|
|
|
59
61
|
setSelectedCustomer(customer);
|
|
60
62
|
(_a = props.changeCustomerToGlobalState) == null ? void 0 : _a.call(props, customer);
|
|
61
63
|
});
|
|
62
|
-
pisellos.effects.on(
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
pisellos.effects.on(
|
|
65
|
+
"customer:onPaginationChange",
|
|
66
|
+
(paginationInfo) => {
|
|
67
|
+
setPagination(paginationInfo);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
65
70
|
return () => {
|
|
66
71
|
pisellos.effects.off("customer:onUpdate");
|
|
67
72
|
pisellos.effects.off("customer:onSelected");
|
|
68
73
|
pisellos.effects.off("customer:onPaginationChange");
|
|
69
74
|
};
|
|
70
75
|
}, [bookingTicket]);
|
|
71
|
-
const loadCustomers = (0, import_ahooks.useMemoizedFn)(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
const loadCustomers = (0, import_ahooks.useMemoizedFn)(
|
|
77
|
+
async (params) => {
|
|
78
|
+
try {
|
|
79
|
+
setLoading(true);
|
|
80
|
+
await bookingTicket.getCustomerList(params);
|
|
81
|
+
} catch (err) {
|
|
82
|
+
setError(err == null ? void 0 : err.message);
|
|
83
|
+
}
|
|
84
|
+
setLoading(false);
|
|
77
85
|
}
|
|
78
|
-
|
|
79
|
-
});
|
|
86
|
+
);
|
|
80
87
|
const initLoad = (0, import_ahooks.useMemoizedFn)(async (keyword = "") => {
|
|
81
88
|
try {
|
|
89
|
+
setLoading(true);
|
|
82
90
|
await bookingTicket.resetAndLoadCustomers({
|
|
83
91
|
search: keyword || void 0
|
|
84
92
|
});
|
|
85
93
|
} catch (error2) {
|
|
86
94
|
console.error("初始化加载失败:", error2);
|
|
87
95
|
}
|
|
96
|
+
setLoading(false);
|
|
88
97
|
});
|
|
89
98
|
const loadMore = (0, import_ahooks.useMemoizedFn)(async () => {
|
|
90
99
|
if (!hasMore || loadingMore) return;
|
|
91
100
|
setLoadingMore(true);
|
|
101
|
+
setLoading(true);
|
|
92
102
|
try {
|
|
93
103
|
await bookingTicket.loadMoreCustomers();
|
|
94
104
|
} catch (error2) {
|
|
95
105
|
console.error("加载更多失败:", error2);
|
|
96
106
|
}
|
|
107
|
+
setLoading(false);
|
|
97
108
|
setLoadingMore(false);
|
|
98
109
|
});
|
|
99
110
|
const changePage = (0, import_ahooks.useMemoizedFn)(async (page, pageSize) => {
|
|
@@ -75,7 +75,10 @@ var locales_default = {
|
|
|
75
75
|
"pisell2.ticket-booking.in-cart": (number) => `${number} in cart`,
|
|
76
76
|
"pisell2.product.card.cart-items": (number) => `${number}items`,
|
|
77
77
|
"pisell2.product.card.subtotal": "Subtotal",
|
|
78
|
-
"pisell2.product.card.hour.minute": (hour, minute) =>
|
|
78
|
+
"pisell2.product.card.hour.minute": (hour, minute) => {
|
|
79
|
+
if (hour === 0 && minute === 0) return `${minute}min`;
|
|
80
|
+
return `${hour > 0 ? `${hour}h` : ""}${hour > 0 && minute > 0 ? " " : ""}${minute > 0 ? `${minute}min` : ""}`;
|
|
81
|
+
},
|
|
79
82
|
"pisell2.product.card.day": (val) => `${val > 1 ? " days" : " day"}`,
|
|
80
83
|
"pisell2.product.card.day.event": (val) => `${val > 1 ? " events" : " event"}`,
|
|
81
84
|
"pisell2.product.card.minute": (val) => `${val > 1 ? " minutes" : " minute"}`,
|
|
@@ -134,7 +137,10 @@ var locales_default = {
|
|
|
134
137
|
"pisell2.product.card.cart-items": (number) => `${number}件商品`,
|
|
135
138
|
"pisell2.product.card.subtotal": "小计",
|
|
136
139
|
"pisell2.ticket-booking.in-cart": (number) => `已有${number}件`,
|
|
137
|
-
"pisell2.product.card.hour.minute": (hour, minute) =>
|
|
140
|
+
"pisell2.product.card.hour.minute": (hour, minute) => {
|
|
141
|
+
if (hour === 0 && minute === 0) return `${minute}分钟`;
|
|
142
|
+
return `${hour > 0 ? `${hour}小时` : ""}${minute > 0 ? `${minute}分钟` : ""}`;
|
|
143
|
+
},
|
|
138
144
|
"pisell2.product.card.day": (val) => "天",
|
|
139
145
|
"pisell2.product.card.day.event": (val) => "个活动",
|
|
140
146
|
"pisell2.product.card.minute": (val) => "分钟",
|
|
@@ -193,7 +199,10 @@ var locales_default = {
|
|
|
193
199
|
"pisell2.ticket-booking.in-cart": (number) => `已有${number}件`,
|
|
194
200
|
"pisell2.product.card.cart-items": (number) => `${number}件商品`,
|
|
195
201
|
"pisell2.product.card.subtotal": "小計",
|
|
196
|
-
"pisell2.product.card.hour.minute": (hour, minute) =>
|
|
202
|
+
"pisell2.product.card.hour.minute": (hour, minute) => {
|
|
203
|
+
if (hour === 0 && minute === 0) return `${minute}分鐘`;
|
|
204
|
+
return `${hour > 0 ? `${hour}小時` : ""}${minute > 0 ? `${minute}分鐘` : ""}`;
|
|
205
|
+
},
|
|
197
206
|
"pisell2.product.card.day": (val) => "天",
|
|
198
207
|
"pisell2.product.card.day.event": (val) => "个活動",
|
|
199
208
|
"pisell2.product.card.minute": (val) => "分鐘",
|
|
@@ -31,11 +31,11 @@ var locales_default = {
|
|
|
31
31
|
"zh-CN": {
|
|
32
32
|
"pisell2.text.add-client": "添加客户",
|
|
33
33
|
"pisell2.text.change-client": "更换客户",
|
|
34
|
-
"pisell2.text.remove-client": "
|
|
34
|
+
"pisell2.text.remove-client": "移除客户"
|
|
35
35
|
},
|
|
36
36
|
"zh-HK": {
|
|
37
37
|
"pisell2.text.add-client": "新增客戶",
|
|
38
38
|
"pisell2.text.change-client": "更換客戶",
|
|
39
|
-
"pisell2.text.remove-client": "
|
|
39
|
+
"pisell2.text.remove-client": "移除客戶"
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -11,7 +11,6 @@ interface ClientSearchProps extends Omit<ComprehensiveSearchProps, 'resultDispla
|
|
|
11
11
|
onLoadMore?: () => void;
|
|
12
12
|
}
|
|
13
13
|
export declare type ClientSearchRef = {
|
|
14
|
-
setSearchKeyword: (keyword: string) => void;
|
|
15
14
|
resetScrollPosition: () => void;
|
|
16
15
|
};
|
|
17
16
|
declare const ClientSearch: React.ForwardRefExoticComponent<ClientSearchProps & React.RefAttributes<ClientSearchRef>>;
|
|
@@ -85,8 +85,10 @@ var ClientSearch = (0, import_react.forwardRef)(
|
|
|
85
85
|
import_InfiniteScroll.default,
|
|
86
86
|
{
|
|
87
87
|
dataLength: searchResults.length,
|
|
88
|
-
next:
|
|
89
|
-
|
|
88
|
+
next: () => {
|
|
89
|
+
console.log("loading more");
|
|
90
|
+
onLoadMore == null ? void 0 : onLoadMore();
|
|
91
|
+
},
|
|
90
92
|
hasMore: hasMore || false,
|
|
91
93
|
style: { width: "100%" },
|
|
92
94
|
loader: /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -101,7 +103,8 @@ var ClientSearch = (0, import_react.forwardRef)(
|
|
|
101
103
|
import_utils.locales.getText("pisell2.text.loading")
|
|
102
104
|
),
|
|
103
105
|
endMessage: /* @__PURE__ */ import_react.default.createElement("div", { style: { textAlign: "center", color: "#999" } }, (searchResults == null ? void 0 : searchResults.length) ? import_utils.locales.getText("pisell2.text.no-more-data") : null),
|
|
104
|
-
scrollableTarget: "client-search_infinite-scroll"
|
|
106
|
+
scrollableTarget: "client-search_infinite-scroll",
|
|
107
|
+
scrollThreshold: "180px"
|
|
105
108
|
},
|
|
106
109
|
/* @__PURE__ */ import_react.default.createElement(
|
|
107
110
|
import_antd.List,
|
|
@@ -167,10 +170,6 @@ var ClientSearch = (0, import_react.forwardRef)(
|
|
|
167
170
|
handleModalCancel();
|
|
168
171
|
};
|
|
169
172
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
170
|
-
setSearchKeyword: (keyword) => {
|
|
171
|
-
var _a2, _b2;
|
|
172
|
-
(_b2 = (_a2 = comprehensiveSearchRef.current) == null ? void 0 : _a2.setSearchKeyword) == null ? void 0 : _b2.call(_a2, keyword);
|
|
173
|
-
},
|
|
174
173
|
resetScrollPosition: () => {
|
|
175
174
|
if (scrollContainerRef.current) {
|
|
176
175
|
scrollContainerRef.current.scrollTop = 0;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ComprehensiveSearchProps, SearchResult } from './types';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export declare type ComprehensiveSearchRef = {
|
|
5
|
-
setSearchKeyword: (keyword: string) => void;
|
|
6
|
-
};
|
|
4
|
+
export declare type ComprehensiveSearchRef = {};
|
|
7
5
|
declare const ComprehensiveSearch: React.ForwardRefExoticComponent<ComprehensiveSearchProps & React.RefAttributes<ComprehensiveSearchRef>>;
|
|
8
6
|
export default ComprehensiveSearch;
|
|
9
7
|
export type { ComprehensiveSearchProps, SearchResult };
|
|
@@ -37,10 +37,10 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_icon = require("@pisell/icon");
|
|
39
39
|
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_ahooks = require("ahooks");
|
|
40
41
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
41
42
|
var import_useTerminalPeripherals = __toESM(require("./hooks/useTerminalPeripherals"));
|
|
42
43
|
var import_useNativeScanner = __toESM(require("./hooks/useNativeScanner"));
|
|
43
|
-
var import_camera = __toESM(require("./camera.svg"));
|
|
44
44
|
var import_locales = __toESM(require("./locales"));
|
|
45
45
|
var import_index = require("./index.less");
|
|
46
46
|
var import_classnames = __toESM(require("classnames"));
|
|
@@ -64,14 +64,19 @@ var ComprehensiveSearch = (0, import_react.forwardRef)(
|
|
|
64
64
|
resultSort = "asc",
|
|
65
65
|
style,
|
|
66
66
|
loading,
|
|
67
|
-
|
|
67
|
+
keyword,
|
|
68
|
+
onKeywordChange,
|
|
68
69
|
onSearch,
|
|
69
70
|
onAdd,
|
|
70
71
|
onRowClick,
|
|
71
72
|
...props
|
|
72
73
|
}, ref) => {
|
|
73
74
|
var _a, _b, _c;
|
|
74
|
-
const [searchValue, setSearchValue] = (0,
|
|
75
|
+
const [searchValue, setSearchValue] = (0, import_ahooks.useControllableValue)({
|
|
76
|
+
value: keyword,
|
|
77
|
+
onChange: onKeywordChange,
|
|
78
|
+
defaultValue: ""
|
|
79
|
+
});
|
|
75
80
|
const { peripheralsStatus } = (0, import_useTerminalPeripherals.default)();
|
|
76
81
|
const { activeNativeScanner, isTerminal } = (0, import_useNativeScanner.default)();
|
|
77
82
|
const context = (0, import_useEngineContext.default)();
|
|
@@ -79,18 +84,6 @@ var ComprehensiveSearch = (0, import_react.forwardRef)(
|
|
|
79
84
|
import_locales.default,
|
|
80
85
|
((_c = (_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.storage) == null ? void 0 : _c.get("umi_locale")) || "en"
|
|
81
86
|
);
|
|
82
|
-
async function checkCameraAvailability() {
|
|
83
|
-
try {
|
|
84
|
-
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
85
|
-
const hasCamera = devices.some(
|
|
86
|
-
(device) => device.kind === "videoinput"
|
|
87
|
-
);
|
|
88
|
-
return hasCamera;
|
|
89
|
-
} catch (err) {
|
|
90
|
-
console.error("Error checking camera availability:", err);
|
|
91
|
-
}
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
87
|
const handleSearch = async () => {
|
|
95
88
|
try {
|
|
96
89
|
await (onSearch == null ? void 0 : onSearch(searchValue));
|
|
@@ -100,7 +93,6 @@ var ComprehensiveSearch = (0, import_react.forwardRef)(
|
|
|
100
93
|
const handleInputChange = (e) => {
|
|
101
94
|
const value = e.target.value;
|
|
102
95
|
setSearchValue(value);
|
|
103
|
-
onSearchTextChange == null ? void 0 : onSearchTextChange(value);
|
|
104
96
|
};
|
|
105
97
|
const handleAdd = () => {
|
|
106
98
|
onAdd == null ? void 0 : onAdd();
|
|
@@ -148,11 +140,7 @@ var ComprehensiveSearch = (0, import_react.forwardRef)(
|
|
|
148
140
|
}
|
|
149
141
|
)), isShowSearchButton && /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__search-button-wrapper" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", onClick: handleSearch, loading }, import_utils.locales.getText("pisell2.text.search")))));
|
|
150
142
|
};
|
|
151
|
-
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
152
|
-
setSearchKeyword: (keyword) => {
|
|
153
|
-
setSearchValue(keyword);
|
|
154
|
-
}
|
|
155
|
-
}));
|
|
143
|
+
(0, import_react.useImperativeHandle)(ref, () => ({}));
|
|
156
144
|
const renderResults = () => {
|
|
157
145
|
if (import_react.default.isValidElement(resultDisplay)) {
|
|
158
146
|
return resultDisplay;
|
|
@@ -218,12 +206,13 @@ var ComprehensiveSearch = (0, import_react.forwardRef)(
|
|
|
218
206
|
import_antd.Button,
|
|
219
207
|
{
|
|
220
208
|
className: "comprehensive-search__new-button",
|
|
221
|
-
onClick: handleAdd
|
|
209
|
+
onClick: handleAdd,
|
|
210
|
+
type: "primary"
|
|
222
211
|
},
|
|
223
212
|
newButtonText || import_utils.locales.getText("pisell2.text.new-client"),
|
|
224
213
|
/* @__PURE__ */ import_react.default.createElement(import_icon.PlusCircle, { style: { fontSize: 20 } })
|
|
225
214
|
);
|
|
226
|
-
const iconGroup = /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__icon-group" }, isShowScanner && /* @__PURE__ */ import_react.default.createElement("span", { className: "comprehensive-search__icon-button" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-Scanner" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "status-indicator" }, stautsIndicator((peripheralsStatus == null ? void 0 : peripheralsStatus.scanner) === "connected"))), isShowNFC && /* @__PURE__ */ import_react.default.createElement("span", { className: "comprehensive-search__icon-button" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-NFC" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "status-indicator" }, stautsIndicator((peripheralsStatus == null ? void 0 : peripheralsStatus.nfc) === "connected"))), isShowCamera && /* @__PURE__ */ import_react.default.createElement("span", { className: "comprehensive-search__icon-button" }, /* @__PURE__ */ import_react.default.createElement(
|
|
215
|
+
const iconGroup = /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__icon-group" }, isShowScanner && /* @__PURE__ */ import_react.default.createElement("span", { className: "comprehensive-search__icon-button" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-Scanner" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "status-indicator" }, stautsIndicator((peripheralsStatus == null ? void 0 : peripheralsStatus.scanner) === "connected"))), isShowNFC && /* @__PURE__ */ import_react.default.createElement("span", { className: "comprehensive-search__icon-button" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-NFC" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "status-indicator" }, stautsIndicator((peripheralsStatus == null ? void 0 : peripheralsStatus.nfc) === "connected"))), isShowCamera && /* @__PURE__ */ import_react.default.createElement("span", { className: "comprehensive-search__icon-button" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-camera" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "status-indicator" }, stautsIndicator(isTerminal))));
|
|
227
216
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__third" }, newButtonAlign === "left" ? newButton : newButtonAlign === "right" ? iconGroup : null), /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__third" }, newButtonAlign === "center" ? newButton : null), /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__third" }, newButtonAlign === "left" ? iconGroup : newButtonAlign === "right" ? newButton : iconGroup));
|
|
228
217
|
};
|
|
229
218
|
const renderContent = () => /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search", style, ...props }, /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__top-section" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__top-row" }, getTopRowLayout())), renderSearchSection(), /* @__PURE__ */ import_react.default.createElement("div", { className: "comprehensive-search__results-container" }, renderResults()));
|
|
@@ -20,7 +20,8 @@ export interface ComprehensiveSearchProps {
|
|
|
20
20
|
sortBy?: string;
|
|
21
21
|
style?: React.CSSProperties;
|
|
22
22
|
loading?: boolean;
|
|
23
|
-
|
|
23
|
+
keyword?: string;
|
|
24
|
+
onKeywordChange?: (value: string) => void;
|
|
24
25
|
onSearch?: (value: string) => void;
|
|
25
26
|
onAdd?: () => void;
|
|
26
27
|
onDataChange?: (data: any) => void;
|
|
@@ -198,6 +198,12 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
198
198
|
setDiscounts([]);
|
|
199
199
|
setShowPriceAdjustModal(false);
|
|
200
200
|
};
|
|
201
|
+
const coverText = (0, import_react.useMemo)(() => {
|
|
202
|
+
var _a2;
|
|
203
|
+
const title = ((_a2 = productData == null ? void 0 : productData.title) == null ? void 0 : _a2.trim()) || "";
|
|
204
|
+
if (!title) return "";
|
|
205
|
+
return Array.from(title).slice(0, 2).join("");
|
|
206
|
+
}, [productData == null ? void 0 : productData.title]);
|
|
201
207
|
if (!productData) return null;
|
|
202
208
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
203
209
|
import_materials.PisellModal,
|
|
@@ -212,7 +218,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
212
218
|
width: 880,
|
|
213
219
|
className: "pisell-sku-detail-modal"
|
|
214
220
|
},
|
|
215
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-content-main" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-left" },
|
|
221
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-content-main" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-image" }, productData.cover ? /* @__PURE__ */ import_react.default.createElement("img", { src: productData.cover || "" }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "product-cover-text" }, coverText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "product-actions" }, /* @__PURE__ */ import_react.default.createElement(
|
|
216
222
|
import_materials.Button,
|
|
217
223
|
{
|
|
218
224
|
size: "large",
|
|
@@ -260,7 +266,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
260
266
|
danger: true,
|
|
261
267
|
size: "large",
|
|
262
268
|
icon: /* @__PURE__ */ import_react.default.createElement(import_Delete_wght300_24px.default, { style: { fontSize: 20 } }),
|
|
263
|
-
className: "remove-btn",
|
|
269
|
+
className: "sku-detail-content-footer-remove-btn",
|
|
264
270
|
onClick: handleRemove
|
|
265
271
|
},
|
|
266
272
|
import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.remove")
|
|
@@ -269,12 +275,22 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
269
275
|
{
|
|
270
276
|
type: "default",
|
|
271
277
|
size: "large",
|
|
272
|
-
onClick: handleManualPriceChange
|
|
278
|
+
onClick: handleManualPriceChange,
|
|
279
|
+
className: "sku-detail-content-footer-price-btn"
|
|
273
280
|
},
|
|
274
|
-
import_utils.locales.getText(
|
|
281
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "sku-detail-content-footer-price-btn-text" }, import_utils.locales.getText(
|
|
275
282
|
"pisell2.text.sku.detail.modal.btn.manual.price.change"
|
|
276
|
-
)
|
|
277
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
283
|
+
))
|
|
284
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
285
|
+
import_materials.Button,
|
|
286
|
+
{
|
|
287
|
+
type: "primary",
|
|
288
|
+
size: "large",
|
|
289
|
+
onClick: handleConfirm,
|
|
290
|
+
className: "sku-detail-content-footer-confirm-btn"
|
|
291
|
+
},
|
|
292
|
+
import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.confirm")
|
|
293
|
+
)))),
|
|
278
294
|
noteModalOpen && /* @__PURE__ */ import_react.default.createElement(
|
|
279
295
|
import_noteModal.default,
|
|
280
296
|
{
|