@pisell/private-materials 6.2.25 → 6.2.27
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 +143 -159
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/customiseItemModal/index.js +5 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.js +37 -27
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/constants.d.ts +1 -0
- package/es/components/booking/info/service/editService/constants.js +3 -0
- package/es/components/booking/info/service/editService/index.js +15 -10
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +29 -21
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +6 -3
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
- package/es/components/booking/info2/service/editService/index.js +265 -170
- package/es/components/booking/info2/service/index.js +22 -19
- package/es/components/booking/info2/utilsByBooking.js +2 -1
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +77 -51
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Cart/index.less +14 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +4 -3
- package/es/components/ticketBooking/components/timeBar/index.js +77 -73
- package/es/components/ticketBooking/index.less +1 -1
- package/es/components/ticketBooking/utils/index.js +13 -8
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/pro/pisellNumberSelector/index.less +1 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/customiseItemModal/index.js +7 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.js +36 -24
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
- package/lib/components/booking/info/service/editService/constants.js +31 -0
- package/lib/components/booking/info/service/editService/index.js +7 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +26 -17
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
- package/lib/components/booking/info2/service/editService/index.js +138 -74
- package/lib/components/booking/info2/service/index.js +14 -10
- package/lib/components/booking/info2/utilsByBooking.js +2 -1
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +58 -31
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Cart/index.less +14 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
- package/lib/components/ticketBooking/index.less +1 -1
- package/lib/components/ticketBooking/utils/index.js +4 -4
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/pro/pisellNumberSelector/index.less +1 -1
- package/package.json +4 -4
@@ -251,7 +251,13 @@ var CustomiseItemModal = ({
|
|
251
251
|
max: 999,
|
252
252
|
step: 1,
|
253
253
|
disabled,
|
254
|
-
onChange: (value) =>
|
254
|
+
onChange: (value) => {
|
255
|
+
if (value < 1) {
|
256
|
+
setQuantity(1);
|
257
|
+
} else {
|
258
|
+
setQuantity(value);
|
259
|
+
}
|
260
|
+
},
|
255
261
|
size: "middle",
|
256
262
|
enablePriceAdjust: true
|
257
263
|
}
|
@@ -37,7 +37,7 @@ var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
38
38
|
var import_utils = require("@pisell/utils");
|
39
39
|
var useClearCart = (state, dispatch) => {
|
40
|
-
var _a, _b
|
40
|
+
var _a, _b;
|
41
41
|
const handleClear = () => {
|
42
42
|
dispatch({
|
43
43
|
type: "setService",
|
@@ -46,17 +46,20 @@ var useClearCart = (state, dispatch) => {
|
|
46
46
|
}
|
47
47
|
});
|
48
48
|
};
|
49
|
-
return
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
return (0, import_react.useMemo)(() => {
|
50
|
+
var _a2, _b2, _c, _d;
|
51
|
+
return !!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
|
52
|
+
"span",
|
53
|
+
{
|
54
|
+
className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
|
55
|
+
["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
|
56
|
+
}),
|
57
|
+
onClick: handleClear
|
58
|
+
},
|
59
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
|
60
|
+
" ",
|
61
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
|
62
|
+
);
|
63
|
+
}, [(_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length, state.channelDisabledEdit]);
|
61
64
|
};
|
62
65
|
var useClearCart_default = useClearCart;
|
@@ -48,7 +48,7 @@ var import_utils3 = require("../clientVariant/utils");
|
|
48
48
|
var import_useGetHolderList = __toESM(require("../hooks/useGetHolderList"));
|
49
49
|
var isLoadClient = false;
|
50
50
|
var Client = () => {
|
51
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
52
52
|
const modalRef = (0, import_react.useRef)();
|
53
53
|
const [loadLoading, setLoadLoading] = (0, import_react.useState)(false);
|
54
54
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
@@ -298,6 +298,7 @@ var Client = () => {
|
|
298
298
|
)) : null;
|
299
299
|
}, [loadLoading, params, state.client.clients.length]);
|
300
300
|
const customSelect = (0, import_react.useMemo)(() => {
|
301
|
+
console.log("render customSelect");
|
301
302
|
return /* @__PURE__ */ import_react.default.createElement(
|
302
303
|
import_customSelect.default,
|
303
304
|
{
|
@@ -340,7 +341,7 @@ var Client = () => {
|
|
340
341
|
}
|
341
342
|
}
|
342
343
|
);
|
343
|
-
}, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
344
|
+
}, [state.isTerminal, state.modalOpen, (_b = state.client) == null ? void 0 : _b.value, state.drawerMask, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
344
345
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
345
346
|
"div",
|
346
347
|
{
|
@@ -357,11 +358,11 @@ var Client = () => {
|
|
357
358
|
import_antd.Avatar,
|
358
359
|
{
|
359
360
|
className: "pisell-lowcode__booking-client-list-item-avatar",
|
360
|
-
src: import_utils.image.ali((
|
361
|
+
src: import_utils.image.ali((_c = state.client.value) == null ? void 0 : _c.cover, 100),
|
361
362
|
icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
|
362
363
|
}
|
363
364
|
),
|
364
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-name" }, getNickname(state.client.value)), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((
|
365
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-name" }, getNickname(state.client.value)), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_d = state.client.value) == null ? void 0 : _d.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-email" }, (_e = state.client.value) == null ? void 0 : _e.email) : null, ((_f = state.client.value) == null ? void 0 : _f.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-phone" }, (_g = state.client.value) == null ? void 0 : _g.phone) : null, !!((_i = (_h = state.client.value) == null ? void 0 : _h.waiver_form) == null ? void 0 : _i.length) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-waiver", title: (0, import_utils3.getWaiverTitle)((_j = state.client.value) == null ? void 0 : _j.waiver_form) }, (_m = (_l = (_k = state.client.value) == null ? void 0 : _k.waiver_form) == null ? void 0 : _l.map) == null ? void 0 : _m.call(_l, (item) => {
|
365
366
|
return /* @__PURE__ */ import_react.default.createElement("span", null, item.form_title, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-client-waiver-colon" }, ":"), item.is_filled ? /* @__PURE__ */ import_react.default.createElement(
|
366
367
|
"span",
|
367
368
|
{
|
@@ -32,6 +32,7 @@ __export(useInfoHolder_exports, {
|
|
32
32
|
default: () => useInfoHolder_default
|
33
33
|
});
|
34
34
|
module.exports = __toCommonJS(useInfoHolder_exports);
|
35
|
+
var import_ahooks = require("ahooks");
|
35
36
|
var import_react = require("react");
|
36
37
|
var import_useHolderConfig = __toESM(require("./useHolderConfig"));
|
37
38
|
var import_utils = require("../utils");
|
@@ -58,24 +59,22 @@ var useInfoHolder = (state, dispatch) => {
|
|
58
59
|
const showAddTimeModal = (0, import_react.useMemo)(() => {
|
59
60
|
return (0, import_utils.isOpenAddTime)(state);
|
60
61
|
}, [state, appointment_card.quick_time]);
|
61
|
-
const handleEdit = (cacheItem, type) => {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
}, 100);
|
71
|
-
};
|
62
|
+
const handleEdit = (0, import_ahooks.useMemoizedFn)((cacheItem, type) => {
|
63
|
+
var _a2, _b2, _c2;
|
64
|
+
const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(cacheItem);
|
65
|
+
if (isNoSpecAndPackage) {
|
66
|
+
(_a2 = editNormalServiceRef.current) == null ? void 0 : _a2.init(cacheItem);
|
67
|
+
} else {
|
68
|
+
(_c2 = (_b2 = detailRef.current) == null ? void 0 : _b2.init) == null ? void 0 : _c2.call(_b2, cacheItem, false, type === "edit_product");
|
69
|
+
}
|
70
|
+
});
|
72
71
|
const dispatchService = (type, payload) => {
|
73
72
|
dispatch({
|
74
73
|
type,
|
75
74
|
payload: { ...payload }
|
76
75
|
});
|
77
76
|
};
|
78
|
-
const handleAction = (dataSource) => {
|
77
|
+
const handleAction = (0, import_ahooks.useMemoizedFn)((dataSource) => {
|
79
78
|
const cacheItem = (0, import_utils2.getProductExtend)({
|
80
79
|
cacheItem: { ...dataSource._origin, new: 0 },
|
81
80
|
state
|
@@ -87,7 +86,7 @@ var useInfoHolder = (state, dispatch) => {
|
|
87
86
|
cacheItem
|
88
87
|
}
|
89
88
|
});
|
90
|
-
};
|
89
|
+
});
|
91
90
|
return {
|
92
91
|
detailRef,
|
93
92
|
handleEdit,
|
@@ -48,10 +48,12 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
48
48
|
const { handleAddHolder } = (0, import_useAddHolder.default)(state, dispatch);
|
49
49
|
const handleChange = (0, import_ahooks.useMemoizedFn)(
|
50
50
|
(currentItem, type, other) => {
|
51
|
+
console.time("handleChange");
|
52
|
+
console.log(window.pp1 = performance.now(), "打开商品");
|
51
53
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
52
54
|
return;
|
53
55
|
}
|
54
|
-
let
|
56
|
+
let products2 = (0, import_utils.updateServices)(state, currentItem, type, other, {
|
55
57
|
handleAddHolder
|
56
58
|
});
|
57
59
|
if (type === "view" || type === "edit_product") {
|
@@ -64,11 +66,11 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
64
66
|
});
|
65
67
|
}
|
66
68
|
onChange({ editModal: true, cacheItem });
|
67
|
-
return onEdit == null ? void 0 : onEdit(
|
69
|
+
return onEdit == null ? void 0 : onEdit(cacheItem, type);
|
68
70
|
}
|
69
71
|
const params = {
|
70
72
|
editModal: false,
|
71
|
-
value:
|
73
|
+
value: products2,
|
72
74
|
edit: true,
|
73
75
|
cacheItem: null
|
74
76
|
};
|
@@ -98,27 +100,37 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
98
100
|
state.isBookingCreatePage,
|
99
101
|
state.bookingConfig
|
100
102
|
]);
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
103
|
+
const products = (0, import_react.useMemo)(() => {
|
104
|
+
var _a2;
|
105
|
+
console.time("products");
|
106
|
+
const p = (0, import_utils.formatProducts)(
|
107
|
+
((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) || [],
|
108
|
+
state,
|
109
|
+
false,
|
110
|
+
true,
|
111
|
+
isParallelResource
|
112
|
+
);
|
113
|
+
console.timeEnd("products");
|
114
|
+
return p;
|
115
|
+
}, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value, state]);
|
116
|
+
return (0, import_react.useMemo)(() => {
|
117
|
+
console.log("render List");
|
118
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
|
119
|
+
import_shoppingCart.default,
|
120
|
+
{
|
121
|
+
scenario: state.isBookingTicket2 ? "booking2" : void 0,
|
122
|
+
isParallelResource,
|
123
|
+
onAction,
|
124
|
+
onChange: handleChange,
|
125
|
+
isOpenGroup: false,
|
126
|
+
isHideClearCart: true,
|
127
|
+
onAddProduct: () => onChange({ addModal: true }),
|
128
|
+
productParams: {
|
129
|
+
...productParams,
|
130
|
+
products
|
131
|
+
}
|
120
132
|
}
|
121
|
-
|
122
|
-
)
|
133
|
+
));
|
134
|
+
}, [products, state, productParams]);
|
123
135
|
};
|
124
136
|
var Lists_default = Lists;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getIsPartyRoomResourceShop: (id: number) => boolean;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __export = (target, all) => {
|
6
|
+
for (var name in all)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
8
|
+
};
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
+
}
|
15
|
+
return to;
|
16
|
+
};
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
|
19
|
+
// src/components/booking/info/service/editService/constants.ts
|
20
|
+
var constants_exports = {};
|
21
|
+
__export(constants_exports, {
|
22
|
+
getIsPartyRoomResourceShop: () => getIsPartyRoomResourceShop
|
23
|
+
});
|
24
|
+
module.exports = __toCommonJS(constants_exports);
|
25
|
+
var getIsPartyRoomResourceShop = (id) => {
|
26
|
+
return [2155, 9].includes(id);
|
27
|
+
};
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
29
|
+
0 && (module.exports = {
|
30
|
+
getIsPartyRoomResourceShop
|
31
|
+
});
|
@@ -57,10 +57,13 @@ var import_like = __toESM(require("../like"));
|
|
57
57
|
var import_utils7 = require("../../utils");
|
58
58
|
var import_serviceManager = require("../serviceManager");
|
59
59
|
var import_EditTabs = __toESM(require("./EditTabs"));
|
60
|
+
var import_constants = require("./constants");
|
61
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
60
62
|
var submitLock = false;
|
61
63
|
var Info = (_, ref) => {
|
62
64
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
63
65
|
const [form] = import_antd.Form.useForm();
|
66
|
+
const context = (0, import_useEngineContext.default)();
|
64
67
|
const useTotal = import_antd.Form.useWatch("total", form);
|
65
68
|
const useLikeStatus = import_antd.Form.useWatch("like_status", form);
|
66
69
|
const useResource = import_antd.Form.useWatch("resource", form);
|
@@ -354,6 +357,7 @@ var Info = (_, ref) => {
|
|
354
357
|
});
|
355
358
|
}, [(_q = (_p = (_o = state.service) == null ? void 0 : _o.cacheItem) == null ? void 0 : _p._extend) == null ? void 0 : _q.multi_day]);
|
356
359
|
const getResourcesData = async () => {
|
360
|
+
var _a2, _b2, _c2, _d2, _e2;
|
357
361
|
setResourceLoading(true);
|
358
362
|
try {
|
359
363
|
let params = {};
|
@@ -373,10 +377,12 @@ var Info = (_, ref) => {
|
|
373
377
|
} else {
|
374
378
|
params.with_date_times = state.date.value.format("YYYY-MM-DD");
|
375
379
|
}
|
380
|
+
const isPartyRoomResourceShop = (0, import_constants.getIsPartyRoomResourceShop)((_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils.store) == null ? void 0 : _a2.getState) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id);
|
381
|
+
const codes = isPartyRoomResourceShop ? ["resources", "therapist", "table", "party_room"] : ["resources", "therapist", "table"];
|
376
382
|
let data = await state.apis.getResources({
|
377
383
|
skip: 1,
|
378
384
|
num: 1e3,
|
379
|
-
codes
|
385
|
+
codes,
|
380
386
|
_config: { abort: true },
|
381
387
|
...params
|
382
388
|
});
|
@@ -317,6 +317,15 @@ var updateServices = (state, currentItem, type, other, actions) => {
|
|
317
317
|
products = handleChangeResource(products, currentItem, other, state);
|
318
318
|
return products;
|
319
319
|
}
|
320
|
+
if (type === "num") {
|
321
|
+
return products.map((product) => {
|
322
|
+
if (product._id === currentItem._id) {
|
323
|
+
product._extend.quantity = other.num;
|
324
|
+
return product;
|
325
|
+
}
|
326
|
+
return product;
|
327
|
+
});
|
328
|
+
}
|
320
329
|
if (type === "update_holders") {
|
321
330
|
products = products == null ? void 0 : products.map((item) => {
|
322
331
|
var _a2;
|
@@ -590,25 +599,25 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
|
|
590
599
|
_origin: item
|
591
600
|
};
|
592
601
|
};
|
593
|
-
lists.forEach((item) => {
|
594
|
-
var _a;
|
595
|
-
if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
|
596
|
-
normalList.push(formItem(item));
|
597
|
-
} else {
|
598
|
-
groupList.push(item);
|
599
|
-
}
|
600
|
-
});
|
601
|
-
let groups = groupList.reduce((prev, item) => {
|
602
|
-
var _a;
|
603
|
-
const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
|
604
|
-
if (!prev[groupId]) {
|
605
|
-
prev[groupId] = [];
|
606
|
-
}
|
607
|
-
prev[groupId].push(item);
|
608
|
-
return prev;
|
609
|
-
}, {});
|
610
602
|
console.log(normalList, "normalList");
|
611
603
|
if (isRenderGroup) {
|
604
|
+
lists.forEach((item) => {
|
605
|
+
var _a;
|
606
|
+
if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
|
607
|
+
normalList.push(formItem(item));
|
608
|
+
} else {
|
609
|
+
groupList.push(item);
|
610
|
+
}
|
611
|
+
});
|
612
|
+
let groups = groupList.reduce((prev, item) => {
|
613
|
+
var _a;
|
614
|
+
const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
|
615
|
+
if (!prev[groupId]) {
|
616
|
+
prev[groupId] = [];
|
617
|
+
}
|
618
|
+
prev[groupId].push(item);
|
619
|
+
return prev;
|
620
|
+
}, {});
|
612
621
|
return Object.values(groups).map((d) => formItem((0, import_utils3.concatBookings)(d))).concat(normalList);
|
613
622
|
} else {
|
614
623
|
return lists == null ? void 0 : lists.map((item) => formItem(item));
|
@@ -142,7 +142,8 @@ var getTimeObj = ({
|
|
142
142
|
cacheItem,
|
143
143
|
useStartTime,
|
144
144
|
currentResource,
|
145
|
-
|
145
|
+
// 没有使用该参数
|
146
|
+
// state,
|
146
147
|
durationProps
|
147
148
|
});
|
148
149
|
let obj = (0, import_utils.sliceDayIntoFiveMinutes)(
|
@@ -242,7 +243,8 @@ var setDefaultResource = ({ cacheItem, resources }) => {
|
|
242
243
|
}
|
243
244
|
const defaultResource = defaultOriginalResource.map((d) => {
|
244
245
|
return {
|
245
|
-
...d,
|
246
|
+
// ...d,
|
247
|
+
children: d.children,
|
246
248
|
relation_type: d.relation_type,
|
247
249
|
form_id: item.form_id,
|
248
250
|
relation_id: d.id,
|
@@ -65,6 +65,7 @@ var AddTimeModal = () => {
|
|
65
65
|
const [number, setNumber] = (0, import_react.useState)(1);
|
66
66
|
const originServices = (0, import_react.useRef)([]);
|
67
67
|
const [renderList, setRenderList] = (0, import_react.useState)([]);
|
68
|
+
console.log(renderList, "renderListrenderList");
|
68
69
|
const context = (0, import_useEngineContext.default)();
|
69
70
|
const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
70
71
|
const statusMap = {
|
@@ -126,6 +127,7 @@ var AddTimeModal = () => {
|
|
126
127
|
}
|
127
128
|
return arr.filter(Boolean);
|
128
129
|
}, [(_f = (_e = (_d = state.service) == null ? void 0 : _d.cacheItem) == null ? void 0 : _e._extend) == null ? void 0 : _f.resource]);
|
130
|
+
console.log(currentResource, "currentResource");
|
129
131
|
const getTimeUsableStatus = (time) => {
|
130
132
|
var _a2, _b2;
|
131
133
|
if (!((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend) || !currentResource.length) {
|
@@ -206,6 +208,7 @@ var AddTimeModal = () => {
|
|
206
208
|
setLoading("list");
|
207
209
|
const newList = await _getAddTimeProducts();
|
208
210
|
let list = newList.map((d) => {
|
211
|
+
debugger;
|
209
212
|
let isUsable = (0, import_utils2.isUsableProduct)(d.add_time, state.service.cacheItem);
|
210
213
|
return {
|
211
214
|
...d,
|
@@ -168,9 +168,11 @@ var Resources = ({
|
|
168
168
|
const getIsAutoAllocation = (id) => {
|
169
169
|
return (0, import_utils2.getAutoAllocationStorage)(id);
|
170
170
|
};
|
171
|
+
console.log("resourcesss");
|
171
172
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data.map((item) => {
|
172
173
|
var _a2;
|
173
174
|
const cur = _value[item.form_id];
|
175
|
+
console.log(cur, "curcur");
|
174
176
|
const errors = (cur || []).reduce((pre, d) => {
|
175
177
|
return pre.concat((d == null ? void 0 : d.errors) || []);
|
176
178
|
}, []);
|