@pisell/private-materials 3.2.22 → 3.2.23
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 +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +32 -18
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +28 -18
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +45 -9
- package/es/components/appointmentBooking/hooks.js +158 -121
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +30 -0
- package/es/components/appointmentBooking/locales.js +30 -0
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +68 -1
- package/es/components/booking/components/footer/utils.js +15 -15
- package/es/components/booking/components/voucher/index.d.ts +1 -1
- package/es/components/booking/components/voucher/index.js +28 -27
- 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/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +0 -1
- package/es/components/booking/info/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/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -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/serviceItem/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.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/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/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/SetupForm/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +23 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +28 -16
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +45 -9
- package/lib/components/appointmentBooking/hooks.js +28 -41
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +30 -0
- package/lib/components/appointmentBooking/locales.js +30 -0
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +39 -1
- package/lib/components/booking/components/footer/utils.js +1 -15
- package/lib/components/booking/components/voucher/index.d.ts +1 -1
- package/lib/components/booking/components/voucher/index.js +28 -17
- 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/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +0 -1
- package/lib/components/booking/info/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/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -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/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.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/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/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/SetupForm/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -68,6 +68,9 @@ var Product = function Product(props) {
|
|
|
68
68
|
},
|
|
69
69
|
onCard: function onCard(e) {
|
|
70
70
|
return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'view');
|
|
71
|
+
},
|
|
72
|
+
onChangeResource: function onChangeResource(e) {
|
|
73
|
+
return handleChange(item, 'change_resource', e);
|
|
71
74
|
}
|
|
72
75
|
}, productParams));
|
|
73
76
|
}), !hideAddBtn && platform !== 'h5' && isAdd ? useAddService(id, 'more') : null);
|
|
@@ -16,8 +16,9 @@ var useClearCart = function useClearCart(key) {
|
|
|
16
16
|
onChange = _useContext.onChange;
|
|
17
17
|
var isProductList = state.isProductList,
|
|
18
18
|
disabledEdit = state.disabledEdit,
|
|
19
|
-
holders = state.holders
|
|
20
|
-
|
|
19
|
+
holders = state.holders,
|
|
20
|
+
isHideClearCart = state.isHideClearCart;
|
|
21
|
+
console.log(state, 'wh978968');
|
|
21
22
|
/**
|
|
22
23
|
* @title: 清空购物车
|
|
23
24
|
* @description:
|
|
@@ -47,7 +48,7 @@ var useClearCart = function useClearCart(key) {
|
|
|
47
48
|
// updateState(updateProduct(state, products));
|
|
48
49
|
// onChange(products);
|
|
49
50
|
};
|
|
50
|
-
return !disabledEdit && (holders === null || holders === void 0 ? void 0 : holders.length) > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
51
|
+
return !disabledEdit && (holders === null || holders === void 0 ? void 0 : holders.length) > 0 && !isHideClearCart ? /*#__PURE__*/React.createElement("span", {
|
|
51
52
|
className: classNames('pisell-lowcode__shopping-cart-clear-btn', {
|
|
52
53
|
'pisell-lowcode__shopping-cart-clear-btn-empty': isProductList
|
|
53
54
|
}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M30.6 18.8a1 1 0 0 1-1.4-.2A6.45 6.45 0 0 0 24 16a1 1 0 0 1 0-2 3 3 0 1 0-2.905-3.75 1 1 0 0 1-1.937-.5 5 5 0 1 1 8.217 4.939 8.5 8.5 0 0 1 3.429 2.71A1 1 0 0 1 30.6 18.8m-6.735 7.7a1 1 0 1 1-1.73 1 7.125 7.125 0 0 0-12.27 0 1 1 0 1 1-1.73-1 9 9 0 0 1 4.217-3.74 6 6 0 1 1 7.296 0 9 9 0 0 1 4.217 3.74M16 22a4 4 0 1 0 0-8 4 4 0 0 0 0 8m-7-7a1 1 0 0 0-1-1 3 3 0 1 1 2.905-3.75 1 1 0 0 0 1.938-.5 5 5 0 1 0-8.218 4.939 8.5 8.5 0 0 0-3.425 2.71A1 1 0 1 0 2.8 18.6 6.45 6.45 0 0 1 8 16a1 1 0 0 0 1-1"></path></svg>
|
|
@@ -35,55 +35,64 @@ module.exports = __toCommonJS(ContinueButton_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_utils = require("@pisell/utils");
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
|
-
var import_utils2 = require("../../../../Sales/Checkout/utils");
|
|
39
38
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
40
39
|
var import_hooks = require("../../../hooks");
|
|
41
40
|
var import_context = require("../../../context");
|
|
41
|
+
var import_utils2 = require("../../../utils");
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var ContinueButton = () => {
|
|
44
|
+
var _a;
|
|
44
45
|
const context = (0, import_useEngineContext.default)();
|
|
45
46
|
const utils = context.appHelper.utils || {};
|
|
46
47
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
47
48
|
const { isLogin, openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
48
|
-
const {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
content: ((_a = result == null ? void 0 : result.err) == null ? void 0 : _a.message) || ""
|
|
64
|
-
});
|
|
49
|
+
const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
50
|
+
const {
|
|
51
|
+
currentStep,
|
|
52
|
+
isLastStep,
|
|
53
|
+
carts,
|
|
54
|
+
appointmentBooking,
|
|
55
|
+
resourceOtherParams
|
|
56
|
+
} = (0, import_context.useAppointmentBookingContext)();
|
|
57
|
+
const { getResourceTimeSlot } = (0, import_hooks.useAppointmentBookingResource)();
|
|
58
|
+
const disabled = (0, import_react.useMemo)(() => {
|
|
59
|
+
var _a2, _b;
|
|
60
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
61
|
+
if (!carts.length) return true;
|
|
62
|
+
if (key === "select-resource" && ((_b = resourceOtherParams == null ? void 0 : resourceOtherParams.errorList) == null ? void 0 : _b.length) > 0) {
|
|
63
|
+
return true;
|
|
65
64
|
}
|
|
66
|
-
|
|
65
|
+
return false;
|
|
66
|
+
}, [
|
|
67
|
+
(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key,
|
|
68
|
+
carts,
|
|
69
|
+
accountLists,
|
|
70
|
+
resourceOtherParams == null ? void 0 : resourceOtherParams.errorList
|
|
71
|
+
]);
|
|
67
72
|
const handleNextStep = async () => {
|
|
73
|
+
var _a2, _b;
|
|
68
74
|
if (isLastStep) {
|
|
69
75
|
setLoading(true);
|
|
70
76
|
try {
|
|
71
77
|
const res = await appointmentBooking.submitOrder();
|
|
72
|
-
console.log(isLastStep, isLogin, res, "wh9896788");
|
|
73
78
|
utils.action({
|
|
74
79
|
type: "pisell1.payment",
|
|
75
80
|
data: res == null ? void 0 : res.data,
|
|
76
81
|
callback: (e) => {
|
|
77
|
-
console.log(e, "wh9896788");
|
|
82
|
+
console.log(e, currentStep, "wh9896788");
|
|
78
83
|
}
|
|
79
84
|
});
|
|
80
85
|
setLoading(false);
|
|
81
86
|
} catch (error) {
|
|
82
|
-
console.log(isLastStep, isLogin, error, "wh9896788");
|
|
83
87
|
setLoading(false);
|
|
84
88
|
}
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
91
|
+
if (((_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key) === "select-resource") {
|
|
92
|
+
getResourceTimeSlot("resources");
|
|
93
|
+
}
|
|
94
|
+
if (((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) === "select-time") {
|
|
95
|
+
}
|
|
87
96
|
return appointmentBooking.next();
|
|
88
97
|
};
|
|
89
98
|
const handleContinue = async () => {
|
|
@@ -91,7 +100,12 @@ var ContinueButton = () => {
|
|
|
91
100
|
if (!isLogin) {
|
|
92
101
|
return openLoginModal({
|
|
93
102
|
callback: (status) => {
|
|
103
|
+
var _a2, _b, _c;
|
|
104
|
+
const user = (_c = (_b = (_a2 = utils.store) == null ? void 0 : _a2.getState()) == null ? void 0 : _b.global) == null ? void 0 : _c.userInfo;
|
|
105
|
+
const currentUser = (0, import_utils2.formatCustomer)(user);
|
|
106
|
+
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
94
107
|
if (status === "success") {
|
|
108
|
+
appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
|
|
95
109
|
handleNextStep();
|
|
96
110
|
}
|
|
97
111
|
}
|
|
@@ -107,14 +121,10 @@ var ContinueButton = () => {
|
|
|
107
121
|
return import_utils.locales.getText("pisell2.event.close.continue");
|
|
108
122
|
}
|
|
109
123
|
}, [isLastStep]);
|
|
110
|
-
const confirmLoading = (0, import_react.useMemo)(() => {
|
|
111
|
-
if (!isLastStep) return false;
|
|
112
|
-
return (createBooking == null ? void 0 : createBooking.loading) || (checkBeforeBooking == null ? void 0 : checkBeforeBooking.loading);
|
|
113
|
-
}, [isLastStep, createBooking == null ? void 0 : createBooking.loading, checkBeforeBooking == null ? void 0 : checkBeforeBooking.loading]);
|
|
114
124
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
115
125
|
import_materials.Button,
|
|
116
126
|
{
|
|
117
|
-
disabled
|
|
127
|
+
disabled,
|
|
118
128
|
size: "large",
|
|
119
129
|
type: "primary",
|
|
120
130
|
onClick: () => handleContinue(),
|
|
@@ -41,6 +41,7 @@ var import_context = require("../../../context");
|
|
|
41
41
|
var Total = ({ className, isFooter }) => {
|
|
42
42
|
const { summary, symbolic } = (0, import_context.useAppointmentBookingContext)();
|
|
43
43
|
const { taxTitle, totalTaxFee, isPriceIncludeTax, total } = summary;
|
|
44
|
+
console.log(summary, "summarysummary");
|
|
44
45
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: `event-total-wrap ${className}` }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "gst-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, taxTitle, isFooter ? ": " : ""), /* @__PURE__ */ import_react.default.createElement(import_materials.PisellText.Amount, { value: totalTaxFee, showCurrencySymbol: true })) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
45
46
|
"div",
|
|
46
47
|
{
|
|
@@ -38,32 +38,42 @@ var import_shoppingCart = __toESM(require("../../../../shoppingCart"));
|
|
|
38
38
|
var import_ContinueButton = __toESM(require("../ContinueButton"));
|
|
39
39
|
var import_hooks = require("../../../hooks");
|
|
40
40
|
var import_context = require("../../../context");
|
|
41
|
-
var
|
|
41
|
+
var import_hooks2 = require("../../../hooks");
|
|
42
42
|
var import_utils2 = require("../../../utils");
|
|
43
43
|
var import_Voucher = __toESM(require("../../Voucher"));
|
|
44
|
+
var import_Total = __toESM(require("./Total"));
|
|
44
45
|
var import_index = require("./index.less");
|
|
45
46
|
var CartItem = () => {
|
|
46
47
|
var _a, _b;
|
|
47
48
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
48
|
-
const
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const { carts, isLastStep, currentStep, resources } = (0, import_context.useAppointmentBookingContext)();
|
|
50
|
+
const { accountLists } = (0, import_hooks2.useAppointmentBookingAccount)();
|
|
51
|
+
console.log(accountLists, "wh97879678");
|
|
52
|
+
const currentUser = (0, import_utils2.formatCurrentUser)();
|
|
52
53
|
const holderIds = (0, import_react.useMemo)(() => {
|
|
53
54
|
return accountLists.map((item) => item.id);
|
|
54
55
|
}, [accountLists]);
|
|
55
56
|
const holders = (0, import_react.useMemo)(() => {
|
|
56
57
|
return (0, import_utils2.formatHolder)(accountLists);
|
|
57
58
|
}, [accountLists]);
|
|
58
|
-
const handleClickCard = (e, type,
|
|
59
|
-
console.log(e, type, key, "wh9988767");
|
|
59
|
+
const handleClickCard = (e, type, val) => {
|
|
60
60
|
if (type === "note") {
|
|
61
|
-
return appointmentBooking.updateCart(
|
|
61
|
+
return appointmentBooking.updateCart({
|
|
62
|
+
_id: e == null ? void 0 : e._id,
|
|
63
|
+
...val
|
|
64
|
+
});
|
|
62
65
|
}
|
|
63
66
|
if (type === "delete") {
|
|
67
|
+
return appointmentBooking.deleteCart(e == null ? void 0 : e._id);
|
|
64
68
|
}
|
|
65
69
|
if (type === "delete_holders") {
|
|
66
|
-
return appointmentBooking.removeAccount(
|
|
70
|
+
return appointmentBooking.removeAccount(val);
|
|
71
|
+
}
|
|
72
|
+
if (type === "change_resource") {
|
|
73
|
+
return appointmentBooking.updateCart({
|
|
74
|
+
_id: e == null ? void 0 : e._id,
|
|
75
|
+
resources: [val]
|
|
76
|
+
});
|
|
67
77
|
}
|
|
68
78
|
};
|
|
69
79
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -80,7 +90,8 @@ var CartItem = () => {
|
|
|
80
90
|
holders,
|
|
81
91
|
disabledEdit: isLastStep,
|
|
82
92
|
isShowChangeResource: ((_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key) === "select-resource",
|
|
83
|
-
isShowDelete: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.
|
|
93
|
+
isShowDelete: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) === "select-service",
|
|
94
|
+
isShowPackageNote: false
|
|
84
95
|
},
|
|
85
96
|
collapseParams: {
|
|
86
97
|
activeKey: holderIds,
|
|
@@ -89,10 +100,11 @@ var CartItem = () => {
|
|
|
89
100
|
platform: "h5",
|
|
90
101
|
emptyText: import_utils.locales.getText("pisell2.event.empty.service"),
|
|
91
102
|
isOpenGroup: !!(holderIds == null ? void 0 : holderIds.length),
|
|
103
|
+
isHideClearCart: true,
|
|
92
104
|
onChange: (e, type, key) => handleClickCard(e, type, key)
|
|
93
105
|
}
|
|
94
106
|
)),
|
|
95
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "
|
|
107
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-footer" }, /* @__PURE__ */ import_react.default.createElement(import_Voucher.default, { currentUser, products: carts }), /* @__PURE__ */ import_react.default.createElement(import_Total.default, null), /* @__PURE__ */ import_react.default.createElement(import_ContinueButton.default, null))
|
|
96
108
|
));
|
|
97
109
|
};
|
|
98
110
|
var Item_default = CartItem;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
height: 100%;
|
|
3
3
|
.content {
|
|
4
4
|
background: #fff;
|
|
5
|
-
padding:
|
|
5
|
+
padding: 0 16px;
|
|
6
|
+
max-height: 60vh;
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
|
|
6
9
|
.pisell-lowcode__shopping-cart-content {
|
|
7
10
|
.ant-card-body {
|
|
8
11
|
padding: 0;
|
|
@@ -10,9 +13,9 @@
|
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
|
|
13
|
-
.
|
|
16
|
+
.appointment-footer {
|
|
14
17
|
background: #fff;
|
|
15
|
-
padding:
|
|
18
|
+
padding: 10px 16px 0;
|
|
16
19
|
display: flex;
|
|
17
20
|
flex-direction: column;
|
|
18
21
|
gap: 14px;
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
overflow-y: auto;
|
|
75
78
|
padding: 0 0 140px;
|
|
76
79
|
}
|
|
77
|
-
.
|
|
80
|
+
.appointment-footer {
|
|
78
81
|
z-index: 10;
|
|
79
82
|
position: fixed;
|
|
80
83
|
bottom: 0;
|
|
@@ -42,18 +42,16 @@ var import_Date = __toESM(require("../Date"));
|
|
|
42
42
|
var import_Resource = __toESM(require("../Resource"));
|
|
43
43
|
var import_TimeSlicing = __toESM(require("../TimeSlicing"));
|
|
44
44
|
var import_Guest = __toESM(require("../Guest"));
|
|
45
|
-
var import_hooks = require("../../hooks");
|
|
46
45
|
var import_context = require("../../context");
|
|
46
|
+
var import_hooks = require("../../hooks");
|
|
47
47
|
var import_index = require("./index.less");
|
|
48
48
|
var Layout = () => {
|
|
49
49
|
var _a, _b, _c;
|
|
50
|
-
const appointmentBookingStep = (0, import_hooks.useAppointmentBookingStep)();
|
|
51
|
-
const appointmentBookingCart = (0, import_hooks.useAppointmentBookingCart)();
|
|
52
50
|
const { currentStep } = (0, import_context.useAppointmentBookingContext)();
|
|
51
|
+
(0, import_hooks.useAppointmentBookingCart)();
|
|
52
|
+
(0, import_hooks.useAppointmentBookingStep)();
|
|
53
53
|
const [params, setParams] = (0, import_react.useState)({});
|
|
54
54
|
(0, import_react.useEffect)(() => {
|
|
55
|
-
var _a2;
|
|
56
|
-
console.log((_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key, "whcurrentStep?.step?.key");
|
|
57
55
|
window.scrollTo({
|
|
58
56
|
top: 0,
|
|
59
57
|
behavior: "smooth"
|
|
@@ -36,19 +36,29 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_dayjs = __toESM(require("dayjs"));
|
|
38
38
|
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
|
|
39
|
-
var import_state = require("./state");
|
|
40
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
|
+
var import_utils = require("@pisell/utils");
|
|
41
41
|
var import_icons = require("@ant-design/icons");
|
|
42
42
|
var import_context = require("../../context");
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
45
45
|
var CalendarDate = (props) => {
|
|
46
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
46
47
|
const [currentDate, setCurrentDate] = (0, import_react.useState)();
|
|
47
48
|
const [dateMonthList, setDateMonthList] = (0, import_react.useState)([]);
|
|
48
49
|
const [currentMonth, setCurrentMonth] = (0, import_react.useState)(() => {
|
|
49
50
|
return (0, import_dayjs.default)();
|
|
50
51
|
});
|
|
51
52
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
53
|
+
const weekListText = [
|
|
54
|
+
import_utils.locales.getText("pisell2.appointment.sunday"),
|
|
55
|
+
import_utils.locales.getText("pisell2.appointment.monday"),
|
|
56
|
+
import_utils.locales.getText("pisell2.appointment.tuesday"),
|
|
57
|
+
import_utils.locales.getText("pisell2.appointment.wednesday"),
|
|
58
|
+
import_utils.locales.getText("pisell2.appointment.thursday"),
|
|
59
|
+
import_utils.locales.getText("pisell2.appointment.friday"),
|
|
60
|
+
import_utils.locales.getText("pisell2.appointment.saturday")
|
|
61
|
+
];
|
|
52
62
|
const startingColumn = 0 % 7;
|
|
53
63
|
const columns = Array.from(
|
|
54
64
|
{ length: 7 },
|
|
@@ -80,40 +90,44 @@ var CalendarDate = (props) => {
|
|
|
80
90
|
return lastDate.isBefore((0, import_dayjs.default)(), "month");
|
|
81
91
|
};
|
|
82
92
|
const getDates = async (date) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
103
|
-
}
|
|
104
|
-
const baseMonthData = getMonthData(date.format("YYYY-MM"));
|
|
105
|
-
const updatedDates = baseMonthData.map((day) => {
|
|
106
|
-
const matchedDay = data.find((d) => d.date === day.date);
|
|
107
|
-
if (matchedDay) {
|
|
108
|
-
return {
|
|
109
|
-
...day,
|
|
110
|
-
...matchedDay,
|
|
111
|
-
disabled: matchedDay.status === "unavailable"
|
|
112
|
-
};
|
|
93
|
+
try {
|
|
94
|
+
const startDate = (0, import_dayjs.default)(date).startOf("month").format("YYYY-MM-DD");
|
|
95
|
+
const endDate = (0, import_dayjs.default)(date).endOf("month").format("YYYY-MM-DD");
|
|
96
|
+
const params = {
|
|
97
|
+
startDate,
|
|
98
|
+
endDate
|
|
99
|
+
};
|
|
100
|
+
const data = await appointmentBooking.getAvailableDate(params);
|
|
101
|
+
const selected = await appointmentBooking.getDateRange();
|
|
102
|
+
if ((selected == null ? void 0 : selected.length) > 0) {
|
|
103
|
+
setCurrentDate(selected[0].date);
|
|
104
|
+
} else {
|
|
105
|
+
if (date.format("YYYY-MM") === (0, import_dayjs.default)().format("YYYY-MM")) {
|
|
106
|
+
const firstAvailableDate = data.find(
|
|
107
|
+
(d) => d.status === "available"
|
|
108
|
+
);
|
|
109
|
+
setCurrentDate(firstAvailableDate == null ? void 0 : firstAvailableDate.date);
|
|
110
|
+
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
111
|
+
}
|
|
113
112
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
const baseMonthData = getMonthData(date.format("YYYY-MM"));
|
|
114
|
+
const updatedDates = baseMonthData.map((day) => {
|
|
115
|
+
const matchedDay = data.find((d) => d.date === day.date);
|
|
116
|
+
if (matchedDay) {
|
|
117
|
+
return {
|
|
118
|
+
...day,
|
|
119
|
+
...matchedDay,
|
|
120
|
+
disabled: matchedDay.status === "unavailable"
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return day;
|
|
124
|
+
});
|
|
125
|
+
setLoading(false);
|
|
126
|
+
setDateMonthList(updatedDates);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
setLoading(false);
|
|
129
|
+
console.log(error, "wh978968234234");
|
|
130
|
+
}
|
|
117
131
|
};
|
|
118
132
|
(0, import_react.useEffect)(() => {
|
|
119
133
|
getDates(currentMonth);
|
|
@@ -127,6 +141,7 @@ var CalendarDate = (props) => {
|
|
|
127
141
|
let currentMonthText = currentMonth.format("YYYY-MM");
|
|
128
142
|
let newNextMonth = (0, import_dayjs.default)(currentMonthText).add(1, "month");
|
|
129
143
|
setCurrentMonth(newNextMonth);
|
|
144
|
+
setLoading(true);
|
|
130
145
|
};
|
|
131
146
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-date-box" }, !dateMonthList.length ? /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, style: { paddingTop: "16px" } }) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
132
147
|
"div",
|
|
@@ -140,7 +155,7 @@ var CalendarDate = (props) => {
|
|
|
140
155
|
}
|
|
141
156
|
},
|
|
142
157
|
/* @__PURE__ */ import_react.default.createElement(import_icons.CaretLeftOutlined, null)
|
|
143
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-current-month" }, currentMonth.format("MMMM YYYY")), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-next-month", onClick: nextMonth }, /* @__PURE__ */ import_react.default.createElement(import_icons.CaretRightOutlined, null))), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-weeks" }, columns.map((col) => /* @__PURE__ */ import_react.default.createElement("div", { key: col, className: "calendar-weeks-items" },
|
|
158
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-current-month" }, currentMonth.format("MMMM YYYY")), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-next-month", onClick: nextMonth }, /* @__PURE__ */ import_react.default.createElement(import_icons.CaretRightOutlined, null))), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-weeks" }, columns.map((col) => /* @__PURE__ */ import_react.default.createElement("div", { key: col, className: "calendar-weeks-items" }, weekListText[Number(col)]))), /* @__PURE__ */ import_react.default.createElement("div", { className: "calendar-days" }, dateMonthList.map((day, index) => {
|
|
144
159
|
const date = (0, import_dayjs.default)(day.date).format("YYYY-MM-DD");
|
|
145
160
|
const isCurrentMonth = (0, import_dayjs.default)(day.date).isSame(
|
|
146
161
|
currentMonth,
|
|
@@ -152,26 +167,17 @@ var CalendarDate = (props) => {
|
|
|
152
167
|
key: index,
|
|
153
168
|
className: (0, import_classnames.default)("calendar-days-items", {
|
|
154
169
|
["disabledDate"]: day == null ? void 0 : day.disabled,
|
|
155
|
-
// ['disabledSelect']: status === 'sold_out',
|
|
156
170
|
["selectDate"]: currentDate === date,
|
|
157
|
-
["other-month-days"]: !isCurrentMonth
|
|
171
|
+
["other-month-days"]: !isCurrentMonth,
|
|
172
|
+
["loading-item"]: loading
|
|
158
173
|
}),
|
|
159
174
|
onClick: () => {
|
|
160
175
|
if (day == null ? void 0 : day.disabled) return;
|
|
161
|
-
console.log(day, "wh987976");
|
|
162
176
|
setCurrentDate(date);
|
|
163
177
|
appointmentBooking.setDateRange([day]);
|
|
164
178
|
}
|
|
165
179
|
},
|
|
166
|
-
isCurrentMonth && /* @__PURE__ */ import_react.default.createElement(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
className: (0, import_classnames.default)("day-text", {
|
|
170
|
-
// ['day-line']: !disabled,
|
|
171
|
-
})
|
|
172
|
-
},
|
|
173
|
-
(0, import_dayjs.default)(day.date).format("D")
|
|
174
|
-
)
|
|
180
|
+
isCurrentMonth && /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("day-text") }, (0, import_dayjs.default)(day.date).format("D"))
|
|
175
181
|
);
|
|
176
182
|
})))));
|
|
177
183
|
};
|