@pisell/private-materials 3.0.203 → 3.0.205
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 +5 -5
- 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 -1064
- 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 -678
- 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,678 +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/utils.ts
|
|
30
|
-
var utils_exports = {};
|
|
31
|
-
__export(utils_exports, {
|
|
32
|
-
disabledDate: () => disabledDate,
|
|
33
|
-
formItems: () => formItems,
|
|
34
|
-
formatActiveKey: () => formatActiveKey,
|
|
35
|
-
formatDateTime: () => formatDateTime,
|
|
36
|
-
formatDayDate: () => formatDayDate,
|
|
37
|
-
formatDayTime: () => formatDayTime,
|
|
38
|
-
formatHolderLists: () => formatHolderLists,
|
|
39
|
-
formatProducts: () => formatProducts,
|
|
40
|
-
getAppointmentService: () => getAppointmentService,
|
|
41
|
-
getDayProducts: () => getDayProducts,
|
|
42
|
-
getErrorMessage: () => getErrorMessage,
|
|
43
|
-
getPets: () => getPets,
|
|
44
|
-
getResourceItem: () => getResourceItem,
|
|
45
|
-
holderId: () => holderId,
|
|
46
|
-
initDate: () => initDate,
|
|
47
|
-
isBookingProduct: () => isBookingProduct,
|
|
48
|
-
isDayBooking: () => isDayBooking,
|
|
49
|
-
isDayBookingProduct: () => isDayBookingProduct,
|
|
50
|
-
isHasDayAppointmentProduct: () => isHasDayAppointmentProduct,
|
|
51
|
-
isOpenDeletePet: () => isOpenDeletePet,
|
|
52
|
-
isTerminalDayBooking: () => isTerminalDayBooking,
|
|
53
|
-
updateAppointmentServicePrice: () => updateAppointmentServicePrice,
|
|
54
|
-
updateNormalBundlePrice: () => updateNormalBundlePrice,
|
|
55
|
-
updateServicePrice: () => updateServicePrice,
|
|
56
|
-
updateServices: () => updateServices
|
|
57
|
-
});
|
|
58
|
-
module.exports = __toCommonJS(utils_exports);
|
|
59
|
-
var import_mock = require("../../mock");
|
|
60
|
-
var import_utils = require("../../utils");
|
|
61
|
-
var import_utils2 = require("@pisell/utils");
|
|
62
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
63
|
-
var import_status = require("./status");
|
|
64
|
-
var import_serve = require("../service/serve");
|
|
65
|
-
var import_locales = __toESM(require("../../locales"));
|
|
66
|
-
var import_utils3 = require("./Group/utils");
|
|
67
|
-
import_utils2.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
68
|
-
var formatActiveKey = (lists, platform, isEdit) => {
|
|
69
|
-
var _a;
|
|
70
|
-
if (!(lists == null ? void 0 : lists.length))
|
|
71
|
-
return [];
|
|
72
|
-
if (lists.length === 1 && isEdit) {
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
if (platform === "shop") {
|
|
76
|
-
return [(_a = lists[lists.length - 1]) == null ? void 0 : _a.key];
|
|
77
|
-
}
|
|
78
|
-
return lists == null ? void 0 : lists.map((cart) => cart == null ? void 0 : cart.key);
|
|
79
|
-
};
|
|
80
|
-
var getResourceItem = (id, state) => {
|
|
81
|
-
var _a;
|
|
82
|
-
if (id === 0) {
|
|
83
|
-
return (0, import_mock.getNoResource)();
|
|
84
|
-
}
|
|
85
|
-
return (_a = state.service.resources) == null ? void 0 : _a.find((d) => d.form_record_id === id);
|
|
86
|
-
};
|
|
87
|
-
var errorTypes = {
|
|
88
|
-
product: import_utils2.locales.getText("pisell2.text.status.service-error-1"),
|
|
89
|
-
time: import_utils2.locales.getText("pisell2.text.status.service-error-2"),
|
|
90
|
-
maxLimit: import_utils2.locales.getText("pisell2.text.status.service-error-3"),
|
|
91
|
-
limit: import_utils2.locales.getText("pisell2.text.status.service-error-3")
|
|
92
|
-
};
|
|
93
|
-
var getErrorMessage = (service, resourceItem, isDay) => {
|
|
94
|
-
const errorList = (0, import_utils.getErrorList)(resourceItem, service, isDay);
|
|
95
|
-
let errorMessage = "";
|
|
96
|
-
if (!service.id) {
|
|
97
|
-
return errorList[0].label;
|
|
98
|
-
}
|
|
99
|
-
if (errorList.length) {
|
|
100
|
-
if (errorList.length > 1) {
|
|
101
|
-
errorMessage = `${errorList.length} ${import_utils2.locales.getText(
|
|
102
|
-
"pisell2.text.warnings"
|
|
103
|
-
)}`;
|
|
104
|
-
} else {
|
|
105
|
-
errorMessage = (resourceItem == null ? void 0 : resourceItem.labelText) + " " + errorTypes[errorList[0].type];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return errorMessage;
|
|
109
|
-
};
|
|
110
|
-
var formatHolderLists = (lists) => {
|
|
111
|
-
const isOpenGroup = true;
|
|
112
|
-
const _lists = lists == null ? void 0 : lists.map((item) => {
|
|
113
|
-
return {
|
|
114
|
-
...item,
|
|
115
|
-
id: (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id),
|
|
116
|
-
key: (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id),
|
|
117
|
-
label: import_utils2.locales.getText("pisell2.text.cart.of")(item == null ? void 0 : item.main_field)
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
if (isOpenGroup) {
|
|
121
|
-
const defaults = [
|
|
122
|
-
{
|
|
123
|
-
key: 0,
|
|
124
|
-
id: 0,
|
|
125
|
-
label: import_utils2.locales.getText("pisell2.text.open.items"),
|
|
126
|
-
main_field: import_utils2.locales.getText("pisell2.text.open.items")
|
|
127
|
-
}
|
|
128
|
-
];
|
|
129
|
-
return defaults.concat(_lists);
|
|
130
|
-
}
|
|
131
|
-
return _lists;
|
|
132
|
-
};
|
|
133
|
-
var getHolderLists = (state) => {
|
|
134
|
-
var _a, _b, _c, _d, _e, _f;
|
|
135
|
-
const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
|
|
136
|
-
const petLists = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
|
|
137
|
-
const _lists = formatHolderLists(petLists);
|
|
138
|
-
return _lists;
|
|
139
|
-
};
|
|
140
|
-
var getHolderName = (state, id) => {
|
|
141
|
-
const holderLists = getHolderLists(state);
|
|
142
|
-
if (!holderLists.length || !id)
|
|
143
|
-
return "";
|
|
144
|
-
const resource = holderLists.find((d) => (d == null ? void 0 : d.id) === id);
|
|
145
|
-
return resource == null ? void 0 : resource.main_field;
|
|
146
|
-
};
|
|
147
|
-
var isBookingProduct = (extension_type) => {
|
|
148
|
-
return import_status.appointmentTypes.includes(extension_type);
|
|
149
|
-
};
|
|
150
|
-
var isDayBookingProduct = (item, state) => {
|
|
151
|
-
return isBookingProduct(item == null ? void 0 : item.extension_type) && isDayBooking(state);
|
|
152
|
-
};
|
|
153
|
-
var updateServices = (state, currentItem, type, other) => {
|
|
154
|
-
var _a;
|
|
155
|
-
let products = ((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value) || [];
|
|
156
|
-
const isGroup = (0, import_utils3.isGroupBooking)(currentItem._id);
|
|
157
|
-
if (type === "delete") {
|
|
158
|
-
let deleteIds = [];
|
|
159
|
-
if (isGroup) {
|
|
160
|
-
debugger;
|
|
161
|
-
deleteIds = (0, import_utils3.getProductByGroupId)(currentItem._id, products);
|
|
162
|
-
} else {
|
|
163
|
-
deleteIds = [currentItem._id];
|
|
164
|
-
}
|
|
165
|
-
products = products == null ? void 0 : products.filter((item) => !deleteIds.includes(item == null ? void 0 : item._id));
|
|
166
|
-
}
|
|
167
|
-
if (type === "delete_holders") {
|
|
168
|
-
products = products == null ? void 0 : products.filter((item) => {
|
|
169
|
-
var _a2;
|
|
170
|
-
return ((_a2 = item == null ? void 0 : item._extend) == null ? void 0 : _a2.holder_id) !== other;
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
if (type === "update_holders") {
|
|
174
|
-
products = products == null ? void 0 : products.map((item) => {
|
|
175
|
-
var _a2;
|
|
176
|
-
const ids = currentItem.map((d) => d._id);
|
|
177
|
-
if (ids == null ? void 0 : ids.includes(item == null ? void 0 : item._id)) {
|
|
178
|
-
let _extend = item._extend || {};
|
|
179
|
-
if (Array.isArray(other)) {
|
|
180
|
-
_extend.holder_id = (_a2 = other.find((other2) => (other2 == null ? void 0 : other2._id) === (item == null ? void 0 : item._id))) == null ? void 0 : _a2.holder_id;
|
|
181
|
-
} else {
|
|
182
|
-
_extend.holder_id = other;
|
|
183
|
-
}
|
|
184
|
-
return item;
|
|
185
|
-
}
|
|
186
|
-
return item;
|
|
187
|
-
});
|
|
188
|
-
} else {
|
|
189
|
-
products = products == null ? void 0 : products.map((item) => {
|
|
190
|
-
let updateIds = [];
|
|
191
|
-
if (isGroup) {
|
|
192
|
-
updateIds = (0, import_utils3.getProductByGroupId)(currentItem._id, products);
|
|
193
|
-
} else {
|
|
194
|
-
updateIds = [currentItem._id];
|
|
195
|
-
}
|
|
196
|
-
if (updateIds.includes(item._id)) {
|
|
197
|
-
if (type === "like") {
|
|
198
|
-
let _extend = item._extend || {};
|
|
199
|
-
_extend.like_status = other == null ? void 0 : other.like_status;
|
|
200
|
-
} else {
|
|
201
|
-
item = {
|
|
202
|
-
...item,
|
|
203
|
-
...other
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
return item;
|
|
207
|
-
}
|
|
208
|
-
return item;
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
return products;
|
|
212
|
-
};
|
|
213
|
-
var formatBundle = (bundle) => {
|
|
214
|
-
if (!(bundle == null ? void 0 : bundle.length))
|
|
215
|
-
return [];
|
|
216
|
-
return bundle.map((item) => {
|
|
217
|
-
return {
|
|
218
|
-
id: item == null ? void 0 : item.id,
|
|
219
|
-
title: item == null ? void 0 : item.title,
|
|
220
|
-
num: item == null ? void 0 : item.num,
|
|
221
|
-
price: item == null ? void 0 : item.price,
|
|
222
|
-
total: item == null ? void 0 : item.price,
|
|
223
|
-
price_type: item == null ? void 0 : item.price_type,
|
|
224
|
-
bundle_sum_price: item == null ? void 0 : item.bundle_sum_price,
|
|
225
|
-
bundle_sum_type: item == null ? void 0 : item.bundle_sum_type,
|
|
226
|
-
options: formatOptions(item == null ? void 0 : item.option)
|
|
227
|
-
};
|
|
228
|
-
});
|
|
229
|
-
};
|
|
230
|
-
var formatOptions = (options) => {
|
|
231
|
-
if (!(options == null ? void 0 : options.length))
|
|
232
|
-
return [];
|
|
233
|
-
return options.map((item) => {
|
|
234
|
-
return {
|
|
235
|
-
id: item == null ? void 0 : item.id,
|
|
236
|
-
name: item == null ? void 0 : item.name,
|
|
237
|
-
num: item == null ? void 0 : item.num,
|
|
238
|
-
price: item == null ? void 0 : item.price,
|
|
239
|
-
total: item == null ? void 0 : item.price,
|
|
240
|
-
origin_total: item == null ? void 0 : item.original_price
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
};
|
|
244
|
-
var formItems = (items) => {
|
|
245
|
-
return items.map((d) => {
|
|
246
|
-
return {
|
|
247
|
-
...d,
|
|
248
|
-
start_date: d._extend.start_date,
|
|
249
|
-
end_date: d._extend.end_date,
|
|
250
|
-
num: d == null ? void 0 : d._extend.quantity,
|
|
251
|
-
total: d._extend.total,
|
|
252
|
-
origin_total: d._extend.origin_total
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
var formatProducts = (lists, state, isRenderGroup = true) => {
|
|
257
|
-
if (!(lists == null ? void 0 : lists.length))
|
|
258
|
-
return [];
|
|
259
|
-
console.log(lists, "wh9879");
|
|
260
|
-
const normalList = [];
|
|
261
|
-
const groupList = [];
|
|
262
|
-
const formItem = (item) => {
|
|
263
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
264
|
-
const _isDayBookingProduct = isDayBookingProduct(item, state);
|
|
265
|
-
const clientTitle = getHolderName(state, (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.holder_id);
|
|
266
|
-
const options = formatOptions((_c = (_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.other) == null ? void 0 : _c.option);
|
|
267
|
-
const bundle = formatBundle((_e = (_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle);
|
|
268
|
-
const isNormalProduct = !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type);
|
|
269
|
-
let resourceItem = {};
|
|
270
|
-
let errorMessage = "";
|
|
271
|
-
if (_isDayBookingProduct) {
|
|
272
|
-
resourceItem = getResourceItem((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.resource, state);
|
|
273
|
-
errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
|
|
274
|
-
}
|
|
275
|
-
return {
|
|
276
|
-
id: item == null ? void 0 : item.id,
|
|
277
|
-
_id: item == null ? void 0 : item._id,
|
|
278
|
-
name: item == null ? void 0 : item.title,
|
|
279
|
-
price: (_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.price,
|
|
280
|
-
total: (_h = item == null ? void 0 : item._extend) == null ? void 0 : _h.total,
|
|
281
|
-
origin_total: (_i = item == null ? void 0 : item._extend) == null ? void 0 : _i.origin_total,
|
|
282
|
-
num: item == null ? void 0 : item._extend.quantity,
|
|
283
|
-
image: item == null ? void 0 : item.cover,
|
|
284
|
-
isShowNote: true,
|
|
285
|
-
note: item == null ? void 0 : item.note,
|
|
286
|
-
like_status: (_j = item == null ? void 0 : item._extend) == null ? void 0 : _j.like_status,
|
|
287
|
-
bundle,
|
|
288
|
-
options,
|
|
289
|
-
errorMessage,
|
|
290
|
-
product_option_string: (_l = (_k = item == null ? void 0 : item._extend) == null ? void 0 : _k.other) == null ? void 0 : _l.product_option_string,
|
|
291
|
-
discount_reason: (_m = item == null ? void 0 : item._extend) == null ? void 0 : _m.discount_reason,
|
|
292
|
-
resource_id: isNormalProduct ? 0 : (_n = item == null ? void 0 : item._extend) == null ? void 0 : _n.resource,
|
|
293
|
-
relation_form_name: isNormalProduct ? "" : (resourceItem == null ? void 0 : resourceItem.labelText) || item.relation_form_name,
|
|
294
|
-
holder_title: clientTitle,
|
|
295
|
-
start_date: !isNormalProduct ? (_o = item == null ? void 0 : item._extend) == null ? void 0 : _o.start_date : "",
|
|
296
|
-
end_date: !isNormalProduct ? (_p = item == null ? void 0 : item._extend) == null ? void 0 : _p.end_date : "",
|
|
297
|
-
holder_id: ((_q = item == null ? void 0 : item._extend) == null ? void 0 : _q.holder_id) || 0,
|
|
298
|
-
isNormalProduct,
|
|
299
|
-
locale: state.locale,
|
|
300
|
-
symbol: state.amountSymbol,
|
|
301
|
-
items: formItems(((_r = item == null ? void 0 : item._extend) == null ? void 0 : _r.items) || []),
|
|
302
|
-
_origin: item
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
lists.forEach((item) => {
|
|
306
|
-
var _a;
|
|
307
|
-
if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
|
|
308
|
-
normalList.push(formItem(item));
|
|
309
|
-
} else {
|
|
310
|
-
groupList.push(item);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
let groups = groupList.reduce((prev, item) => {
|
|
314
|
-
var _a;
|
|
315
|
-
const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
|
|
316
|
-
if (!prev[groupId]) {
|
|
317
|
-
prev[groupId] = [];
|
|
318
|
-
}
|
|
319
|
-
prev[groupId].push(item);
|
|
320
|
-
return prev;
|
|
321
|
-
}, {});
|
|
322
|
-
if (isRenderGroup) {
|
|
323
|
-
return Object.values(groups).map((d) => formItem((0, import_utils3.concatBookings)(d))).concat(normalList);
|
|
324
|
-
} else {
|
|
325
|
-
return lists == null ? void 0 : lists.map((item) => formItem(item));
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
var disabledDate = (current, position, currentDate) => {
|
|
329
|
-
if (!(0, import_dayjs.default)(currentDate).isValid())
|
|
330
|
-
return;
|
|
331
|
-
if (position === "start") {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
if (position === "end" && current.endOf("day") && currentDate) {
|
|
335
|
-
const endDisabled = currentDate.add(8, "months").format("YYYY-MM-DD");
|
|
336
|
-
return (0, import_dayjs.default)(endDisabled) < current.startOf("day") || current.startOf("day") <= currentDate;
|
|
337
|
-
}
|
|
338
|
-
return current && current <= currentDate;
|
|
339
|
-
};
|
|
340
|
-
var isDayBooking = (state) => {
|
|
341
|
-
return (state == null ? void 0 : state.renderType) === "dayBooking";
|
|
342
|
-
};
|
|
343
|
-
var isTerminalDayBooking = (state) => {
|
|
344
|
-
return state.isTerminalDayBookingPage;
|
|
345
|
-
};
|
|
346
|
-
var formatDayDate = (_extend) => {
|
|
347
|
-
let startDate = (0, import_dayjs.default)(_extend == null ? void 0 : _extend.start_date).startOf("day");
|
|
348
|
-
let endDate = (0, import_dayjs.default)(_extend == null ? void 0 : _extend.end_date).startOf("day");
|
|
349
|
-
return {
|
|
350
|
-
..._extend,
|
|
351
|
-
start_date: startDate,
|
|
352
|
-
end_date: endDate
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
var formatDayTime = ({ startDate, endDate }) => {
|
|
356
|
-
const shopOpeningTime = localStorage.getItem("shopOpeningHours") || "00:00";
|
|
357
|
-
let start_date = (0, import_dayjs.default)(startDate).format("YYYY-MM-DD");
|
|
358
|
-
let end_date = (0, import_dayjs.default)(endDate).format("YYYY-MM-DD");
|
|
359
|
-
const result = {
|
|
360
|
-
startDateTime: (0, import_dayjs.default)(`${start_date}T${shopOpeningTime}:00`),
|
|
361
|
-
// 结束日期根据营业日时间减去一分钟
|
|
362
|
-
endDateTime: (0, import_dayjs.default)(`${end_date}T${shopOpeningTime}:00`).subtract(1, "minute")
|
|
363
|
-
};
|
|
364
|
-
return result;
|
|
365
|
-
};
|
|
366
|
-
var formatDateTime = (start_date, end_date) => {
|
|
367
|
-
const _openingTime = (0, import_status.openingTime)();
|
|
368
|
-
const startDate = `${start_date} ${_openingTime}`;
|
|
369
|
-
let endDate = `${end_date} ${_openingTime}`;
|
|
370
|
-
const date = {
|
|
371
|
-
value: (0, import_dayjs.default)(startDate),
|
|
372
|
-
end_date: (0, import_dayjs.default)(endDate).subtract(1, "minute")
|
|
373
|
-
};
|
|
374
|
-
return date;
|
|
375
|
-
};
|
|
376
|
-
var initDate = () => {
|
|
377
|
-
const startDate = (0, import_dayjs.default)().format("YYYY-MM-DD");
|
|
378
|
-
let endDate = (0, import_dayjs.default)().add(1, "days").format("YYYY-MM-DD");
|
|
379
|
-
const date = formatDateTime(startDate, endDate);
|
|
380
|
-
return date;
|
|
381
|
-
};
|
|
382
|
-
var isHasDayAppointmentProduct = (state) => {
|
|
383
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
384
|
-
const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
|
|
385
|
-
const services = ((_e = state.service) == null ? void 0 : _e.value) || [];
|
|
386
|
-
const pets = ((_g = (_f = state.pet) == null ? void 0 : _f.value) == null ? void 0 : _g[form_id]) || [];
|
|
387
|
-
const appointmentServices = services.filter((d) => import_status.appointmentTypes.includes(d.extension_type));
|
|
388
|
-
if (!appointmentServices.length)
|
|
389
|
-
return true;
|
|
390
|
-
let _pets = pets == null ? void 0 : pets.map((d) => {
|
|
391
|
-
const holderProducts = services.filter((d2) => {
|
|
392
|
-
var _a2;
|
|
393
|
-
return ((_a2 = d2._extend) == null ? void 0 : _a2.holder_id) == d2.form_record_id;
|
|
394
|
-
});
|
|
395
|
-
return {
|
|
396
|
-
...d,
|
|
397
|
-
// 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
|
|
398
|
-
// services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
|
|
399
|
-
services: services.filter((item) => {
|
|
400
|
-
var _a2;
|
|
401
|
-
return ((_a2 = item._extend) == null ? void 0 : _a2.holder_id) == d.form_record_id && import_status.appointmentTypes.includes(item.extension_type);
|
|
402
|
-
})
|
|
403
|
-
};
|
|
404
|
-
});
|
|
405
|
-
_pets = _pets.filter((d) => !d.services.length);
|
|
406
|
-
return _pets.length > 0;
|
|
407
|
-
};
|
|
408
|
-
var getDayProducts = (holderId2, lists, isTerminal) => {
|
|
409
|
-
let _lists = lists || [];
|
|
410
|
-
if (!holderId2 && !isTerminal) {
|
|
411
|
-
_lists = _lists.filter((item) => !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type));
|
|
412
|
-
} else {
|
|
413
|
-
_lists = _lists.filter((item) => {
|
|
414
|
-
var _a;
|
|
415
|
-
return !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) || import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) && ((_a = item.duration) == null ? void 0 : _a.type) === "days";
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
return _lists;
|
|
419
|
-
};
|
|
420
|
-
var getPets = (state) => {
|
|
421
|
-
var _a, _b, _c, _d, _e, _f;
|
|
422
|
-
const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
|
|
423
|
-
const pets = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
|
|
424
|
-
return pets;
|
|
425
|
-
};
|
|
426
|
-
var getAppointmentService = (state) => {
|
|
427
|
-
var _a;
|
|
428
|
-
const services = ((_a = state.service) == null ? void 0 : _a.value) || [];
|
|
429
|
-
let lists = services.filter((item) => import_status.appointmentTypes.includes(item.extension_type));
|
|
430
|
-
return lists;
|
|
431
|
-
};
|
|
432
|
-
var isOpenDeletePet = (state, newVal) => {
|
|
433
|
-
var _a, _b, _c, _d, _e, _f;
|
|
434
|
-
const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
|
|
435
|
-
const oldPets = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
|
|
436
|
-
const newPets = (newVal == null ? void 0 : newVal[form_id]) || [];
|
|
437
|
-
const deletePets = oldPets.filter((item) => !newPets.some((newItem) => newItem.form_record_id === item.form_record_id));
|
|
438
|
-
const servicePets = deletePets.map((item) => {
|
|
439
|
-
var _a2, _b2;
|
|
440
|
-
return {
|
|
441
|
-
...item,
|
|
442
|
-
services: (_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.filter((d) => {
|
|
443
|
-
var _a3;
|
|
444
|
-
return ((_a3 = d._extend) == null ? void 0 : _a3.holder_id) == item.form_record_id;
|
|
445
|
-
})
|
|
446
|
-
};
|
|
447
|
-
});
|
|
448
|
-
const lists = servicePets.filter((item) => {
|
|
449
|
-
var _a2;
|
|
450
|
-
return ((_a2 = item.services) == null ? void 0 : _a2.length) > 0;
|
|
451
|
-
});
|
|
452
|
-
return {
|
|
453
|
-
ids: lists.map((item) => item.form_record_id),
|
|
454
|
-
lists
|
|
455
|
-
};
|
|
456
|
-
};
|
|
457
|
-
var holderId = (state) => {
|
|
458
|
-
var _a;
|
|
459
|
-
return Number(((_a = state == null ? void 0 : state.activeCartId) == null ? void 0 : _a[0]) || 0);
|
|
460
|
-
};
|
|
461
|
-
function calculateTotalPrice(data) {
|
|
462
|
-
const _price = data == null ? void 0 : data.reduce(
|
|
463
|
-
(total, item) => total + ((item == null ? void 0 : item.price) || (item == null ? void 0 : item.add_price)) * item.num,
|
|
464
|
-
0
|
|
465
|
-
);
|
|
466
|
-
return parseFloat(_price);
|
|
467
|
-
}
|
|
468
|
-
function updateSinglePrice(currentValue, single) {
|
|
469
|
-
const _single = [];
|
|
470
|
-
for (let index = 0; index < currentValue.length; index++) {
|
|
471
|
-
const item = currentValue[index];
|
|
472
|
-
const currentIndex = single.findIndex(
|
|
473
|
-
(_single2) => _single2.id === item.id
|
|
474
|
-
);
|
|
475
|
-
if (currentIndex !== -1) {
|
|
476
|
-
item.add_price = single[currentIndex].add_price;
|
|
477
|
-
item.name = single[currentIndex].name;
|
|
478
|
-
_single.push(item);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
return _single;
|
|
482
|
-
}
|
|
483
|
-
function updateBundlePrice(currentValue, [bundle, single]) {
|
|
484
|
-
var _a;
|
|
485
|
-
const _bundle = [];
|
|
486
|
-
for (let index = 0; index < currentValue.length; index++) {
|
|
487
|
-
const item = currentValue[index];
|
|
488
|
-
const currentIndex = bundle.findIndex(
|
|
489
|
-
(_bundle2) => _bundle2.id === item.id
|
|
490
|
-
);
|
|
491
|
-
if (currentIndex !== -1 && bundle[currentIndex]) {
|
|
492
|
-
item.title = bundle[currentIndex].title;
|
|
493
|
-
item.price_type = bundle[currentIndex].price_type;
|
|
494
|
-
item._price = bundle[currentIndex].price;
|
|
495
|
-
const bundle_sum_price = parseFloat(
|
|
496
|
-
bundle[currentIndex].price_type === "markdown" ? bundle[currentIndex].price * -1 : bundle[currentIndex].price
|
|
497
|
-
).toFixed(2);
|
|
498
|
-
item.price = bundle_sum_price;
|
|
499
|
-
item.bundle_sum_price = bundle_sum_price;
|
|
500
|
-
if ((_a = item == null ? void 0 : item.option) == null ? void 0 : _a.length) {
|
|
501
|
-
const _option = JSON.parse(JSON.stringify(item.option));
|
|
502
|
-
item.option = updateSinglePrice(_option, single);
|
|
503
|
-
let optionPrice = 0;
|
|
504
|
-
optionPrice = calculateTotalPrice(item.option);
|
|
505
|
-
const bundle_sum_price2 = (parseFloat(
|
|
506
|
-
bundle[currentIndex].price_type === "markdown" ? bundle[currentIndex].price * -1 : bundle[currentIndex].price
|
|
507
|
-
) + optionPrice).toFixed(2);
|
|
508
|
-
item.price = bundle_sum_price2;
|
|
509
|
-
item.bundle_sum_price = bundle_sum_price2;
|
|
510
|
-
}
|
|
511
|
-
_bundle.push(item);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
return _bundle;
|
|
515
|
-
}
|
|
516
|
-
function flatData(newPackageData) {
|
|
517
|
-
var _a, _b, _c;
|
|
518
|
-
let bundle = [];
|
|
519
|
-
let single = [];
|
|
520
|
-
for (const group of newPackageData) {
|
|
521
|
-
if ((_a = group == null ? void 0 : group.bundle_item) == null ? void 0 : _a.length) {
|
|
522
|
-
for (const item of group.bundle_item) {
|
|
523
|
-
bundle.push(item);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
for (const bundleItem of bundle) {
|
|
528
|
-
if ((_b = bundleItem == null ? void 0 : bundleItem.option_group) == null ? void 0 : _b.length) {
|
|
529
|
-
for (const group of bundleItem.option_group) {
|
|
530
|
-
if ((_c = group == null ? void 0 : group.option_item) == null ? void 0 : _c.length) {
|
|
531
|
-
for (const item of group.option_item) {
|
|
532
|
-
single.push(item);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
return [bundle, single];
|
|
539
|
-
}
|
|
540
|
-
function updateNormalBundlePrice(currentValue, newBundleData) {
|
|
541
|
-
const _currentValue = JSON.parse(JSON.stringify(currentValue));
|
|
542
|
-
const _flatData = flatData(newBundleData);
|
|
543
|
-
const newValue = updateBundlePrice(_currentValue, _flatData);
|
|
544
|
-
return newValue;
|
|
545
|
-
}
|
|
546
|
-
var normalServicePrice = async (ids, state) => {
|
|
547
|
-
var _a, _b, _c, _d;
|
|
548
|
-
const services = ((_a = state.service) == null ? void 0 : _a.value) || [];
|
|
549
|
-
const customerId = ((_c = (_b = state == null ? void 0 : state.client) == null ? void 0 : _b.value) == null ? void 0 : _c.id) || 0;
|
|
550
|
-
let data = await state.apis.getServices({
|
|
551
|
-
skip: 1,
|
|
552
|
-
num: 500,
|
|
553
|
-
ids,
|
|
554
|
-
customer_id: customerId,
|
|
555
|
-
open_quotation: 1,
|
|
556
|
-
open_bundle: 1,
|
|
557
|
-
with: ["bundleGroup.bundleItem", "optionGroup.optionItem"],
|
|
558
|
-
_config: { abort: true }
|
|
559
|
-
});
|
|
560
|
-
if (!((_d = data == null ? void 0 : data.list) == null ? void 0 : _d.length))
|
|
561
|
-
return;
|
|
562
|
-
const _lists = services.map((item) => {
|
|
563
|
-
var _a2, _b2, _c2, _d2;
|
|
564
|
-
let obj = { ...item };
|
|
565
|
-
if (!import_status.appointmentTypes.includes(obj.extension_type)) {
|
|
566
|
-
const product = data.list.find((p) => p.id === (item == null ? void 0 : item.product_id));
|
|
567
|
-
let _extend = (obj == null ? void 0 : obj._extend) || {};
|
|
568
|
-
const other = (_extend == null ? void 0 : _extend.other) || {};
|
|
569
|
-
if (product) {
|
|
570
|
-
if (((_a2 = product == null ? void 0 : product.variant) == null ? void 0 : _a2.length) && (other == null ? void 0 : other.product_variant_id)) {
|
|
571
|
-
const _variant = (_b2 = product == null ? void 0 : product.variant) == null ? void 0 : _b2.find((v) => v.id === (other == null ? void 0 : other.product_variant_id));
|
|
572
|
-
obj._extend.price = Number(_variant == null ? void 0 : _variant.price);
|
|
573
|
-
obj._extend.other.price = Number(_variant == null ? void 0 : _variant.price);
|
|
574
|
-
} else {
|
|
575
|
-
obj._extend.price = Number(product == null ? void 0 : product.price);
|
|
576
|
-
}
|
|
577
|
-
if (((_c2 = other == null ? void 0 : other.bundle) == null ? void 0 : _c2.length) && ((_d2 = product == null ? void 0 : product.bundle_group) == null ? void 0 : _d2.length)) {
|
|
578
|
-
let _bundle = updateNormalBundlePrice(other.bundle, product == null ? void 0 : product.bundle_group);
|
|
579
|
-
obj._extend.other = {
|
|
580
|
-
...other,
|
|
581
|
-
bundle: _bundle
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
obj._extend.total = (0, import_utils.getProductTotalPrice)(obj);
|
|
585
|
-
obj._extend.origin_total = (0, import_utils.getProductTotalPrice)(obj);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
return obj;
|
|
589
|
-
});
|
|
590
|
-
return _lists;
|
|
591
|
-
};
|
|
592
|
-
var updateAppointmentServicePrice = async (state, { start_date, end_date, product_id }) => {
|
|
593
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
594
|
-
const defaultReturn = {
|
|
595
|
-
multiDayPrices: [],
|
|
596
|
-
price: Number((_c = (_b = (_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem) == null ? void 0 : _b._extend) == null ? void 0 : _c.price) || 0
|
|
597
|
-
};
|
|
598
|
-
try {
|
|
599
|
-
const format = "YYYY-MM-DD";
|
|
600
|
-
const customer_id = ((_e = (_d = state == null ? void 0 : state.client) == null ? void 0 : _d.value) == null ? void 0 : _e.id) || 1;
|
|
601
|
-
const _product_id = product_id || ((_f = state.service.cacheItem) == null ? void 0 : _f.product_id) || 0;
|
|
602
|
-
let multi_day_price = null;
|
|
603
|
-
if (!product_id) {
|
|
604
|
-
console.log("updateAppointmentServicePrice", product_id);
|
|
605
|
-
return defaultReturn;
|
|
606
|
-
}
|
|
607
|
-
const startDate = (0, import_dayjs.default)(start_date).format(format);
|
|
608
|
-
const endDate = (0, import_dayjs.default)(end_date).subtract(1, "days").format(format);
|
|
609
|
-
const params = {
|
|
610
|
-
customer_id,
|
|
611
|
-
multi_day: { start: startDate, end: endDate }
|
|
612
|
-
};
|
|
613
|
-
const res = await (0, import_serve.postMultiDay)(_product_id, params);
|
|
614
|
-
const _prices = ((_g = res == null ? void 0 : res.data) == null ? void 0 : _g.multi_day_price) || [];
|
|
615
|
-
multi_day_price = _prices == null ? void 0 : _prices.map((p) => {
|
|
616
|
-
var _a2, _b2;
|
|
617
|
-
const startDate2 = (0, import_dayjs.default)((_a2 = p == null ? void 0 : p.multi_day) == null ? void 0 : _a2.start);
|
|
618
|
-
const endDate2 = (0, import_dayjs.default)((_b2 = p == null ? void 0 : p.multi_day) == null ? void 0 : _b2.end).add(1, "day");
|
|
619
|
-
let duration = (endDate2 == null ? void 0 : endDate2.diff(startDate2, "day")) || 1;
|
|
620
|
-
return {
|
|
621
|
-
total: Number(p == null ? void 0 : p.price),
|
|
622
|
-
origin_total: Number(p == null ? void 0 : p.price),
|
|
623
|
-
num: duration,
|
|
624
|
-
quotation_id: (p == null ? void 0 : p.quotation_id) || 0,
|
|
625
|
-
start_date: startDate2 == null ? void 0 : startDate2.format(format),
|
|
626
|
-
end_date: endDate2 == null ? void 0 : endDate2.format(format)
|
|
627
|
-
};
|
|
628
|
-
});
|
|
629
|
-
return {
|
|
630
|
-
multiDayPrices: multi_day_price,
|
|
631
|
-
price: Number((_h = res == null ? void 0 : res.data) == null ? void 0 : _h.price) || 0
|
|
632
|
-
};
|
|
633
|
-
} catch (error) {
|
|
634
|
-
console.log("updateAppointmentServicePrice", error);
|
|
635
|
-
}
|
|
636
|
-
return defaultReturn;
|
|
637
|
-
};
|
|
638
|
-
var updateServicePrice = (state) => {
|
|
639
|
-
var _a;
|
|
640
|
-
let services = ((_a = state.service) == null ? void 0 : _a.value) || [];
|
|
641
|
-
let normalServices = services == null ? void 0 : services.filter(
|
|
642
|
-
(item) => !import_status.appointmentTypes.includes(item.extension_type)
|
|
643
|
-
);
|
|
644
|
-
let newNormalIds = normalServices == null ? void 0 : normalServices.map((item) => (item == null ? void 0 : item.product_id) || (item == null ? void 0 : item.id));
|
|
645
|
-
newNormalIds = [...new Set(newNormalIds)];
|
|
646
|
-
if (newNormalIds == null ? void 0 : newNormalIds.length) {
|
|
647
|
-
return normalServicePrice(newNormalIds, state);
|
|
648
|
-
}
|
|
649
|
-
return [];
|
|
650
|
-
};
|
|
651
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
652
|
-
0 && (module.exports = {
|
|
653
|
-
disabledDate,
|
|
654
|
-
formItems,
|
|
655
|
-
formatActiveKey,
|
|
656
|
-
formatDateTime,
|
|
657
|
-
formatDayDate,
|
|
658
|
-
formatDayTime,
|
|
659
|
-
formatHolderLists,
|
|
660
|
-
formatProducts,
|
|
661
|
-
getAppointmentService,
|
|
662
|
-
getDayProducts,
|
|
663
|
-
getErrorMessage,
|
|
664
|
-
getPets,
|
|
665
|
-
getResourceItem,
|
|
666
|
-
holderId,
|
|
667
|
-
initDate,
|
|
668
|
-
isBookingProduct,
|
|
669
|
-
isDayBooking,
|
|
670
|
-
isDayBookingProduct,
|
|
671
|
-
isHasDayAppointmentProduct,
|
|
672
|
-
isOpenDeletePet,
|
|
673
|
-
isTerminalDayBooking,
|
|
674
|
-
updateAppointmentServicePrice,
|
|
675
|
-
updateNormalBundlePrice,
|
|
676
|
-
updateServicePrice,
|
|
677
|
-
updateServices
|
|
678
|
-
});
|