@pisell/private-materials 6.1.1 → 6.1.3
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 +38 -26
- package/es/components/booking/info/service/editService/index.js +3 -0
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.js +2 -0
- package/es/components/booking/info/service/serviceManager/index.js +3 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.js +1 -0
- package/es/components/booking/info/service2/utils.js +26 -25
- package/es/components/booking/info2/service/addService/index.js +1 -0
- 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 +261 -167
- package/es/components/booking/info2/service/index.js +19 -15
- package/es/components/booking/info2/service/serviceList/index.js +2 -0
- 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 +3 -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 +37 -23
- package/lib/components/booking/info/service/editService/index.js +3 -0
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.js +2 -0
- package/lib/components/booking/info/service/serviceManager/index.js +2 -0
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.js +1 -0
- package/lib/components/booking/info/service2/utils.js +22 -21
- package/lib/components/booking/info2/service/addService/index.js +1 -0
- 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 +164 -79
- package/lib/components/booking/info2/service/index.js +13 -9
- package/lib/components/booking/info2/service/serviceList/index.js +2 -0
- 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 +2 -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 +2 -2
@@ -1,16 +1,9 @@
|
|
1
|
-
var _excluded = ["detail", "product"];
|
2
1
|
var _this = this;
|
3
|
-
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
2
|
+
var _excluded = ["detail", "product"];
|
5
3
|
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); }
|
6
4
|
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; }
|
7
5
|
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); } }
|
8
6
|
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); }); }; }
|
9
|
-
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; }
|
10
|
-
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; }
|
11
|
-
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; }
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
13
|
-
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); }
|
14
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
15
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
16
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -18,6 +11,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
18
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
19
12
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
20
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
|
+
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; }
|
15
|
+
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; }
|
16
|
+
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; }
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
18
|
+
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); }
|
19
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
20
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
21
21
|
import React, { useEffect, useRef } from 'react';
|
22
22
|
import { locales } from '@pisell/utils';
|
23
23
|
import { message } from 'antd';
|
@@ -34,6 +34,135 @@ import "./index.less";
|
|
34
34
|
import { formatProducts } from "../../../booking/info/service2/utils";
|
35
35
|
import { getSumTotal } from "../../../booking/components/footer/amount";
|
36
36
|
import formatProductMessage from "../../utils/formatProductMessage";
|
37
|
+
export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
|
38
|
+
var _bookings$list, _bookings$list2;
|
39
|
+
var customer_id = data.customer_id,
|
40
|
+
holder = data.holder,
|
41
|
+
customer_name = data.customer_name,
|
42
|
+
email = data.email,
|
43
|
+
phone = data.phone,
|
44
|
+
country_calling_code = data.country_calling_code,
|
45
|
+
bookings = data.bookings,
|
46
|
+
customer = data.customer,
|
47
|
+
note = data.note,
|
48
|
+
payment_status = data.payment_status,
|
49
|
+
is_other_entrance_edited = data.is_other_entrance_edited,
|
50
|
+
shop_discount = data.shop_discount;
|
51
|
+
var clientValue = {
|
52
|
+
name: ((customer === null || customer === void 0 ? void 0 : customer.display_name) || '').trim() || ((customer === null || customer === void 0 ? void 0 : customer.nickname) || '').trim() || '',
|
53
|
+
id: customer_id || (customer === null || customer === void 0 ? void 0 : customer.id) || (customer === null || customer === void 0 ? void 0 : customer.customer_id) || 1,
|
54
|
+
email: customer === null || customer === void 0 ? void 0 : customer.email,
|
55
|
+
phone: (customer === null || customer === void 0 ? void 0 : customer.phone) || '',
|
56
|
+
country_calling_code: (customer === null || customer === void 0 ? void 0 : customer.country_calling_code) || '',
|
57
|
+
cover: (customer === null || customer === void 0 ? void 0 : customer.cover) || ''
|
58
|
+
};
|
59
|
+
var start_date = bookings === null || bookings === void 0 || (_bookings$list = bookings.list) === null || _bookings$list === void 0 || (_bookings$list = _bookings$list[0]) === null || _bookings$list === void 0 ? void 0 : _bookings$list.start_date;
|
60
|
+
var dateValue = dayjs(start_date ? start_date + ' ' + (bookings === null || bookings === void 0 || (_bookings$list2 = bookings.list) === null || _bookings$list2 === void 0 || (_bookings$list2 = _bookings$list2[0]) === null || _bookings$list2 === void 0 ? void 0 : _bookings$list2.start_time) : new Date());
|
61
|
+
var petsValue = holder;
|
62
|
+
var getCapacity = function getCapacity(resetD) {
|
63
|
+
var _resetD$metadata;
|
64
|
+
return (_resetD$metadata = resetD.metadata) === null || _resetD$metadata === void 0 ? void 0 : _resetD$metadata.capacity;
|
65
|
+
};
|
66
|
+
var getResource = function getResource(resetD) {
|
67
|
+
if (!bookings.relation_type) {
|
68
|
+
try {
|
69
|
+
var _resetD$event_resourc;
|
70
|
+
if (resetD !== null && resetD !== void 0 && resetD.event_resources && resetD !== null && resetD !== void 0 && (_resetD$event_resourc = resetD.event_resources) !== null && _resetD$event_resourc !== void 0 && _resetD$event_resourc.length) {
|
71
|
+
return resetD.event_resources.reduce(function (pre, cur) {
|
72
|
+
if (pre[cur.form_id]) {
|
73
|
+
pre[cur.form_id].push(cur);
|
74
|
+
} else {
|
75
|
+
pre[cur.form_id] = [cur];
|
76
|
+
}
|
77
|
+
return pre;
|
78
|
+
}, {});
|
79
|
+
}
|
80
|
+
} catch (err) {
|
81
|
+
console.error(err);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
return resetD.relation_id;
|
85
|
+
};
|
86
|
+
var serviceValue = bookings.list.map(function (d) {
|
87
|
+
var detail = d.detail,
|
88
|
+
product = d.product,
|
89
|
+
resetD = _objectWithoutProperties(d, _excluded);
|
90
|
+
var _detail = detail || mockProduct;
|
91
|
+
var start_date = dayjs(resetD.start_date + ' ' + resetD.start_time);
|
92
|
+
var end_date = dayjs(resetD.end_date + ' ' + resetD.end_time);
|
93
|
+
return _objectSpread(_objectSpread({
|
94
|
+
_id: (Math.random() + '').replace(/\D/g, '').substring(0, 11)
|
95
|
+
}, _detail), {}, {
|
96
|
+
booking_id: resetD.id,
|
97
|
+
id: _detail.product_id,
|
98
|
+
title: _detail.product_title,
|
99
|
+
quantity: Number(_detail.product_quantity),
|
100
|
+
cover: _detail.product_cover,
|
101
|
+
// 商品本身的价格
|
102
|
+
price: Number(_detail.source_product_price),
|
103
|
+
relation_form_name: resetD.relation_form_name,
|
104
|
+
product_resource: product === null || product === void 0 ? void 0 : product.product_resource,
|
105
|
+
capacity: product === null || product === void 0 ? void 0 : product.capacity,
|
106
|
+
_extend: _objectSpread(_objectSpread({}, resetD), {}, {
|
107
|
+
quantity: Number(_detail.product_quantity),
|
108
|
+
startDate: start_date,
|
109
|
+
start_date: start_date,
|
110
|
+
endDate: end_date,
|
111
|
+
end_date: end_date,
|
112
|
+
// 商品本身的价格
|
113
|
+
price: Number(_detail.source_product_price),
|
114
|
+
product_name: _detail.product_title,
|
115
|
+
discount_reason: _detail.product_discount_reason,
|
116
|
+
// resource: resetD.relation_id,
|
117
|
+
order_detail_id: _detail.order_detail_id,
|
118
|
+
// 总价: 商品本身价格 + 套餐价格 + 单规格价格 包含折扣
|
119
|
+
total: Number(_detail.selling_price),
|
120
|
+
// 原总价: 商品本身价格 + 套餐价格 + 单规格价格 不包含折扣
|
121
|
+
origin_total: Number(_detail.original_price),
|
122
|
+
payment_price: Number(_detail.payment_price),
|
123
|
+
other: restoreProductOtherData(d),
|
124
|
+
// 是否编辑了套餐 默认为0 如果编辑之后为1
|
125
|
+
bundle_edit: 0,
|
126
|
+
discount_per: _detail.discount_per,
|
127
|
+
discount_type: _detail.discount_type,
|
128
|
+
discountway: _detail.discountway,
|
129
|
+
capacity: getCapacity(resetD),
|
130
|
+
resource: getResource(resetD)
|
131
|
+
})
|
132
|
+
});
|
133
|
+
});
|
134
|
+
var disabledEdit = getDisabledEdit(data);
|
135
|
+
var channelDisabledEdit = !!is_other_entrance_edited;
|
136
|
+
return _objectSpread(_objectSpread({}, modalState), {}, {
|
137
|
+
client: _objectSpread(_objectSpread({}, modalState.client), {}, {
|
138
|
+
value: clientValue,
|
139
|
+
edit: false,
|
140
|
+
showModal: false
|
141
|
+
}),
|
142
|
+
date: _objectSpread(_objectSpread({}, modalState.date), {}, {
|
143
|
+
value: dateValue,
|
144
|
+
edit: false,
|
145
|
+
showModal: false
|
146
|
+
}),
|
147
|
+
pet: _objectSpread(_objectSpread({}, modalState.pet), {}, {
|
148
|
+
showModal: false,
|
149
|
+
edit: false
|
150
|
+
}),
|
151
|
+
service: _objectSpread(_objectSpread({}, modalState.service), {}, {
|
152
|
+
value: serviceValue,
|
153
|
+
addModal: false,
|
154
|
+
editModal: false,
|
155
|
+
edit: false
|
156
|
+
}),
|
157
|
+
notes: _objectSpread(_objectSpread({}, modalState.notes), {}, {
|
158
|
+
orderNote: note,
|
159
|
+
edit: false
|
160
|
+
}),
|
161
|
+
disabledEdit: disabledEdit,
|
162
|
+
channelDisabledEdit: channelDisabledEdit,
|
163
|
+
appointment_status: bookings === null || bookings === void 0 ? void 0 : bookings.appointment_status
|
164
|
+
});
|
165
|
+
};
|
37
166
|
var TicketBooking = function TicketBooking() {
|
38
167
|
var _engineContext$appHel2;
|
39
168
|
var _useStore = useStore(),
|
@@ -438,135 +567,6 @@ var TicketBooking = function TicketBooking() {
|
|
438
567
|
});
|
439
568
|
}
|
440
569
|
};
|
441
|
-
var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
|
442
|
-
var _bookings$list, _bookings$list2;
|
443
|
-
var customer_id = data.customer_id,
|
444
|
-
holder = data.holder,
|
445
|
-
customer_name = data.customer_name,
|
446
|
-
email = data.email,
|
447
|
-
phone = data.phone,
|
448
|
-
country_calling_code = data.country_calling_code,
|
449
|
-
bookings = data.bookings,
|
450
|
-
customer = data.customer,
|
451
|
-
note = data.note,
|
452
|
-
payment_status = data.payment_status,
|
453
|
-
is_other_entrance_edited = data.is_other_entrance_edited,
|
454
|
-
shop_discount = data.shop_discount;
|
455
|
-
var clientValue = {
|
456
|
-
name: ((customer === null || customer === void 0 ? void 0 : customer.display_name) || '').trim() || ((customer === null || customer === void 0 ? void 0 : customer.nickname) || '').trim() || '',
|
457
|
-
id: customer_id || (customer === null || customer === void 0 ? void 0 : customer.id) || (customer === null || customer === void 0 ? void 0 : customer.customer_id) || 1,
|
458
|
-
email: customer === null || customer === void 0 ? void 0 : customer.email,
|
459
|
-
phone: (customer === null || customer === void 0 ? void 0 : customer.phone) || '',
|
460
|
-
country_calling_code: (customer === null || customer === void 0 ? void 0 : customer.country_calling_code) || '',
|
461
|
-
cover: (customer === null || customer === void 0 ? void 0 : customer.cover) || ''
|
462
|
-
};
|
463
|
-
var start_date = bookings === null || bookings === void 0 || (_bookings$list = bookings.list) === null || _bookings$list === void 0 || (_bookings$list = _bookings$list[0]) === null || _bookings$list === void 0 ? void 0 : _bookings$list.start_date;
|
464
|
-
var dateValue = dayjs(start_date ? start_date + ' ' + (bookings === null || bookings === void 0 || (_bookings$list2 = bookings.list) === null || _bookings$list2 === void 0 || (_bookings$list2 = _bookings$list2[0]) === null || _bookings$list2 === void 0 ? void 0 : _bookings$list2.start_time) : new Date());
|
465
|
-
var petsValue = holder;
|
466
|
-
var getCapacity = function getCapacity(resetD) {
|
467
|
-
var _resetD$metadata;
|
468
|
-
return (_resetD$metadata = resetD.metadata) === null || _resetD$metadata === void 0 ? void 0 : _resetD$metadata.capacity;
|
469
|
-
};
|
470
|
-
var getResource = function getResource(resetD) {
|
471
|
-
if (!bookings.relation_type) {
|
472
|
-
try {
|
473
|
-
var _resetD$event_resourc;
|
474
|
-
if (resetD !== null && resetD !== void 0 && resetD.event_resources && resetD !== null && resetD !== void 0 && (_resetD$event_resourc = resetD.event_resources) !== null && _resetD$event_resourc !== void 0 && _resetD$event_resourc.length) {
|
475
|
-
return resetD.event_resources.reduce(function (pre, cur) {
|
476
|
-
if (pre[cur.form_id]) {
|
477
|
-
pre[cur.form_id].push(cur);
|
478
|
-
} else {
|
479
|
-
pre[cur.form_id] = [cur];
|
480
|
-
}
|
481
|
-
return pre;
|
482
|
-
}, {});
|
483
|
-
}
|
484
|
-
} catch (err) {
|
485
|
-
console.error(err);
|
486
|
-
}
|
487
|
-
}
|
488
|
-
return resetD.relation_id;
|
489
|
-
};
|
490
|
-
var serviceValue = bookings.list.map(function (d) {
|
491
|
-
var detail = d.detail,
|
492
|
-
product = d.product,
|
493
|
-
resetD = _objectWithoutProperties(d, _excluded);
|
494
|
-
var _detail = detail || mockProduct;
|
495
|
-
var start_date = dayjs(resetD.start_date + ' ' + resetD.start_time);
|
496
|
-
var end_date = dayjs(resetD.end_date + ' ' + resetD.end_time);
|
497
|
-
return _objectSpread(_objectSpread({
|
498
|
-
_id: (Math.random() + '').replace(/\D/g, '').substring(0, 11)
|
499
|
-
}, _detail), {}, {
|
500
|
-
booking_id: resetD.id,
|
501
|
-
id: _detail.product_id,
|
502
|
-
title: _detail.product_title,
|
503
|
-
quantity: Number(_detail.product_quantity),
|
504
|
-
cover: _detail.product_cover,
|
505
|
-
// 商品本身的价格
|
506
|
-
price: Number(_detail.source_product_price),
|
507
|
-
relation_form_name: resetD.relation_form_name,
|
508
|
-
product_resource: product === null || product === void 0 ? void 0 : product.product_resource,
|
509
|
-
capacity: product === null || product === void 0 ? void 0 : product.capacity,
|
510
|
-
_extend: _objectSpread(_objectSpread({}, resetD), {}, {
|
511
|
-
quantity: Number(_detail.product_quantity),
|
512
|
-
startDate: start_date,
|
513
|
-
start_date: start_date,
|
514
|
-
endDate: end_date,
|
515
|
-
end_date: end_date,
|
516
|
-
// 商品本身的价格
|
517
|
-
price: Number(_detail.source_product_price),
|
518
|
-
product_name: _detail.product_title,
|
519
|
-
discount_reason: _detail.product_discount_reason,
|
520
|
-
// resource: resetD.relation_id,
|
521
|
-
order_detail_id: _detail.order_detail_id,
|
522
|
-
// 总价: 商品本身价格 + 套餐价格 + 单规格价格 包含折扣
|
523
|
-
total: Number(_detail.selling_price),
|
524
|
-
// 原总价: 商品本身价格 + 套餐价格 + 单规格价格 不包含折扣
|
525
|
-
origin_total: Number(_detail.original_price),
|
526
|
-
payment_price: Number(_detail.payment_price),
|
527
|
-
other: restoreProductOtherData(d),
|
528
|
-
// 是否编辑了套餐 默认为0 如果编辑之后为1
|
529
|
-
bundle_edit: 0,
|
530
|
-
discount_per: _detail.discount_per,
|
531
|
-
discount_type: _detail.discount_type,
|
532
|
-
discountway: _detail.discountway,
|
533
|
-
capacity: getCapacity(resetD),
|
534
|
-
resource: getResource(resetD)
|
535
|
-
})
|
536
|
-
});
|
537
|
-
});
|
538
|
-
var disabledEdit = getDisabledEdit(data);
|
539
|
-
var channelDisabledEdit = !!is_other_entrance_edited;
|
540
|
-
return _objectSpread(_objectSpread({}, modalState), {}, {
|
541
|
-
client: _objectSpread(_objectSpread({}, modalState.client), {}, {
|
542
|
-
value: clientValue,
|
543
|
-
edit: false,
|
544
|
-
showModal: false
|
545
|
-
}),
|
546
|
-
date: _objectSpread(_objectSpread({}, modalState.date), {}, {
|
547
|
-
value: dateValue,
|
548
|
-
edit: false,
|
549
|
-
showModal: false
|
550
|
-
}),
|
551
|
-
pet: _objectSpread(_objectSpread({}, modalState.pet), {}, {
|
552
|
-
showModal: false,
|
553
|
-
edit: false
|
554
|
-
}),
|
555
|
-
service: _objectSpread(_objectSpread({}, modalState.service), {}, {
|
556
|
-
value: serviceValue,
|
557
|
-
addModal: false,
|
558
|
-
editModal: false,
|
559
|
-
edit: false
|
560
|
-
}),
|
561
|
-
notes: _objectSpread(_objectSpread({}, modalState.notes), {}, {
|
562
|
-
orderNote: note,
|
563
|
-
edit: false
|
564
|
-
}),
|
565
|
-
disabledEdit: disabledEdit,
|
566
|
-
channelDisabledEdit: channelDisabledEdit,
|
567
|
-
appointment_status: bookings === null || bookings === void 0 ? void 0 : bookings.appointment_status
|
568
|
-
});
|
569
|
-
};
|
570
570
|
|
571
571
|
/**
|
572
572
|
* 初始化预约数据
|
@@ -94,7 +94,8 @@ export var restoreProductOtherData = function restoreProductOtherData(data) {
|
|
94
94
|
quantity: bundleItem.num,
|
95
95
|
product_option_item_id: optionItem.option_group_item_id
|
96
96
|
});
|
97
|
-
})
|
97
|
+
}),
|
98
|
+
price: (bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.bundle_sum_type) === 'markdown' ? "-".concat(Number(bundleItem.bundle_sum_price)) : Number(bundleItem.bundle_sum_price)
|
98
99
|
});
|
99
100
|
}),
|
100
101
|
product_variant_id: 0,
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { useEffect } from 'react';
|
2
|
+
export var useWindowSize = function useWindowSize() {
|
3
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4
|
+
var _options$debounceMs = options.debounceMs,
|
5
|
+
debounceMs = _options$debounceMs === void 0 ? 100 : _options$debounceMs;
|
6
|
+
useEffect(function () {
|
7
|
+
var timeoutId;
|
8
|
+
var setRealVH = function setRealVH() {
|
9
|
+
// window.innerHeight 会返回视口真实的高度(不包括工具栏)
|
10
|
+
var vh = window.innerHeight * 0.01;
|
11
|
+
document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
|
12
|
+
};
|
13
|
+
var debouncedHandleResize = function debouncedHandleResize() {
|
14
|
+
clearTimeout(timeoutId);
|
15
|
+
timeoutId = setTimeout(setRealVH, debounceMs);
|
16
|
+
};
|
17
|
+
|
18
|
+
// 页面加载和窗口大小变化时都重新计算
|
19
|
+
debouncedHandleResize();
|
20
|
+
window.addEventListener('resize', debouncedHandleResize);
|
21
|
+
return function () {
|
22
|
+
window.removeEventListener('resize', debouncedHandleResize);
|
23
|
+
clearTimeout(timeoutId);
|
24
|
+
};
|
25
|
+
}, [debounceMs]);
|
26
|
+
};
|
package/es/index.d.ts
CHANGED
@@ -44,3 +44,5 @@ export { default as AppointmentBooking } from './components/appointmentBooking';
|
|
44
44
|
export { default as AppointmentDeposit } from './components/appointmentBooking/deposit';
|
45
45
|
export { default as TicketBooking } from './components/ticketBooking';
|
46
46
|
export { default as SubTotal } from './components/subTotal';
|
47
|
+
export { default as EditBookingModal } from './components/booking/editBookingModal';
|
48
|
+
export { default as StepController } from './components/stepController';
|
package/es/index.js
CHANGED
@@ -47,4 +47,6 @@ export { default as ShoppingCart } from "./components/shoppingCart";
|
|
47
47
|
export { default as AppointmentBooking } from "./components/appointmentBooking";
|
48
48
|
export { default as AppointmentDeposit } from "./components/appointmentBooking/deposit";
|
49
49
|
export { default as TicketBooking } from "./components/ticketBooking";
|
50
|
-
export { default as SubTotal } from "./components/subTotal";
|
50
|
+
export { default as SubTotal } from "./components/subTotal";
|
51
|
+
export { default as EditBookingModal } from "./components/booking/editBookingModal";
|
52
|
+
export { default as StepController } from "./components/stepController";
|
@@ -35,6 +35,7 @@ __export(Sales_exports, {
|
|
35
35
|
});
|
36
36
|
module.exports = __toCommonJS(Sales_exports);
|
37
37
|
var import_react = __toESM(require("react"));
|
38
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
38
39
|
var defaultData = {};
|
39
40
|
var SALES_MODEL_SESSION_STORAGE_KEY = "shop_h5_sales_model_data";
|
40
41
|
var SalesContext = (0, import_react.createContext)(
|
@@ -45,14 +46,13 @@ var SalesProvider = (props) => {
|
|
45
46
|
const dataRef = (0, import_react.useRef)({});
|
46
47
|
const [data, setData] = (0, import_react.useState)(defaultData);
|
47
48
|
const [hooks, setHooks] = (0, import_react.useState)(props.hooks);
|
49
|
+
const context = (0, import_useEngineContext.default)();
|
50
|
+
const utils = context.appHelper.utils || {};
|
48
51
|
const _setData = (newData) => {
|
49
52
|
dataRef.current = { ...dataRef.current, ...newData };
|
50
53
|
console.log("sales_model_newData", dataRef.current);
|
51
54
|
if (config == null ? void 0 : config.useSessionStorage) {
|
52
|
-
|
53
|
-
SALES_MODEL_SESSION_STORAGE_KEY,
|
54
|
-
JSON.stringify(dataRef.current || {})
|
55
|
-
);
|
55
|
+
setSessionStorage();
|
56
56
|
}
|
57
57
|
setData({ ...dataRef.current });
|
58
58
|
};
|
@@ -60,14 +60,28 @@ var SalesProvider = (props) => {
|
|
60
60
|
return dataRef.current;
|
61
61
|
};
|
62
62
|
const setSessionStorage = () => {
|
63
|
+
var _a, _b, _c;
|
64
|
+
const history = ((_a = utils == null ? void 0 : utils.getHistory) == null ? void 0 : _a.call(utils)) || {};
|
65
|
+
const cacheId = ((_c = (_b = history == null ? void 0 : history.location) == null ? void 0 : _b.query) == null ? void 0 : _c.cacheId) || "";
|
66
|
+
const sessionData = { ...dataRef.current || {}, cacheId };
|
63
67
|
sessionStorage.setItem(
|
64
|
-
SALES_MODEL_SESSION_STORAGE_KEY
|
65
|
-
JSON.stringify(
|
68
|
+
`${SALES_MODEL_SESSION_STORAGE_KEY}`,
|
69
|
+
JSON.stringify(sessionData || {})
|
66
70
|
);
|
67
71
|
};
|
68
72
|
const getSessionStorage = () => {
|
69
|
-
|
70
|
-
|
73
|
+
var _a, _b, _c;
|
74
|
+
const history = ((_a = utils == null ? void 0 : utils.getHistory) == null ? void 0 : _a.call(utils)) || {};
|
75
|
+
const strResult = sessionStorage.getItem(SALES_MODEL_SESSION_STORAGE_KEY);
|
76
|
+
const result = strResult ? JSON.parse(strResult || "{}") : {};
|
77
|
+
const cacheId = ((_c = (_b = history == null ? void 0 : history.location) == null ? void 0 : _b.query) == null ? void 0 : _c.cacheId) || "";
|
78
|
+
if (!cacheId && !(result == null ? void 0 : result.cacheId)) {
|
79
|
+
return result;
|
80
|
+
}
|
81
|
+
if (cacheId && (result == null ? void 0 : result.cacheId) === cacheId) {
|
82
|
+
return result;
|
83
|
+
}
|
84
|
+
return {};
|
71
85
|
};
|
72
86
|
const removeSessionStorage = () => {
|
73
87
|
sessionStorage.removeItem(SALES_MODEL_SESSION_STORAGE_KEY);
|
@@ -90,7 +90,7 @@ var ResourceProvider = ({
|
|
90
90
|
resourceMap.forEach((v) => renderData.push(v));
|
91
91
|
return renderData;
|
92
92
|
};
|
93
|
-
const getResourceList = (0, import_ahooks.useRequest)(import_serve.
|
93
|
+
const getResourceList = (0, import_ahooks.useRequest)(import_serve.getSpecialResourceListApi, {
|
94
94
|
manual: true,
|
95
95
|
onSuccess: (res) => {
|
96
96
|
const formatData = formatResourceList(res);
|
@@ -3,3 +3,10 @@ export declare const getResourceListApi: (params: {
|
|
3
3
|
shop_id: string;
|
4
4
|
form_data_status: string;
|
5
5
|
}) => Promise<any>;
|
6
|
+
/**
|
7
|
+
* @title: 获取特殊资源列表
|
8
|
+
* @Author: xiangfeng.xue
|
9
|
+
*/
|
10
|
+
export declare const getSpecialResourceListApi: (params: {
|
11
|
+
event_item_ids?: string | number[];
|
12
|
+
}) => Promise<any>;
|
@@ -19,14 +19,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
19
19
|
// src/components/Sales/Resource/serve.ts
|
20
20
|
var serve_exports = {};
|
21
21
|
__export(serve_exports, {
|
22
|
-
getResourceListApi: () => getResourceListApi
|
22
|
+
getResourceListApi: () => getResourceListApi,
|
23
|
+
getSpecialResourceListApi: () => getSpecialResourceListApi
|
23
24
|
});
|
24
25
|
module.exports = __toCommonJS(serve_exports);
|
25
26
|
var import_utils = require("../../../utils");
|
26
27
|
var getResourceListApi = (params) => {
|
27
28
|
return import_utils.request.getRequest().get("/h5/form/data/v1", params, { useCache: true });
|
28
29
|
};
|
30
|
+
var getSpecialResourceListApi = (params) => {
|
31
|
+
return import_utils.request.getRequest().get("/h5/eventbookingv2/item/specify-resources", params, {
|
32
|
+
useCache: true
|
33
|
+
});
|
34
|
+
};
|
29
35
|
// Annotate the CommonJS export names for ESM import in node:
|
30
36
|
0 && (module.exports = {
|
31
|
-
getResourceListApi
|
37
|
+
getResourceListApi,
|
38
|
+
getSpecialResourceListApi
|
32
39
|
});
|
@@ -78,6 +78,7 @@ var CustomSelect = (props, ref) => {
|
|
78
78
|
handleOpenModal: propsHandleOpenModal,
|
79
79
|
handleDayChange
|
80
80
|
} = props;
|
81
|
+
console.log("custom select");
|
81
82
|
const searchRef = (0, import_react.useRef)();
|
82
83
|
const [_value, set_value] = (0, import_react.useState)([]);
|
83
84
|
const [search, setSearch] = (0, import_react.useState)("");
|
@@ -27,6 +27,7 @@ export interface ResourceItem {
|
|
27
27
|
* @Author: jinglin.tan
|
28
28
|
*/
|
29
29
|
export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
|
30
|
+
export declare const checkResourcesFormat: (resources: any[], service: any, isChild?: boolean) => any[];
|
30
31
|
/**
|
31
32
|
* @title: 格式化商品单价
|
32
33
|
* @description:
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
var utils_exports = {};
|
31
31
|
__export(utils_exports, {
|
32
32
|
checkHolderIsError: () => checkHolderIsError,
|
33
|
+
checkResourcesFormat: () => checkResourcesFormat,
|
33
34
|
checkSubResourcesCapacity: () => checkSubResourcesCapacity,
|
34
35
|
formatProductBundle: () => formatProductBundle,
|
35
36
|
formatProductOption: () => formatProductOption,
|
@@ -194,11 +195,17 @@ var formatHolders = (state, item, values) => {
|
|
194
195
|
return obj;
|
195
196
|
};
|
196
197
|
var formatProductPrice = (item) => {
|
197
|
-
var _a, _b, _c;
|
198
|
+
var _a, _b, _c, _d;
|
198
199
|
const other = (_a = item._extend) == null ? void 0 : _a.other;
|
199
200
|
let price = Number((_b = item._extend) == null ? void 0 : _b.price);
|
201
|
+
if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_c = item == null ? void 0 : item.variant) == null ? void 0 : _c.length) > 0) {
|
202
|
+
const variant = item.variant.find((d) => d.id === (other == null ? void 0 : other.product_variant_id));
|
203
|
+
if (variant) {
|
204
|
+
price = Number(variant == null ? void 0 : variant.price) || 0;
|
205
|
+
}
|
206
|
+
}
|
200
207
|
if (other == null ? void 0 : other.option) {
|
201
|
-
price = (
|
208
|
+
price = (_d = other == null ? void 0 : other.option) == null ? void 0 : _d.reduce((pre, cur) => {
|
202
209
|
return pre + Number(cur.price) * Number(cur.num);
|
203
210
|
}, price);
|
204
211
|
}
|
@@ -221,8 +228,20 @@ var formatMetaData = (item) => {
|
|
221
228
|
}
|
222
229
|
return metadata;
|
223
230
|
};
|
231
|
+
var getSourceProductPrice = (item) => {
|
232
|
+
var _a, _b, _c;
|
233
|
+
const other = (_a = item._extend) == null ? void 0 : _a.other;
|
234
|
+
let price = Number((_b = item._extend) == null ? void 0 : _b.price);
|
235
|
+
if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_c = item == null ? void 0 : item.variant) == null ? void 0 : _c.length) > 0) {
|
236
|
+
const variant = item.variant.find((d) => d.id === (other == null ? void 0 : other.product_variant_id));
|
237
|
+
if (variant) {
|
238
|
+
price = Number(variant == null ? void 0 : variant.price) || 0;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
return price;
|
242
|
+
};
|
224
243
|
var formatProducts = (item, quantity) => {
|
225
|
-
var _a, _b, _c, _d, _e, _f
|
244
|
+
var _a, _b, _c, _d, _e, _f;
|
226
245
|
const total = Number(item._extend.total);
|
227
246
|
const origin_total = Number(item._extend.origin_total);
|
228
247
|
const discount_amount = origin_total - total;
|
@@ -232,7 +251,7 @@ var formatProducts = (item, quantity) => {
|
|
232
251
|
return {
|
233
252
|
"num": quantity || item._extend.quantity,
|
234
253
|
"price": formatProductPrice(item),
|
235
|
-
"source_product_price": (
|
254
|
+
"source_product_price": getSourceProductPrice(item),
|
236
255
|
"product_id": (item == null ? void 0 : item.product_id) || item.id,
|
237
256
|
"discount_amount": notManualDiscount.length > 0 ? 0 : discount_amount,
|
238
257
|
"product_discount_reason": item._extend.discount_reason || "",
|
@@ -242,10 +261,10 @@ var formatProducts = (item, quantity) => {
|
|
242
261
|
"discount_per": item._extend.discount_per,
|
243
262
|
"discount_type": item._extend.discount_type || discount_type,
|
244
263
|
"order_detail_id": item._extend.order_detail_id || 0,
|
245
|
-
"product_bundle": formatProductBundle((
|
264
|
+
"product_bundle": formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
|
246
265
|
"bundle_edit": item._extend.bundle_edit,
|
247
|
-
"product_option_item": formatProductOption((
|
248
|
-
"product_variant_id": ((
|
266
|
+
"product_option_item": formatProductOption((_d = (_c = item._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.option),
|
267
|
+
"product_variant_id": ((_f = (_e = item._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.product_variant_id) || 0,
|
249
268
|
"discount_list": notManualDiscount,
|
250
269
|
metadata: formatMetaData(item)
|
251
270
|
};
|
@@ -473,6 +492,7 @@ var checkHolderIsError = (state) => {
|
|
473
492
|
// Annotate the CommonJS export names for ESM import in node:
|
474
493
|
0 && (module.exports = {
|
475
494
|
checkHolderIsError,
|
495
|
+
checkResourcesFormat,
|
476
496
|
checkSubResourcesCapacity,
|
477
497
|
formatProductBundle,
|
478
498
|
formatProductOption,
|