@pisell/private-materials 3.0.199 → 3.0.200
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 +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 +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 +38 -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 +243 -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 +119 -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 +142 -22
- 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 +246 -44
- 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 +438 -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 +139 -23
- 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/helper.d.ts +0 -1
- package/es/components/eftposPay/helper.js +0 -14
- package/es/components/eftposPay/tyro/index.js +20 -51
- 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 +60 -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 +157 -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 +111 -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 +107 -34
- 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 +283 -125
- 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 +322 -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 +87 -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/helper.d.ts +0 -1
- package/lib/components/eftposPay/helper.js +0 -21
- package/lib/components/eftposPay/tyro/index.js +7 -36
- 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
|
};
|
|
@@ -180,7 +215,10 @@ var Info = (props) => {
|
|
|
180
215
|
};
|
|
181
216
|
const handleSelectProduct = (0, import_ahooks.useMemoizedFn)(
|
|
182
217
|
(item, type) => {
|
|
183
|
-
|
|
218
|
+
let isEject = type === "detail" || item.bundle_group_count > 0;
|
|
219
|
+
if (isDay) {
|
|
220
|
+
isEject = type === "detail" || item.bundle_group_count > 0 || item.option_group_count > 0 || item.is_variant > 0;
|
|
221
|
+
}
|
|
184
222
|
let lock = false;
|
|
185
223
|
state.action({
|
|
186
224
|
type: "pisell1.handleOpenProductModal",
|
|
@@ -188,15 +226,15 @@ var Info = (props) => {
|
|
|
188
226
|
id: item.id,
|
|
189
227
|
date: state.date.value.format("YYYY-MM-DD"),
|
|
190
228
|
showConfig: {
|
|
191
|
-
option: false,
|
|
229
|
+
option: isDay ? true : false,
|
|
192
230
|
session: false,
|
|
193
|
-
variant: false,
|
|
231
|
+
variant: isDay ? true : false,
|
|
194
232
|
package: true
|
|
195
233
|
},
|
|
196
234
|
is_eject: isEject ? 1 : 0
|
|
197
235
|
},
|
|
198
236
|
callback: (e) => {
|
|
199
|
-
var _a2, _b2;
|
|
237
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
200
238
|
if (lock) {
|
|
201
239
|
return;
|
|
202
240
|
}
|
|
@@ -207,7 +245,7 @@ var Info = (props) => {
|
|
|
207
245
|
let cacheItem = {
|
|
208
246
|
...item,
|
|
209
247
|
product_id: item.id,
|
|
210
|
-
_id: (0,
|
|
248
|
+
_id: (0, import_utils5.getUniqueId)(),
|
|
211
249
|
_key: e.key,
|
|
212
250
|
_extend: {
|
|
213
251
|
start_date: state.date.value,
|
|
@@ -218,22 +256,32 @@ var Info = (props) => {
|
|
|
218
256
|
},
|
|
219
257
|
new: 1
|
|
220
258
|
};
|
|
259
|
+
if (isDay) {
|
|
260
|
+
cacheItem._extend.holder_id = (0, import_utils4.holderId)(state);
|
|
261
|
+
cacheItem._extend.end_date = state.date.end_date;
|
|
262
|
+
cacheItem._extend.sub_type = "days";
|
|
263
|
+
}
|
|
221
264
|
let _total = (0, import_utils3.getProductTotalPrice)(cacheItem);
|
|
265
|
+
if ((_b2 = (_a2 = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _a2.other) == null ? void 0 : _b2.product_variant_id) {
|
|
266
|
+
cacheItem._extend.price = Number((_d2 = (_c2 = cacheItem._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.price);
|
|
267
|
+
}
|
|
222
268
|
cacheItem._extend.total = _total;
|
|
223
269
|
cacheItem._extend.origin_total = _total;
|
|
224
270
|
const _isEdit = !!state.service.cacheItem;
|
|
225
271
|
if (_isEdit) {
|
|
226
|
-
cacheItem._id = (
|
|
272
|
+
cacheItem._id = (_e = state.service.cacheItem) == null ? void 0 : _e._id;
|
|
227
273
|
cacheItem.new = 0;
|
|
228
274
|
}
|
|
229
275
|
if (renderMode === "current") {
|
|
230
276
|
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
|
231
277
|
}
|
|
232
278
|
cacheItem._extend = (0, import_utils2.getProductExtend)({ cacheItem, state });
|
|
233
|
-
if (
|
|
279
|
+
if (isDay && !(0, import_utils4.isAppointment)(item, state)) {
|
|
280
|
+
cacheItem.autoClose = !_isEdit;
|
|
281
|
+
} else if (state.renderType === "eventBooking") {
|
|
234
282
|
cacheItem.autoClose = false;
|
|
235
283
|
} else {
|
|
236
|
-
cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((
|
|
284
|
+
cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((_f = state.service) == null ? void 0 : _f.resourcesOrigin) || []).length === 1);
|
|
237
285
|
}
|
|
238
286
|
dispatch({
|
|
239
287
|
type: "setService",
|
|
@@ -252,6 +300,13 @@ var Info = (props) => {
|
|
|
252
300
|
const renderList = (0, import_react.useMemo)(() => {
|
|
253
301
|
var _a2;
|
|
254
302
|
let _list = ((_a2 = state.service) == null ? void 0 : _a2.services) || [];
|
|
303
|
+
if (isDay) {
|
|
304
|
+
if (!(0, import_utils4.holderId)(state)) {
|
|
305
|
+
_list = _list.filter(
|
|
306
|
+
(item) => !import_status.appointmentTypes.includes(item.extension_type)
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
255
310
|
const isIncludes = (str) => {
|
|
256
311
|
return str.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
257
312
|
};
|
|
@@ -259,7 +314,7 @@ var Info = (props) => {
|
|
|
259
314
|
_list,
|
|
260
315
|
search ? (item) => isIncludes(item.title) : void 0
|
|
261
316
|
);
|
|
262
|
-
}, [search, (_a = state.service) == null ? void 0 : _a.services]);
|
|
317
|
+
}, [search, (_a = state.service) == null ? void 0 : _a.services, state == null ? void 0 : state.activeCartId]);
|
|
263
318
|
console.log("state.service.renderList", renderList);
|
|
264
319
|
const isService = (0, import_react.useMemo)(() => {
|
|
265
320
|
var _a2, _b2;
|
|
@@ -302,6 +357,9 @@ var Info = (props) => {
|
|
|
302
357
|
}
|
|
303
358
|
}, [state.renderType, state.modalOpen]);
|
|
304
359
|
const addButton = (0, import_react.useMemo)(() => {
|
|
360
|
+
if (isDay) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
305
363
|
if (state.isBookingCreatePage) {
|
|
306
364
|
return /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
307
365
|
}
|
|
@@ -311,8 +369,8 @@ var Info = (props) => {
|
|
|
311
369
|
{
|
|
312
370
|
loading,
|
|
313
371
|
showSub: false,
|
|
314
|
-
title:
|
|
315
|
-
subTitle:
|
|
372
|
+
title: import_utils5.locales.getText("pisell2.text.add-a-service"),
|
|
373
|
+
subTitle: import_utils5.locales.getText("pisell2.text.add-another-service"),
|
|
316
374
|
onClick: handleSelectService
|
|
317
375
|
}
|
|
318
376
|
);
|
|
@@ -321,8 +379,8 @@ var Info = (props) => {
|
|
|
321
379
|
import_addButton.default,
|
|
322
380
|
{
|
|
323
381
|
showSub: isService,
|
|
324
|
-
title:
|
|
325
|
-
subTitle:
|
|
382
|
+
title: import_utils5.locales.getText("pisell2.text.add-a-service"),
|
|
383
|
+
subTitle: import_utils5.locales.getText("pisell2.text.add-another-service"),
|
|
326
384
|
onClick: handleSelectService
|
|
327
385
|
}
|
|
328
386
|
) : /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
@@ -336,31 +394,42 @@ var Info = (props) => {
|
|
|
336
394
|
const isRenderCurrent = (0, import_react.useMemo)(() => {
|
|
337
395
|
return renderMode === "current";
|
|
338
396
|
}, [renderMode]);
|
|
397
|
+
const colSpan = (0, import_react.useMemo)(() => {
|
|
398
|
+
const isTerminal = state.isTerminalDayBookingPage;
|
|
399
|
+
const showDate = !!(isDay && (0, import_utils4.holderId)(state));
|
|
400
|
+
return (0, import_status.inputDateCol)(showDate, isTerminal);
|
|
401
|
+
}, [state.isTerminalDayBookingPage, isDay, (0, import_utils4.holderId)(state)]);
|
|
339
402
|
return (0, import_react.useMemo)(() => {
|
|
340
403
|
var _a2, _b2;
|
|
341
|
-
const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
404
|
+
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
405
|
import_antd.Input,
|
|
343
406
|
{
|
|
344
407
|
ref: searchRef,
|
|
345
408
|
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
346
409
|
style: { marginTop: 16, height: 44 },
|
|
347
|
-
placeholder:
|
|
410
|
+
placeholder: import_utils5.locales.getText("pisell2.text.search"),
|
|
348
411
|
allowClear: true,
|
|
349
412
|
value: search,
|
|
350
413
|
onChange: (e) => {
|
|
351
414
|
setSearch(e.target.value);
|
|
352
415
|
}
|
|
353
416
|
}
|
|
354
|
-
));
|
|
355
|
-
const content = /* @__PURE__ */ import_react.default.createElement(
|
|
356
|
-
|
|
417
|
+
))));
|
|
418
|
+
const content = /* @__PURE__ */ import_react.default.createElement(
|
|
419
|
+
"div",
|
|
357
420
|
{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
421
|
+
className: isDay && headerHeight > 76 ? "pisell-lowcode__booking-service-date-body" : "pisell-lowcode__booking-service-body"
|
|
422
|
+
},
|
|
423
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
424
|
+
import_TabProduct.default,
|
|
425
|
+
{
|
|
426
|
+
list: renderList,
|
|
427
|
+
amountSymbol: state.amountSymbol,
|
|
428
|
+
onChange: handleSelectProduct,
|
|
429
|
+
scrollDom: isRenderCurrent ? ".pisell-lowcode__booking-vertical-add-service-wrap" : ".booking-server-wrap .pisell-lowcode-drawer-body "
|
|
430
|
+
}
|
|
431
|
+
)
|
|
432
|
+
);
|
|
364
433
|
if (renderMode === "current") {
|
|
365
434
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
366
435
|
"div",
|
|
@@ -376,8 +445,8 @@ var Info = (props) => {
|
|
|
376
445
|
import_drawer.default,
|
|
377
446
|
{
|
|
378
447
|
titleNoWrap: true,
|
|
379
|
-
open: state.service.addModal && !state.isBookingCreatePage,
|
|
380
|
-
title:
|
|
448
|
+
open: state.service.addModal && !state.isBookingCreatePage && !state.isTerminalDayBookingPage,
|
|
449
|
+
title: isDay ? import_utils5.locales.getText("pisell2.text.select.items") : import_utils5.locales.getText("pisell2.text.select-service"),
|
|
381
450
|
rootClassName: "booking-server-wrap",
|
|
382
451
|
onClose: () => {
|
|
383
452
|
dispatch({
|
|
@@ -397,10 +466,14 @@ var Info = (props) => {
|
|
|
397
466
|
(_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose,
|
|
398
467
|
addButton,
|
|
399
468
|
state.service.addModal,
|
|
400
|
-
|
|
469
|
+
import_utils5.locales,
|
|
401
470
|
search,
|
|
402
471
|
renderList,
|
|
403
|
-
state.amountSymbol
|
|
472
|
+
state.amountSymbol,
|
|
473
|
+
state.renderType,
|
|
474
|
+
state == null ? void 0 : state.activeCartId,
|
|
475
|
+
headerHeight,
|
|
476
|
+
(0, import_utils4.holderId)(state)
|
|
404
477
|
]);
|
|
405
478
|
};
|
|
406
479
|
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
|
});
|