@pisell/private-materials 6.1.1 → 6.1.2
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/businessModel/SalesModel/Sales/index.js +37 -4
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +7 -0
- package/es/components/Sales/Resource/serve.js +10 -0
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/footer/utils.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +47 -18
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/editBookingModal/index.d.ts +5 -0
- package/es/components/booking/editBookingModal/index.js +386 -0
- package/es/components/booking/editBookingModal/index.less +8 -0
- package/es/components/booking/editBookingModal/locales.d.ts +21 -0
- package/es/components/booking/editBookingModal/locales.js +20 -0
- package/es/components/booking/editBookingModal/mock.d.ts +807 -0
- package/es/components/booking/editBookingModal/mock.js +2993 -0
- package/es/components/booking/editBookingModal/serve.d.ts +51 -0
- package/es/components/booking/editBookingModal/serve.js +288 -0
- package/es/components/booking/editBookingModal/type.d.ts +12 -0
- package/es/components/booking/editBookingModal/type.js +1 -0
- package/es/components/booking/editBookingModal/utils.d.ts +12 -0
- package/es/components/booking/editBookingModal/utils.js +157 -0
- 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/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +24 -10
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/Lists.js +36 -26
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +26 -25
- package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/es/components/booking/info2/service/addService/utils.js +54 -17
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +27 -8
- package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/es/components/booking/info2/service/editService/index.js +244 -166
- package/es/components/booking/info2/service/index.js +19 -15
- package/es/components/booking/info2/utilsByBooking.js +9 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- 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/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/payo/config.js +30 -3
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
- 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/eventBooking/components/bookingDetailModal/index.js +19 -3
- package/es/components/eventBooking/index.js +21 -7
- package/es/components/eventBooking/locales.js +3 -3
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toB/components/Content/index.js +35 -52
- package/es/components/pay/toB/store/hooks.js +13 -4
- package/es/components/pay/toB/store/provider.js +1 -0
- package/es/components/pay/toB/types/storeTypes.d.ts +2 -0
- 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/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/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/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 +48 -41
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/stepController/components/Content/index.d.ts +7 -0
- package/es/components/stepController/components/Content/index.js +9 -0
- package/es/components/stepController/components/Content/index.less +8 -0
- package/es/components/stepController/components/Footer/index.d.ts +8 -0
- package/es/components/stepController/components/Footer/index.js +15 -0
- package/es/components/stepController/components/Footer/index.less +39 -0
- package/es/components/stepController/components/Header/index.d.ts +20 -0
- package/es/components/stepController/components/Header/index.js +97 -0
- package/es/components/stepController/components/Header/index.less +21 -0
- package/es/components/stepController/index.d.ts +5 -0
- package/es/components/stepController/index.js +64 -0
- package/es/components/stepController/index.less +11 -0
- package/es/components/stepController/locales.d.ts +27 -0
- package/es/components/stepController/locales.js +32 -0
- package/es/components/stepController/types.d.ts +23 -0
- package/es/components/stepController/types.js +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +137 -137
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/hooks/useWindowSize.js +26 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/businessModel/SalesModel/Sales/index.js +22 -8
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +7 -0
- package/lib/components/Sales/Resource/serve.js +9 -2
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +27 -7
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/editBookingModal/index.d.ts +5 -0
- package/lib/components/booking/editBookingModal/index.js +363 -0
- package/lib/components/booking/editBookingModal/index.less +8 -0
- package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
- package/lib/components/booking/editBookingModal/locales.js +44 -0
- package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
- package/lib/components/booking/editBookingModal/mock.js +3314 -0
- package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
- package/lib/components/booking/editBookingModal/serve.js +178 -0
- package/lib/components/booking/editBookingModal/type.d.ts +12 -0
- package/lib/components/booking/editBookingModal/type.js +17 -0
- package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
- package/lib/components/booking/editBookingModal/utils.js +158 -0
- 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/client/index.js +7 -6
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +16 -10
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/Lists.js +35 -23
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +22 -21
- package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/lib/components/booking/info2/service/addService/utils.js +36 -7
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +56 -10
- package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/lib/components/booking/info2/service/editService/index.js +150 -78
- package/lib/components/booking/info2/service/index.js +13 -9
- package/lib/components/booking/info2/utilsByBooking.js +6 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- 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/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/payo/config.js +22 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
- 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/eventBooking/components/bookingDetailModal/index.js +9 -3
- package/lib/components/eventBooking/index.js +11 -7
- package/lib/components/eventBooking/locales.js +3 -3
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toB/components/Content/index.js +5 -5
- package/lib/components/pay/toB/store/hooks.js +8 -1
- package/lib/components/pay/toB/store/provider.js +1 -0
- package/lib/components/pay/toB/types/storeTypes.d.ts +2 -0
- 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/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/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/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 +31 -21
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/stepController/components/Content/index.d.ts +7 -0
- package/lib/components/stepController/components/Content/index.js +40 -0
- package/lib/components/stepController/components/Content/index.less +8 -0
- package/lib/components/stepController/components/Footer/index.d.ts +8 -0
- package/lib/components/stepController/components/Footer/index.js +49 -0
- package/lib/components/stepController/components/Footer/index.less +39 -0
- package/lib/components/stepController/components/Header/index.d.ts +20 -0
- package/lib/components/stepController/components/Header/index.js +104 -0
- package/lib/components/stepController/components/Header/index.less +21 -0
- package/lib/components/stepController/index.d.ts +5 -0
- package/lib/components/stepController/index.js +89 -0
- package/lib/components/stepController/index.less +11 -0
- package/lib/components/stepController/locales.d.ts +27 -0
- package/lib/components/stepController/locales.js +50 -0
- package/lib/components/stepController/types.d.ts +23 -0
- package/lib/components/stepController/types.js +17 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +143 -138
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.js +51 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/edit-booking-modal/meta.ts +53 -0
- package/lowcode/step-controller/meta.ts +88 -0
- package/package.json +3 -3
@@ -0,0 +1,51 @@
|
|
1
|
+
import { mockBooking } from './mock';
|
2
|
+
import { EditBookingModalParams } from './type';
|
3
|
+
/**
|
4
|
+
* @title: 获取预约详情
|
5
|
+
* @description: 获取预约详细信息
|
6
|
+
* @param {number} bookingId
|
7
|
+
* @param {any} params
|
8
|
+
* @return {*}
|
9
|
+
* @Author: cong.shao
|
10
|
+
* @Date: 2025-06-17 14:22
|
11
|
+
*/
|
12
|
+
export declare const getBookingDetail: (bookingId: number, params?: any) => Promise<any>;
|
13
|
+
/**
|
14
|
+
* @title: 获取资源列表
|
15
|
+
* @description: 资源列表
|
16
|
+
* @param {any} params
|
17
|
+
* @return {*}
|
18
|
+
* @Author: cong.shao
|
19
|
+
* @Date: 2025-06-17 14:22
|
20
|
+
*/
|
21
|
+
export declare const getResources: (params: any) => Promise<any>;
|
22
|
+
/**
|
23
|
+
* @title: 更新子预约时间及资源
|
24
|
+
* @description: 更新预约信息
|
25
|
+
* @param {string} orderId
|
26
|
+
* @param {any} params
|
27
|
+
* @return {*}
|
28
|
+
* @Author: cong.shao
|
29
|
+
* @Date: 2025-06-17 14:26
|
30
|
+
*/
|
31
|
+
export declare const updateChildBooking: (orderId: string, params: any) => Promise<any>;
|
32
|
+
export declare const _getBookingDetail: (bookingId: number) => Promise<typeof mockBooking>;
|
33
|
+
export declare const getChildrenBookingById: (bookings: any[], id: number) => any;
|
34
|
+
export declare const _getResources: (params: any, bookingId?: number) => Promise<{
|
35
|
+
list: any[];
|
36
|
+
listMap: any;
|
37
|
+
}>;
|
38
|
+
export declare const _editBooking: (data: any, values: any) => Promise<void>;
|
39
|
+
export declare const updateResourceErrors: (resourceMaps: any, cacheItem: any) => any;
|
40
|
+
export declare const init: (params: EditBookingModalParams) => Promise<{
|
41
|
+
bookingOrigin: any;
|
42
|
+
booking: any;
|
43
|
+
childrenBooking: any;
|
44
|
+
dataRange: {
|
45
|
+
end_date: any;
|
46
|
+
start_date: any;
|
47
|
+
};
|
48
|
+
resourcesOrigin: any[];
|
49
|
+
toResource: any;
|
50
|
+
}>;
|
51
|
+
export declare const createCacheItem: (cacheItem: any, values?: any) => any;
|
@@ -0,0 +1,288 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
10
|
+
import { request } from "../../../utils";
|
11
|
+
import { _formatBookingDetail } from "../../ticketBooking/components/ticketBooking";
|
12
|
+
import dayjs from 'dayjs';
|
13
|
+
import { getResourceByIds } from "../info2/service/addService/utils";
|
14
|
+
import { getFormatResourceListAndMap } from "../info2/utils";
|
15
|
+
import { getErrorList } from "../info2/utilsByBooking";
|
16
|
+
/**
|
17
|
+
* @title: 获取预约详情
|
18
|
+
* @description: 获取预约详细信息
|
19
|
+
* @param {number} bookingId
|
20
|
+
* @param {any} params
|
21
|
+
* @return {*}
|
22
|
+
* @Author: cong.shao
|
23
|
+
* @Date: 2025-06-17 14:22
|
24
|
+
*/
|
25
|
+
export var getBookingDetail = /*#__PURE__*/function () {
|
26
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(bookingId, params) {
|
27
|
+
var _yield$request$getReq, data;
|
28
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
30
|
+
case 0:
|
31
|
+
_context.next = 2;
|
32
|
+
return request.getRequest().get("/shop/order/appointment/".concat(bookingId), params);
|
33
|
+
case 2:
|
34
|
+
_yield$request$getReq = _context.sent;
|
35
|
+
data = _yield$request$getReq.data;
|
36
|
+
return _context.abrupt("return", data);
|
37
|
+
case 5:
|
38
|
+
case "end":
|
39
|
+
return _context.stop();
|
40
|
+
}
|
41
|
+
}, _callee);
|
42
|
+
}));
|
43
|
+
return function getBookingDetail(_x, _x2) {
|
44
|
+
return _ref.apply(this, arguments);
|
45
|
+
};
|
46
|
+
}();
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @title: 获取资源列表
|
50
|
+
* @description: 资源列表
|
51
|
+
* @param {any} params
|
52
|
+
* @return {*}
|
53
|
+
* @Author: cong.shao
|
54
|
+
* @Date: 2025-06-17 14:22
|
55
|
+
*/
|
56
|
+
export var getResources = /*#__PURE__*/function () {
|
57
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
58
|
+
var _yield$request$getReq2, data;
|
59
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
60
|
+
while (1) switch (_context2.prev = _context2.next) {
|
61
|
+
case 0:
|
62
|
+
_context2.next = 2;
|
63
|
+
return request.getRequest().get("/shop/schedule/resource/list", params);
|
64
|
+
case 2:
|
65
|
+
_yield$request$getReq2 = _context2.sent;
|
66
|
+
data = _yield$request$getReq2.data;
|
67
|
+
return _context2.abrupt("return", data);
|
68
|
+
case 5:
|
69
|
+
case "end":
|
70
|
+
return _context2.stop();
|
71
|
+
}
|
72
|
+
}, _callee2);
|
73
|
+
}));
|
74
|
+
return function getResources(_x3) {
|
75
|
+
return _ref2.apply(this, arguments);
|
76
|
+
};
|
77
|
+
}();
|
78
|
+
|
79
|
+
/**
|
80
|
+
* @title: 更新子预约时间及资源
|
81
|
+
* @description: 更新预约信息
|
82
|
+
* @param {string} orderId
|
83
|
+
* @param {any} params
|
84
|
+
* @return {*}
|
85
|
+
* @Author: cong.shao
|
86
|
+
* @Date: 2025-06-17 14:26
|
87
|
+
*/
|
88
|
+
|
89
|
+
export var updateChildBooking = /*#__PURE__*/function () {
|
90
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderId, params) {
|
91
|
+
var _yield$request$getReq3, data;
|
92
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
93
|
+
while (1) switch (_context3.prev = _context3.next) {
|
94
|
+
case 0:
|
95
|
+
_context3.next = 2;
|
96
|
+
return request.getRequest().put("/shop/v1.1/order/appointment/child-booking/".concat(orderId), params);
|
97
|
+
case 2:
|
98
|
+
_yield$request$getReq3 = _context3.sent;
|
99
|
+
data = _yield$request$getReq3.data;
|
100
|
+
return _context3.abrupt("return", data);
|
101
|
+
case 5:
|
102
|
+
case "end":
|
103
|
+
return _context3.stop();
|
104
|
+
}
|
105
|
+
}, _callee3);
|
106
|
+
}));
|
107
|
+
return function updateChildBooking(_x4, _x5) {
|
108
|
+
return _ref3.apply(this, arguments);
|
109
|
+
};
|
110
|
+
}();
|
111
|
+
export var _getBookingDetail = /*#__PURE__*/function () {
|
112
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(bookingId) {
|
113
|
+
var data;
|
114
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
115
|
+
while (1) switch (_context4.prev = _context4.next) {
|
116
|
+
case 0:
|
117
|
+
_context4.next = 2;
|
118
|
+
return getBookingDetail(bookingId);
|
119
|
+
case 2:
|
120
|
+
data = _context4.sent;
|
121
|
+
return _context4.abrupt("return", data);
|
122
|
+
case 4:
|
123
|
+
case "end":
|
124
|
+
return _context4.stop();
|
125
|
+
}
|
126
|
+
}, _callee4);
|
127
|
+
}));
|
128
|
+
return function _getBookingDetail(_x6) {
|
129
|
+
return _ref4.apply(this, arguments);
|
130
|
+
};
|
131
|
+
}();
|
132
|
+
export var getChildrenBookingById = function getChildrenBookingById(bookings, id) {
|
133
|
+
return bookings.find(function (item) {
|
134
|
+
return item.booking_id === id;
|
135
|
+
});
|
136
|
+
};
|
137
|
+
export var _getResources = /*#__PURE__*/function () {
|
138
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params, bookingId) {
|
139
|
+
var data;
|
140
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
141
|
+
while (1) switch (_context5.prev = _context5.next) {
|
142
|
+
case 0:
|
143
|
+
_context5.next = 2;
|
144
|
+
return getResources(params);
|
145
|
+
case 2:
|
146
|
+
data = _context5.sent;
|
147
|
+
return _context5.abrupt("return", getFormatResourceListAndMap(data, bookingId));
|
148
|
+
case 4:
|
149
|
+
case "end":
|
150
|
+
return _context5.stop();
|
151
|
+
}
|
152
|
+
}, _callee5);
|
153
|
+
}));
|
154
|
+
return function _getResources(_x7, _x8) {
|
155
|
+
return _ref5.apply(this, arguments);
|
156
|
+
};
|
157
|
+
}();
|
158
|
+
export var _editBooking = /*#__PURE__*/function () {
|
159
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data, values) {
|
160
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
161
|
+
while (1) switch (_context6.prev = _context6.next) {
|
162
|
+
case 0:
|
163
|
+
console.log('submit data', data);
|
164
|
+
console.log('submit values', values);
|
165
|
+
|
166
|
+
// let { data } = await editBooking('1', params);
|
167
|
+
// return data;
|
168
|
+
case 2:
|
169
|
+
case "end":
|
170
|
+
return _context6.stop();
|
171
|
+
}
|
172
|
+
}, _callee6);
|
173
|
+
}));
|
174
|
+
return function _editBooking(_x9, _x10) {
|
175
|
+
return _ref6.apply(this, arguments);
|
176
|
+
};
|
177
|
+
}();
|
178
|
+
export var updateResourceErrors = function updateResourceErrors(resourceMaps, cacheItem) {
|
179
|
+
var _cacheItem$_extend;
|
180
|
+
if (cacheItem !== null && cacheItem !== void 0 && (_cacheItem$_extend = cacheItem._extend) !== null && _cacheItem$_extend !== void 0 && _cacheItem$_extend.resource) {
|
181
|
+
var _cacheItem$_extend2;
|
182
|
+
var _resource = _objectSpread({}, cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend2 = cacheItem._extend) === null || _cacheItem$_extend2 === void 0 ? void 0 : _cacheItem$_extend2.resource);
|
183
|
+
// 拿当前value 和 resources
|
184
|
+
var _loop = function _loop(form_id) {
|
185
|
+
_resource[form_id] = _resource[form_id].map(function (d) {
|
186
|
+
var _resourceMaps$form_id;
|
187
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
188
|
+
errors: getErrorList(resourceMaps === null || resourceMaps === void 0 || (_resourceMaps$form_id = resourceMaps[form_id]) === null || _resourceMaps$form_id === void 0 || (_resourceMaps$form_id = _resourceMaps$form_id.renderListMaps) === null || _resourceMaps$form_id === void 0 ? void 0 : _resourceMaps$form_id[d === null || d === void 0 ? void 0 : d.relation_id], cacheItem)
|
189
|
+
});
|
190
|
+
});
|
191
|
+
};
|
192
|
+
for (var form_id in _resource) {
|
193
|
+
_loop(form_id);
|
194
|
+
}
|
195
|
+
return _resource;
|
196
|
+
}
|
197
|
+
};
|
198
|
+
export var init = /*#__PURE__*/function () {
|
199
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
|
200
|
+
var toStartDate, toEndDate, event, fromResourceId, toResourceId, bookingOrigin, booking, resources, childrenBooking, extraParams, fromResource, toResource, resourcesOrigin;
|
201
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
202
|
+
while (1) switch (_context7.prev = _context7.next) {
|
203
|
+
case 0:
|
204
|
+
toStartDate = params.toStartDate, toEndDate = params.toEndDate, event = params.event, fromResourceId = params.fromResourceId, toResourceId = params.toResourceId; // 根据父id 获取预约详情
|
205
|
+
_context7.next = 3;
|
206
|
+
return _getBookingDetail(event.order.id);
|
207
|
+
case 3:
|
208
|
+
bookingOrigin = _context7.sent;
|
209
|
+
booking = _formatBookingDetail(bookingOrigin, {}); // 根据所选日期 获取资源列表
|
210
|
+
_context7.next = 7;
|
211
|
+
return _getResources({
|
212
|
+
date: dayjs(toStartDate).format('YYYY-MM-DD')
|
213
|
+
});
|
214
|
+
case 7:
|
215
|
+
resources = _context7.sent;
|
216
|
+
// 筛选出当前的子预约
|
217
|
+
childrenBooking = getChildrenBookingById(booking.service.value, event.id);
|
218
|
+
console.log('childrenBooking', childrenBooking);
|
219
|
+
|
220
|
+
// 假如移入未绑定的资源中,需要特殊处理
|
221
|
+
extraParams = {
|
222
|
+
extraResources: []
|
223
|
+
};
|
224
|
+
fromResource = resources.listMap[fromResourceId];
|
225
|
+
toResource = resources.listMap[toResourceId];
|
226
|
+
if (fromResource) {
|
227
|
+
extraParams.extraResources.push({
|
228
|
+
form_id: fromResource.form_id,
|
229
|
+
id: fromResource.id
|
230
|
+
});
|
231
|
+
}
|
232
|
+
if (toResource) {
|
233
|
+
extraParams.extraResources.push({
|
234
|
+
form_id: toResource.form_id,
|
235
|
+
id: toResource.id
|
236
|
+
});
|
237
|
+
}
|
238
|
+
|
239
|
+
// 将商品关联的资源id还原资源列表
|
240
|
+
resourcesOrigin = getResourceByIds(resources.listMap, childrenBooking, extraParams);
|
241
|
+
return _context7.abrupt("return", {
|
242
|
+
// 原接口数据
|
243
|
+
bookingOrigin: bookingOrigin,
|
244
|
+
//格式化后的booking数据
|
245
|
+
booking: booking,
|
246
|
+
// 当前子预约
|
247
|
+
childrenBooking: childrenBooking,
|
248
|
+
// 时间范围数据
|
249
|
+
dataRange: {
|
250
|
+
end_date: childrenBooking._extend.end_date,
|
251
|
+
start_date: childrenBooking._extend.start_date
|
252
|
+
},
|
253
|
+
// 总资源列表
|
254
|
+
resourcesOrigin: resourcesOrigin,
|
255
|
+
// 目标资源
|
256
|
+
toResource: toResource
|
257
|
+
});
|
258
|
+
case 17:
|
259
|
+
case "end":
|
260
|
+
return _context7.stop();
|
261
|
+
}
|
262
|
+
}, _callee7);
|
263
|
+
}));
|
264
|
+
return function init(_x11) {
|
265
|
+
return _ref7.apply(this, arguments);
|
266
|
+
};
|
267
|
+
}();
|
268
|
+
export var createCacheItem = function createCacheItem(cacheItem, values) {
|
269
|
+
var _values$toDate;
|
270
|
+
console.log('values', values);
|
271
|
+
if (!values || (values === null || values === void 0 || (_values$toDate = values.toDate) === null || _values$toDate === void 0 ? void 0 : _values$toDate.length) !== 2 || !(values !== null && values !== void 0 && values.resource)) {
|
272
|
+
return cacheItem;
|
273
|
+
}
|
274
|
+
var _ref8 = values || {},
|
275
|
+
toDate = _ref8.toDate,
|
276
|
+
resource = _ref8.resource;
|
277
|
+
return _objectSpread(_objectSpread({}, cacheItem), {}, {
|
278
|
+
_extend: _objectSpread(_objectSpread({}, cacheItem._extend), {}, {
|
279
|
+
endDate: toDate[1],
|
280
|
+
end_date: toDate[1],
|
281
|
+
end_time: toDate[1].format('HH:mm'),
|
282
|
+
startDate: toDate[0],
|
283
|
+
start_date: toDate[0],
|
284
|
+
start_time: toDate[0].format('HH:mm'),
|
285
|
+
resource: resource
|
286
|
+
})
|
287
|
+
});
|
288
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export interface EditBookingModalParams {
|
2
|
+
toStartDate: string;
|
3
|
+
toEndDate: string;
|
4
|
+
event: any;
|
5
|
+
fromResourceId: string;
|
6
|
+
toResourceId: string;
|
7
|
+
}
|
8
|
+
export interface EditBookingModalProps {
|
9
|
+
open: boolean;
|
10
|
+
onCancel: () => void;
|
11
|
+
onOk: () => void;
|
12
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export interface ResourceItem {
|
2
|
+
[key: string]: any;
|
3
|
+
}
|
4
|
+
/**
|
5
|
+
* @title: 传入资源,如果有子资源,会根据组合资源的 capacity 计算修改子资源的 capacity
|
6
|
+
* @description:
|
7
|
+
* @param {object} resource
|
8
|
+
* @return {*}
|
9
|
+
* @Author: jinglin.tan
|
10
|
+
*/
|
11
|
+
export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
|
12
|
+
export declare const formatValues: (data: any, values: any) => any;
|
@@ -0,0 +1,157 @@
|
|
1
|
+
import { getSumCapacity } from "../../info2/utilsByBooking";
|
2
|
+
var formatRelationDetails = function formatRelationDetails(list) {
|
3
|
+
return (list || []).map(function (item) {
|
4
|
+
return {
|
5
|
+
num: item.product_quantity,
|
6
|
+
price: item.payment_price || 0,
|
7
|
+
product_id: item.product_id,
|
8
|
+
is_charge_tax: item.is_charge_tax,
|
9
|
+
order_detail_id: item.order_detail_id
|
10
|
+
};
|
11
|
+
});
|
12
|
+
};
|
13
|
+
/**
|
14
|
+
* @title: 传入资源,如果有子资源,会根据组合资源的 capacity 计算修改子资源的 capacity
|
15
|
+
* @description:
|
16
|
+
* @param {object} resource
|
17
|
+
* @return {*}
|
18
|
+
* @Author: jinglin.tan
|
19
|
+
*/
|
20
|
+
export var checkSubResourcesCapacity = function checkSubResourcesCapacity(resource) {
|
21
|
+
if (resource.children && resource.children.length) {
|
22
|
+
var countCapacity = resource.capacity;
|
23
|
+
resource.children.forEach(function (child) {
|
24
|
+
if (child.capacity <= countCapacity) {
|
25
|
+
countCapacity -= child.capacity;
|
26
|
+
} else {
|
27
|
+
child.capacity = countCapacity;
|
28
|
+
countCapacity = 0;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
}
|
32
|
+
};
|
33
|
+
var checkResourcesFormat = function checkResourcesFormat(resources, service, isChild) {
|
34
|
+
return resources.map(function (resource) {
|
35
|
+
var _resource$children;
|
36
|
+
if (!isChild) {
|
37
|
+
resource.capacity = getSumCapacity({
|
38
|
+
cacheItem: service
|
39
|
+
});
|
40
|
+
}
|
41
|
+
checkSubResourcesCapacity(resource);
|
42
|
+
return {
|
43
|
+
children: (_resource$children = resource.children) !== null && _resource$children !== void 0 && _resource$children.length ? checkResourcesFormat(resource.children, service, true) : undefined,
|
44
|
+
form_id: resource.form_id,
|
45
|
+
relation_type: resource.relation_type || 'form',
|
46
|
+
relation_id: resource.relation_id || 0,
|
47
|
+
capacity: resource.capacity,
|
48
|
+
like_status: resource.like_status || 'common',
|
49
|
+
metadata: resource.metadata || {}
|
50
|
+
};
|
51
|
+
});
|
52
|
+
};
|
53
|
+
var formatResource = function formatResource(service) {
|
54
|
+
if (!service._extend.resource) {
|
55
|
+
return undefined;
|
56
|
+
}
|
57
|
+
try {
|
58
|
+
return Object.values(service._extend.resource).reduce(function (pre, cur) {
|
59
|
+
var newList = checkResourcesFormat(cur, service);
|
60
|
+
pre = pre.concat(newList);
|
61
|
+
return pre;
|
62
|
+
}, []);
|
63
|
+
} catch (err) {
|
64
|
+
return undefined;
|
65
|
+
}
|
66
|
+
};
|
67
|
+
|
68
|
+
/**
|
69
|
+
* @title: 格式化商品数据
|
70
|
+
* @description:
|
71
|
+
* @param {any} item
|
72
|
+
* @return {*}
|
73
|
+
* @Author: WangHan
|
74
|
+
* @Date: 2024-12-07 14:21
|
75
|
+
*/
|
76
|
+
var formatProducts = function formatProducts(item) {
|
77
|
+
return {
|
78
|
+
"num": Number(item.detail.quantity),
|
79
|
+
"price": Number(item.detail.source_product_price),
|
80
|
+
"source_product_price": Number(item.detail.source_product_price),
|
81
|
+
"product_id": item.detail.id,
|
82
|
+
"discount_amount": item.detail.discount_amount,
|
83
|
+
"product_discount_reason": item.detail.product_discount_reason || '',
|
84
|
+
"is_charge_tax": item.detail.is_charge_tax,
|
85
|
+
"note": item.detail.note,
|
86
|
+
"discountway": item.detail.discountway || "num",
|
87
|
+
"discount_per": item.detail.discount_per,
|
88
|
+
"discount_type": item.detail.discount_type,
|
89
|
+
"order_detail_id": item.detail.order_detail_id,
|
90
|
+
"product_bundle": item.detail.product_bundle,
|
91
|
+
"bundle_edit": 0,
|
92
|
+
"product_option_item": [],
|
93
|
+
"product_variant_id": item.detail.product_variant_id || 0,
|
94
|
+
"discount_list": item.detail.discount_list,
|
95
|
+
metadata: item.detail.metadata
|
96
|
+
};
|
97
|
+
};
|
98
|
+
|
99
|
+
/**
|
100
|
+
* @title: 预约商品信息
|
101
|
+
* @description:
|
102
|
+
* @param {any} data
|
103
|
+
* @return {*}
|
104
|
+
* @Author: zhiwei.Wang
|
105
|
+
* @Date: 2024-02-19 09:26
|
106
|
+
*/
|
107
|
+
var formatBookings = function formatBookings(data, values) {
|
108
|
+
var bookings = [];
|
109
|
+
bookings = data.map(function (item) {
|
110
|
+
return {
|
111
|
+
"product": formatProducts(item),
|
112
|
+
"relation_products": formatRelationDetails(item.relation_details),
|
113
|
+
'id': item.id,
|
114
|
+
"relation_id": item.relation_id,
|
115
|
+
"like_status": item.like_status,
|
116
|
+
"relation_type": item.relation_type,
|
117
|
+
"is_all": item.is_all,
|
118
|
+
"schedule_id": item.schedule_id || 0,
|
119
|
+
"end_time": item.end_time,
|
120
|
+
"sub_type": item.sub_type,
|
121
|
+
"select_date": item.start_date,
|
122
|
+
"start_time": item.start_time,
|
123
|
+
"end_date": item.end_date,
|
124
|
+
"start_date": item.start_date,
|
125
|
+
"duration": item.duration,
|
126
|
+
"number": item.number,
|
127
|
+
"resources": formatResource(item),
|
128
|
+
"metadata": item.metadata,
|
129
|
+
"holder": item.holder
|
130
|
+
};
|
131
|
+
});
|
132
|
+
return bookings;
|
133
|
+
};
|
134
|
+
export var formatValues = function formatValues(data, values) {
|
135
|
+
var result = {
|
136
|
+
type: "appointment_booking",
|
137
|
+
platform: data.platform,
|
138
|
+
sales_channel: data.platform,
|
139
|
+
bookings: [],
|
140
|
+
customer_id: data.customer_id,
|
141
|
+
holder: data.holder,
|
142
|
+
relation_products: data.relation_products,
|
143
|
+
metadata: data.metadata,
|
144
|
+
shop_note: data.shop_note,
|
145
|
+
shop_discount: data.shop_discount,
|
146
|
+
shop_discount_reason: data.shop_discount_reason,
|
147
|
+
contacts: data.contacts,
|
148
|
+
customer_name: data.customer_name,
|
149
|
+
email: data.customer_name,
|
150
|
+
phone: data.customer_name,
|
151
|
+
country_calling_code: data.customer_name
|
152
|
+
};
|
153
|
+
|
154
|
+
// 服务
|
155
|
+
result.bookings = formatBookings(data, values);
|
156
|
+
return result;
|
157
|
+
};
|
@@ -2,12 +2,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
2
2
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
5
|
-
import React from 'react';
|
5
|
+
import React, { useMemo } from 'react';
|
6
6
|
import classNames from 'classnames';
|
7
7
|
import { Iconfont } from '@pisell/materials';
|
8
8
|
import { locales } from "@pisell/utils";
|
9
9
|
var useClearCart = function useClearCart(state, dispatch) {
|
10
|
-
var _state$
|
10
|
+
var _state$service3;
|
11
11
|
var handleClear = function handleClear() {
|
12
12
|
// 清除购物车
|
13
13
|
dispatch({
|
@@ -17,11 +17,14 @@ var useClearCart = function useClearCart(state, dispatch) {
|
|
17
17
|
}
|
18
18
|
});
|
19
19
|
};
|
20
|
-
return
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
return useMemo(function () {
|
21
|
+
var _state$service, _state$service2;
|
22
|
+
return !!((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length) && !state.channelDisabledEdit && /*#__PURE__*/React.createElement("span", {
|
23
|
+
className: classNames('pisell-lowcode__booking-service-clear-btn', _defineProperty({}, 'pisell-lowcode__booking-service-clear-btn-disabled', !((_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length))),
|
24
|
+
onClick: handleClear
|
25
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
26
|
+
type: "pisell2-trash-01"
|
27
|
+
}), " ", /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.booking.info.text.clear-cart')));
|
28
|
+
}, [(_state$service3 = state.service) === null || _state$service3 === void 0 || (_state$service3 = _state$service3.value) === null || _state$service3 === void 0 ? void 0 : _state$service3.length, state.channelDisabledEdit]);
|
26
29
|
};
|
27
30
|
export default useClearCart;
|
@@ -36,7 +36,7 @@ import { getWaiverTitle } from "../clientVariant/utils";
|
|
36
36
|
import useGetHolderList from "../hooks/useGetHolderList";
|
37
37
|
var isLoadClient = false;
|
38
38
|
var Client = function Client() {
|
39
|
-
var _state$client$value2, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
|
39
|
+
var _state$client$value2, _state$client4, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
|
40
40
|
var modalRef = useRef();
|
41
41
|
var _useState = useState(false),
|
42
42
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -397,6 +397,7 @@ var Client = function Client() {
|
|
397
397
|
}, locales.getText('pisell2.text.load-more'))) : null;
|
398
398
|
}, [loadLoading, params, state.client.clients.length]);
|
399
399
|
var customSelect = useMemo(function () {
|
400
|
+
console.log('render customSelect');
|
400
401
|
return /*#__PURE__*/React.createElement(CustomSelect, {
|
401
402
|
autoFocus: !state.isTerminal,
|
402
403
|
modalOpen: state.modalOpen,
|
@@ -459,7 +460,7 @@ var Client = function Client() {
|
|
459
460
|
return true;
|
460
461
|
}
|
461
462
|
});
|
462
|
-
}, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
463
|
+
}, [state.isTerminal, state.modalOpen, (_state$client4 = state.client) === null || _state$client4 === void 0 ? void 0 : _state$client4.value, state.drawerMask, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
463
464
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
464
465
|
className: "pisell-lowcode__booking-client",
|
465
466
|
onClick: function onClick() {
|