@pisell/private-materials 3.3.34 → 3.3.35
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/Sales/Cart/index.js +26 -13
- package/es/components/Sales/Cart/types.d.ts +12 -0
- package/es/components/Sales/Cart/utils.d.ts +23 -0
- package/es/components/Sales/Cart/utils.js +161 -0
- package/es/components/Sales/Checkout/utils.d.ts +9 -1
- package/es/components/Sales/Checkout/utils.js +25 -3
- package/es/components/Sales/Event/Detail.d.ts +2 -0
- package/es/components/Sales/Event/Detail.js +56 -13
- package/es/components/Sales/Event/serve.d.ts +10 -0
- package/es/components/Sales/Event/serve.js +26 -1
- package/es/components/Sales/Summary/utils.js +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +18 -17
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +21 -20
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +156 -53
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.js +17 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +26 -25
- package/es/components/appointmentBooking/components/Content/index.less +23 -1
- package/es/components/appointmentBooking/components/Footer/index.js +5 -5
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +7 -7
- package/es/components/appointmentBooking/components/Services/index.js +50 -25
- package/es/components/appointmentBooking/hooks.d.ts +2 -1
- package/es/components/appointmentBooking/hooks.js +52 -47
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- 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/booking/utils.js +19 -11
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +218 -73
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -4
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +70 -13
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.js +4 -2
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/Sales/Cart/index.js +30 -18
- package/lib/components/Sales/Cart/types.d.ts +12 -0
- package/lib/components/Sales/Cart/utils.d.ts +23 -0
- package/lib/components/Sales/Cart/utils.js +149 -0
- package/lib/components/Sales/Checkout/utils.d.ts +9 -1
- package/lib/components/Sales/Checkout/utils.js +18 -4
- package/lib/components/Sales/Event/Detail.d.ts +2 -0
- package/lib/components/Sales/Event/Detail.js +34 -10
- package/lib/components/Sales/Event/serve.d.ts +10 -0
- package/lib/components/Sales/Event/serve.js +5 -2
- package/lib/components/Sales/Summary/utils.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +3 -3
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +43 -6
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.js +37 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +7 -7
- package/lib/components/appointmentBooking/components/Content/index.less +23 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +5 -3
- package/lib/components/appointmentBooking/components/Services/index.js +18 -10
- package/lib/components/appointmentBooking/hooks.d.ts +2 -1
- package/lib/components/appointmentBooking/hooks.js +9 -3
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- 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/booking/utils.js +5 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +128 -42
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -2
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +79 -24
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.js +6 -2
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/package.json +4 -4
|
@@ -51,11 +51,15 @@ var EventDetailProvider = ({
|
|
|
51
51
|
const [currentBookingOption, setCurrentBookingOption] = (0, import_react.useState)(null);
|
|
52
52
|
const { selectEvent } = (0, import_index.useEvent)();
|
|
53
53
|
const customer = (0, import_useLoginUser.default)();
|
|
54
|
+
const currentBookingOptionRef = (0, import_react.useRef)(null);
|
|
54
55
|
const _setDetail = (detailData) => {
|
|
55
56
|
detailRef.current = { ...detailRef.current || {}, ...detailData || {} };
|
|
56
|
-
console.log(detailRef.current, "55555555");
|
|
57
57
|
setDetail({ ...detailRef.current });
|
|
58
58
|
};
|
|
59
|
+
const _setCurrentBookingOption = (id) => {
|
|
60
|
+
currentBookingOptionRef.current = id;
|
|
61
|
+
setCurrentBookingOption(id);
|
|
62
|
+
};
|
|
59
63
|
const onOpenEventDetail = (eventItem) => {
|
|
60
64
|
var _a;
|
|
61
65
|
setOpen(true);
|
|
@@ -73,7 +77,8 @@ var EventDetailProvider = ({
|
|
|
73
77
|
num: 100,
|
|
74
78
|
skip: 1,
|
|
75
79
|
customer_id: customer == null ? void 0 : customer.id,
|
|
76
|
-
open_quotation: 1
|
|
80
|
+
open_quotation: 1,
|
|
81
|
+
is_eject: 1
|
|
77
82
|
});
|
|
78
83
|
getEventDetailSelectDate.run(eventItem.id, {
|
|
79
84
|
days: 366
|
|
@@ -83,16 +88,19 @@ var EventDetailProvider = ({
|
|
|
83
88
|
setOpen(false);
|
|
84
89
|
_setDetail(null);
|
|
85
90
|
detailRef.current = null;
|
|
91
|
+
setCurrentBookingOption(null);
|
|
92
|
+
currentBookingOptionRef.current = null;
|
|
86
93
|
};
|
|
87
94
|
const onSelectEventDetail = () => {
|
|
88
|
-
var _a, _b;
|
|
95
|
+
var _a, _b, _c;
|
|
89
96
|
selectEvent({
|
|
90
97
|
...eventRef.current,
|
|
91
98
|
eventDetail: {
|
|
92
|
-
...
|
|
99
|
+
...detailRef.current || {},
|
|
93
100
|
bookingOptionItem: (_b = (_a = detail.bookingOptions) == null ? void 0 : _a.filter(
|
|
94
|
-
(v) => v.value ===
|
|
95
|
-
)) == null ? void 0 : _b[0]
|
|
101
|
+
(v) => v.value === currentBookingOptionRef.current
|
|
102
|
+
)) == null ? void 0 : _b[0],
|
|
103
|
+
productDetail: (_c = detailRef.current) == null ? void 0 : _c.productDetail
|
|
96
104
|
}
|
|
97
105
|
});
|
|
98
106
|
onCloseEventDetail();
|
|
@@ -178,7 +186,7 @@ var EventDetailProvider = ({
|
|
|
178
186
|
price: v.price,
|
|
179
187
|
_originData: v
|
|
180
188
|
};
|
|
181
|
-
if (!current || current.price > v.price) {
|
|
189
|
+
if (!current || Number((current == null ? void 0 : current.price) || 0) > Number(v.price || 0)) {
|
|
182
190
|
current = { ...option };
|
|
183
191
|
}
|
|
184
192
|
return option;
|
|
@@ -197,9 +205,23 @@ var EventDetailProvider = ({
|
|
|
197
205
|
...introduction,
|
|
198
206
|
price: option.price,
|
|
199
207
|
origin_price: option.original_price
|
|
200
|
-
}
|
|
208
|
+
},
|
|
209
|
+
selectedProduct: option
|
|
210
|
+
// 选中的活动关联的商品
|
|
201
211
|
});
|
|
202
|
-
|
|
212
|
+
_setCurrentBookingOption(id);
|
|
213
|
+
};
|
|
214
|
+
const selectEventDetailProductDetail = (productDetail) => {
|
|
215
|
+
_setDetail({ productDetail });
|
|
216
|
+
};
|
|
217
|
+
const checkBeforeSelectEventDetail = () => {
|
|
218
|
+
var _a;
|
|
219
|
+
const { selectedProduct, productDetail } = detailRef.current || {};
|
|
220
|
+
console.log("selectedProduct", selectedProduct, productDetail);
|
|
221
|
+
if (((_a = selectedProduct == null ? void 0 : selectedProduct._originData) == null ? void 0 : _a.is_eject) === 1 && !productDetail) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
return true;
|
|
203
225
|
};
|
|
204
226
|
const contextValue = {
|
|
205
227
|
detail,
|
|
@@ -209,7 +231,9 @@ var EventDetailProvider = ({
|
|
|
209
231
|
onSelectEventDetail,
|
|
210
232
|
selectEventDetailBookingOptions,
|
|
211
233
|
getEventDetailSelectDate,
|
|
212
|
-
currentBookingOption
|
|
234
|
+
currentBookingOption,
|
|
235
|
+
selectEventDetailProductDetail,
|
|
236
|
+
checkBeforeSelectEventDetail
|
|
213
237
|
};
|
|
214
238
|
return /* @__PURE__ */ import_react.default.createElement(EventDetailContext.Provider, { value: contextValue }, children);
|
|
215
239
|
};
|
|
@@ -22,8 +22,18 @@ export declare const getEventDetailBookingOptionsApi: (params: {
|
|
|
22
22
|
skip: number;
|
|
23
23
|
customer_id?: number;
|
|
24
24
|
open_quotation?: number;
|
|
25
|
+
is_eject?: number;
|
|
25
26
|
}) => Promise<any>;
|
|
26
27
|
export declare const getEventDetailSelectDateApi: (id: number | string, params: {
|
|
27
28
|
days: number;
|
|
28
29
|
start_date?: string;
|
|
29
30
|
}) => Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* 批量查询指定商品的最新价格
|
|
33
|
+
* @param params
|
|
34
|
+
*/
|
|
35
|
+
export declare const getProductPrice: (params: {
|
|
36
|
+
ids: number[];
|
|
37
|
+
customer_id: number;
|
|
38
|
+
schedule_date?: string;
|
|
39
|
+
}) => Promise<any>;
|
|
@@ -23,7 +23,8 @@ __export(serve_exports, {
|
|
|
23
23
|
getEventDetailIntroductionApi: () => getEventDetailIntroductionApi,
|
|
24
24
|
getEventDetailSelectDateApi: () => getEventDetailSelectDateApi,
|
|
25
25
|
getEventDetailTeacherApi: () => getEventDetailTeacherApi,
|
|
26
|
-
getEventListApi: () => getEventListApi
|
|
26
|
+
getEventListApi: () => getEventListApi,
|
|
27
|
+
getProductPrice: () => getProductPrice
|
|
27
28
|
});
|
|
28
29
|
module.exports = __toCommonJS(serve_exports);
|
|
29
30
|
var import_utils = require("../../../utils");
|
|
@@ -44,11 +45,13 @@ var getEventDetailSelectDateApi = (id, params) => {
|
|
|
44
45
|
useCache: true
|
|
45
46
|
});
|
|
46
47
|
};
|
|
48
|
+
var getProductPrice = async (params) => import_utils.request.getRequest().post(`/h5/product/query/price`, params);
|
|
47
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
50
|
0 && (module.exports = {
|
|
49
51
|
getEventDetailBookingOptionsApi,
|
|
50
52
|
getEventDetailIntroductionApi,
|
|
51
53
|
getEventDetailSelectDateApi,
|
|
52
54
|
getEventDetailTeacherApi,
|
|
53
|
-
getEventListApi
|
|
55
|
+
getEventListApi,
|
|
56
|
+
getProductPrice
|
|
54
57
|
});
|
|
@@ -51,6 +51,7 @@ var calculateTaxFee = (shopInfo, items) => {
|
|
|
51
51
|
return "0.00";
|
|
52
52
|
}
|
|
53
53
|
const { is_price_include_tax, tax_rate } = shopInfo || {};
|
|
54
|
+
console.log("shopInfo>>>", is_price_include_tax, tax_rate);
|
|
54
55
|
const totalTaxFee = items.reduce((sum, item) => {
|
|
55
56
|
const price = new import_decimal.default(item.price || 0);
|
|
56
57
|
const taxRate = new import_decimal.default(tax_rate || 0).div(100);
|
|
@@ -46,7 +46,6 @@ var ContinueButton = ({ onNext }) => {
|
|
|
46
46
|
const utils = context.appHelper.utils || {};
|
|
47
47
|
const { isLogin, openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
48
48
|
const { accountLists, getHolders, checkAccount } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
49
|
-
const shopDiscount = (0, import_hooks.useShopDiscount)();
|
|
50
49
|
const {
|
|
51
50
|
currentStep,
|
|
52
51
|
carts,
|
|
@@ -56,12 +55,13 @@ var ContinueButton = ({ onNext }) => {
|
|
|
56
55
|
setIsErrorHolder,
|
|
57
56
|
isLastStep
|
|
58
57
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
59
|
-
const { isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
58
|
+
const { isFormSubject, isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
60
59
|
const stepList = (0, import_react.useMemo)(() => {
|
|
61
60
|
var _a2, _b2, _c2;
|
|
62
61
|
return (_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList;
|
|
63
62
|
}, [(_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList]);
|
|
64
63
|
const handleCheckAccount = () => {
|
|
64
|
+
if (isDateSelectedFirst) return false;
|
|
65
65
|
const result = (0, import_utils2.checkHolder)({
|
|
66
66
|
isFormSubject,
|
|
67
67
|
checkAccount,
|
|
@@ -86,7 +86,7 @@ var ContinueButton = ({ onNext }) => {
|
|
|
86
86
|
};
|
|
87
87
|
const handleContinue = async () => {
|
|
88
88
|
try {
|
|
89
|
-
if ((currentStep == null ? void 0 : currentStep.index) + 2
|
|
89
|
+
if ((currentStep == null ? void 0 : currentStep.index) + 2 >= (stepList == null ? void 0 : stepList.length)) {
|
|
90
90
|
const loginOk = await handleLoginCheck();
|
|
91
91
|
if (!loginOk) return;
|
|
92
92
|
if (handleCheckAccount()) return;
|
|
@@ -59,7 +59,7 @@ var CartItem = ({ onNext }) => {
|
|
|
59
59
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
60
60
|
const { accountLists, getHolders, form_id, addAccount } = (0, import_hooks2.useAppointmentBookingAccount)();
|
|
61
61
|
const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
|
|
62
|
-
const { isFormSubject, bookingSubject } = (0, import_hooks2.useAppointmentBookingSetting)();
|
|
62
|
+
const { isFormSubject, bookingSubject, isRetailTemplate } = (0, import_hooks2.useAppointmentBookingSetting)();
|
|
63
63
|
const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
|
|
64
64
|
const utils = (0, import_hooks2.contextUtils)();
|
|
65
65
|
const { businessUtils } = utils;
|
|
@@ -39,6 +39,7 @@ var import_context = require("../../context");
|
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
40
|
var import_Item = __toESM(require("../Cart/Item"));
|
|
41
41
|
var import_utils2 = require("../../utils");
|
|
42
|
+
var import_utils3 = require("./utils");
|
|
42
43
|
var import_index = require("./index.less");
|
|
43
44
|
var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
44
45
|
var _a, _b;
|
|
@@ -46,12 +47,7 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
46
47
|
const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
|
|
47
48
|
const utils = (0, import_hooks.contextUtils)();
|
|
48
49
|
const { appointmentBooking, summary, isAgreeDepositPolicy, setLoading } = (0, import_context.useAppointmentBookingContext)();
|
|
49
|
-
const
|
|
50
|
-
const clearData = () => {
|
|
51
|
-
var _a2;
|
|
52
|
-
appointmentBooking.destroy();
|
|
53
|
-
(_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
|
|
54
|
-
};
|
|
50
|
+
const { isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
55
51
|
const goPaymentFinish = (order_id, amount) => {
|
|
56
52
|
var _a2;
|
|
57
53
|
const url = `/payment-finish/success?order_id=${order_id}&amount=${Number(
|
|
@@ -60,14 +56,55 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
60
56
|
(_a2 = utils == null ? void 0 : utils.history) == null ? void 0 : _a2.replace(url);
|
|
61
57
|
setLoading(false);
|
|
62
58
|
};
|
|
59
|
+
(0, import_react.useEffect)(() => {
|
|
60
|
+
if (isRetailTemplate) {
|
|
61
|
+
handleForm();
|
|
62
|
+
}
|
|
63
|
+
}, [isRetailTemplate]);
|
|
64
|
+
const handleForm = async (isSubmit) => {
|
|
65
|
+
var _a2;
|
|
66
|
+
const carts = await appointmentBooking.getCart();
|
|
67
|
+
const key = "isRetailFormSubmit";
|
|
68
|
+
const isRetailFormSubmit = appointmentBooking.getOtherData(key);
|
|
69
|
+
const callback = () => {
|
|
70
|
+
if (isSubmit) {
|
|
71
|
+
onCheckout();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
if (isRetailFormSubmit) {
|
|
75
|
+
return callback();
|
|
76
|
+
}
|
|
77
|
+
const params = (0, import_utils3.getFormParams)(carts);
|
|
78
|
+
(_a2 = utils == null ? void 0 : utils.action) == null ? void 0 : _a2.call(utils, {
|
|
79
|
+
type: "pisell1.goProductForm",
|
|
80
|
+
data: params,
|
|
81
|
+
callback: async (e) => {
|
|
82
|
+
var _a3;
|
|
83
|
+
await appointmentBooking.updateCart({
|
|
84
|
+
_id: (_a3 = carts == null ? void 0 : carts[0]) == null ? void 0 : _a3._id,
|
|
85
|
+
relationForms: e
|
|
86
|
+
});
|
|
87
|
+
appointmentBooking.setOtherData(key, true);
|
|
88
|
+
callback();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
};
|
|
63
92
|
const handleNext = async () => {
|
|
64
93
|
var _a2;
|
|
65
94
|
const { deposit } = summary;
|
|
66
95
|
if ((deposit == null ? void 0 : deposit.hasDeposit) && ((_a2 = deposit == null ? void 0 : deposit.protocols) == null ? void 0 : _a2.length) > 0 && !isAgreeDepositPolicy) {
|
|
67
96
|
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.deposit.agree.policy"));
|
|
68
97
|
}
|
|
98
|
+
if (isRetailTemplate) {
|
|
99
|
+
handleForm(true);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
onCheckout();
|
|
103
|
+
};
|
|
104
|
+
const onCheckout = async () => {
|
|
69
105
|
setLoading(true);
|
|
70
106
|
try {
|
|
107
|
+
const { deposit } = summary;
|
|
71
108
|
const { data } = await appointmentBooking.submitOrder();
|
|
72
109
|
const { is_deposit, deposit_amount, total_amount, order_id } = data || {};
|
|
73
110
|
const _total = is_deposit ? deposit_amount : total_amount;
|
|
@@ -0,0 +1,37 @@
|
|
|
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/appointmentBooking/components/ConfirmInformation/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
getFormParams: () => getFormParams
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var getFormParams = (carts) => {
|
|
26
|
+
const product_id = (carts || []).map((item) => {
|
|
27
|
+
return item.id;
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
product_id,
|
|
31
|
+
appointment_type: "virtual"
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
getFormParams
|
|
37
|
+
});
|
|
@@ -62,7 +62,7 @@ var Layout = () => {
|
|
|
62
62
|
policyParams,
|
|
63
63
|
closePolicy
|
|
64
64
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
65
|
-
const { isDateSelectedFirst, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
65
|
+
const { isDateSelectedFirst, isFormSubject, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
66
66
|
const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
67
67
|
const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
68
68
|
const { removeStep, stepList } = (0, import_hooks.useAppointmentBookingStep)();
|
|
@@ -80,12 +80,12 @@ var Layout = () => {
|
|
|
80
80
|
}, []);
|
|
81
81
|
(0, import_react.useEffect)(() => {
|
|
82
82
|
try {
|
|
83
|
+
if (!(appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || isRetailTemplate) return;
|
|
83
84
|
if (isFormSubject) {
|
|
84
85
|
removeStep("select-guest");
|
|
85
86
|
} else {
|
|
86
87
|
appointmentBooking.addStep(
|
|
87
88
|
{
|
|
88
|
-
index: (currentStep == null ? void 0 : currentStep.index) + 1,
|
|
89
89
|
key: "select-guest",
|
|
90
90
|
description: import_utils.locales.getText("pisell2.appointment.add-guests")
|
|
91
91
|
},
|
|
@@ -94,12 +94,12 @@ var Layout = () => {
|
|
|
94
94
|
}
|
|
95
95
|
} catch (error) {
|
|
96
96
|
}
|
|
97
|
-
}, [isFormSubject]);
|
|
97
|
+
}, [isFormSubject, isRetailTemplate]);
|
|
98
98
|
(0, import_react.useEffect)(() => {
|
|
99
|
-
if (isFormSubject && isLogin) {
|
|
99
|
+
if (isFormSubject && isLogin && !isRetailTemplate) {
|
|
100
100
|
getHolders();
|
|
101
101
|
}
|
|
102
|
-
}, [isFormSubject, isLogin]);
|
|
102
|
+
}, [isFormSubject, isLogin, isRetailTemplate]);
|
|
103
103
|
(0, import_react.useEffect)(() => {
|
|
104
104
|
if (!(currentStep == null ? void 0 : currentStep.step)) return;
|
|
105
105
|
setLoading(false);
|
|
@@ -172,10 +172,10 @@ var Layout = () => {
|
|
|
172
172
|
if (isDateSelectedFirst && key === "select-date") return false;
|
|
173
173
|
return key !== "confirm-information";
|
|
174
174
|
}, [isDateSelectedFirst, (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key]);
|
|
175
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Header.default, null), /* @__PURE__ */ import_react.default.createElement(
|
|
175
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !isRetailTemplate ? /* @__PURE__ */ import_react.default.createElement(import_Header.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
176
176
|
"div",
|
|
177
177
|
{
|
|
178
|
-
className: `parallel-content-wrap ${(0, import_utils.isMobile)() ? "parallel-content-mobile-wrap" : ""}`
|
|
178
|
+
className: `parallel-content-wrap ${(0, import_utils.isMobile)() ? "parallel-content-mobile-wrap" : ""} ${isRetailTemplate ? "parallel-content-retail-wrap" : ""}`
|
|
179
179
|
},
|
|
180
180
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "parallel-content-left" }, Com),
|
|
181
181
|
isShowCartCom
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.parallel-content-wrap {
|
|
2
2
|
width: 1000px;
|
|
3
|
+
max-width: 100%;
|
|
3
4
|
display: flex;
|
|
4
5
|
gap: 6px;
|
|
5
6
|
// align-items: center;
|
|
@@ -13,7 +14,9 @@
|
|
|
13
14
|
|
|
14
15
|
.parallel-content-left {
|
|
15
16
|
flex: 1;
|
|
16
|
-
width: 634px;
|
|
17
|
+
// width: 634px;
|
|
18
|
+
width: auto;
|
|
19
|
+
min-width: 0;
|
|
17
20
|
// padding: 16px 0;
|
|
18
21
|
|
|
19
22
|
.appointment-resource-wrap {
|
|
@@ -37,6 +40,8 @@
|
|
|
37
40
|
position: sticky;
|
|
38
41
|
top: 93px;
|
|
39
42
|
height: fit-content;
|
|
43
|
+
flex: 0 0 360px;
|
|
44
|
+
background-color: #fff;
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
@@ -89,3 +94,20 @@
|
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
96
|
}
|
|
97
|
+
|
|
98
|
+
.parallel-content-retail-wrap {
|
|
99
|
+
.pisell-product-select-wrapper {
|
|
100
|
+
.pisell-product-select-tabs-wrapper {
|
|
101
|
+
top: 0px !important;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.parallel-content-right {
|
|
106
|
+
top: 16px;
|
|
107
|
+
margin-top: 0;
|
|
108
|
+
|
|
109
|
+
.appointment-cart-item-wrap {
|
|
110
|
+
height: calc(100vh - 16px) !important;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -90,9 +90,11 @@ var Header = () => {
|
|
|
90
90
|
appointmentBooking.deleteCartItemInfo("resource");
|
|
91
91
|
}
|
|
92
92
|
appointmentBooking.back();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
const prevStepData = stepList[(currentStep == null ? void 0 : currentStep.index) - 1];
|
|
94
|
+
const currentStepData = stepList[currentStep == null ? void 0 : currentStep.index];
|
|
95
|
+
if ((currentStepData == null ? void 0 : currentStepData.isSkip) || (prevStepData == null ? void 0 : prevStepData.isSkip)) {
|
|
96
|
+
const key2 = (currentStepData == null ? void 0 : currentStepData.isSkip) ? currentStepData == null ? void 0 : currentStepData.key : prevStepData == null ? void 0 : prevStepData.key;
|
|
97
|
+
updateStep(key2, {
|
|
96
98
|
isSkip: false
|
|
97
99
|
});
|
|
98
100
|
}
|
|
@@ -45,7 +45,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
45
45
|
const context = (0, import_useEngineContext.default)();
|
|
46
46
|
const { utils } = context.appHelper || {};
|
|
47
47
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
48
|
-
const { isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
48
|
+
const { isDateSelectedFirst, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
49
49
|
const { getProducts, checkProductType } = (0, import_hooks.useAppointmentBookingProduct)();
|
|
50
50
|
const { removeStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
51
51
|
const { currentStep } = (0, import_context.useAppointmentBookingContext)();
|
|
@@ -67,9 +67,12 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
67
67
|
});
|
|
68
68
|
}, [isDateSelectedFirst]);
|
|
69
69
|
const handleSelectProduct = async (item) => {
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
70
|
+
let type = "";
|
|
71
|
+
if (!isRetailTemplate) {
|
|
72
|
+
type = await checkProductType(item == null ? void 0 : item.id);
|
|
73
|
+
if (type === "session") {
|
|
74
|
+
appointmentBooking.openProductDetail(item.id);
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
utils == null ? void 0 : utils.action({
|
|
75
78
|
type: "pisell1.productDetail",
|
|
@@ -78,6 +81,16 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
78
81
|
},
|
|
79
82
|
callback: async (data) => {
|
|
80
83
|
var _a, _b;
|
|
84
|
+
const product = {
|
|
85
|
+
...data,
|
|
86
|
+
options: (data == null ? void 0 : data.option) || []
|
|
87
|
+
};
|
|
88
|
+
delete product.option;
|
|
89
|
+
if (isRetailTemplate) {
|
|
90
|
+
if (data == null ? void 0 : data.isCancel) return;
|
|
91
|
+
appointmentBooking.storeProduct(product);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
81
94
|
if (data == null ? void 0 : data.isCancel) {
|
|
82
95
|
if (type === "session") {
|
|
83
96
|
appointmentBooking.closeProductDetail();
|
|
@@ -86,11 +99,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
86
99
|
return;
|
|
87
100
|
}
|
|
88
101
|
const session = data == null ? void 0 : data.session;
|
|
89
|
-
const product = {
|
|
90
|
-
...data,
|
|
91
|
-
options: (data == null ? void 0 : data.option) || []
|
|
92
|
-
};
|
|
93
|
-
delete product.option;
|
|
94
102
|
if (session) {
|
|
95
103
|
const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
|
|
96
104
|
const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
|
|
@@ -102,7 +110,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
102
110
|
}
|
|
103
111
|
});
|
|
104
112
|
appointmentBooking.closeProductDetail();
|
|
105
|
-
appointmentBooking.getAvailableDate({
|
|
113
|
+
await appointmentBooking.getAvailableDate({
|
|
106
114
|
startDate,
|
|
107
115
|
endDate
|
|
108
116
|
});
|
|
@@ -14,7 +14,7 @@ export declare const useAppointmentBookingStep: () => {
|
|
|
14
14
|
removeStep: (key: string) => any;
|
|
15
15
|
addStep: (props: any, stepKey?: string) => any;
|
|
16
16
|
updateStep: (key: string, step: any) => void;
|
|
17
|
-
nextStep: () =>
|
|
17
|
+
nextStep: () => any;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* @title: 获取商品数据
|
|
@@ -97,6 +97,7 @@ export declare const useIsSkipResourceStep: () => {
|
|
|
97
97
|
export declare const useAppointmentBookingSetting: () => {
|
|
98
98
|
isDateSelectedFirst: boolean;
|
|
99
99
|
isFormSubject: boolean;
|
|
100
|
+
isRetailTemplate: any;
|
|
100
101
|
customPageId: any;
|
|
101
102
|
channel: any;
|
|
102
103
|
bookingSubject: any;
|
|
@@ -67,6 +67,7 @@ var useAppointmentBookingStep = () => {
|
|
|
67
67
|
var _a, _b, _c;
|
|
68
68
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
69
69
|
const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
|
|
70
|
+
const { isRetailTemplate } = useAppointmentBookingSetting();
|
|
70
71
|
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
71
72
|
const getCurrentAndLastStep = () => {
|
|
72
73
|
const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
@@ -115,6 +116,9 @@ var useAppointmentBookingStep = () => {
|
|
|
115
116
|
};
|
|
116
117
|
const nextStep = () => {
|
|
117
118
|
var _a2, _b2, _c2, _d;
|
|
119
|
+
if (isRetailTemplate) {
|
|
120
|
+
return appointmentBooking.next();
|
|
121
|
+
}
|
|
118
122
|
const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
119
123
|
const stepList2 = ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
|
|
120
124
|
if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepList2 == null ? void 0 : stepList2.length)) {
|
|
@@ -139,9 +143,9 @@ var useAppointmentBookingStep = () => {
|
|
|
139
143
|
return { getStepIndex, stepList, removeStep, addStep, updateStep, nextStep };
|
|
140
144
|
};
|
|
141
145
|
var useAppointmentBookingProduct = () => {
|
|
142
|
-
const { appointmentBooking
|
|
146
|
+
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
143
147
|
const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
144
|
-
const { bookingProcess
|
|
148
|
+
const { bookingProcess } = productModuleParams || {};
|
|
145
149
|
const getProducts = async () => {
|
|
146
150
|
var _a;
|
|
147
151
|
if (bookingProcess === "date_first") {
|
|
@@ -345,7 +349,7 @@ var useIsSkipResourceStep = () => {
|
|
|
345
349
|
return { checkSkipResourceStep };
|
|
346
350
|
};
|
|
347
351
|
var useAppointmentBookingSetting = () => {
|
|
348
|
-
var _a;
|
|
352
|
+
var _a, _b;
|
|
349
353
|
const utils = contextUtils();
|
|
350
354
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
351
355
|
const { bookingProcess, bookingSubject, customPageId, channel } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
|
|
@@ -363,6 +367,8 @@ var useAppointmentBookingSetting = () => {
|
|
|
363
367
|
isDateSelectedFirst: bookingProcess === "date_first",
|
|
364
368
|
// 主体是否是表单
|
|
365
369
|
isFormSubject: (bookingSubject == null ? void 0 : bookingSubject.type) === "form",
|
|
370
|
+
// 是否是零售模版
|
|
371
|
+
isRetailTemplate: ((_b = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _b.isRetailTemplate) || false,
|
|
366
372
|
customPageId,
|
|
367
373
|
channel,
|
|
368
374
|
bookingSubject,
|