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