@pisell/private-materials 3.3.18 → 3.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +3 -2
- package/es/components/appointmentBooking/components/Content/index.js +19 -22
- package/es/components/appointmentBooking/components/Date/index.js +66 -42
- package/es/components/appointmentBooking/components/Date/state.d.ts +1 -0
- package/es/components/appointmentBooking/components/Date/state.js +5 -0
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Form/index.js +12 -4
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/index.js +4 -2
- package/es/components/appointmentBooking/components/Resource/index.js +7 -4
- package/es/components/appointmentBooking/components/Services/index.js +3 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +4 -2
- package/es/components/appointmentBooking/context.d.ts +3 -1
- package/es/components/appointmentBooking/context.js +63 -6
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +35 -11
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +48 -8
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/locales.d.ts +6 -0
- package/es/components/appointmentBooking/locales.js +6 -0
- package/es/components/appointmentBooking/utils.d.ts +2 -2
- package/es/components/appointmentBooking/utils.js +10 -4
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/deposit/index.js +1 -1
- package/es/components/booking/forms/footer.d.ts +0 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -2
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +0 -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/device.d.ts +0 -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/payo/config.d.ts +0 -1
- package/es/components/eftposPay/payo/config.js +14 -3
- package/es/components/eftposPay/payo/hooks.js +12 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.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/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/es/components/ruleSetting/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +11 -11
- package/lib/components/appointmentBooking/components/Date/index.js +29 -12
- package/lib/components/appointmentBooking/components/Date/state.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Date/state.js +7 -0
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Form/index.js +6 -3
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/index.js +2 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +6 -4
- package/lib/components/appointmentBooking/components/Services/index.js +2 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +2 -1
- package/lib/components/appointmentBooking/context.d.ts +3 -1
- package/lib/components/appointmentBooking/context.js +28 -7
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +39 -4
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +29 -5
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/locales.d.ts +6 -0
- package/lib/components/appointmentBooking/locales.js +6 -0
- package/lib/components/appointmentBooking/utils.d.ts +2 -2
- package/lib/components/appointmentBooking/utils.js +8 -4
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.js +1 -1
- package/lib/components/booking/forms/footer.d.ts +0 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -2
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +0 -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/device.d.ts +0 -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/payo/config.d.ts +0 -1
- package/lib/components/eftposPay/payo/config.js +12 -1
- package/lib/components/eftposPay/payo/hooks.js +10 -0
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.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/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/lib/components/ruleSetting/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/package.json +3 -3
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useState, useEffect } from 'react';
|
|
12
12
|
import { Spin } from 'antd';
|
|
13
|
-
import { PisellModal, PisellEmpty } from '@pisell/materials';
|
|
13
|
+
import { PisellModal, PisellEmpty, Button, Checkbox } from '@pisell/materials';
|
|
14
14
|
import { locales, isMobile } from '@pisell/utils';
|
|
15
15
|
import { useAppointmentBookingContext } from "../../../context";
|
|
16
16
|
import "./index.less";
|
|
@@ -18,7 +18,10 @@ var DepositModal = function DepositModal(props) {
|
|
|
18
18
|
var open = props.open,
|
|
19
19
|
onCancel = props.onCancel,
|
|
20
20
|
item = props.item,
|
|
21
|
-
onChange = props.onChange
|
|
21
|
+
onChange = props.onChange,
|
|
22
|
+
onConfirm = props.onConfirm,
|
|
23
|
+
_props$isHideCheckout = props.isHideCheckout,
|
|
24
|
+
isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout;
|
|
22
25
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
23
26
|
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
24
27
|
var _useState = useState(null),
|
|
@@ -29,6 +32,13 @@ var DepositModal = function DepositModal(props) {
|
|
|
29
32
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
33
|
loading = _useState4[0],
|
|
31
34
|
setLoading = _useState4[1];
|
|
35
|
+
var _useState5 = useState(false),
|
|
36
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
+
disabled = _useState6[0],
|
|
38
|
+
setDisabled = _useState6[1];
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
setDisabled(!isHideCheckout);
|
|
41
|
+
}, [isHideCheckout]);
|
|
32
42
|
|
|
33
43
|
/**
|
|
34
44
|
* @title: 获取协议内容
|
|
@@ -52,23 +62,24 @@ var DepositModal = function DepositModal(props) {
|
|
|
52
62
|
_yield$appointmentBoo = _context.sent;
|
|
53
63
|
data = _yield$appointmentBoo.data;
|
|
54
64
|
setPolicy(data);
|
|
55
|
-
onChange(data);
|
|
56
|
-
_context.next =
|
|
65
|
+
onChange && onChange(data);
|
|
66
|
+
_context.next = 15;
|
|
57
67
|
break;
|
|
58
68
|
case 10:
|
|
59
69
|
_context.prev = 10;
|
|
60
70
|
_context.t0 = _context["catch"](1);
|
|
61
71
|
console.log(_context.t0);
|
|
62
|
-
onChange(_context.t0);
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
onChange && onChange(_context.t0);
|
|
73
|
+
debugger;
|
|
74
|
+
case 15:
|
|
75
|
+
_context.prev = 15;
|
|
65
76
|
setLoading(false);
|
|
66
|
-
return _context.finish(
|
|
67
|
-
case
|
|
77
|
+
return _context.finish(15);
|
|
78
|
+
case 18:
|
|
68
79
|
case "end":
|
|
69
80
|
return _context.stop();
|
|
70
81
|
}
|
|
71
|
-
}, _callee, null, [[1, 10,
|
|
82
|
+
}, _callee, null, [[1, 10, 15, 18]]);
|
|
72
83
|
}));
|
|
73
84
|
return function getPolicy(_x) {
|
|
74
85
|
return _ref.apply(this, arguments);
|
|
@@ -93,7 +104,20 @@ var DepositModal = function DepositModal(props) {
|
|
|
93
104
|
className: 'policy-modal-wrap',
|
|
94
105
|
cancelVisible: false,
|
|
95
106
|
okText: locales.getText('pisell2.appointment.deposit.close'),
|
|
96
|
-
|
|
107
|
+
footer: [/*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: "policy-modal-footer"
|
|
109
|
+
}, !isHideCheckout ? /*#__PURE__*/React.createElement(Checkbox, {
|
|
110
|
+
className: "policy-modal-checkbox",
|
|
111
|
+
onChange: function onChange(e) {
|
|
112
|
+
var _e$target;
|
|
113
|
+
return setDisabled(!((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.checked));
|
|
114
|
+
}
|
|
115
|
+
}, locales.getText('pisell2.appointment.policy')) : null, /*#__PURE__*/React.createElement(Button, {
|
|
116
|
+
type: "primary",
|
|
117
|
+
size: "large",
|
|
118
|
+
onClick: isHideCheckout ? onCancel : onConfirm,
|
|
119
|
+
disabled: disabled
|
|
120
|
+
}, locales.getText(isHideCheckout ? 'pisell2.appointment.deposit.close' : 'pisell2.appointment.policy.confirm')))]
|
|
97
121
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
98
122
|
style: {
|
|
99
123
|
minHeight: '200px'
|
|
@@ -47,7 +47,9 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
47
47
|
var pisellOS = usePisellOS();
|
|
48
48
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
49
49
|
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
50
|
-
setCurrentStep = _useAppointmentBookin.setCurrentStep
|
|
50
|
+
setCurrentStep = _useAppointmentBookin.setCurrentStep,
|
|
51
|
+
policyIdsRef = _useAppointmentBookin.policyIdsRef,
|
|
52
|
+
openPolicy = _useAppointmentBookin.openPolicy;
|
|
51
53
|
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
52
54
|
|
|
53
55
|
// 判断是否是最后一步
|
|
@@ -117,12 +119,46 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
117
119
|
isSkip: (step === null || step === void 0 ? void 0 : step.isSkip) || false
|
|
118
120
|
});
|
|
119
121
|
};
|
|
122
|
+
|
|
123
|
+
// 下一步
|
|
124
|
+
var nextStep = function nextStep() {
|
|
125
|
+
var _appointmentBooking$s2;
|
|
126
|
+
var currentStep = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep();
|
|
127
|
+
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList) || [];
|
|
128
|
+
|
|
129
|
+
// 倒数第二步
|
|
130
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2 === (stepList === null || stepList === void 0 ? void 0 : stepList.length)) {
|
|
131
|
+
var _policyIdsRef$current;
|
|
132
|
+
// 如果没有同意资源上挂接的协议,则打开协议弹窗
|
|
133
|
+
if (policyIdsRef !== null && policyIdsRef !== void 0 && (_policyIdsRef$current = policyIdsRef.current) !== null && _policyIdsRef$current !== void 0 && _policyIdsRef$current.length) {
|
|
134
|
+
// 依次弹出所有协议
|
|
135
|
+
var idx = 0;
|
|
136
|
+
var showNextPolicy = function showNextPolicy() {
|
|
137
|
+
if (idx < policyIdsRef.current.length) {
|
|
138
|
+
openPolicy({
|
|
139
|
+
id: policyIdsRef.current[idx]
|
|
140
|
+
}, function () {
|
|
141
|
+
idx++;
|
|
142
|
+
showNextPolicy();
|
|
143
|
+
});
|
|
144
|
+
} else {
|
|
145
|
+
// 全部同意后,进入下一步
|
|
146
|
+
appointmentBooking.next();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
showNextPolicy();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
appointmentBooking.next();
|
|
154
|
+
};
|
|
120
155
|
return {
|
|
121
156
|
getStepIndex: getStepIndex,
|
|
122
157
|
stepList: stepList,
|
|
123
158
|
removeStep: removeStep,
|
|
124
159
|
addStep: addStep,
|
|
125
|
-
updateStep: updateStep
|
|
160
|
+
updateStep: updateStep,
|
|
161
|
+
nextStep: nextStep
|
|
126
162
|
};
|
|
127
163
|
};
|
|
128
164
|
|
|
@@ -575,23 +611,26 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
575
611
|
* @Date: 2025-04-21 11:47
|
|
576
612
|
*/
|
|
577
613
|
export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
578
|
-
var _appointmentBooking$
|
|
614
|
+
var _appointmentBooking$s3;
|
|
579
615
|
var _useAppointmentBookin5 = useAppointmentBookingContext(),
|
|
580
616
|
currentStep = _useAppointmentBookin5.currentStep,
|
|
581
|
-
setCarts = _useAppointmentBookin5.setCarts
|
|
617
|
+
setCarts = _useAppointmentBookin5.setCarts,
|
|
618
|
+
setPolicyIds = _useAppointmentBookin5.setPolicyIds;
|
|
582
619
|
var _useAppointmentBookin6 = useAppointmentBookingResource(),
|
|
583
620
|
getResourceList = _useAppointmentBookin6.getResourceList,
|
|
584
621
|
autoSelectAllProductResources = _useAppointmentBookin6.autoSelectAllProductResources;
|
|
585
622
|
var _useAppointmentBookin7 = useAppointmentBookingSetting(),
|
|
586
623
|
isFormSubject = _useAppointmentBookin7.isFormSubject;
|
|
587
624
|
var appointmentBooking = useAppointmentBooking();
|
|
588
|
-
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$
|
|
625
|
+
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList) || [];
|
|
589
626
|
var _useAppointmentBookin8 = useAppointmentBookingLogin(),
|
|
590
627
|
isLogin = _useAppointmentBookin8.isLogin,
|
|
591
628
|
openLoginModal = _useAppointmentBookin8.openLoginModal;
|
|
592
629
|
var _useAppointmentBookin9 = useAppointmentBookingAccount(),
|
|
593
630
|
getHolders = _useAppointmentBookin9.getHolders,
|
|
594
631
|
checkAccount = _useAppointmentBookin9.checkAccount;
|
|
632
|
+
var _useAppointmentBookin10 = useAppointmentBookingStep(),
|
|
633
|
+
nextStep = _useAppointmentBookin10.nextStep;
|
|
595
634
|
var utils = contextUtils();
|
|
596
635
|
var checkSkipResourceStep = /*#__PURE__*/function () {
|
|
597
636
|
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(isSkipUpdateFormStep) {
|
|
@@ -622,8 +661,9 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
622
661
|
break;
|
|
623
662
|
}
|
|
624
663
|
if (!isSkipUpdateFormStep) {
|
|
625
|
-
resultCarts = formatCartsResources(carts, resources); // 如果当前资源有表单,则添加表单步骤,否则删除表单步骤
|
|
664
|
+
resultCarts = formatCartsResources(carts, resources, setPolicyIds); // 如果当前资源有表单,则添加表单步骤,否则删除表单步骤
|
|
626
665
|
checkHasFormStep({
|
|
666
|
+
nextStep: nextStep,
|
|
627
667
|
isSkip: true,
|
|
628
668
|
openLoginModal: openLoginModal,
|
|
629
669
|
utils: utils,
|
|
@@ -683,8 +723,8 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
683
723
|
export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
|
|
684
724
|
var _appointmentBooking$o3;
|
|
685
725
|
var utils = contextUtils();
|
|
686
|
-
var
|
|
687
|
-
appointmentBooking =
|
|
726
|
+
var _useAppointmentBookin11 = useAppointmentBookingContext(),
|
|
727
|
+
appointmentBooking = _useAppointmentBookin11.appointmentBooking;
|
|
688
728
|
var _ref21 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
|
|
689
729
|
bookingProcess = _ref21.bookingProcess,
|
|
690
730
|
bookingSubject = _ref21.bookingSubject,
|
|
@@ -104,6 +104,8 @@ declare const _default: {
|
|
|
104
104
|
'pisell2.appointment.unselect.date': string;
|
|
105
105
|
'pisell2.appointment.unuse.date': string;
|
|
106
106
|
'pisell2.appointment.add-guests': string;
|
|
107
|
+
'pisell2.appointment.policy': string;
|
|
108
|
+
'pisell2.appointment.policy.confirm': string;
|
|
107
109
|
'pisell2.text.apply': string;
|
|
108
110
|
'pisell2.text.goodpass': string;
|
|
109
111
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -219,6 +221,8 @@ declare const _default: {
|
|
|
219
221
|
'pisell2.appointment.unselect.date': string;
|
|
220
222
|
'pisell2.appointment.unuse.date': string;
|
|
221
223
|
'pisell2.appointment.add-guests': string;
|
|
224
|
+
'pisell2.appointment.policy': string;
|
|
225
|
+
'pisell2.appointment.policy.confirm': string;
|
|
222
226
|
'pisell2.text.apply': string;
|
|
223
227
|
'pisell2.text.goodpass': string;
|
|
224
228
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -334,6 +338,8 @@ declare const _default: {
|
|
|
334
338
|
'pisell2.appointment.unselect.date': string;
|
|
335
339
|
'pisell2.appointment.unuse.date': string;
|
|
336
340
|
'pisell2.appointment.add-guests': string;
|
|
341
|
+
'pisell2.appointment.policy': string;
|
|
342
|
+
'pisell2.appointment.policy.confirm': string;
|
|
337
343
|
'pisell2.text.apply': string;
|
|
338
344
|
'pisell2.text.goodpass': string;
|
|
339
345
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -120,6 +120,8 @@ export default {
|
|
|
120
120
|
'pisell2.appointment.unselect.date': 'Please select date',
|
|
121
121
|
'pisell2.appointment.unuse.date': 'This date is not available, please change the date.',
|
|
122
122
|
'pisell2.appointment.add-guests': 'Add guests',
|
|
123
|
+
'pisell2.appointment.policy': 'You have read and agreed to this policy',
|
|
124
|
+
'pisell2.appointment.policy.confirm': 'Confirm',
|
|
123
125
|
'pisell2.text.apply': 'Apply',
|
|
124
126
|
'pisell2.text.goodpass': 'GoodPass',
|
|
125
127
|
'pisell2.text.goodpass.product-vouchers': 'Product Vouchers',
|
|
@@ -251,6 +253,8 @@ export default {
|
|
|
251
253
|
'pisell2.appointment.unselect.date': '请选择日期',
|
|
252
254
|
'pisell2.appointment.unuse.date': '此日期不可用,请更换日期。',
|
|
253
255
|
'pisell2.appointment.add-guests': '添加预约人',
|
|
256
|
+
'pisell2.appointment.policy': '您已仔细阅读并同意此协议',
|
|
257
|
+
'pisell2.appointment.policy.confirm': '确定',
|
|
254
258
|
'pisell2.text.apply': '应用',
|
|
255
259
|
'pisell2.text.goodpass': '商品券',
|
|
256
260
|
'pisell2.text.goodpass.product-vouchers': '商品兑换券',
|
|
@@ -382,6 +386,8 @@ export default {
|
|
|
382
386
|
'pisell2.appointment.unselect.date': '請選擇日期',
|
|
383
387
|
'pisell2.appointment.unuse.date': '此日期不可用,請更換日期。',
|
|
384
388
|
'pisell2.appointment.add-guests': '添加預約人',
|
|
389
|
+
'pisell2.appointment.policy': '您已仔細閱讀並同意此協議',
|
|
390
|
+
'pisell2.appointment.policy.confirm': '確定',
|
|
385
391
|
'pisell2.text.apply': '應用',
|
|
386
392
|
'pisell2.text.goodpass': '商品券',
|
|
387
393
|
'pisell2.text.goodpass.product-vouchers': '商品兌換券',
|
|
@@ -17,7 +17,7 @@ export declare const formatGuest: (data: any[], products: any) => any[];
|
|
|
17
17
|
* @Author: WangHan
|
|
18
18
|
* @Date: 2025-05-06 22:22
|
|
19
19
|
*/
|
|
20
|
-
export declare const formatCartsResources: (carts: any[], resources: any[]) => any[];
|
|
20
|
+
export declare const formatCartsResources: (carts: any[], resources: any[], setPolicyIds: any) => any[];
|
|
21
21
|
/**
|
|
22
22
|
* @title: 格式化购物车数据
|
|
23
23
|
* @description:
|
|
@@ -111,4 +111,4 @@ export declare const Toast: (text: string) => void;
|
|
|
111
111
|
* @Author: WangHan
|
|
112
112
|
* @Date: 2025-05-06 21:51
|
|
113
113
|
*/
|
|
114
|
-
export declare const checkHasFormStep: ({ isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;
|
|
114
|
+
export declare const checkHasFormStep: ({ nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;
|
|
@@ -57,8 +57,9 @@ export var formatGuest = function formatGuest(data, products) {
|
|
|
57
57
|
* @Author: WangHan
|
|
58
58
|
* @Date: 2025-05-06 22:22
|
|
59
59
|
*/
|
|
60
|
-
export var formatCartsResources = function formatCartsResources(carts, resources) {
|
|
60
|
+
export var formatCartsResources = function formatCartsResources(carts, resources, setPolicyIds) {
|
|
61
61
|
try {
|
|
62
|
+
var policyIds = [];
|
|
62
63
|
var newCarts = carts === null || carts === void 0 ? void 0 : carts.map(function (d) {
|
|
63
64
|
var _currentResource$reso;
|
|
64
65
|
var currentResource = resources === null || resources === void 0 ? void 0 : resources.find(function (r) {
|
|
@@ -77,9 +78,13 @@ export var formatCartsResources = function formatCartsResources(carts, resources
|
|
|
77
78
|
return _objectSpread(_objectSpread({}, d), {}, {
|
|
78
79
|
resource_form_id: foundResource === null || foundResource === void 0 ? void 0 : foundResource.resource_form_id
|
|
79
80
|
});
|
|
81
|
+
} else if (foundResource !== null && foundResource !== void 0 && foundResource.policy_id && !policyIds.includes(foundResource === null || foundResource === void 0 ? void 0 : foundResource.policy_id)) {
|
|
82
|
+
// 资源上没有挂接表单,但是有协议,则在触发按钮的时候需要同意协议才能继续
|
|
83
|
+
policyIds.push(foundResource === null || foundResource === void 0 ? void 0 : foundResource.policy_id);
|
|
80
84
|
}
|
|
81
85
|
return false;
|
|
82
86
|
}).filter(Boolean);
|
|
87
|
+
setPolicyIds(policyIds);
|
|
83
88
|
return newCarts || [];
|
|
84
89
|
} catch (error) {
|
|
85
90
|
console.log(error, 'formatCarts');
|
|
@@ -371,7 +376,8 @@ export var Toast = function Toast(text) {
|
|
|
371
376
|
*/
|
|
372
377
|
export var checkHasFormStep = function checkHasFormStep(_ref2) {
|
|
373
378
|
var _appointmentBooking$s;
|
|
374
|
-
var
|
|
379
|
+
var nextStep = _ref2.nextStep,
|
|
380
|
+
isSkip = _ref2.isSkip,
|
|
375
381
|
checkHolder = _ref2.checkHolder,
|
|
376
382
|
checkAccount = _ref2.checkAccount,
|
|
377
383
|
carts = _ref2.carts,
|
|
@@ -453,14 +459,14 @@ export var checkHasFormStep = function checkHasFormStep(_ref2) {
|
|
|
453
459
|
isNext = true;
|
|
454
460
|
}
|
|
455
461
|
if (isNext && !_checkHolder()) {
|
|
456
|
-
|
|
462
|
+
nextStep();
|
|
457
463
|
} else {
|
|
458
464
|
return true;
|
|
459
465
|
}
|
|
460
466
|
} else {
|
|
461
467
|
// 如果只有一个资源执行跳过
|
|
462
468
|
if (isSkip) {
|
|
463
|
-
|
|
469
|
+
nextStep();
|
|
464
470
|
}
|
|
465
471
|
}
|
|
466
472
|
};
|
|
@@ -97,7 +97,7 @@ var Deposit = function Deposit(props) {
|
|
|
97
97
|
}, [globalState]);
|
|
98
98
|
var depositList = useMemo(function () {
|
|
99
99
|
if (!bookingId) return [];
|
|
100
|
-
if (
|
|
100
|
+
if ((bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.is_deposit) === 0) return [];
|
|
101
101
|
return [{
|
|
102
102
|
customer: bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.customer,
|
|
103
103
|
status: bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.deposit_payment_status,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { SendModalValues } from './index';
|
|
3
2
|
declare const useSendModal: (bookingId?: number) => {
|
|
4
3
|
open: boolean;
|
|
5
4
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
6
5
|
handleOpen: () => void;
|
|
7
6
|
handleValuesChange: (val: any) => void;
|
|
8
|
-
handleOk: (values: SendModalValues) => Promise<
|
|
7
|
+
handleOk: (values: SendModalValues) => Promise<any>;
|
|
9
8
|
};
|
|
10
9
|
export default useSendModal;
|
|
@@ -240,4 +240,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
240
240
|
* @Author: WangHan
|
|
241
241
|
* @Date: 2024-12-24 11:32
|
|
242
242
|
*/
|
|
243
|
-
export declare const updateServicePrice: (state: any) => never[]
|
|
243
|
+
export declare const updateServicePrice: (state: any) => Promise<any> | never[];
|
|
@@ -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;
|
|
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"success" | "
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
@@ -33,7 +33,8 @@ export var POS = function POS(_ref) {
|
|
|
33
33
|
var api = _ref.api,
|
|
34
34
|
onChange = _ref.onChange;
|
|
35
35
|
var _useContextData = useContextData(),
|
|
36
|
-
steps = _useContextData.steps
|
|
36
|
+
steps = _useContextData.steps,
|
|
37
|
+
custom = _useContextData.custom;
|
|
37
38
|
var _useStoreRef = useStoreRef(),
|
|
38
39
|
deviceRef = _useStoreRef.deviceRef,
|
|
39
40
|
payRef = _useStoreRef.payRef,
|
|
@@ -150,7 +151,17 @@ export var POS = function POS(_ref) {
|
|
|
150
151
|
}));
|
|
151
152
|
controllerRef.current = new AbortController();
|
|
152
153
|
// 支付 or 退款
|
|
153
|
-
var resultPromise = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay ? api.pay({
|
|
154
|
+
var resultPromise = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay ? api.pay(_objectSpread(_objectSpread({}, custom !== null && custom !== void 0 && custom.platform ? {
|
|
155
|
+
"operator_id": custom.operator_id,
|
|
156
|
+
"operator_type": custom.operator_type,
|
|
157
|
+
"platform": custom.platform,
|
|
158
|
+
"custom_payment_id": custom.custom_payment_id,
|
|
159
|
+
"service_charge": {
|
|
160
|
+
"amount": payRef.current.surMoney,
|
|
161
|
+
"percentage": payRef.current.surPercentRate
|
|
162
|
+
},
|
|
163
|
+
"original_amount": payRef.current.amount
|
|
164
|
+
} : {}), {}, {
|
|
154
165
|
order_id: orderIdRef.current,
|
|
155
166
|
amount: payRef.current.total,
|
|
156
167
|
card_reader_type: eftposRef.current,
|
|
@@ -159,7 +170,7 @@ export var POS = function POS(_ref) {
|
|
|
159
170
|
pay_param_base64: encodeURIComponent(btoa(encodeURIComponent(JSON.stringify(_objectSpread(_objectSpread({}, dataRef.current), {}, {
|
|
160
171
|
number: numRef.current
|
|
161
172
|
})))))
|
|
162
|
-
}, {
|
|
173
|
+
}), {
|
|
163
174
|
signal: controllerRef.current.signal
|
|
164
175
|
}) : api.refund({
|
|
165
176
|
order_id: orderIdRef.current,
|
|
@@ -12,6 +12,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
12
12
|
import { useCallback, useEffect, useRef } from 'react';
|
|
13
13
|
import { PayStatus } from "../const";
|
|
14
14
|
import { sleep } from "../helper";
|
|
15
|
+
import { sendWarningLog } from '@pisell/utils';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* @title: 循环查询 接口状态
|
|
@@ -111,14 +112,24 @@ export var useValidate = function useValidate(timeout) {
|
|
|
111
112
|
(_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 || _controllerRef$curren.abort();
|
|
112
113
|
}, []);
|
|
113
114
|
var run = function run() {
|
|
115
|
+
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
116
|
+
params[_key] = arguments[_key];
|
|
117
|
+
}
|
|
114
118
|
isTimeoutCloseRef.current = false;
|
|
115
119
|
TimeoutRef.current && clearTimeout(TimeoutRef.current);
|
|
116
120
|
// 开启计时
|
|
117
121
|
TimeoutRef.current = setTimeout(function () {
|
|
118
122
|
isTimeoutCloseRef.current = true;
|
|
123
|
+
sendWarningLog({
|
|
124
|
+
title: '支付状态查询超时',
|
|
125
|
+
content: [{
|
|
126
|
+
key: 'params',
|
|
127
|
+
value: JSON.stringify(params)
|
|
128
|
+
}]
|
|
129
|
+
});
|
|
119
130
|
close();
|
|
120
131
|
}, timeout);
|
|
121
|
-
return checkApi.apply(void 0,
|
|
132
|
+
return checkApi.apply(void 0, params);
|
|
122
133
|
};
|
|
123
134
|
useEffect(function () {
|
|
124
135
|
return function () {
|