@pisell/private-materials 3.2.22 → 3.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +32 -18
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +28 -18
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +45 -9
- package/es/components/appointmentBooking/hooks.js +158 -121
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +30 -0
- package/es/components/appointmentBooking/locales.js +30 -0
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +68 -1
- package/es/components/booking/components/footer/utils.js +15 -15
- package/es/components/booking/components/voucher/index.d.ts +1 -1
- package/es/components/booking/components/voucher/index.js +28 -27
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +23 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +28 -16
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +45 -9
- package/lib/components/appointmentBooking/hooks.js +28 -41
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +30 -0
- package/lib/components/appointmentBooking/locales.js +30 -0
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +39 -1
- package/lib/components/booking/components/footer/utils.js +1 -15
- package/lib/components/booking/components/voucher/index.d.ts +1 -1
- package/lib/components/booking/components/voucher/index.js +28 -17
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _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; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
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; }
|
|
2
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
10
|
import dayjs from 'dayjs';
|
|
11
|
+
import { getUniqueId } from "@pisell/utils";
|
|
8
12
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
9
13
|
|
|
10
14
|
/**
|
|
@@ -134,7 +138,6 @@ export var formatCarts = function formatCarts(data, resources) {
|
|
|
134
138
|
var utils = context.appHelper.utils || {};
|
|
135
139
|
var locale = (utils === null || utils === void 0 || (_utils$storage2 = utils.storage) === null || _utils$storage2 === void 0 ? void 0 : _utils$storage2.get('umi_locale')) || 'en-US';
|
|
136
140
|
var symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
|
|
137
|
-
console.log(resources, data, 'wh987utils');
|
|
138
141
|
return data === null || data === void 0 ? void 0 : data.map(function (d) {
|
|
139
142
|
var _currentResource$reso, _currentResources;
|
|
140
143
|
var currentResource = resources.find(function (r) {
|
|
@@ -196,4 +199,68 @@ export var sortResources = function sortResources(resources, resourceSort) {
|
|
|
196
199
|
} catch (error) {
|
|
197
200
|
console.log(error, 'wh2222');
|
|
198
201
|
}
|
|
202
|
+
};
|
|
203
|
+
export var getMeAccount = function getMeAccount(val) {
|
|
204
|
+
return val === null || val === void 0 ? void 0 : val.find(function (d) {
|
|
205
|
+
return !(d !== null && d !== void 0 && d.isGuest);
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
export var formatCustomer = function formatCustomer(val) {
|
|
209
|
+
var currentUserName = "".concat((val === null || val === void 0 ? void 0 : val.first_name) || '').concat(val !== null && val !== void 0 && val.last_name ? " ".concat(val === null || val === void 0 ? void 0 : val.last_name) : '');
|
|
210
|
+
currentUserName = currentUserName || (val === null || val === void 0 ? void 0 : val.nickname) || 'Me';
|
|
211
|
+
return {
|
|
212
|
+
id: (val === null || val === void 0 ? void 0 : val.id) || getUniqueId(),
|
|
213
|
+
username: currentUserName
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
export var formatCurrentUser = function formatCurrentUser() {
|
|
217
|
+
var _utils$getStore$getSt, _userInfo;
|
|
218
|
+
var context = useEngineContext();
|
|
219
|
+
var utils = context.appHelper.utils || {};
|
|
220
|
+
var userInfo = (_utils$getStore$getSt = utils.getStore().getState()) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.userInfo;
|
|
221
|
+
var localUserInfo = JSON.parse(utils.storage.get('customer') || '{}');
|
|
222
|
+
userInfo = (_userInfo = userInfo) !== null && _userInfo !== void 0 && _userInfo.id ? userInfo : localUserInfo;
|
|
223
|
+
var customer = formatCustomer(userInfo);
|
|
224
|
+
return customer;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @title: 检查是否有空的账户
|
|
229
|
+
* @description:
|
|
230
|
+
* @param {any} carts
|
|
231
|
+
* @param {any} accounts
|
|
232
|
+
* @return {*}
|
|
233
|
+
* @Author: WangHan
|
|
234
|
+
* @Date: 2025-04-15 17:05
|
|
235
|
+
*/
|
|
236
|
+
export var isEmptyGuest = function isEmptyGuest(carts, accounts) {
|
|
237
|
+
// 遍历账户列表
|
|
238
|
+
var _iterator = _createForOfIteratorHelper(accounts),
|
|
239
|
+
_step;
|
|
240
|
+
try {
|
|
241
|
+
var _loop = function _loop() {
|
|
242
|
+
var item = _step.value;
|
|
243
|
+
// 检查商品数据是否有匹配的holder_id
|
|
244
|
+
var hasMatch = carts.some(function (firstItem) {
|
|
245
|
+
return firstItem.holder_id === item.id;
|
|
246
|
+
});
|
|
247
|
+
// 如果没有找到匹配的,直接返回true
|
|
248
|
+
if (!hasMatch) {
|
|
249
|
+
return {
|
|
250
|
+
v: true
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
_ret;
|
|
255
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
256
|
+
_ret = _loop();
|
|
257
|
+
if (_ret) return _ret.v;
|
|
258
|
+
}
|
|
259
|
+
// 所有元素都找到了匹配,返回false
|
|
260
|
+
} catch (err) {
|
|
261
|
+
_iterator.e(err);
|
|
262
|
+
} finally {
|
|
263
|
+
_iterator.f();
|
|
264
|
+
}
|
|
265
|
+
return false;
|
|
199
266
|
};
|
|
@@ -222,20 +222,20 @@ var formatMetaData = function formatMetaData(item) {
|
|
|
222
222
|
}
|
|
223
223
|
return metadata;
|
|
224
224
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
225
|
+
|
|
226
|
+
// const formatDiscountList = (list: any[]) => {
|
|
227
|
+
// return list.map(item => {
|
|
228
|
+
// return {
|
|
229
|
+
// amount: item.amount,
|
|
230
|
+
// product_id: item.product_id || item.discount?.product_id,
|
|
231
|
+
// resource_id: item.resource_id || item.discount?.resource_id,
|
|
232
|
+
// title: item.title || item.discount?.title,
|
|
233
|
+
// original_amount: item.original_amount || item.discount?.original_amount,
|
|
234
|
+
// id: item.id,
|
|
235
|
+
// type: item.type,
|
|
236
|
+
// }
|
|
237
|
+
// })
|
|
238
|
+
// }
|
|
239
239
|
|
|
240
240
|
/**
|
|
241
241
|
* @title: 格式化商品数据
|
|
@@ -250,7 +250,7 @@ var formatProducts = function formatProducts(item) {
|
|
|
250
250
|
var total = Number(item._extend.total);
|
|
251
251
|
var origin_total = Number(item._extend.origin_total);
|
|
252
252
|
var discount_amount = origin_total - total;
|
|
253
|
-
var discount_list =
|
|
253
|
+
var discount_list = (item === null || item === void 0 ? void 0 : item.discount_list) || [];
|
|
254
254
|
|
|
255
255
|
// 加价时type使用change_price
|
|
256
256
|
var discount_type = discount_amount < 0 ? 'change_price' : 'discount';
|
|
@@ -21,6 +21,7 @@ import { locales } from '@pisell/utils';
|
|
|
21
21
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
22
22
|
import { PisellInput, PisellTooltip, PisellGoodPassCard, PisellToast } from '@pisell/materials';
|
|
23
23
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
24
|
+
import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
|
|
24
25
|
import "./index.less";
|
|
25
26
|
var ShopDiscountHooks = {
|
|
26
27
|
onInited: 'shopDiscount:onInited',
|
|
@@ -51,8 +52,10 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
51
52
|
discountList = _useState6[0],
|
|
52
53
|
setDisCountList = _useState6[1];
|
|
53
54
|
var productRef = useRef(state.service.value);
|
|
55
|
+
var isBooking4Shop = useIsBooking4Shop(state);
|
|
54
56
|
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
55
57
|
var availableData = useMemo(function () {
|
|
58
|
+
if (!isBooking4Shop) return [];
|
|
56
59
|
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
57
60
|
return discountList.filter(function (item) {
|
|
58
61
|
return !!item.isAvailable;
|
|
@@ -61,37 +64,44 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
61
64
|
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
|
|
62
65
|
});
|
|
63
66
|
});
|
|
64
|
-
}, [discountList]);
|
|
67
|
+
}, [discountList, isBooking4Shop]);
|
|
65
68
|
|
|
66
69
|
// 设置client
|
|
67
70
|
useEffect(function () {
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
if (isBooking4Shop) {
|
|
72
|
+
shopDiscount.setCustomer(state.client.value);
|
|
73
|
+
}
|
|
74
|
+
}, [(_state$client$value = state.client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id, isBooking4Shop]);
|
|
70
75
|
|
|
71
76
|
// 设置productList
|
|
72
77
|
useEffect(function () {
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
if (isBooking4Shop) {
|
|
79
|
+
shopDiscount.setProductList(state.service.value);
|
|
80
|
+
}
|
|
81
|
+
}, [state.service.value, isBooking4Shop]);
|
|
75
82
|
|
|
76
83
|
// 更新productList
|
|
77
84
|
useEffect(function () {
|
|
78
85
|
if (productRef.current === state.service.value) {
|
|
79
86
|
return;
|
|
80
87
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
if (isBooking4Shop) {
|
|
89
|
+
var val = shopDiscount.calcDiscount(state.service.value);
|
|
90
|
+
console.log('input: ', state.service.value);
|
|
91
|
+
console.log('output: ', val);
|
|
92
|
+
productRef.current = val.productList;
|
|
93
|
+
dispatch({
|
|
94
|
+
type: 'setService',
|
|
95
|
+
payload: {
|
|
96
|
+
value: val.productList
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}, [state.service.value, isBooking4Shop]);
|
|
92
101
|
|
|
93
102
|
// 监听customer变化
|
|
94
103
|
useEffect(function () {
|
|
104
|
+
if (!isBooking4Shop) return;
|
|
95
105
|
pisellos.effects.on(ShopDiscountHooks.onCustomerChange, function (customer) {
|
|
96
106
|
console.log(customer, 'customerChange');
|
|
97
107
|
// 更新客户
|
|
@@ -120,7 +130,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
120
130
|
pisellos.effects.off(ShopDiscountHooks.onLoadPrepareCalcResult);
|
|
121
131
|
pisellos.effects.off(ShopDiscountHooks.onDiscountListChange);
|
|
122
132
|
};
|
|
123
|
-
}, [state.bookingId]);
|
|
133
|
+
}, [state.bookingId, isBooking4Shop]);
|
|
124
134
|
|
|
125
135
|
// apply code
|
|
126
136
|
var onScanCode = /*#__PURE__*/function () {
|
|
@@ -156,16 +166,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
156
166
|
return _ref.apply(this, arguments);
|
|
157
167
|
};
|
|
158
168
|
}();
|
|
159
|
-
|
|
160
|
-
// if (
|
|
161
|
-
// !isBooking4Shop(
|
|
162
|
-
// context.appHelper.utils.store?.getState?.()?.global?.globalConfig?.id,
|
|
163
|
-
// state.renderType
|
|
164
|
-
// )
|
|
165
|
-
// ) {
|
|
166
|
-
// return null;
|
|
167
|
-
// }
|
|
168
|
-
|
|
169
|
+
if (!isBooking4Shop) return null;
|
|
169
170
|
return /*#__PURE__*/React.createElement("div", {
|
|
170
171
|
className: "pisell-lowcode__booking-footer-voucher-container"
|
|
171
172
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsBooking4Shop: (state: any) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
3
|
+
import { isBooking4Shop } from "../info/utils";
|
|
4
|
+
export var useIsBooking4Shop = function useIsBooking4Shop(state) {
|
|
5
|
+
var context = useEngineContext();
|
|
6
|
+
return useMemo(function () {
|
|
7
|
+
var _context$appHelper$ut, _context$appHelper$ut2;
|
|
8
|
+
return isBooking4Shop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id, state.renderType);
|
|
9
|
+
}, [state.renderType]);
|
|
10
|
+
};
|
|
@@ -237,4 +237,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
237
237
|
* @Author: WangHan
|
|
238
238
|
* @Date: 2024-12-24 11:32
|
|
239
239
|
*/
|
|
240
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
|
240
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
|
@@ -162,10 +162,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
162
162
|
export declare const getDuration: (duration: number | {
|
|
163
163
|
type: string;
|
|
164
164
|
value: number;
|
|
165
|
-
}) => number | {
|
|
165
|
+
}) => number | "flexible" | {
|
|
166
166
|
type: string;
|
|
167
167
|
value: number;
|
|
168
|
-
}
|
|
168
|
+
};
|
|
169
169
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
170
170
|
export declare const getIsEdit: (state: any) => boolean;
|
|
171
171
|
export {};
|
|
@@ -9,7 +9,7 @@ import { PosProps } from './const';
|
|
|
9
9
|
*/
|
|
10
10
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
11
11
|
className?: string | undefined;
|
|
12
|
-
onChange?: ((status: "
|
|
12
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
13
13
|
[keys: string]: unknown;
|
|
14
14
|
} | undefined, other?: any) => void) | undefined;
|
|
15
15
|
onClose: () => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PosProps, RouteType } from './const';
|
|
3
2
|
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
|
|
4
3
|
action: RouteType;
|
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "
|
|
14
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"stripe" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
295
295
|
name?: string | undefined;
|
|
296
296
|
symbol?: string | undefined;
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
|
-
mode?: "
|
|
298
|
+
mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "stripe" | "
|
|
301
|
-
action?: "amount" | "
|
|
300
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | undefined;
|
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
304
304
|
title?: string | undefined;
|