@pisell/private-materials 3.0.202 → 3.0.204
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +27 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +33 -18
- 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 -46
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +35 -266
- package/es/components/booking/forms/model.d.ts +1 -1
- 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 +9 -124
- package/es/components/booking/info/main.js +15 -28
- 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 +96 -187
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -12
- package/es/components/booking/info/service/addService/utils.js +26 -103
- package/es/components/booking/info/service/editService/index.js +132 -435
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/service/serve.d.ts +0 -10
- package/es/components/booking/info/service/serve.js +0 -28
- package/es/components/booking/info/utils.d.ts +0 -20
- package/es/components/booking/info/utils.js +0 -37
- package/es/components/booking/locales.d.ts +0 -66
- package/es/components/booking/locales.js +3 -81
- package/es/components/booking/model.d.ts +1 -5
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -1
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +26 -143
- 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/hooks.d.ts +4 -4
- 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/app.d.ts +11 -0
- package/es/components/eftposPay/app.js +173 -0
- package/es/components/eftposPay/component/fail/failCustom.js +1 -0
- package/es/components/eftposPay/component/fail/index.js +1 -0
- package/es/components/eftposPay/component/manual/index.js +4 -1
- package/es/components/eftposPay/component/step/index.d.ts +6 -6
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +27 -1
- package/es/components/eftposPay/const.js +22 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/device.js +2 -2
- package/es/components/eftposPay/helper.d.ts +6 -0
- package/es/components/eftposPay/helper.js +24 -4
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +22 -16
- package/es/components/eftposPay/index.d.ts +1 -1
- package/es/components/eftposPay/index.js +130 -179
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +15 -0
- package/es/components/eftposPay/payo/config.js +20 -8
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +10 -0
- package/es/components/eftposPay/tip.js +177 -0
- package/es/components/eftposPay/tip.less +9 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/es/components/eftposPay/tyro/index.js +55 -22
- package/es/components/eftposPay/windcave/helper.d.ts +1 -1
- package/es/components/eftposPay/windcave/windcave.js +17 -6
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -1
- 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 -27
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +35 -161
- package/lib/components/booking/forms/model.d.ts +1 -1
- 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 +11 -87
- package/lib/components/booking/info/main.js +9 -17
- 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 +84 -115
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
- package/lib/components/booking/info/service/addService/utils.js +10 -58
- package/lib/components/booking/info/service/editService/index.js +182 -425
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/service/serve.d.ts +0 -10
- package/lib/components/booking/info/service/serve.js +2 -7
- package/lib/components/booking/info/utils.d.ts +0 -20
- package/lib/components/booking/info/utils.js +0 -41
- package/lib/components/booking/locales.d.ts +0 -66
- package/lib/components/booking/locales.js +3 -69
- package/lib/components/booking/model.d.ts +1 -5
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +18 -89
- 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/hooks.d.ts +4 -4
- 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/app.d.ts +11 -0
- package/lib/components/eftposPay/app.js +166 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
- package/lib/components/eftposPay/component/fail/index.js +1 -1
- package/lib/components/eftposPay/component/manual/index.js +19 -5
- package/lib/components/eftposPay/component/step/index.d.ts +6 -6
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +27 -1
- package/lib/components/eftposPay/const.js +18 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/device.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +6 -0
- package/lib/components/eftposPay/helper.js +29 -4
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +8 -2
- package/lib/components/eftposPay/index.d.ts +1 -1
- package/lib/components/eftposPay/index.js +106 -144
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +15 -0
- package/lib/components/eftposPay/payo/config.js +33 -9
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +10 -0
- package/lib/components/eftposPay/tip.js +159 -0
- package/lib/components/eftposPay/tip.less +9 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/lib/components/eftposPay/tyro/index.js +40 -9
- package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
- package/lib/components/eftposPay/windcave/windcave.js +29 -6
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +4 -4
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/info/Provider.d.ts +0 -0
- package/es/components/booking/info/Provider.js +0 -54
- 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 -134
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
- package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
- package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
- package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceManager/index.js +0 -277
- package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/es/components/booking/info/service/serviceManager/utils.js +0 -0
- package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/es/components/booking/info/service2/Group/utils.js +0 -146
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -152
- 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 -6
- package/es/components/booking/info/service2/index.js +0 -57
- 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 -237
- package/es/components/booking/info/service2/utils.js +0 -1062
- 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 -68
- 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 -69
- 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 -132
- 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 -59
- 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 -116
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/info/Provider.d.ts +0 -0
- package/lib/components/booking/info/Provider.js +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 -121
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
- package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
- package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceManager/index.js +0 -207
- package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
- package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/lib/components/booking/info/service2/Group/utils.js +0 -142
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -115
- 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 -6
- 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 -237
- package/lib/components/booking/info/service2/utils.js +0 -675
- 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 -73
- 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 -75
- 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 -124
- 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 -66
- 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 -86
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -1,207 +0,0 @@
|
|
|
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/serviceManager/index.tsx
|
|
20
|
-
var serviceManager_exports = {};
|
|
21
|
-
__export(serviceManager_exports, {
|
|
22
|
-
useService: () => useService
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(serviceManager_exports);
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
var import_utils = require("@pisell/utils");
|
|
27
|
-
var import_utils2 = require("../addService/utils");
|
|
28
|
-
var import_utils3 = require("../../service2/utils");
|
|
29
|
-
var import_utils4 = require("../../service2/Group/utils");
|
|
30
|
-
var import_utils5 = require("../../../utils");
|
|
31
|
-
var lock = false;
|
|
32
|
-
var useService = ({
|
|
33
|
-
renderMode,
|
|
34
|
-
onEdit,
|
|
35
|
-
state,
|
|
36
|
-
dispatch
|
|
37
|
-
}) => {
|
|
38
|
-
var _a;
|
|
39
|
-
const holderId = (0, import_react.useMemo)(() => {
|
|
40
|
-
var _a2;
|
|
41
|
-
return Number(((_a2 = state == null ? void 0 : state.activeCartId) == null ? void 0 : _a2[0]) || 0);
|
|
42
|
-
}, [state == null ? void 0 : state.activeCartId]);
|
|
43
|
-
const isDayBookingMode = (0, import_react.useMemo)(() => {
|
|
44
|
-
return (0, import_utils3.isDayBooking)(state);
|
|
45
|
-
}, [state == null ? void 0 : state.renderType]);
|
|
46
|
-
const createBookingData = async ({ product }) => {
|
|
47
|
-
var _a2, _b;
|
|
48
|
-
if (lock) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
lock = true;
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
lock = false;
|
|
54
|
-
}, 2e3);
|
|
55
|
-
const { _params } = product;
|
|
56
|
-
let cacheItem = {
|
|
57
|
-
...product,
|
|
58
|
-
product_id: product.id,
|
|
59
|
-
_id: (0, import_utils.getUniqueId)(),
|
|
60
|
-
_key: _params.key,
|
|
61
|
-
_extend: {
|
|
62
|
-
start_date: state.date.value,
|
|
63
|
-
quantity: 1,
|
|
64
|
-
price: product.price,
|
|
65
|
-
product_name: product.title,
|
|
66
|
-
other: JSON.parse(JSON.stringify(_params))
|
|
67
|
-
},
|
|
68
|
-
new: 1
|
|
69
|
-
};
|
|
70
|
-
if (isDayBookingMode) {
|
|
71
|
-
cacheItem._extend.holder_id = holderId;
|
|
72
|
-
cacheItem._extend.end_date = state.date.end_date;
|
|
73
|
-
cacheItem._extend.sub_type = "days";
|
|
74
|
-
}
|
|
75
|
-
let _total = (0, import_utils5.getProductTotalPrice)(cacheItem);
|
|
76
|
-
cacheItem._extend.total = _total;
|
|
77
|
-
cacheItem._extend.origin_total = _total;
|
|
78
|
-
const _isEdit = !!state.service.cacheItem;
|
|
79
|
-
if (_isEdit) {
|
|
80
|
-
cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
|
|
81
|
-
cacheItem.new = 0;
|
|
82
|
-
}
|
|
83
|
-
if (renderMode === "current") {
|
|
84
|
-
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
|
85
|
-
}
|
|
86
|
-
cacheItem._extend = (0, import_utils2.getProductExtend)({ cacheItem, state });
|
|
87
|
-
if (isDayBookingMode) {
|
|
88
|
-
cacheItem = await (0, import_utils2.getMultiDay)({
|
|
89
|
-
start_date: cacheItem._extend.startDate,
|
|
90
|
-
end_date: cacheItem._extend.endDate,
|
|
91
|
-
state,
|
|
92
|
-
cacheItem
|
|
93
|
-
});
|
|
94
|
-
if ((0, import_utils3.isDayBookingProduct)(cacheItem, state)) {
|
|
95
|
-
cacheItem = (0, import_utils4.concatBookings)((0, import_utils4.createBookingItemsByGroup)(cacheItem));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (isDayBookingMode && !(0, import_utils3.isDayBookingProduct)(cacheItem, state)) {
|
|
99
|
-
cacheItem.autoClose = true;
|
|
100
|
-
} else if (state.renderType === "eventBooking") {
|
|
101
|
-
cacheItem.autoClose = false;
|
|
102
|
-
} else {
|
|
103
|
-
cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((_b = state.service) == null ? void 0 : _b.resourcesOrigin) || []).length === 1);
|
|
104
|
-
}
|
|
105
|
-
debugger;
|
|
106
|
-
return cacheItem;
|
|
107
|
-
};
|
|
108
|
-
const currentResource = (0, import_react.useCallback)(
|
|
109
|
-
(useResource) => {
|
|
110
|
-
const list = state.service.resources;
|
|
111
|
-
let item = list.find((d) => d.form_record_id == useResource) || {};
|
|
112
|
-
return item;
|
|
113
|
-
},
|
|
114
|
-
[(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.resources]
|
|
115
|
-
);
|
|
116
|
-
const editBookingData = async ({ changeValues }) => {
|
|
117
|
-
var _a2;
|
|
118
|
-
let _item = {
|
|
119
|
-
...state.service.cacheItem,
|
|
120
|
-
autoClose: false
|
|
121
|
-
};
|
|
122
|
-
let _extend = {
|
|
123
|
-
..._item._extend,
|
|
124
|
-
...changeValues
|
|
125
|
-
};
|
|
126
|
-
if ((0, import_utils3.isDayBookingProduct)(state.service.cacheItem, state)) {
|
|
127
|
-
_extend.quantity = 1;
|
|
128
|
-
_extend.startDate = _extend == null ? void 0 : _extend.start_date;
|
|
129
|
-
_extend.endDate = _extend == null ? void 0 : _extend.end_date;
|
|
130
|
-
} else {
|
|
131
|
-
const { startDate, endDate } = (0, import_utils5.getServiceTimes)({ _extend });
|
|
132
|
-
_extend.startDate = startDate;
|
|
133
|
-
_extend.endDate = endDate;
|
|
134
|
-
}
|
|
135
|
-
const resourceItem = currentResource(changeValues.resource);
|
|
136
|
-
const { relation_type, item_id, schedule_id } = ((_a2 = resourceItem == null ? void 0 : resourceItem._extend) == null ? void 0 : _a2.usableTime) || {};
|
|
137
|
-
_extend.relation_type = relation_type || "form";
|
|
138
|
-
_extend.relation_id = item_id || (resourceItem == null ? void 0 : resourceItem.form_record_id) || 0;
|
|
139
|
-
_extend.schedule_id = schedule_id || 0;
|
|
140
|
-
if (_extend.bundle_edit !== void 0) {
|
|
141
|
-
_extend.bundle_edit = 1;
|
|
142
|
-
}
|
|
143
|
-
_item._extend = _extend;
|
|
144
|
-
_item._time = (/* @__PURE__ */ new Date()).getTime();
|
|
145
|
-
return _item;
|
|
146
|
-
};
|
|
147
|
-
const createBooking = async ({ booking }) => {
|
|
148
|
-
goEditPanel({ booking });
|
|
149
|
-
};
|
|
150
|
-
const editBooking = async ({ booking }) => {
|
|
151
|
-
var _a2;
|
|
152
|
-
let _list = state.service.value;
|
|
153
|
-
let _id = booking == null ? void 0 : booking._id;
|
|
154
|
-
let groupId = (_a2 = booking == null ? void 0 : booking._extend) == null ? void 0 : _a2.groupId;
|
|
155
|
-
if (groupId) {
|
|
156
|
-
_list = _list.filter((d) => {
|
|
157
|
-
var _a3;
|
|
158
|
-
return ((_a3 = d._extend) == null ? void 0 : _a3.groupId) !== groupId;
|
|
159
|
-
});
|
|
160
|
-
_list = _list.concat((0, import_utils4.createBookingItemsByGroup)(booking, true));
|
|
161
|
-
} else {
|
|
162
|
-
if (!_list.some((d) => d._id === _id)) {
|
|
163
|
-
if (!(0, import_utils3.isBookingProduct)(booking == null ? void 0 : booking.extension_type) || !isDayBookingMode) {
|
|
164
|
-
_list.push(booking);
|
|
165
|
-
} else {
|
|
166
|
-
}
|
|
167
|
-
} else {
|
|
168
|
-
_list = _list.map((d) => d._id === _id ? { ...booking, new: 0 } : d);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
(0, import_utils5.deleteCacheParams)();
|
|
172
|
-
dispatch({
|
|
173
|
-
type: "setService",
|
|
174
|
-
payload: {
|
|
175
|
-
editModal: false,
|
|
176
|
-
addModal: false,
|
|
177
|
-
value: _list,
|
|
178
|
-
edit: true,
|
|
179
|
-
cacheItem: null,
|
|
180
|
-
changeService: false
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
const goEditPanel = ({ booking }) => {
|
|
185
|
-
dispatch({
|
|
186
|
-
type: "setService",
|
|
187
|
-
payload: {
|
|
188
|
-
editModal: true,
|
|
189
|
-
cacheItem: booking,
|
|
190
|
-
addModal: !booking.autoClose,
|
|
191
|
-
changeService: false
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
onEdit(booking);
|
|
195
|
-
};
|
|
196
|
-
return {
|
|
197
|
-
createBookingData,
|
|
198
|
-
editBookingData,
|
|
199
|
-
createBooking,
|
|
200
|
-
editBooking,
|
|
201
|
-
goEditPanel
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
205
|
-
0 && (module.exports = {
|
|
206
|
-
useService
|
|
207
|
-
});
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const getGroupTotalPrice: (items: any[]) => any;
|
|
2
|
-
/**
|
|
3
|
-
* @title: 创建一个虚拟的组
|
|
4
|
-
* @description:
|
|
5
|
-
* @param {any} items
|
|
6
|
-
* @return {*}
|
|
7
|
-
* @Author: zhiwei.Wang
|
|
8
|
-
*/
|
|
9
|
-
export declare const concatBookings: (items: any[]) => any;
|
|
10
|
-
export declare const createBookingItemsByGroup: (item: any, isBatchEdit?: any) => any[];
|
|
11
|
-
export declare const isGroupBooking: (_id: any) => boolean;
|
|
12
|
-
export declare const getProductByGroupId: (groupId: string, items: any[]) => any[];
|
|
13
|
-
export declare const getGroupBooking: (groupId: string, items: any[]) => any;
|
|
14
|
-
export declare const filterItemByGroupId: (groupId: string, items: any[]) => any[];
|
|
@@ -1,142 +0,0 @@
|
|
|
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/service2/Group/utils.ts
|
|
20
|
-
var utils_exports = {};
|
|
21
|
-
__export(utils_exports, {
|
|
22
|
-
concatBookings: () => concatBookings,
|
|
23
|
-
createBookingItemsByGroup: () => createBookingItemsByGroup,
|
|
24
|
-
filterItemByGroupId: () => filterItemByGroupId,
|
|
25
|
-
getGroupBooking: () => getGroupBooking,
|
|
26
|
-
getGroupTotalPrice: () => getGroupTotalPrice,
|
|
27
|
-
getProductByGroupId: () => getProductByGroupId,
|
|
28
|
-
isGroupBooking: () => isGroupBooking
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(utils_exports);
|
|
31
|
-
var import_utils = require("@pisell/utils");
|
|
32
|
-
var import_utils2 = require("../../../utils");
|
|
33
|
-
var import_distributeDiscount = require("../../service/serviceManager/distributeDiscount");
|
|
34
|
-
var getGroupTotalPrice = (items) => {
|
|
35
|
-
return items.reduce((prev, next) => {
|
|
36
|
-
prev.duration += next._extend.duration;
|
|
37
|
-
prev.total += next._extend.total;
|
|
38
|
-
prev.origin_total += next._extend.origin_total;
|
|
39
|
-
return prev;
|
|
40
|
-
}, { total: 0, origin_total: 0 });
|
|
41
|
-
};
|
|
42
|
-
var concatBookings = (items) => {
|
|
43
|
-
let firstItem = items[0];
|
|
44
|
-
let lastItem = items[items.length - 1];
|
|
45
|
-
let { total, duration, startDate, endDate, origin_total } = items.reduce((prev, next) => {
|
|
46
|
-
prev.duration += next._extend.duration;
|
|
47
|
-
prev.total += next._extend.total;
|
|
48
|
-
prev.origin_total += next._extend.origin_total;
|
|
49
|
-
return prev;
|
|
50
|
-
}, { price: 0, total: 0, origin_total: 0, duration: 0, startDate: firstItem._extend.startDate, endDate: lastItem._extend.endDate });
|
|
51
|
-
return {
|
|
52
|
-
...firstItem,
|
|
53
|
-
// 虚拟组, id使用组id
|
|
54
|
-
_id: firstItem._extend.groupId,
|
|
55
|
-
_extend: {
|
|
56
|
-
...firstItem._extend,
|
|
57
|
-
items,
|
|
58
|
-
duration,
|
|
59
|
-
// price: total,
|
|
60
|
-
total,
|
|
61
|
-
origin_total,
|
|
62
|
-
startDate,
|
|
63
|
-
endDate,
|
|
64
|
-
start_date: startDate,
|
|
65
|
-
end_date: endDate
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
var createBookingItemsByGroup = (item, isBatchEdit) => {
|
|
70
|
-
var _a;
|
|
71
|
-
const groupId = item._extend.groupId || (0, import_utils.getUniqueId)("bookingGroup_");
|
|
72
|
-
let bookings = [];
|
|
73
|
-
for (let i = 0; i < item._extend.duration; i++) {
|
|
74
|
-
const _extend = { ...item._extend };
|
|
75
|
-
const startDate = _extend.start_date.add(i, "day");
|
|
76
|
-
const endDate = _extend.start_date.add(i + 1, "day");
|
|
77
|
-
const price = ((_a = _extend.multiDayPrices[startDate.format("YYYY-MM-DD")]) == null ? void 0 : _a.total) || item._extend.price;
|
|
78
|
-
const cacheItem = {
|
|
79
|
-
...item,
|
|
80
|
-
// 编辑时组商品需要清空booking_id 否则会重复
|
|
81
|
-
booking_id: isBatchEdit ? 0 : item.booking_id,
|
|
82
|
-
_id: `${item._id}-${i + 1}`,
|
|
83
|
-
price,
|
|
84
|
-
_extend: {
|
|
85
|
-
..._extend,
|
|
86
|
-
order_detail_id: isBatchEdit ? 0 : item.order_detail_id,
|
|
87
|
-
groupId,
|
|
88
|
-
duration: 1,
|
|
89
|
-
price,
|
|
90
|
-
startDate,
|
|
91
|
-
endDate,
|
|
92
|
-
start_date: startDate,
|
|
93
|
-
end_date: endDate,
|
|
94
|
-
dateKey: `${startDate.format("YYYY-MM-DD")}~${endDate.format("YYYY-MM-DD")}}`
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const totalPrice = (0, import_utils2.getProductTotalPrice)(cacheItem);
|
|
98
|
-
cacheItem._extend.total = totalPrice;
|
|
99
|
-
cacheItem._extend.origin_total = totalPrice;
|
|
100
|
-
cacheItem._extend.items = void 0;
|
|
101
|
-
bookings.push(cacheItem);
|
|
102
|
-
}
|
|
103
|
-
if (isBatchEdit) {
|
|
104
|
-
const groupTotalPrice = item._extend.total;
|
|
105
|
-
const groupOriginTotalPrice = item._extend.origin_total;
|
|
106
|
-
const discountAmount = (groupOriginTotalPrice - groupTotalPrice) * -1;
|
|
107
|
-
if (discountAmount !== 0) {
|
|
108
|
-
bookings = (0, import_distributeDiscount.distributeDiscountOrIncrease)(bookings, discountAmount, groupOriginTotalPrice);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
console.log("bookings", bookings);
|
|
112
|
-
return bookings;
|
|
113
|
-
};
|
|
114
|
-
var isGroupBooking = (_id) => {
|
|
115
|
-
return (_id == null ? void 0 : _id.indexOf("bookingGroup_")) === 0;
|
|
116
|
-
};
|
|
117
|
-
var getProductByGroupId = (groupId, items) => {
|
|
118
|
-
return items.filter((item) => {
|
|
119
|
-
var _a;
|
|
120
|
-
return ((_a = item._extend) == null ? void 0 : _a.groupId) === groupId;
|
|
121
|
-
}).map((item) => item._id);
|
|
122
|
-
};
|
|
123
|
-
var getGroupBooking = (groupId, items) => {
|
|
124
|
-
let products = getProductByGroupId(groupId, items);
|
|
125
|
-
return concatBookings(products);
|
|
126
|
-
};
|
|
127
|
-
var filterItemByGroupId = (groupId, items) => {
|
|
128
|
-
return items.filter((item) => {
|
|
129
|
-
var _a;
|
|
130
|
-
return ((_a = item._extend) == null ? void 0 : _a.groupId) !== groupId;
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
-
0 && (module.exports = {
|
|
135
|
-
concatBookings,
|
|
136
|
-
createBookingItemsByGroup,
|
|
137
|
-
filterItemByGroupId,
|
|
138
|
-
getGroupBooking,
|
|
139
|
-
getGroupTotalPrice,
|
|
140
|
-
getProductByGroupId,
|
|
141
|
-
isGroupBooking
|
|
142
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/components/booking/info/service2/Lists.tsx
|
|
30
|
-
var Lists_exports = {};
|
|
31
|
-
__export(Lists_exports, {
|
|
32
|
-
default: () => Lists_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Lists_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_Provider = require("../../../shoppingCart/Provider");
|
|
37
|
-
var import_shoppingCart = __toESM(require("../../../shoppingCart"));
|
|
38
|
-
var import_model = require("../model");
|
|
39
|
-
var import_utils = require("./utils");
|
|
40
|
-
var import_useSelectPet = __toESM(require("./hooks/useSelectPet"));
|
|
41
|
-
var import_status = require("./status");
|
|
42
|
-
var Lists = ({ onEdit, onChange }) => {
|
|
43
|
-
var _a;
|
|
44
|
-
const { state } = (0, import_react.useContext)(import_model.Context);
|
|
45
|
-
const [params, setParams] = (0, import_react.useState)(import_status.defaultData);
|
|
46
|
-
const { holderLists } = (0, import_useSelectPet.default)(state);
|
|
47
|
-
(0, import_react.useEffect)(() => {
|
|
48
|
-
const keys = (0, import_utils.formatActiveKey)(
|
|
49
|
-
holderLists,
|
|
50
|
-
params == null ? void 0 : params.platform,
|
|
51
|
-
!!state.bookingId
|
|
52
|
-
);
|
|
53
|
-
onChange({ activeCartId: keys }, "setActiveCartId");
|
|
54
|
-
setParams({
|
|
55
|
-
...params,
|
|
56
|
-
activeKey: keys
|
|
57
|
-
});
|
|
58
|
-
}, [holderLists, params == null ? void 0 : params.platform]);
|
|
59
|
-
const handleChange = (currentItem, type, other) => {
|
|
60
|
-
if (state.disabledEdit || state.disableEventBookingEdit) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
let products = (0, import_utils.updateServices)(state, currentItem, type, other);
|
|
64
|
-
if (type === "view") {
|
|
65
|
-
let product = currentItem._origin;
|
|
66
|
-
onChange({ editModal: true, cacheItem: { ...product, new: 0 } });
|
|
67
|
-
return onEdit == null ? void 0 : onEdit({ ...product, new: 0 });
|
|
68
|
-
}
|
|
69
|
-
const params2 = {
|
|
70
|
-
editModal: false,
|
|
71
|
-
value: products,
|
|
72
|
-
edit: true,
|
|
73
|
-
cacheItem: null
|
|
74
|
-
};
|
|
75
|
-
onChange(params2);
|
|
76
|
-
};
|
|
77
|
-
const handleActiveKey = (key) => {
|
|
78
|
-
onChange({ activeCartId: key }, "setActiveCartId");
|
|
79
|
-
setParams({
|
|
80
|
-
...params,
|
|
81
|
-
activeKey: key
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const CollapseParams = (0, import_react.useMemo)(() => {
|
|
85
|
-
const _params = {
|
|
86
|
-
activeKey: params == null ? void 0 : params.activeKey,
|
|
87
|
-
bordered: false
|
|
88
|
-
};
|
|
89
|
-
return _params;
|
|
90
|
-
}, [params == null ? void 0 : params.activeKey]);
|
|
91
|
-
const productParams = (0, import_react.useMemo)(() => {
|
|
92
|
-
return {
|
|
93
|
-
hideAddBtn: state.isTerminalDayBookingPage,
|
|
94
|
-
isShowNote: false,
|
|
95
|
-
isShowPackageNote: false,
|
|
96
|
-
holders: holderLists,
|
|
97
|
-
isEdit: !!(state == null ? void 0 : state.bookingId),
|
|
98
|
-
disabledEdit: state == null ? void 0 : state.disabledEdit
|
|
99
|
-
};
|
|
100
|
-
}, [holderLists, state == null ? void 0 : state.bookingId]);
|
|
101
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
-
import_shoppingCart.default,
|
|
103
|
-
{
|
|
104
|
-
onChange: handleChange,
|
|
105
|
-
onAddProduct: () => onChange({ addModal: true }),
|
|
106
|
-
onActiveKey: handleActiveKey,
|
|
107
|
-
collapseParams: CollapseParams,
|
|
108
|
-
productParams: {
|
|
109
|
-
...productParams,
|
|
110
|
-
products: (0, import_utils.formatProducts)((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value, state)
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
));
|
|
114
|
-
};
|
|
115
|
-
var Lists_default = Lists;
|
|
@@ -1,50 +0,0 @@
|
|
|
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/service2/hooks/useSelectPet.tsx
|
|
20
|
-
var useSelectPet_exports = {};
|
|
21
|
-
__export(useSelectPet_exports, {
|
|
22
|
-
default: () => useSelectPet_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(useSelectPet_exports);
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
var import_utils = require("../utils");
|
|
27
|
-
var useSelectPet = (state) => {
|
|
28
|
-
var _a;
|
|
29
|
-
const petLists = (0, import_react.useMemo)(() => {
|
|
30
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
31
|
-
const form_id = ((_d = (_c = (_b = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
|
|
32
|
-
return ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
|
|
33
|
-
}, [(_a = state == null ? void 0 : state.pet) == null ? void 0 : _a.value]);
|
|
34
|
-
const holderLists = (0, import_react.useMemo)(() => {
|
|
35
|
-
const _lists = (0, import_utils.formatHolderLists)(petLists);
|
|
36
|
-
return _lists;
|
|
37
|
-
}, [petLists]);
|
|
38
|
-
const getHolderName = (id) => {
|
|
39
|
-
if (!holderLists.length)
|
|
40
|
-
return "";
|
|
41
|
-
const resource = holderLists.find((d) => d.id === id);
|
|
42
|
-
return resource == null ? void 0 : resource.main_field;
|
|
43
|
-
};
|
|
44
|
-
return {
|
|
45
|
-
petLists,
|
|
46
|
-
holderLists,
|
|
47
|
-
getHolderName
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
var useSelectPet_default = useSelectPet;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/components/booking/info/service2/index.tsx
|
|
30
|
-
var service2_exports = {};
|
|
31
|
-
__export(service2_exports, {
|
|
32
|
-
Service2Cart: () => Service2Cart,
|
|
33
|
-
Service2Context: () => Service2Context
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(service2_exports);
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_addService = __toESM(require("../service/addService"));
|
|
38
|
-
var import_editService = __toESM(require("../service/editService"));
|
|
39
|
-
var import_model = require("../model");
|
|
40
|
-
var import_Lists = __toESM(require("./Lists"));
|
|
41
|
-
var Service2Context = (0, import_react.createContext)({});
|
|
42
|
-
var Service2Cart = ({
|
|
43
|
-
hideAdd,
|
|
44
|
-
hideEdit
|
|
45
|
-
}) => {
|
|
46
|
-
const detailRef = (0, import_react.useRef)();
|
|
47
|
-
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
48
|
-
(0, import_react.useEffect)(() => {
|
|
49
|
-
document.body.id = "body";
|
|
50
|
-
}, []);
|
|
51
|
-
const dispatchService = (type, payload) => {
|
|
52
|
-
dispatch({
|
|
53
|
-
type,
|
|
54
|
-
payload: { ...payload }
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
const handleEdit = (cacheItem) => {
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
var _a, _b;
|
|
60
|
-
(_b = (_a = detailRef.current) == null ? void 0 : _a.init) == null ? void 0 : _b.call(_a, cacheItem);
|
|
61
|
-
}, 100);
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
-
import_Lists.default,
|
|
65
|
-
{
|
|
66
|
-
onEdit: handleEdit,
|
|
67
|
-
onChange: (e, type) => dispatchService(type || "setService", e)
|
|
68
|
-
}
|
|
69
|
-
), !hideAdd && /* @__PURE__ */ import_react.default.createElement(import_addService.default, { onEdit: handleEdit })), !hideEdit && /* @__PURE__ */ import_react.default.createElement(import_editService.default, { ref: detailRef }));
|
|
70
|
-
};
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
Service2Cart,
|
|
74
|
-
Service2Context
|
|
75
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { shoppingCartProps } from '../../../shoppingCart/type';
|
|
2
|
-
export declare const defaultData: shoppingCartProps;
|
|
3
|
-
/**
|
|
4
|
-
* @title: 根据是否是跨日预约和是否是terminal打开的,返回日期和输入框占据的列数
|
|
5
|
-
* @description:
|
|
6
|
-
* @param {boolean} isDayBooking
|
|
7
|
-
* @param {boolean} isTerminal
|
|
8
|
-
* @return {*}
|
|
9
|
-
* @Author: WangHan
|
|
10
|
-
* @Date: 2024-12-06 10:29
|
|
11
|
-
*/
|
|
12
|
-
export declare const inputDateCol: (isDayBooking: boolean, isTerminal?: boolean) => {
|
|
13
|
-
date: {};
|
|
14
|
-
input: {};
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @title: 预约商品扩展类型
|
|
18
|
-
* @description:
|
|
19
|
-
* @return {*}
|
|
20
|
-
* @Author: WangHan
|
|
21
|
-
* @Date: 2024-12-06 14:59
|
|
22
|
-
*/
|
|
23
|
-
export declare const appointmentTypes: string[];
|
|
24
|
-
/**
|
|
25
|
-
* @title: 营业日时间
|
|
26
|
-
* @description:
|
|
27
|
-
* @return {*}
|
|
28
|
-
* @Author: WangHan
|
|
29
|
-
* @Date: 2024-12-06 17:23
|
|
30
|
-
*/
|
|
31
|
-
export declare const openingTime: () => string;
|