@pisell/private-materials 6.2.25 → 6.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +143 -159
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/customiseItemModal/index.js +5 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.js +37 -27
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/constants.d.ts +1 -0
- package/es/components/booking/info/service/editService/constants.js +3 -0
- package/es/components/booking/info/service/editService/index.js +15 -10
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +29 -21
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +6 -3
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
- package/es/components/booking/info2/service/editService/index.js +265 -170
- package/es/components/booking/info2/service/index.js +22 -19
- package/es/components/booking/info2/utilsByBooking.js +2 -1
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +77 -51
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Cart/index.less +14 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +4 -3
- package/es/components/ticketBooking/components/timeBar/index.js +77 -73
- package/es/components/ticketBooking/index.less +1 -1
- package/es/components/ticketBooking/utils/index.js +13 -8
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/pro/pisellNumberSelector/index.less +1 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/customiseItemModal/index.js +7 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.js +36 -24
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
- package/lib/components/booking/info/service/editService/constants.js +31 -0
- package/lib/components/booking/info/service/editService/index.js +7 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +26 -17
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
- package/lib/components/booking/info2/service/editService/index.js +138 -74
- package/lib/components/booking/info2/service/index.js +14 -10
- package/lib/components/booking/info2/utilsByBooking.js +2 -1
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +58 -31
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Cart/index.less +14 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
- package/lib/components/ticketBooking/index.less +1 -1
- package/lib/components/ticketBooking/utils/index.js +4 -4
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/pro/pisellNumberSelector/index.less +1 -1
- package/package.json +4 -4
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
22
|
+
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
25
25
|
};
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
175
175
|
type: EActionTypes;
|
176
176
|
payload: {
|
177
|
-
status: "
|
177
|
+
status: "success" | "warn" | "loading" | "fail" | "question";
|
178
178
|
};
|
179
179
|
};
|
180
180
|
/**
|
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
295
295
|
name?: string | undefined;
|
296
296
|
symbol?: string | undefined;
|
297
297
|
amount?: string | number | undefined;
|
298
|
-
mode?: "
|
298
|
+
mode?: "query" | "pay" | "fullPay" | "refund" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
|
-
eftpos?: "
|
301
|
-
action?: "amount" | "
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
301
|
+
action?: "amount" | "deviceList" | "pay" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
304
304
|
title?: string | undefined;
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
308
308
|
net?: boolean | undefined;
|
309
309
|
component?: string | undefined;
|
310
310
|
form?: string | undefined;
|
311
|
-
status?: "
|
311
|
+
status?: "success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
312
312
|
warn?: string | undefined;
|
313
313
|
steps?: {
|
314
314
|
/** 用于重置当前步骤 */
|
@@ -33,11 +33,13 @@ __export(Product_exports, {
|
|
33
33
|
});
|
34
34
|
module.exports = __toCommonJS(Product_exports);
|
35
35
|
var import_react = __toESM(require("react"));
|
36
|
-
var
|
36
|
+
var import_productCard = __toESM(require("../../../../../../materials/src/components/productCard"));
|
37
37
|
var import_useClearCart = __toESM(require("../../hooks/useClearCart"));
|
38
38
|
var import_useContext = require("../../hooks/useContext");
|
39
39
|
var import_useAddService = __toESM(require("../../hooks/useAddService"));
|
40
40
|
var import_utils = require("../../../booking/info/service2/utils");
|
41
|
+
var import_pisellNumberSelector = __toESM(require("../../../../pro/pisellNumberSelector"));
|
42
|
+
var import_ahooks = require("ahooks");
|
41
43
|
var Product = (props) => {
|
42
44
|
const { id, lists, isAdd = true } = props;
|
43
45
|
const { state, onAction, onChange } = (0, import_useContext.useContext)();
|
@@ -56,10 +58,10 @@ var Product = (props) => {
|
|
56
58
|
productCardStyleConfig = {}
|
57
59
|
} = state;
|
58
60
|
const clearCart = (0, import_useClearCart.default)(id);
|
59
|
-
const handleChange = (item, type, other) => {
|
61
|
+
const handleChange = (0, import_ahooks.useMemoizedFn)((item, type, other) => {
|
60
62
|
if (disabledEdit && !(other == null ? void 0 : other.disabled)) return;
|
61
63
|
onChange(item, type, other);
|
62
|
-
};
|
64
|
+
});
|
63
65
|
const productParams = (0, import_react.useMemo)(() => {
|
64
66
|
return {
|
65
67
|
isShowNote,
|
@@ -83,39 +85,64 @@ var Product = (props) => {
|
|
83
85
|
isShowChangeHolder,
|
84
86
|
isShowEditProduct
|
85
87
|
]);
|
86
|
-
const getProductCardStyleProps = (type) => {
|
88
|
+
const getProductCardStyleProps = (0, import_ahooks.useMemoizedFn)((type) => {
|
87
89
|
const conf = productCardStyleConfig[`${type}_product_card_style`];
|
88
90
|
return {
|
89
91
|
isShowImage: conf == null ? void 0 : conf.show_product_image,
|
90
92
|
isShowDelete: conf == null ? void 0 : conf.show_remove_button
|
91
93
|
};
|
92
|
-
};
|
93
|
-
return
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
isRetail
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
Comp,
|
102
|
-
{
|
103
|
-
type: isRetail ? "a2" : void 0,
|
104
|
-
key: item._id,
|
105
|
-
dataSource: item,
|
106
|
-
onAction: (e) => onAction == null ? void 0 : onAction(e),
|
107
|
-
onDelete: (e) => handleChange(e, "delete", item),
|
108
|
-
onNote: (e) => handleChange(e, "note", { note: e.note }),
|
109
|
-
onLike: (e) => handleChange(e, "like", { like_status: e.like_status }),
|
110
|
-
onEditProduct: (e) => handleChange == null ? void 0 : handleChange(e, "edit_product"),
|
111
|
-
onCard: (e) => handleChange == null ? void 0 : handleChange(e, "view"),
|
112
|
-
onChangeResource: (e) => handleChange(item, "change_resource", e),
|
113
|
-
onChangeHolder: (e) => handleChange(item, "change_holder", e),
|
114
|
-
onAddHolder: (e) => handleChange(item, "add_holder", e),
|
115
|
-
...productParams,
|
116
|
-
...getProductCardStyleProps(isRetail ? "retail" : "appointment")
|
94
|
+
});
|
95
|
+
return (0, import_react.useMemo)(() => {
|
96
|
+
console.log("render cart");
|
97
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__shopping-cart-content" }, clearCart, lists == null ? void 0 : lists.map((item) => {
|
98
|
+
let Comp = import_productCard.default;
|
99
|
+
let isRetail;
|
100
|
+
if (state.scenario === "booking2") {
|
101
|
+
isRetail = (0, import_utils.isNormalProductByDurationSchedule)(item == null ? void 0 : item._origin);
|
102
|
+
Comp = isRetail ? import_productCard.default.V2 : import_productCard.default;
|
117
103
|
}
|
118
|
-
|
119
|
-
|
104
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
105
|
+
Comp,
|
106
|
+
{
|
107
|
+
type: isRetail ? "a2" : void 0,
|
108
|
+
rightActions: [
|
109
|
+
{
|
110
|
+
key: "update_number",
|
111
|
+
text: /* @__PURE__ */ import_react.default.createElement(
|
112
|
+
import_pisellNumberSelector.default,
|
113
|
+
{
|
114
|
+
enablePriceAdjust: true,
|
115
|
+
min: 1,
|
116
|
+
className: "pisell-sku-card__pisell-number-setter",
|
117
|
+
value: item == null ? void 0 : item.num,
|
118
|
+
onChange: (value) => {
|
119
|
+
if (value < 1) {
|
120
|
+
handleChange(item, "num", { num: 1 });
|
121
|
+
} else {
|
122
|
+
handleChange(item, "num", { num: value });
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
),
|
127
|
+
color: "#667085"
|
128
|
+
}
|
129
|
+
],
|
130
|
+
key: item._id,
|
131
|
+
dataSource: item,
|
132
|
+
onAction: (e) => onAction == null ? void 0 : onAction(e),
|
133
|
+
onDelete: (e) => handleChange(e, "delete", item),
|
134
|
+
onNote: (e) => handleChange(e, "note", { note: e.note }),
|
135
|
+
onLike: (e) => handleChange(e, "like", { like_status: e.like_status }),
|
136
|
+
onEditProduct: (e) => handleChange == null ? void 0 : handleChange(e, "edit_product"),
|
137
|
+
onCard: (e) => handleChange == null ? void 0 : handleChange(e, "view"),
|
138
|
+
onChangeResource: (e) => handleChange(item, "change_resource", e),
|
139
|
+
onChangeHolder: (e) => handleChange(item, "change_holder", e),
|
140
|
+
onAddHolder: (e) => handleChange(item, "add_holder", e),
|
141
|
+
...productParams,
|
142
|
+
...getProductCardStyleProps(isRetail ? "retail" : "appointment")
|
143
|
+
}
|
144
|
+
);
|
145
|
+
}), !hideAddBtn && platform !== "h5" && isAdd ? (0, import_useAddService.default)(id, "more") : null);
|
146
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
120
147
|
};
|
121
148
|
var Product_default = Product;
|
@@ -66,20 +66,23 @@ var Cart = () => {
|
|
66
66
|
};
|
67
67
|
});
|
68
68
|
}, [carts, platform]);
|
69
|
-
return
|
70
|
-
|
71
|
-
{
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
69
|
+
return (0, import_react.useMemo)(() => {
|
70
|
+
console.log("render cart 22222");
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__shopping-cart") }, isProductList ? /* @__PURE__ */ import_react.default.createElement(import_Product.default, { id: void 0, lists: state == null ? void 0 : state.products }) : /* @__PURE__ */ import_react.default.createElement(
|
72
|
+
import_materials.Collapse,
|
73
|
+
{
|
74
|
+
items: cartsMap,
|
75
|
+
showHeader: true,
|
76
|
+
panelBackground: "#ffffff",
|
77
|
+
collapsible: platform !== "shop" ? "disabled" : "-",
|
78
|
+
accordion: platform === "shop",
|
79
|
+
onChange: (key) => {
|
80
|
+
updateState({ activeKey: key });
|
81
|
+
onActiveKey(key);
|
82
|
+
},
|
83
|
+
...collapseParams
|
84
|
+
}
|
85
|
+
));
|
86
|
+
}, [isProductList, cartsMap, platform, collapseParams, state == null ? void 0 : state.products]);
|
84
87
|
};
|
85
88
|
var Cart_default = Cart;
|
@@ -66,3 +66,17 @@
|
|
66
66
|
// align-items: start;
|
67
67
|
//}
|
68
68
|
}
|
69
|
+
|
70
|
+
.pisell-sku-card__pisell-number-setter {
|
71
|
+
width: 110px;
|
72
|
+
|
73
|
+
.pisell-number-selector-btn {
|
74
|
+
flex-shrink: 0;
|
75
|
+
}
|
76
|
+
|
77
|
+
.pisell-number-selector-number {
|
78
|
+
min-width: unset !important;
|
79
|
+
padding: 0 !important;
|
80
|
+
flex: 1;
|
81
|
+
}
|
82
|
+
}
|
@@ -49,7 +49,7 @@ var import_dayjs = __toESM(require("dayjs"));
|
|
49
49
|
var import_pisellos = require("../../hooks/pisellos");
|
50
50
|
var import_utils7 = require("./utils");
|
51
51
|
var AddSerivce = (props) => {
|
52
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
53
53
|
const { onEdit, state, dispatch, renderMode = "current" } = props;
|
54
54
|
const context = (0, import_useEngineContext.default)();
|
55
55
|
const notAvailableRef = (0, import_react.useRef)(null);
|
@@ -137,10 +137,148 @@ var AddSerivce = (props) => {
|
|
137
137
|
const isEject = (0, import_utils2.getIsEject)(item, type);
|
138
138
|
const isOnlySession = (0, import_utils2.getIsOnlySession)(item);
|
139
139
|
let lock = false;
|
140
|
+
let cacheValues = null;
|
140
141
|
if (isEject) {
|
141
142
|
setCurrentProduct(item);
|
142
143
|
} else {
|
143
144
|
setCurrentProduct(null);
|
145
|
+
if (!isSession) {
|
146
|
+
cacheValues = {
|
147
|
+
bundle: [],
|
148
|
+
key: item.id,
|
149
|
+
option: [],
|
150
|
+
product_id: item.id,
|
151
|
+
product_variant_id: 0,
|
152
|
+
quantity: 1,
|
153
|
+
rowKey: item.id,
|
154
|
+
session: null,
|
155
|
+
unique: "08974625397"
|
156
|
+
};
|
157
|
+
}
|
158
|
+
}
|
159
|
+
const callback = async (e, extension_type, detail) => {
|
160
|
+
var _a3, _b2, _c2, _d2, _e2, _f2;
|
161
|
+
setCurrentProduct(null);
|
162
|
+
if (lock) {
|
163
|
+
return;
|
164
|
+
}
|
165
|
+
lock = true;
|
166
|
+
setTimeout(() => {
|
167
|
+
lock = false;
|
168
|
+
}, 2e3);
|
169
|
+
if (!isBooking4) {
|
170
|
+
const data = await createBookingData({
|
171
|
+
product: { ...detail || item, _params: e }
|
172
|
+
});
|
173
|
+
createBooking({ booking: data });
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
const _detail = detail || item;
|
177
|
+
const other = JSON.parse(JSON.stringify(e));
|
178
|
+
other.session = e.session;
|
179
|
+
let cacheItem = {
|
180
|
+
..._detail,
|
181
|
+
product_id: item.id,
|
182
|
+
_id: (0, import_utils.getUniqueId)(),
|
183
|
+
_key: e.key,
|
184
|
+
_extend: {
|
185
|
+
start_date: state.date.value,
|
186
|
+
quantity: (e == null ? void 0 : e.quantity) || 1,
|
187
|
+
price: _detail.price,
|
188
|
+
product_name: item.title,
|
189
|
+
other
|
190
|
+
},
|
191
|
+
new: 1
|
192
|
+
};
|
193
|
+
let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
|
194
|
+
cacheItem._extend.total = _total;
|
195
|
+
cacheItem._extend.origin_total = _total;
|
196
|
+
const _isEdit = !!state.service.cacheItem;
|
197
|
+
if (_isEdit) {
|
198
|
+
cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
|
199
|
+
cacheItem.new = 0;
|
200
|
+
}
|
201
|
+
if (renderMode === "current") {
|
202
|
+
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
203
|
+
}
|
204
|
+
cacheItem = (0, import_utils3.getProductExtend)({
|
205
|
+
cacheItem,
|
206
|
+
state,
|
207
|
+
isDisabledTime: true
|
208
|
+
});
|
209
|
+
if (state.renderType === "eventBooking") {
|
210
|
+
cacheItem.autoClose = false;
|
211
|
+
}
|
212
|
+
if (cacheItem.autoClose) {
|
213
|
+
cacheItem.autoClose = false;
|
214
|
+
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
215
|
+
let { list: _list, quantity } = (0, import_utils6.addService)(
|
216
|
+
[...state.service.value],
|
217
|
+
cacheItem,
|
218
|
+
state
|
219
|
+
);
|
220
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
221
|
+
(0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
|
222
|
+
try {
|
223
|
+
if (((_f2 = (_e2 = (_d2 = (_c2 = (_b2 = context.appHelper.utils.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c2.call(_b2)) == null ? void 0 : _d2.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
|
224
|
+
const val = _list == null ? void 0 : _list.map((s) => {
|
225
|
+
return {
|
226
|
+
product_id: s == null ? void 0 : s.product_id,
|
227
|
+
detailId: s == null ? void 0 : s.id,
|
228
|
+
detailProductId: s == null ? void 0 : s.product_id,
|
229
|
+
product_name: s == null ? void 0 : s.title,
|
230
|
+
price: s == null ? void 0 : s.price,
|
231
|
+
_id: s == null ? void 0 : s._id,
|
232
|
+
_key: s == null ? void 0 : s._key,
|
233
|
+
_serviceKey: s == null ? void 0 : s._serviceKey
|
234
|
+
};
|
235
|
+
});
|
236
|
+
const sendData = {
|
237
|
+
product_id: item == null ? void 0 : item.id,
|
238
|
+
detailId: _detail == null ? void 0 : _detail.id,
|
239
|
+
detailProductId: _detail == null ? void 0 : _detail.product_id,
|
240
|
+
product_name: item == null ? void 0 : item.title,
|
241
|
+
price: _detail == null ? void 0 : _detail.price,
|
242
|
+
serviceVal: val
|
243
|
+
};
|
244
|
+
(0, import_utils.sendWarningLog)({
|
245
|
+
title: "addService",
|
246
|
+
content: [
|
247
|
+
{ key: "添加数据", value: JSON.stringify(sendData) },
|
248
|
+
{
|
249
|
+
key: "日期",
|
250
|
+
value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
251
|
+
}
|
252
|
+
]
|
253
|
+
});
|
254
|
+
}
|
255
|
+
} catch (error) {
|
256
|
+
}
|
257
|
+
dispatch({
|
258
|
+
type: "setService",
|
259
|
+
payload: {
|
260
|
+
addModal: false,
|
261
|
+
value: _list,
|
262
|
+
edit: true,
|
263
|
+
changeService: false
|
264
|
+
}
|
265
|
+
});
|
266
|
+
} else {
|
267
|
+
dispatch({
|
268
|
+
type: "setService",
|
269
|
+
payload: {
|
270
|
+
editModal: true,
|
271
|
+
cacheItem,
|
272
|
+
addModal: !cacheItem.autoClose,
|
273
|
+
changeService: false
|
274
|
+
}
|
275
|
+
});
|
276
|
+
onEdit == null ? void 0 : onEdit(cacheItem);
|
277
|
+
}
|
278
|
+
};
|
279
|
+
if (cacheValues) {
|
280
|
+
callback(cacheValues, "", item);
|
281
|
+
return;
|
144
282
|
}
|
145
283
|
state.action({
|
146
284
|
type: "pisell1.handleOpenProductModal",
|
@@ -162,126 +300,7 @@ var AddSerivce = (props) => {
|
|
162
300
|
onCancel: () => {
|
163
301
|
setCurrentProduct(null);
|
164
302
|
},
|
165
|
-
callback
|
166
|
-
var _a3, _b2, _c2, _d2, _e2, _f2;
|
167
|
-
setCurrentProduct(null);
|
168
|
-
if (lock) {
|
169
|
-
return;
|
170
|
-
}
|
171
|
-
lock = true;
|
172
|
-
setTimeout(() => {
|
173
|
-
lock = false;
|
174
|
-
}, 2e3);
|
175
|
-
if (!isBooking4) {
|
176
|
-
const data = await createBookingData({
|
177
|
-
product: { ...detail || item, _params: e }
|
178
|
-
});
|
179
|
-
createBooking({ booking: data });
|
180
|
-
return;
|
181
|
-
}
|
182
|
-
const _detail = detail || item;
|
183
|
-
const other = JSON.parse(JSON.stringify(e));
|
184
|
-
other.session = e.session;
|
185
|
-
let cacheItem = {
|
186
|
-
..._detail,
|
187
|
-
product_id: item.id,
|
188
|
-
_id: (0, import_utils.getUniqueId)(),
|
189
|
-
_key: e.key,
|
190
|
-
_extend: {
|
191
|
-
start_date: state.date.value,
|
192
|
-
quantity: (e == null ? void 0 : e.quantity) || 1,
|
193
|
-
price: _detail.price,
|
194
|
-
product_name: item.title,
|
195
|
-
other
|
196
|
-
},
|
197
|
-
new: 1
|
198
|
-
};
|
199
|
-
let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
|
200
|
-
cacheItem._extend.total = _total;
|
201
|
-
cacheItem._extend.origin_total = _total;
|
202
|
-
const _isEdit = !!state.service.cacheItem;
|
203
|
-
if (_isEdit) {
|
204
|
-
cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
|
205
|
-
cacheItem.new = 0;
|
206
|
-
}
|
207
|
-
if (renderMode === "current") {
|
208
|
-
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
209
|
-
}
|
210
|
-
cacheItem = (0, import_utils3.getProductExtend)({
|
211
|
-
cacheItem,
|
212
|
-
state,
|
213
|
-
isDisabledTime: true
|
214
|
-
});
|
215
|
-
if (state.renderType === "eventBooking") {
|
216
|
-
cacheItem.autoClose = false;
|
217
|
-
}
|
218
|
-
if (cacheItem.autoClose) {
|
219
|
-
cacheItem.autoClose = false;
|
220
|
-
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
221
|
-
let { list: _list, quantity } = (0, import_utils6.addService)(
|
222
|
-
[...state.service.value],
|
223
|
-
cacheItem,
|
224
|
-
state
|
225
|
-
);
|
226
|
-
handleAddToast(cacheItem.title, quantity || 1);
|
227
|
-
(0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
|
228
|
-
try {
|
229
|
-
if (((_f2 = (_e2 = (_d2 = (_c2 = (_b2 = context.appHelper.utils.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c2.call(_b2)) == null ? void 0 : _d2.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
|
230
|
-
const val = _list == null ? void 0 : _list.map((s) => {
|
231
|
-
return {
|
232
|
-
product_id: s == null ? void 0 : s.product_id,
|
233
|
-
detailId: s == null ? void 0 : s.id,
|
234
|
-
detailProductId: s == null ? void 0 : s.product_id,
|
235
|
-
product_name: s == null ? void 0 : s.title,
|
236
|
-
price: s == null ? void 0 : s.price,
|
237
|
-
_id: s == null ? void 0 : s._id,
|
238
|
-
_key: s == null ? void 0 : s._key,
|
239
|
-
_serviceKey: s == null ? void 0 : s._serviceKey
|
240
|
-
};
|
241
|
-
});
|
242
|
-
const sendData = {
|
243
|
-
product_id: item == null ? void 0 : item.id,
|
244
|
-
detailId: _detail == null ? void 0 : _detail.id,
|
245
|
-
detailProductId: _detail == null ? void 0 : _detail.product_id,
|
246
|
-
product_name: item == null ? void 0 : item.title,
|
247
|
-
price: _detail == null ? void 0 : _detail.price,
|
248
|
-
serviceVal: val
|
249
|
-
};
|
250
|
-
(0, import_utils.sendWarningLog)({
|
251
|
-
title: "addService",
|
252
|
-
content: [
|
253
|
-
{ key: "添加数据", value: JSON.stringify(sendData) },
|
254
|
-
{
|
255
|
-
key: "日期",
|
256
|
-
value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
257
|
-
}
|
258
|
-
]
|
259
|
-
});
|
260
|
-
}
|
261
|
-
} catch (error) {
|
262
|
-
}
|
263
|
-
dispatch({
|
264
|
-
type: "setService",
|
265
|
-
payload: {
|
266
|
-
addModal: false,
|
267
|
-
value: _list,
|
268
|
-
edit: true,
|
269
|
-
changeService: false
|
270
|
-
}
|
271
|
-
});
|
272
|
-
} else {
|
273
|
-
dispatch({
|
274
|
-
type: "setService",
|
275
|
-
payload: {
|
276
|
-
editModal: true,
|
277
|
-
cacheItem,
|
278
|
-
addModal: !cacheItem.autoClose,
|
279
|
-
changeService: false
|
280
|
-
}
|
281
|
-
});
|
282
|
-
onEdit == null ? void 0 : onEdit(cacheItem);
|
283
|
-
}
|
284
|
-
}
|
303
|
+
callback
|
285
304
|
});
|
286
305
|
}
|
287
306
|
);
|
@@ -338,7 +357,6 @@ var AddSerivce = (props) => {
|
|
338
357
|
}
|
339
358
|
return null;
|
340
359
|
}, [
|
341
|
-
(_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m.autoClose,
|
342
360
|
state.service.addModal,
|
343
361
|
import_utils.locales,
|
344
362
|
renderList,
|
@@ -123,7 +123,8 @@ var isVariant = (item) => {
|
|
123
123
|
return (item == null ? void 0 : item.variant_group_count) > 0 && (item == null ? void 0 : item.option_group_count) === 0;
|
124
124
|
};
|
125
125
|
var isOption = (item) => {
|
126
|
-
|
126
|
+
var _a;
|
127
|
+
return (item == null ? void 0 : item.option_group_count) > 0 || ((_a = item == null ? void 0 : item.option_group) == null ? void 0 : _a.length) > 0;
|
127
128
|
};
|
128
129
|
var isBundle = (item) => {
|
129
130
|
return (item == null ? void 0 : item.bundle_group_count) > 0;
|