@pisell/private-materials 6.2.16 → 6.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/Sales/Checkout/utils.d.ts +40 -0
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/es/components/appointmentBooking/hooks.d.ts +106 -0
- package/es/components/appointmentBooking/index.d.ts +3 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/reloadResourceModal/index.d.ts +8 -0
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.js +16 -9
- package/es/components/booking/info/index.d.ts +4 -0
- package/es/components/booking/info/service/Lists.js +36 -26
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.js +20 -21
- package/es/components/booking/info/utils.d.ts +50 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +11 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +98 -0
- package/es/components/booking/info2/service/addService/utils.js +6 -3
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
- package/es/components/booking/info2/service/editService/index.js +258 -165
- package/es/components/booking/info2/service/index.js +19 -15
- package/es/components/booking/locales.d.ts +828 -0
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +108 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/const.d.ts +184 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +35 -0
- package/es/components/eftposPay/index.d.ts +4 -0
- package/es/components/eftposPay/linkly/const.d.ts +23 -0
- package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
- package/es/components/eftposPay/linkly/index.d.ts +2 -0
- package/es/components/eftposPay/linkly/service.d.ts +32 -0
- package/es/components/eftposPay/manufacturer.d.ts +7 -0
- package/es/components/eftposPay/pay.d.ts +20 -0
- package/es/components/eftposPay/store/index.d.ts +355 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.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/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productSelect/components/TabProduct/index.d.ts +2 -0
- package/es/components/productSelect/index.d.ts +26 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- 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 +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +177 -157
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.js +78 -71
- package/es/components/ticketBooking/index.d.ts +7 -0
- package/es/components/walletList/index.d.ts +28 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/utils/index.d.ts +23 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/Sales/Checkout/utils.d.ts +40 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/lib/components/appointmentBooking/hooks.d.ts +106 -0
- package/lib/components/appointmentBooking/index.d.ts +3 -0
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +8 -0
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.js +10 -9
- package/lib/components/booking/info/index.d.ts +4 -0
- package/lib/components/booking/info/service/Lists.js +35 -23
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.js +17 -17
- package/lib/components/booking/info/utils.d.ts +50 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +11 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +98 -0
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
- package/lib/components/booking/info2/service/editService/index.js +132 -70
- package/lib/components/booking/info2/service/index.js +13 -9
- package/lib/components/booking/locales.d.ts +828 -0
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +108 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/const.d.ts +184 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +35 -0
- package/lib/components/eftposPay/index.d.ts +4 -0
- package/lib/components/eftposPay/linkly/const.d.ts +23 -0
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
- package/lib/components/eftposPay/linkly/index.d.ts +2 -0
- package/lib/components/eftposPay/linkly/service.d.ts +32 -0
- package/lib/components/eftposPay/manufacturer.d.ts +7 -0
- package/lib/components/eftposPay/pay.d.ts +20 -0
- package/lib/components/eftposPay/store/index.d.ts +355 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.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/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productSelect/components/TabProduct/index.d.ts +2 -0
- package/lib/components/productSelect/index.d.ts +26 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- 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 +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +145 -127
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.js +95 -88
- package/lib/components/ticketBooking/index.d.ts +7 -0
- package/lib/components/walletList/index.d.ts +28 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/utils/index.d.ts +23 -0
- package/package.json +2 -2
@@ -5,6 +5,7 @@ import { ProductCard } from '@pisell/materials';
|
|
5
5
|
import useClearCart from "../../hooks/useClearCart";
|
6
6
|
import { useContext } from "../../hooks/useContext";
|
7
7
|
import useAddService from "../../hooks/useAddService";
|
8
|
+
import { useMemoizedFn, useTrackedEffect } from "ahooks";
|
8
9
|
var Product = function Product(props) {
|
9
10
|
var id = props.id,
|
10
11
|
lists = props.lists,
|
@@ -35,10 +36,10 @@ var Product = function Product(props) {
|
|
35
36
|
* @Author: WangHan
|
36
37
|
* @Date: 2024-11-28 22:02
|
37
38
|
*/
|
38
|
-
var handleChange = function
|
39
|
+
var handleChange = useMemoizedFn(function (item, type, other) {
|
39
40
|
if (disabledEdit && !(other !== null && other !== void 0 && other.disabled)) return;
|
40
41
|
onChange(item, type, other);
|
41
|
-
};
|
42
|
+
});
|
42
43
|
var productParams = useMemo(function () {
|
43
44
|
return {
|
44
45
|
isShowNote: isShowNote,
|
@@ -52,44 +53,50 @@ var Product = function Product(props) {
|
|
52
53
|
isShowEditProduct: isShowEditProduct
|
53
54
|
};
|
54
55
|
}, [isShowNote, isShowPackageNote, disabledEdit, isShowChangeResource, isShowDelete, isShowHolder, isShowAddHolderButton, isShowChangeHolder, isShowEditProduct]);
|
55
|
-
|
56
|
-
|
57
|
-
}, clearCart, lists
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
56
|
+
useTrackedEffect(function (changes) {
|
57
|
+
console.log('Index of changed dependencies: ', changes);
|
58
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
59
|
+
return useMemo(function () {
|
60
|
+
console.log('render cart');
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
62
|
+
className: "pisell-lowcode__shopping-cart-content"
|
63
|
+
}, clearCart, lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
|
64
|
+
return /*#__PURE__*/React.createElement(ProductCard, _extends({
|
65
|
+
key: item._id,
|
66
|
+
dataSource: item,
|
67
|
+
onAction: function onAction(e) {
|
68
|
+
return _onAction === null || _onAction === void 0 ? void 0 : _onAction(e);
|
69
|
+
},
|
70
|
+
onDelete: function onDelete(e) {
|
71
|
+
return handleChange(e, 'delete', item);
|
72
|
+
},
|
73
|
+
onNote: function onNote(e) {
|
74
|
+
return handleChange(e, 'note', {
|
75
|
+
note: e.note
|
76
|
+
});
|
77
|
+
},
|
78
|
+
onLike: function onLike(e) {
|
79
|
+
return handleChange(e, 'like', {
|
80
|
+
like_status: e.like_status
|
81
|
+
});
|
82
|
+
},
|
83
|
+
onEditProduct: function onEditProduct(e) {
|
84
|
+
return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'edit_product');
|
85
|
+
},
|
86
|
+
onCard: function onCard(e) {
|
87
|
+
return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'view');
|
88
|
+
},
|
89
|
+
onChangeResource: function onChangeResource(e) {
|
90
|
+
return handleChange(item, 'change_resource', e);
|
91
|
+
},
|
92
|
+
onChangeHolder: function onChangeHolder(e) {
|
93
|
+
return handleChange(item, 'change_holder', e);
|
94
|
+
},
|
95
|
+
onAddHolder: function onAddHolder(e) {
|
96
|
+
return handleChange(item, 'add_holder', e);
|
97
|
+
}
|
98
|
+
}, productParams));
|
99
|
+
}), !hideAddBtn && platform !== 'h5' && isAdd ? useAddService(id, 'more') : null);
|
100
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
94
101
|
};
|
95
102
|
export default Product;
|
@@ -51,23 +51,26 @@ var Cart = function Cart() {
|
|
51
51
|
});
|
52
52
|
});
|
53
53
|
}, [carts, platform]);
|
54
|
-
return
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
54
|
+
return useMemo(function () {
|
55
|
+
console.log('render cart 22222');
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
57
|
+
className: classNames('pisell-lowcode__shopping-cart')
|
58
|
+
}, isProductList ? /*#__PURE__*/React.createElement(Product, {
|
59
|
+
id: undefined,
|
60
|
+
lists: state === null || state === void 0 ? void 0 : state.products
|
61
|
+
}) : /*#__PURE__*/React.createElement(Collapse, _extends({
|
62
|
+
items: cartsMap,
|
63
|
+
showHeader: true,
|
64
|
+
panelBackground: "#ffffff",
|
65
|
+
collapsible: platform !== 'shop' ? 'disabled' : '-',
|
66
|
+
accordion: platform === 'shop',
|
67
|
+
onChange: function onChange(key) {
|
68
|
+
updateState({
|
69
|
+
activeKey: key
|
70
|
+
});
|
71
|
+
onActiveKey(key);
|
72
|
+
}
|
73
|
+
}, collapseParams)));
|
74
|
+
}, [isProductList, cartsMap, platform, collapseParams, state === null || state === void 0 ? void 0 : state.products]);
|
72
75
|
};
|
73
76
|
export default Cart;
|
@@ -33,7 +33,7 @@ import { addService, addServiceScroll, genServiceKey, getIsShowNumber } from "..
|
|
33
33
|
import NotAvailable from "../notAvailable";
|
34
34
|
import dayjs from 'dayjs';
|
35
35
|
var AddSerivce = function AddSerivce(props) {
|
36
|
-
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$client2, _state$service4
|
36
|
+
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$client2, _state$service4;
|
37
37
|
var onEdit = props.onEdit,
|
38
38
|
state = props.state,
|
39
39
|
dispatch = props.dispatch,
|
@@ -276,10 +276,184 @@ var AddSerivce = function AddSerivce(props) {
|
|
276
276
|
var isEject = getIsEject(item, type);
|
277
277
|
var isOnlySession = getIsOnlySession(item);
|
278
278
|
var lock = false;
|
279
|
+
// 对于不需要打开弹窗的商品, 直接模拟数据, 不走弹窗
|
280
|
+
var cacheValues = null;
|
279
281
|
if (isEject) {
|
280
282
|
setCurrentProduct(item);
|
281
283
|
} else {
|
282
284
|
setCurrentProduct(null);
|
285
|
+
if (!isSession) {
|
286
|
+
cacheValues = {
|
287
|
+
bundle: [],
|
288
|
+
key: item.id,
|
289
|
+
option: [],
|
290
|
+
product_id: item.id,
|
291
|
+
product_variant_id: 0,
|
292
|
+
quantity: 1,
|
293
|
+
rowKey: item.id,
|
294
|
+
session: null,
|
295
|
+
unique: '08974625397'
|
296
|
+
};
|
297
|
+
}
|
298
|
+
}
|
299
|
+
var callback = /*#__PURE__*/function () {
|
300
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
|
301
|
+
var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
|
302
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
303
|
+
while (1) switch (_context3.prev = _context3.next) {
|
304
|
+
case 0:
|
305
|
+
setCurrentProduct(null);
|
306
|
+
// 防止选择商品弹窗多次触发callback
|
307
|
+
if (!lock) {
|
308
|
+
_context3.next = 3;
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
return _context3.abrupt("return");
|
312
|
+
case 3:
|
313
|
+
lock = true;
|
314
|
+
|
315
|
+
// 2秒后解除
|
316
|
+
setTimeout(function () {
|
317
|
+
lock = false;
|
318
|
+
}, 2000);
|
319
|
+
if (isBooking4) {
|
320
|
+
_context3.next = 11;
|
321
|
+
break;
|
322
|
+
}
|
323
|
+
_context3.next = 8;
|
324
|
+
return createBookingData({
|
325
|
+
product: _objectSpread(_objectSpread({}, detail || item), {}, {
|
326
|
+
_params: e
|
327
|
+
})
|
328
|
+
});
|
329
|
+
case 8:
|
330
|
+
data = _context3.sent;
|
331
|
+
// 创建预约
|
332
|
+
createBooking({
|
333
|
+
booking: data
|
334
|
+
});
|
335
|
+
return _context3.abrupt("return");
|
336
|
+
case 11:
|
337
|
+
// info2 addService 逻辑
|
338
|
+
_detail = detail || item;
|
339
|
+
other = JSON.parse(JSON.stringify(e));
|
340
|
+
other.session = e.session;
|
341
|
+
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
342
|
+
product_id: item.id,
|
343
|
+
_id: getUniqueId(),
|
344
|
+
_key: e.key,
|
345
|
+
_extend: {
|
346
|
+
start_date: state.date.value,
|
347
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
348
|
+
price: _detail.price,
|
349
|
+
product_name: item.title,
|
350
|
+
other: other
|
351
|
+
},
|
352
|
+
new: 1
|
353
|
+
});
|
354
|
+
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
355
|
+
cacheItem._extend.total = _total;
|
356
|
+
// 用于储存原价
|
357
|
+
cacheItem._extend.origin_total = _total;
|
358
|
+
_isEdit = !!state.service.cacheItem;
|
359
|
+
if (_isEdit) {
|
360
|
+
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
361
|
+
cacheItem.new = 0;
|
362
|
+
}
|
363
|
+
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
364
|
+
if (renderMode === 'current') {
|
365
|
+
// cacheItem._extend.resource = 0;
|
366
|
+
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
367
|
+
}
|
368
|
+
cacheItem = getProductExtend({
|
369
|
+
cacheItem: cacheItem,
|
370
|
+
state: state,
|
371
|
+
isDisabledTime: true
|
372
|
+
});
|
373
|
+
if (state.renderType === 'eventBooking') {
|
374
|
+
cacheItem.autoClose = false;
|
375
|
+
}
|
376
|
+
if (cacheItem.autoClose) {
|
377
|
+
cacheItem.autoClose = false;
|
378
|
+
cacheItem._serviceKey = genServiceKey(cacheItem);
|
379
|
+
_addService = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService.list, quantity = _addService.quantity;
|
380
|
+
Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
|
381
|
+
className: "add-toast-wrap"
|
382
|
+
}, /*#__PURE__*/React.createElement("div", {
|
383
|
+
className: "add-toast-title"
|
384
|
+
}, cacheItem.title), /*#__PURE__*/React.createElement("div", {
|
385
|
+
className: "add-toast-quantity"
|
386
|
+
}, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
|
387
|
+
addServiceScroll(e.rowKey, cacheItem);
|
388
|
+
try {
|
389
|
+
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
390
|
+
val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
391
|
+
return {
|
392
|
+
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
393
|
+
detailId: s === null || s === void 0 ? void 0 : s.id,
|
394
|
+
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
395
|
+
product_name: s === null || s === void 0 ? void 0 : s.title,
|
396
|
+
price: s === null || s === void 0 ? void 0 : s.price,
|
397
|
+
_id: s === null || s === void 0 ? void 0 : s._id,
|
398
|
+
_key: s === null || s === void 0 ? void 0 : s._key,
|
399
|
+
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
400
|
+
};
|
401
|
+
});
|
402
|
+
sendData = {
|
403
|
+
product_id: item === null || item === void 0 ? void 0 : item.id,
|
404
|
+
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
405
|
+
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
406
|
+
product_name: item === null || item === void 0 ? void 0 : item.title,
|
407
|
+
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
408
|
+
serviceVal: val
|
409
|
+
};
|
410
|
+
sendWarningLog({
|
411
|
+
title: 'addService',
|
412
|
+
content: [{
|
413
|
+
key: '添加数据',
|
414
|
+
value: JSON.stringify(sendData)
|
415
|
+
}, {
|
416
|
+
key: '日期',
|
417
|
+
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
418
|
+
}]
|
419
|
+
});
|
420
|
+
}
|
421
|
+
} catch (error) {}
|
422
|
+
dispatch({
|
423
|
+
type: 'setService',
|
424
|
+
payload: {
|
425
|
+
addModal: false,
|
426
|
+
value: _list,
|
427
|
+
edit: true,
|
428
|
+
changeService: false
|
429
|
+
}
|
430
|
+
});
|
431
|
+
} else {
|
432
|
+
dispatch({
|
433
|
+
type: 'setService',
|
434
|
+
payload: {
|
435
|
+
editModal: true,
|
436
|
+
cacheItem: cacheItem,
|
437
|
+
addModal: !cacheItem.autoClose,
|
438
|
+
changeService: false
|
439
|
+
}
|
440
|
+
});
|
441
|
+
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
442
|
+
}
|
443
|
+
case 24:
|
444
|
+
case "end":
|
445
|
+
return _context3.stop();
|
446
|
+
}
|
447
|
+
}, _callee3);
|
448
|
+
}));
|
449
|
+
return function callback(_x3, _x4, _x5) {
|
450
|
+
return _ref3.apply(this, arguments);
|
451
|
+
};
|
452
|
+
}();
|
453
|
+
// 如果不需要打开弹窗, 直接添加数据
|
454
|
+
if (cacheValues) {
|
455
|
+
callback(cacheValues, '', item);
|
456
|
+
return;
|
283
457
|
}
|
284
458
|
state.action({
|
285
459
|
type: 'pisell1.handleOpenProductModal',
|
@@ -301,161 +475,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
301
475
|
onCancel: function onCancel() {
|
302
476
|
setCurrentProduct(null);
|
303
477
|
},
|
304
|
-
callback:
|
305
|
-
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
|
306
|
-
var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
|
307
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
308
|
-
while (1) switch (_context3.prev = _context3.next) {
|
309
|
-
case 0:
|
310
|
-
setCurrentProduct(null);
|
311
|
-
// 防止选择商品弹窗多次触发callback
|
312
|
-
if (!lock) {
|
313
|
-
_context3.next = 3;
|
314
|
-
break;
|
315
|
-
}
|
316
|
-
return _context3.abrupt("return");
|
317
|
-
case 3:
|
318
|
-
lock = true;
|
319
|
-
|
320
|
-
// 2秒后解除
|
321
|
-
setTimeout(function () {
|
322
|
-
lock = false;
|
323
|
-
}, 2000);
|
324
|
-
if (isBooking4) {
|
325
|
-
_context3.next = 11;
|
326
|
-
break;
|
327
|
-
}
|
328
|
-
_context3.next = 8;
|
329
|
-
return createBookingData({
|
330
|
-
product: _objectSpread(_objectSpread({}, detail || item), {}, {
|
331
|
-
_params: e
|
332
|
-
})
|
333
|
-
});
|
334
|
-
case 8:
|
335
|
-
data = _context3.sent;
|
336
|
-
// 创建预约
|
337
|
-
createBooking({
|
338
|
-
booking: data
|
339
|
-
});
|
340
|
-
return _context3.abrupt("return");
|
341
|
-
case 11:
|
342
|
-
// info2 addService 逻辑
|
343
|
-
_detail = detail || item;
|
344
|
-
other = JSON.parse(JSON.stringify(e));
|
345
|
-
other.session = e.session;
|
346
|
-
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
347
|
-
product_id: item.id,
|
348
|
-
_id: getUniqueId(),
|
349
|
-
_key: e.key,
|
350
|
-
_extend: {
|
351
|
-
start_date: state.date.value,
|
352
|
-
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
353
|
-
price: _detail.price,
|
354
|
-
product_name: item.title,
|
355
|
-
other: other
|
356
|
-
},
|
357
|
-
new: 1
|
358
|
-
});
|
359
|
-
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
360
|
-
cacheItem._extend.total = _total;
|
361
|
-
// 用于储存原价
|
362
|
-
cacheItem._extend.origin_total = _total;
|
363
|
-
_isEdit = !!state.service.cacheItem;
|
364
|
-
if (_isEdit) {
|
365
|
-
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
366
|
-
cacheItem.new = 0;
|
367
|
-
}
|
368
|
-
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
369
|
-
if (renderMode === 'current') {
|
370
|
-
// cacheItem._extend.resource = 0;
|
371
|
-
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
372
|
-
}
|
373
|
-
cacheItem = getProductExtend({
|
374
|
-
cacheItem: cacheItem,
|
375
|
-
state: state,
|
376
|
-
isDisabledTime: true
|
377
|
-
});
|
378
|
-
if (state.renderType === 'eventBooking') {
|
379
|
-
cacheItem.autoClose = false;
|
380
|
-
}
|
381
|
-
if (cacheItem.autoClose) {
|
382
|
-
cacheItem.autoClose = false;
|
383
|
-
cacheItem._serviceKey = genServiceKey(cacheItem);
|
384
|
-
_addService = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService.list, quantity = _addService.quantity;
|
385
|
-
Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
|
386
|
-
className: "add-toast-wrap"
|
387
|
-
}, /*#__PURE__*/React.createElement("div", {
|
388
|
-
className: "add-toast-title"
|
389
|
-
}, cacheItem.title), /*#__PURE__*/React.createElement("div", {
|
390
|
-
className: "add-toast-quantity"
|
391
|
-
}, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
|
392
|
-
addServiceScroll(e.rowKey, cacheItem);
|
393
|
-
try {
|
394
|
-
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
395
|
-
val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
396
|
-
return {
|
397
|
-
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
398
|
-
detailId: s === null || s === void 0 ? void 0 : s.id,
|
399
|
-
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
400
|
-
product_name: s === null || s === void 0 ? void 0 : s.title,
|
401
|
-
price: s === null || s === void 0 ? void 0 : s.price,
|
402
|
-
_id: s === null || s === void 0 ? void 0 : s._id,
|
403
|
-
_key: s === null || s === void 0 ? void 0 : s._key,
|
404
|
-
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
405
|
-
};
|
406
|
-
});
|
407
|
-
sendData = {
|
408
|
-
product_id: item === null || item === void 0 ? void 0 : item.id,
|
409
|
-
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
410
|
-
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
411
|
-
product_name: item === null || item === void 0 ? void 0 : item.title,
|
412
|
-
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
413
|
-
serviceVal: val
|
414
|
-
};
|
415
|
-
sendWarningLog({
|
416
|
-
title: 'addService',
|
417
|
-
content: [{
|
418
|
-
key: '添加数据',
|
419
|
-
value: JSON.stringify(sendData)
|
420
|
-
}, {
|
421
|
-
key: '日期',
|
422
|
-
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
423
|
-
}]
|
424
|
-
});
|
425
|
-
}
|
426
|
-
} catch (error) {}
|
427
|
-
dispatch({
|
428
|
-
type: 'setService',
|
429
|
-
payload: {
|
430
|
-
addModal: false,
|
431
|
-
value: _list,
|
432
|
-
edit: true,
|
433
|
-
changeService: false
|
434
|
-
}
|
435
|
-
});
|
436
|
-
} else {
|
437
|
-
dispatch({
|
438
|
-
type: 'setService',
|
439
|
-
payload: {
|
440
|
-
editModal: true,
|
441
|
-
cacheItem: cacheItem,
|
442
|
-
addModal: !cacheItem.autoClose,
|
443
|
-
changeService: false
|
444
|
-
}
|
445
|
-
});
|
446
|
-
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
447
|
-
}
|
448
|
-
case 24:
|
449
|
-
case "end":
|
450
|
-
return _context3.stop();
|
451
|
-
}
|
452
|
-
}, _callee3);
|
453
|
-
}));
|
454
|
-
function callback(_x3, _x4, _x5) {
|
455
|
-
return _callback.apply(this, arguments);
|
456
|
-
}
|
457
|
-
return callback;
|
458
|
-
}()
|
478
|
+
callback: callback
|
459
479
|
});
|
460
480
|
});
|
461
481
|
var renderList = useMemo(function () {
|
@@ -513,6 +533,6 @@ var AddSerivce = function AddSerivce(props) {
|
|
513
533
|
}));
|
514
534
|
}
|
515
535
|
return null;
|
516
|
-
}, [
|
536
|
+
}, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
|
517
537
|
};
|
518
538
|
export default AddSerivce;
|