@pisell/private-materials 3.0.194 → 3.0.196
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +142 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/components/customSelect/index.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +6 -2
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +37 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/components/footer/amount.js +45 -22
- package/es/components/booking/components/footer/index.js +84 -40
- package/es/components/booking/components/footer/utils.js +218 -32
- package/es/components/booking/info/addServiceVariant/index.js +8 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
- package/es/components/booking/info/clientVariant/vertical/index.js +33 -4
- package/es/components/booking/info/dateRange/index.d.ts +5 -0
- package/es/components/booking/info/dateRange/index.js +98 -0
- package/es/components/booking/info/dateRange/index.less +21 -0
- package/es/components/booking/info/main.js +20 -8
- package/es/components/booking/info/model.js +3 -0
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/es/components/booking/info/pet/ChangePetModal/index.js +118 -0
- package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/es/components/booking/info/pet/index.js +54 -5
- package/es/components/booking/info/service/addService/index.js +127 -20
- package/es/components/booking/info/service/addService/index.less +13 -3
- package/es/components/booking/info/service/addService/utils.d.ts +11 -2
- package/es/components/booking/info/service/addService/utils.js +49 -24
- package/es/components/booking/info/service/editService/index.js +232 -41
- package/es/components/booking/info/service/editService/index.less +18 -13
- package/es/components/booking/info/service2/Lists.d.ts +3 -0
- package/es/components/booking/info/service2/Lists.js +158 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
- package/es/components/booking/info/service2/index.d.ts +3 -0
- package/es/components/booking/info/service2/index.js +58 -0
- package/es/components/booking/info/service2/status.d.ts +31 -0
- package/es/components/booking/info/service2/status.js +78 -0
- package/es/components/booking/info/service2/utils.d.ts +145 -0
- package/es/components/booking/info/service2/utils.js +436 -0
- package/es/components/booking/info/utils.d.ts +9 -0
- package/es/components/booking/info/utils.js +13 -0
- package/es/components/booking/locales.d.ts +60 -0
- package/es/components/booking/locales.js +75 -3
- package/es/components/booking/materiels/holder/index.d.ts +7 -0
- package/es/components/booking/materiels/holder/index.js +51 -0
- package/es/components/booking/model.d.ts +4 -1
- package/es/components/booking/model.js +4 -2
- package/es/components/booking/utils.d.ts +12 -3
- package/es/components/booking/utils.js +126 -22
- package/es/components/eftpos/form/index.js +6 -12
- package/es/components/eftpos/group/index.d.ts +2 -1
- package/es/components/eftpos/group/index.js +2 -1
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftposPay/tyro/index.js +17 -40
- package/es/components/shoppingCart/Provider.d.ts +3 -0
- package/es/components/shoppingCart/Provider.js +86 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/Product.js +96 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/index.js +72 -0
- package/es/components/shoppingCart/components/Cart/index.less +68 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Empty/index.js +14 -0
- package/es/components/shoppingCart/components/Empty/index.less +19 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Render/index.js +68 -0
- package/es/components/shoppingCart/components/Render/index.less +2 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useAddService.js +23 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +54 -0
- package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useContext.js +5 -0
- package/es/components/shoppingCart/index.d.ts +4 -0
- package/es/components/shoppingCart/index.js +24 -0
- package/es/components/shoppingCart/locales.d.ts +33 -0
- package/es/components/shoppingCart/locales.js +38 -0
- package/es/components/shoppingCart/mock.d.ts +40 -0
- package/es/components/shoppingCart/mock.js +40 -0
- package/es/components/shoppingCart/status.d.ts +2 -0
- package/es/components/shoppingCart/status.js +22 -0
- package/es/components/shoppingCart/type.d.ts +39 -0
- package/es/components/shoppingCart/type.js +1 -0
- package/es/components/shoppingCart/utils.d.ts +63 -0
- package/es/components/shoppingCart/utils.js +119 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/components/customSelect/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +6 -2
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +59 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/components/footer/amount.js +26 -8
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.js +144 -31
- package/lib/components/booking/info/addServiceVariant/index.js +5 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
- package/lib/components/booking/info/clientVariant/vertical/index.js +36 -10
- package/lib/components/booking/info/dateRange/index.d.ts +5 -0
- package/lib/components/booking/info/dateRange/index.js +111 -0
- package/lib/components/booking/info/dateRange/index.less +21 -0
- package/lib/components/booking/info/main.js +11 -4
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.js +110 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/lib/components/booking/info/pet/index.js +61 -25
- package/lib/components/booking/info/service/addService/index.js +95 -28
- package/lib/components/booking/info/service/addService/index.less +13 -3
- package/lib/components/booking/info/service/addService/utils.d.ts +11 -2
- package/lib/components/booking/info/service/addService/utils.js +31 -10
- package/lib/components/booking/info/service/editService/index.js +271 -122
- package/lib/components/booking/info/service/editService/index.less +18 -13
- package/lib/components/booking/info/service2/Lists.d.ts +3 -0
- package/lib/components/booking/info/service2/Lists.js +113 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +50 -0
- package/lib/components/booking/info/service2/index.d.ts +3 -0
- package/lib/components/booking/info/service2/index.js +75 -0
- package/lib/components/booking/info/service2/status.d.ts +31 -0
- package/lib/components/booking/info/service2/status.js +81 -0
- package/lib/components/booking/info/service2/utils.d.ts +145 -0
- package/lib/components/booking/info/service2/utils.js +320 -0
- package/lib/components/booking/info/utils.d.ts +9 -0
- package/lib/components/booking/info/utils.js +6 -0
- package/lib/components/booking/locales.d.ts +60 -0
- package/lib/components/booking/locales.js +63 -3
- package/lib/components/booking/materiels/holder/index.d.ts +7 -0
- package/lib/components/booking/materiels/holder/index.js +65 -0
- package/lib/components/booking/model.d.ts +4 -1
- package/lib/components/booking/model.js +4 -2
- package/lib/components/booking/utils.d.ts +12 -3
- package/lib/components/booking/utils.js +79 -15
- package/lib/components/eftpos/form/index.js +6 -12
- package/lib/components/eftpos/group/index.d.ts +2 -1
- package/lib/components/eftpos/group/index.js +1 -0
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftposPay/tyro/index.js +5 -26
- package/lib/components/shoppingCart/Provider.d.ts +3 -0
- package/lib/components/shoppingCart/Provider.js +110 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +89 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/index.js +77 -0
- package/lib/components/shoppingCart/components/Cart/index.less +68 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Empty/index.js +43 -0
- package/lib/components/shoppingCart/components/Empty/index.less +19 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Render/index.js +79 -0
- package/lib/components/shoppingCart/components/Render/index.less +2 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +116 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +71 -0
- package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useContext.js +31 -0
- package/lib/components/shoppingCart/index.d.ts +4 -0
- package/lib/components/shoppingCart/index.js +60 -0
- package/lib/components/shoppingCart/locales.d.ts +33 -0
- package/lib/components/shoppingCart/locales.js +56 -0
- package/lib/components/shoppingCart/mock.d.ts +40 -0
- package/lib/components/shoppingCart/mock.js +76 -0
- package/lib/components/shoppingCart/status.d.ts +2 -0
- package/lib/components/shoppingCart/status.js +60 -0
- package/lib/components/shoppingCart/type.d.ts +39 -0
- package/lib/components/shoppingCart/type.js +17 -0
- package/lib/components/shoppingCart/utils.d.ts +63 -0
- package/lib/components/shoppingCart/utils.js +92 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/shopping-cart/meta.ts +98 -0
- package/package.json +4 -4
- package/es/components/eftpos/receipt/index.d.ts +0 -24
- package/es/components/eftpos/receipt/index.js +0 -96
- package/lib/components/eftpos/receipt/index.d.ts +0 -24
- package/lib/components/eftpos/receipt/index.js +0 -88
|
@@ -43,10 +43,14 @@ var import_index = require("./index.less");
|
|
|
43
43
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
44
44
|
var import_serve = require("../serve");
|
|
45
45
|
var import_utils = require("../../utils");
|
|
46
|
+
var import_dateRange = __toESM(require("../../dateRange"));
|
|
46
47
|
var import_utils2 = require("./utils");
|
|
47
48
|
var import_utils3 = require("../../../utils");
|
|
48
|
-
var import_utils4 = require("
|
|
49
|
+
var import_utils4 = require("../../service2/utils");
|
|
50
|
+
var import_status = require("../../service2/status");
|
|
51
|
+
var import_utils5 = require("@pisell/utils");
|
|
49
52
|
var import_ahooks = require("ahooks");
|
|
53
|
+
var import_debounce = __toESM(require("lodash/debounce"));
|
|
50
54
|
var shopList = [
|
|
51
55
|
2886,
|
|
52
56
|
4422,
|
|
@@ -70,10 +74,31 @@ var Info = (props) => {
|
|
|
70
74
|
let { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
71
75
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
72
76
|
const searchRef = (0, import_react.useRef)();
|
|
77
|
+
const headerRef = (0, import_react.useRef)(null);
|
|
78
|
+
const [headerHeight, setHeaderHeight] = (0, import_react.useState)(0);
|
|
73
79
|
const context = (0, import_useEngineContext.default)();
|
|
74
80
|
state = state || (props == null ? void 0 : props.state);
|
|
75
81
|
dispatch = dispatch || (props == null ? void 0 : props.dispatch);
|
|
76
82
|
import_utils3.request.setRequest(context.appHelper.utils.request);
|
|
83
|
+
const isDay = (0, import_react.useMemo)(() => {
|
|
84
|
+
return (0, import_utils4.isDayBooking)(state);
|
|
85
|
+
}, [state.renderType]);
|
|
86
|
+
const handleResize = () => {
|
|
87
|
+
var _a2;
|
|
88
|
+
if (headerRef == null ? void 0 : headerRef.current) {
|
|
89
|
+
setHeaderHeight((_a2 = headerRef.current) == null ? void 0 : _a2.offsetHeight);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const debouncedHandleResize = (0, import_debounce.default)(handleResize, 100);
|
|
93
|
+
(0, import_react.useEffect)(() => {
|
|
94
|
+
if (isDay && state.isTerminalDayBookingPage) {
|
|
95
|
+
handleResize();
|
|
96
|
+
window.addEventListener("resize", debouncedHandleResize);
|
|
97
|
+
}
|
|
98
|
+
return () => {
|
|
99
|
+
window.removeEventListener("resize", debouncedHandleResize);
|
|
100
|
+
};
|
|
101
|
+
}, [debouncedHandleResize]);
|
|
77
102
|
const setDefaultService = async (list) => {
|
|
78
103
|
if (state.renderType !== "eventBooking") {
|
|
79
104
|
return;
|
|
@@ -100,11 +125,11 @@ var Info = (props) => {
|
|
|
100
125
|
let _item = {
|
|
101
126
|
...product,
|
|
102
127
|
product_id: product.id,
|
|
103
|
-
_id: (0,
|
|
128
|
+
_id: (0, import_utils5.getUniqueId)(),
|
|
104
129
|
_extend: {
|
|
105
130
|
start_date: state.date.value,
|
|
106
131
|
startDate: state.date.value,
|
|
107
|
-
endDate: state.date.value,
|
|
132
|
+
endDate: isDay ? state.date.end_date : state.date.value,
|
|
108
133
|
start_time: "00:00:00",
|
|
109
134
|
duration: 10,
|
|
110
135
|
quantity: 1,
|
|
@@ -136,6 +161,10 @@ var Info = (props) => {
|
|
|
136
161
|
setLoading(false);
|
|
137
162
|
return;
|
|
138
163
|
}
|
|
164
|
+
let dayParams = {};
|
|
165
|
+
if (isDay) {
|
|
166
|
+
dayParams.extension_type = ["normal", "product_appointment"];
|
|
167
|
+
}
|
|
139
168
|
let data = await state.apis.getServices({
|
|
140
169
|
skip: 1,
|
|
141
170
|
num: 500,
|
|
@@ -151,16 +180,22 @@ var Info = (props) => {
|
|
|
151
180
|
_config: {
|
|
152
181
|
useCache: true
|
|
153
182
|
}
|
|
154
|
-
}
|
|
183
|
+
},
|
|
184
|
+
...dayParams
|
|
155
185
|
});
|
|
156
186
|
setLoading(false);
|
|
187
|
+
let lists = (data == null ? void 0 : data.list) || [];
|
|
188
|
+
if (isDay) {
|
|
189
|
+
const id = (0, import_utils4.holderId)(state);
|
|
190
|
+
lists = (0, import_utils4.getDayProducts)(id, lists, state == null ? void 0 : state.isTerminalDayBookingPage);
|
|
191
|
+
}
|
|
157
192
|
if (!state.service.addModal) {
|
|
158
|
-
setDefaultService(
|
|
193
|
+
setDefaultService(lists);
|
|
159
194
|
}
|
|
160
195
|
dispatch({
|
|
161
196
|
type: "setService",
|
|
162
197
|
payload: {
|
|
163
|
-
services:
|
|
198
|
+
services: lists
|
|
164
199
|
}
|
|
165
200
|
});
|
|
166
201
|
};
|
|
@@ -207,7 +242,7 @@ var Info = (props) => {
|
|
|
207
242
|
let cacheItem = {
|
|
208
243
|
...item,
|
|
209
244
|
product_id: item.id,
|
|
210
|
-
_id: (0,
|
|
245
|
+
_id: (0, import_utils5.getUniqueId)(),
|
|
211
246
|
_key: e.key,
|
|
212
247
|
_extend: {
|
|
213
248
|
start_date: state.date.value,
|
|
@@ -218,6 +253,11 @@ var Info = (props) => {
|
|
|
218
253
|
},
|
|
219
254
|
new: 1
|
|
220
255
|
};
|
|
256
|
+
if (isDay) {
|
|
257
|
+
cacheItem._extend.holder_id = (0, import_utils4.holderId)(state);
|
|
258
|
+
cacheItem._extend.end_date = state.date.end_date;
|
|
259
|
+
cacheItem._extend.sub_type = "days";
|
|
260
|
+
}
|
|
221
261
|
let _total = (0, import_utils3.getProductTotalPrice)(cacheItem);
|
|
222
262
|
cacheItem._extend.total = _total;
|
|
223
263
|
cacheItem._extend.origin_total = _total;
|
|
@@ -230,7 +270,9 @@ var Info = (props) => {
|
|
|
230
270
|
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
|
231
271
|
}
|
|
232
272
|
cacheItem._extend = (0, import_utils2.getProductExtend)({ cacheItem, state });
|
|
233
|
-
if (
|
|
273
|
+
if (isDay && !(0, import_utils4.isAppointment)(item, state)) {
|
|
274
|
+
cacheItem.autoClose = !_isEdit;
|
|
275
|
+
} else if (state.renderType === "eventBooking") {
|
|
234
276
|
cacheItem.autoClose = false;
|
|
235
277
|
} else {
|
|
236
278
|
cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((_b2 = state.service) == null ? void 0 : _b2.resourcesOrigin) || []).length === 1);
|
|
@@ -252,6 +294,13 @@ var Info = (props) => {
|
|
|
252
294
|
const renderList = (0, import_react.useMemo)(() => {
|
|
253
295
|
var _a2;
|
|
254
296
|
let _list = ((_a2 = state.service) == null ? void 0 : _a2.services) || [];
|
|
297
|
+
if (isDay) {
|
|
298
|
+
if (!(0, import_utils4.holderId)(state)) {
|
|
299
|
+
_list = _list.filter(
|
|
300
|
+
(item) => !import_status.appointmentTypes.includes(item.extension_type)
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
255
304
|
const isIncludes = (str) => {
|
|
256
305
|
return str.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
257
306
|
};
|
|
@@ -259,7 +308,7 @@ var Info = (props) => {
|
|
|
259
308
|
_list,
|
|
260
309
|
search ? (item) => isIncludes(item.title) : void 0
|
|
261
310
|
);
|
|
262
|
-
}, [search, (_a = state.service) == null ? void 0 : _a.services]);
|
|
311
|
+
}, [search, (_a = state.service) == null ? void 0 : _a.services, state == null ? void 0 : state.activeCartId]);
|
|
263
312
|
console.log("state.service.renderList", renderList);
|
|
264
313
|
const isService = (0, import_react.useMemo)(() => {
|
|
265
314
|
var _a2, _b2;
|
|
@@ -302,6 +351,9 @@ var Info = (props) => {
|
|
|
302
351
|
}
|
|
303
352
|
}, [state.renderType, state.modalOpen]);
|
|
304
353
|
const addButton = (0, import_react.useMemo)(() => {
|
|
354
|
+
if (isDay) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
305
357
|
if (state.isBookingCreatePage) {
|
|
306
358
|
return /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
307
359
|
}
|
|
@@ -311,8 +363,8 @@ var Info = (props) => {
|
|
|
311
363
|
{
|
|
312
364
|
loading,
|
|
313
365
|
showSub: false,
|
|
314
|
-
title:
|
|
315
|
-
subTitle:
|
|
366
|
+
title: import_utils5.locales.getText("pisell2.text.add-a-service"),
|
|
367
|
+
subTitle: import_utils5.locales.getText("pisell2.text.add-another-service"),
|
|
316
368
|
onClick: handleSelectService
|
|
317
369
|
}
|
|
318
370
|
);
|
|
@@ -321,8 +373,8 @@ var Info = (props) => {
|
|
|
321
373
|
import_addButton.default,
|
|
322
374
|
{
|
|
323
375
|
showSub: isService,
|
|
324
|
-
title:
|
|
325
|
-
subTitle:
|
|
376
|
+
title: import_utils5.locales.getText("pisell2.text.add-a-service"),
|
|
377
|
+
subTitle: import_utils5.locales.getText("pisell2.text.add-another-service"),
|
|
326
378
|
onClick: handleSelectService
|
|
327
379
|
}
|
|
328
380
|
) : /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
@@ -336,31 +388,42 @@ var Info = (props) => {
|
|
|
336
388
|
const isRenderCurrent = (0, import_react.useMemo)(() => {
|
|
337
389
|
return renderMode === "current";
|
|
338
390
|
}, [renderMode]);
|
|
391
|
+
const colSpan = (0, import_react.useMemo)(() => {
|
|
392
|
+
const isTerminal = state.isTerminalDayBookingPage;
|
|
393
|
+
const showDate = !!(isDay && (0, import_utils4.holderId)(state));
|
|
394
|
+
return (0, import_status.inputDateCol)(showDate, isTerminal);
|
|
395
|
+
}, [state.isTerminalDayBookingPage, isDay, (0, import_utils4.holderId)(state)]);
|
|
339
396
|
return (0, import_react.useMemo)(() => {
|
|
340
397
|
var _a2, _b2;
|
|
341
|
-
const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
398
|
+
const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header", ref: headerRef }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { gutter: [16, 16] }, isDay && (0, import_utils4.holderId)(state) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { ...colSpan.date }, /* @__PURE__ */ import_react.default.createElement(import_dateRange.default, { state, dispatch })) : null, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { ...colSpan.input }, /* @__PURE__ */ import_react.default.createElement(
|
|
342
399
|
import_antd.Input,
|
|
343
400
|
{
|
|
344
401
|
ref: searchRef,
|
|
345
402
|
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
346
403
|
style: { marginTop: 16, height: 44 },
|
|
347
|
-
placeholder:
|
|
404
|
+
placeholder: import_utils5.locales.getText("pisell2.text.search"),
|
|
348
405
|
allowClear: true,
|
|
349
406
|
value: search,
|
|
350
407
|
onChange: (e) => {
|
|
351
408
|
setSearch(e.target.value);
|
|
352
409
|
}
|
|
353
410
|
}
|
|
354
|
-
));
|
|
355
|
-
const content = /* @__PURE__ */ import_react.default.createElement(
|
|
356
|
-
|
|
411
|
+
))));
|
|
412
|
+
const content = /* @__PURE__ */ import_react.default.createElement(
|
|
413
|
+
"div",
|
|
357
414
|
{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
415
|
+
className: isDay && headerHeight > 76 ? "pisell-lowcode__booking-service-date-body" : "pisell-lowcode__booking-service-body"
|
|
416
|
+
},
|
|
417
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
418
|
+
import_TabProduct.default,
|
|
419
|
+
{
|
|
420
|
+
list: renderList,
|
|
421
|
+
amountSymbol: state.amountSymbol,
|
|
422
|
+
onChange: handleSelectProduct,
|
|
423
|
+
scrollDom: isRenderCurrent ? ".pisell-lowcode__booking-vertical-add-service-wrap" : ".booking-server-wrap .pisell-lowcode-drawer-body "
|
|
424
|
+
}
|
|
425
|
+
)
|
|
426
|
+
);
|
|
364
427
|
if (renderMode === "current") {
|
|
365
428
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
366
429
|
"div",
|
|
@@ -376,8 +439,8 @@ var Info = (props) => {
|
|
|
376
439
|
import_drawer.default,
|
|
377
440
|
{
|
|
378
441
|
titleNoWrap: true,
|
|
379
|
-
open: state.service.addModal && !state.isBookingCreatePage,
|
|
380
|
-
title:
|
|
442
|
+
open: state.service.addModal && !state.isBookingCreatePage && !state.isTerminalDayBookingPage,
|
|
443
|
+
title: isDay ? import_utils5.locales.getText("pisell2.text.select.items") : import_utils5.locales.getText("pisell2.text.select-service"),
|
|
381
444
|
rootClassName: "booking-server-wrap",
|
|
382
445
|
onClose: () => {
|
|
383
446
|
dispatch({
|
|
@@ -397,10 +460,14 @@ var Info = (props) => {
|
|
|
397
460
|
(_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose,
|
|
398
461
|
addButton,
|
|
399
462
|
state.service.addModal,
|
|
400
|
-
|
|
463
|
+
import_utils5.locales,
|
|
401
464
|
search,
|
|
402
465
|
renderList,
|
|
403
|
-
state.amountSymbol
|
|
466
|
+
state.amountSymbol,
|
|
467
|
+
state.renderType,
|
|
468
|
+
state == null ? void 0 : state.activeCartId,
|
|
469
|
+
headerHeight,
|
|
470
|
+
(0, import_utils4.holderId)(state)
|
|
404
471
|
]);
|
|
405
472
|
};
|
|
406
473
|
var addService_default = Info;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// border-bottom: 1px solid var(--gray-300, #D0D5DD);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.pisell-lowcode__booking-service-body
|
|
7
|
-
|
|
6
|
+
.pisell-lowcode__booking-service-body,
|
|
7
|
+
.pisell-lowcode__booking-service-date-body {
|
|
8
|
+
background: var(--gray-50, #f9fafb);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.pisell-lowcode__booking-vertical-add-service-wrap {
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
.booking-category-list {
|
|
26
27
|
padding: 0 16px !important;
|
|
27
28
|
}
|
|
29
|
+
|
|
28
30
|
.pisell-lowcode__booking-service-body {
|
|
29
31
|
.booking-tab-product {
|
|
30
32
|
.booking-tabs-wrap {
|
|
@@ -32,4 +34,12 @@
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
|
|
38
|
+
.pisell-lowcode__booking-service-date-body {
|
|
39
|
+
.booking-tab-product {
|
|
40
|
+
.booking-tabs-wrap {
|
|
41
|
+
top: 136px !important;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import dayjs from
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
export declare const getDurationProps: ({ cacheItem, useStartTime, currentResource, slice, }: any) => {
|
|
3
3
|
startDate: dayjs.Dayjs;
|
|
4
4
|
usableTime: any;
|
|
@@ -48,7 +48,7 @@ export declare const getTimeObj: ({ cacheItem, useStartTime, currentResource, st
|
|
|
48
48
|
* @Author: zhiwei.Wang
|
|
49
49
|
* @Date: 2024-01-09 13:38
|
|
50
50
|
*/
|
|
51
|
-
export declare const formatResources: ({ cacheItem, resourcesOrigin }: any) => any[];
|
|
51
|
+
export declare const formatResources: ({ cacheItem, resourcesOrigin, isDay }: any) => any[];
|
|
52
52
|
export declare const checkCacheItemResource: ({ cacheItem, resources }: any) => any;
|
|
53
53
|
/**
|
|
54
54
|
* @title: 预生成服务的 extend
|
|
@@ -59,3 +59,12 @@ export declare const checkCacheItemResource: ({ cacheItem, resources }: any) =>
|
|
|
59
59
|
* @Date: 2024-06-01 13:25
|
|
60
60
|
*/
|
|
61
61
|
export declare const getProductExtend: ({ cacheItem, state }: any) => any;
|
|
62
|
+
/**
|
|
63
|
+
* @title: 获取资源标题
|
|
64
|
+
* @description:
|
|
65
|
+
* @param {any} param1
|
|
66
|
+
* @return {*}
|
|
67
|
+
* @Author: WangHan
|
|
68
|
+
* @Date: 2024-12-09 15:53
|
|
69
|
+
*/
|
|
70
|
+
export declare const getResourceTitle: ({ state, id }: any) => any;
|
|
@@ -34,6 +34,7 @@ __export(utils_exports, {
|
|
|
34
34
|
getDurationProps: () => getDurationProps,
|
|
35
35
|
getFlexibleOption: () => getFlexibleOption,
|
|
36
36
|
getProductExtend: () => getProductExtend,
|
|
37
|
+
getResourceTitle: () => getResourceTitle,
|
|
37
38
|
getTimeObj: () => getTimeObj
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(utils_exports);
|
|
@@ -42,6 +43,7 @@ var import_utils = require("../../../utils");
|
|
|
42
43
|
var import_dayjs = __toESM(require("dayjs"));
|
|
43
44
|
var import_utils2 = require("@pisell/utils");
|
|
44
45
|
var import_AlertTriangle = __toESM(require("@pisell/icon/es/AlertTriangle"));
|
|
46
|
+
var import_utils3 = require("../../service2/utils");
|
|
45
47
|
var getDurationProps = ({
|
|
46
48
|
cacheItem,
|
|
47
49
|
useStartTime,
|
|
@@ -108,7 +110,8 @@ var getTimeObj = ({
|
|
|
108
110
|
});
|
|
109
111
|
let obj = (0, import_utils.sliceDayIntoFiveMinutes)(
|
|
110
112
|
(_c = (_b = (_a = state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.service_time,
|
|
111
|
-
import_utils2.locales.locale
|
|
113
|
+
import_utils2.locales.locale,
|
|
114
|
+
(0, import_utils3.isDayBooking)(state)
|
|
112
115
|
);
|
|
113
116
|
let timeSlices = [...obj.timeSlices];
|
|
114
117
|
let durationSlicesBasedOnTime = [...obj.durationSlicesBasedOnTime];
|
|
@@ -117,7 +120,7 @@ var getTimeObj = ({
|
|
|
117
120
|
}
|
|
118
121
|
if (useDuration && !durationSlicesBasedOnTime.some((d) => d.value === useDuration)) {
|
|
119
122
|
durationSlicesBasedOnTime.unshift({
|
|
120
|
-
label: (0, import_utils.getDiscountTime)(useDuration),
|
|
123
|
+
label: (0, import_utils.getDiscountTime)(useDuration, (0, import_utils3.isDayBooking)(state)),
|
|
121
124
|
value: useDuration,
|
|
122
125
|
//@ts-ignore
|
|
123
126
|
disabled: true
|
|
@@ -139,14 +142,19 @@ var getTimeObj = ({
|
|
|
139
142
|
durationSlicesBasedOnTime
|
|
140
143
|
};
|
|
141
144
|
};
|
|
142
|
-
var formatResources = ({ cacheItem, resourcesOrigin }) => {
|
|
145
|
+
var formatResources = ({ cacheItem, resourcesOrigin, isDay }) => {
|
|
143
146
|
try {
|
|
144
147
|
let _list = [...resourcesOrigin];
|
|
145
148
|
const _cacheItem = cacheItem;
|
|
146
149
|
_list = _list.map(
|
|
147
|
-
(d) => (0, import_utils.formatResource)(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
(d) => (0, import_utils.formatResource)(
|
|
151
|
+
d,
|
|
152
|
+
_cacheItem,
|
|
153
|
+
(item) => {
|
|
154
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "resource-option" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "like-wrap" }), item.labelText, !item.usable && /* @__PURE__ */ import_react.default.createElement(import_AlertTriangle.default, { className: "resource-option-alert-icon" }));
|
|
155
|
+
},
|
|
156
|
+
isDay
|
|
157
|
+
)
|
|
150
158
|
);
|
|
151
159
|
_list = _list.sort((a, b) => b.usable ? 1 : -1);
|
|
152
160
|
return _list;
|
|
@@ -156,22 +164,23 @@ var formatResources = ({ cacheItem, resourcesOrigin }) => {
|
|
|
156
164
|
return [];
|
|
157
165
|
};
|
|
158
166
|
var checkCacheItemResource = ({ cacheItem, resources }) => {
|
|
167
|
+
var _a, _b;
|
|
159
168
|
let resourceId = cacheItem._extend.resource;
|
|
160
169
|
if (resourceId || resourceId === 0) {
|
|
161
|
-
if (!resources.find((d) => d.form_record_id === resourceId)) {
|
|
170
|
+
if (!resources.find((d) => (d == null ? void 0 : d.form_record_id) === resourceId)) {
|
|
162
171
|
resourceId = void 0;
|
|
163
172
|
}
|
|
164
173
|
} else {
|
|
165
174
|
if (cacheItem.new) {
|
|
166
175
|
if (resources.length <= 2) {
|
|
167
|
-
resourceId = resources[resources.length - 1].form_record_id;
|
|
176
|
+
resourceId = (_a = resources == null ? void 0 : resources[(resources == null ? void 0 : resources.length) - 1]) == null ? void 0 : _a.form_record_id;
|
|
168
177
|
}
|
|
169
178
|
if (resources.length > 2) {
|
|
170
179
|
const usableList = resources.filter(
|
|
171
180
|
(d) => d.usable && d.form_id !== 0
|
|
172
181
|
);
|
|
173
182
|
if (usableList.length === 1) {
|
|
174
|
-
resourceId = usableList[0].form_record_id;
|
|
183
|
+
resourceId = (_b = usableList == null ? void 0 : usableList[0]) == null ? void 0 : _b.form_record_id;
|
|
175
184
|
}
|
|
176
185
|
}
|
|
177
186
|
}
|
|
@@ -186,7 +195,10 @@ var getProductExtend = ({ cacheItem, state }) => {
|
|
|
186
195
|
let currentResource = null;
|
|
187
196
|
if (!cacheItem.new) {
|
|
188
197
|
const resources2 = formatResources({ cacheItem, resourcesOrigin });
|
|
189
|
-
let item = resources2.find((d) =>
|
|
198
|
+
let item = resources2.find((d) => {
|
|
199
|
+
var _a;
|
|
200
|
+
return (d == null ? void 0 : d.form_record_id) == ((_a = cacheItem._extend) == null ? void 0 : _a.resource);
|
|
201
|
+
}) || {};
|
|
190
202
|
if (item) {
|
|
191
203
|
currentResource = item;
|
|
192
204
|
}
|
|
@@ -203,6 +215,14 @@ var getProductExtend = ({ cacheItem, state }) => {
|
|
|
203
215
|
});
|
|
204
216
|
return _extend;
|
|
205
217
|
};
|
|
218
|
+
var getResourceTitle = ({ state, id }) => {
|
|
219
|
+
var _a;
|
|
220
|
+
const resources = ((_a = state == null ? void 0 : state.client) == null ? void 0 : _a.value) || [];
|
|
221
|
+
if (!resources.length)
|
|
222
|
+
return "";
|
|
223
|
+
const resource = resources.find((d) => d.id === id);
|
|
224
|
+
return (resource == null ? void 0 : resource.main_field) || "-";
|
|
225
|
+
};
|
|
206
226
|
// Annotate the CommonJS export names for ESM import in node:
|
|
207
227
|
0 && (module.exports = {
|
|
208
228
|
checkCacheItemResource,
|
|
@@ -210,5 +230,6 @@ var getProductExtend = ({ cacheItem, state }) => {
|
|
|
210
230
|
getDurationProps,
|
|
211
231
|
getFlexibleOption,
|
|
212
232
|
getProductExtend,
|
|
233
|
+
getResourceTitle,
|
|
213
234
|
getTimeObj
|
|
214
235
|
});
|