@pisell/private-materials 6.3.146 → 6.3.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.js +12 -6
- package/es/components/appointmentBooking/components/Form/index.js +15 -2
- package/es/components/appointmentBooking/context.js +18 -11
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +6 -3
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/venueBooking/context.d.ts +9 -0
- package/es/components/venueBooking/context.js +17 -12
- package/es/components/venueBooking/index.js +50 -12
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.js +5 -5
- package/lib/components/appointmentBooking/components/Form/index.js +9 -2
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +2 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/venueBooking/context.d.ts +9 -0
- package/lib/components/venueBooking/context.js +4 -2
- package/lib/components/venueBooking/index.js +51 -7
- package/package.json +1 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -3
- package/es/components/appointmentBooking/context.d.ts +0 -35
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
- package/es/components/appointmentBooking/utils.d.ts +0 -227
- package/es/components/booking/components/footer/utils.d.ts +0 -47
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/booking/info/service/editService/index.d.ts +0 -7
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/es/components/eftposPay/linkly/index.d.ts +0 -2
- package/es/components/kioskSkuDetail/index.d.ts +0 -39
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.d.ts +0 -16
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/index.d.ts +0 -15
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -83
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +0 -22
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -25
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -16
- package/es/components/pay/toC/PaymentMethods/index.d.ts +0 -9
- package/es/components/pay/toC/index.d.ts +0 -3
- package/es/components/pay/toC/serve.d.ts +0 -87
- package/es/components/systemSettings/registry/components/GroupModal.d.ts +0 -4
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +0 -4
- package/es/components/systemSettings/registry/index.d.ts +0 -5
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -12
- package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +0 -3
- package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +0 -15
- package/es/plus/skuOptionsSelection/index.d.ts +0 -5
- package/es/plus/skuOptionsSelection/utils/transformBundleGroup.d.ts +0 -19
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +0 -10
- package/es/plus/walletPassGallery/locales.d.ts +0 -488
- package/es/pro/Cards/components/SKUCard/index.d.ts +0 -5
- package/es/pro/Login2.0/Register2.d.ts +0 -65
- package/es/pro/Login2.0/components/PhoneInput.d.ts +0 -53
- package/es/pro/Login2.0/shared/registerFlow.d.ts +0 -117
- package/es/pro/Login2.0/steps/CodeInput.d.ts +0 -24
- package/es/pro/Login2.0/steps/WaitEmailLink.d.ts +0 -18
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -3
- package/lib/components/appointmentBooking/context.d.ts +0 -35
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
- package/lib/components/appointmentBooking/utils.d.ts +0 -227
- package/lib/components/booking/components/footer/utils.d.ts +0 -47
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/booking/info/service/editService/index.d.ts +0 -7
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/lib/components/eftposPay/linkly/index.d.ts +0 -2
- package/lib/components/kioskSkuDetail/index.d.ts +0 -39
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.d.ts +0 -16
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/index.d.ts +0 -15
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -83
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +0 -22
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -25
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -16
- package/lib/components/pay/toC/PaymentMethods/index.d.ts +0 -9
- package/lib/components/pay/toC/index.d.ts +0 -3
- package/lib/components/pay/toC/serve.d.ts +0 -87
- package/lib/components/systemSettings/registry/components/GroupModal.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +0 -4
- package/lib/components/systemSettings/registry/index.d.ts +0 -5
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -12
- package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +0 -3
- package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +0 -15
- package/lib/plus/skuOptionsSelection/index.d.ts +0 -5
- package/lib/plus/skuOptionsSelection/utils/transformBundleGroup.d.ts +0 -19
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +0 -10
- package/lib/plus/walletPassGallery/locales.d.ts +0 -488
- package/lib/pro/Cards/components/SKUCard/index.d.ts +0 -5
- package/lib/pro/Login2.0/Register2.d.ts +0 -65
- package/lib/pro/Login2.0/components/PhoneInput.d.ts +0 -53
- package/lib/pro/Login2.0/shared/registerFlow.d.ts +0 -117
- package/lib/pro/Login2.0/steps/CodeInput.d.ts +0 -24
- package/lib/pro/Login2.0/steps/WaitEmailLink.d.ts +0 -18
|
@@ -21,13 +21,16 @@ var Footer = function Footer(_ref) {
|
|
|
21
21
|
carts = _ref2.carts,
|
|
22
22
|
currentStep = _ref2.currentStep,
|
|
23
23
|
isErrorHolder = _ref2.isErrorHolder,
|
|
24
|
-
setIsErrorHolder = _ref2.setIsErrorHolder
|
|
24
|
+
setIsErrorHolder = _ref2.setIsErrorHolder,
|
|
25
|
+
cartDrawerOpen = _ref2.cartDrawerOpen,
|
|
26
|
+
setCartDrawerOpen = _ref2.setCartDrawerOpen;
|
|
25
27
|
var _useState = useState(false),
|
|
26
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
29
|
open = _useState2[0],
|
|
28
30
|
setOpen = _useState2[1];
|
|
29
31
|
useEffect(function () {
|
|
30
|
-
setOpen(isErrorHolder || false);
|
|
32
|
+
// setOpen(isErrorHolder || false);
|
|
33
|
+
setCartDrawerOpen(isErrorHolder || false);
|
|
31
34
|
}, [currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key, isErrorHolder]);
|
|
32
35
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionFooters, {
|
|
33
36
|
className: "section-footer-wrap",
|
|
@@ -40,9 +43,11 @@ var Footer = function Footer(_ref) {
|
|
|
40
43
|
}, /*#__PURE__*/React.createElement(Badge, {
|
|
41
44
|
count: (carts === null || carts === void 0 ? void 0 : carts.length) || 0
|
|
42
45
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
43
|
-
size: "large"
|
|
46
|
+
size: "large"
|
|
47
|
+
// onClick={() => setOpen(true)}
|
|
48
|
+
,
|
|
44
49
|
onClick: function onClick() {
|
|
45
|
-
return
|
|
50
|
+
return setCartDrawerOpen(true);
|
|
46
51
|
},
|
|
47
52
|
className: "section-footer-btn"
|
|
48
53
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
@@ -52,9 +57,10 @@ var Footer = function Footer(_ref) {
|
|
|
52
57
|
onNext: onNext
|
|
53
58
|
}))
|
|
54
59
|
}), /*#__PURE__*/React.createElement(Cart, {
|
|
55
|
-
open:
|
|
60
|
+
open: cartDrawerOpen,
|
|
56
61
|
onCancel: function onCancel() {
|
|
57
|
-
setOpen(false);
|
|
62
|
+
// setOpen(false);
|
|
63
|
+
setCartDrawerOpen(false);
|
|
58
64
|
setIsErrorHolder(false);
|
|
59
65
|
},
|
|
60
66
|
onNext: onNext
|
|
@@ -27,7 +27,9 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
27
27
|
appointmentBooking = _ref.appointmentBooking,
|
|
28
28
|
setLoading = _ref.setLoading,
|
|
29
29
|
currentStepParams = _ref.currentStepParams,
|
|
30
|
-
carts = _ref.carts
|
|
30
|
+
carts = _ref.carts,
|
|
31
|
+
cartDrawerOpen = _ref.cartDrawerOpen,
|
|
32
|
+
setCartDrawerOpen = _ref.setCartDrawerOpen;
|
|
31
33
|
var _useAppointmentBookin = useAppointmentBookingResource(),
|
|
32
34
|
getResourceList = _useAppointmentBookin.getResourceList;
|
|
33
35
|
var _useAppointmentBookin2 = useAppointmentBookingSetting(),
|
|
@@ -120,8 +122,19 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
120
122
|
*/
|
|
121
123
|
var updateFormStatus = function updateFormStatus(status) {
|
|
122
124
|
if (status === 'error') {
|
|
123
|
-
nextStepLog(utils, '表单内部错误');
|
|
124
125
|
setLoading(false);
|
|
126
|
+
nextStepLog(utils, '表单内部错误, 请填写完整表单', [{
|
|
127
|
+
key: 'isMobile',
|
|
128
|
+
value: JSON.stringify(utils === null || utils === void 0 ? void 0 : utils.isMobile())
|
|
129
|
+
}, {
|
|
130
|
+
key: 'cartDrawerOpen',
|
|
131
|
+
value: JSON.stringify(cartDrawerOpen)
|
|
132
|
+
}]);
|
|
133
|
+
console.log('isErrorHolder11', utils, utils === null || utils === void 0 ? void 0 : utils.isMobile(), cartDrawerOpen);
|
|
134
|
+
// 如果表单错误,则关闭当前购物车
|
|
135
|
+
if (cartDrawerOpen) {
|
|
136
|
+
setCartDrawerOpen(false);
|
|
137
|
+
}
|
|
125
138
|
}
|
|
126
139
|
};
|
|
127
140
|
|
|
@@ -60,20 +60,25 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
60
60
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
61
61
|
isErrorHolder = _useState22[0],
|
|
62
62
|
setIsErrorHolder = _useState22[1];
|
|
63
|
+
/** 底部购物车抽屉是否展开(与 isErrorHolder 解耦,便于表单校验失败时仅关闭抽屉) */
|
|
64
|
+
var _useState23 = useState(false),
|
|
65
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
66
|
+
cartDrawerOpen = _useState24[0],
|
|
67
|
+
setCartDrawerOpen = _useState24[1];
|
|
63
68
|
// 初始化 TasksManager
|
|
64
|
-
var
|
|
69
|
+
var _useState25 = useState(function () {
|
|
65
70
|
return new TasksManager();
|
|
66
71
|
}),
|
|
67
|
-
|
|
68
|
-
tasksManager =
|
|
69
|
-
var
|
|
70
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
71
|
-
policyParams = _useState26[0],
|
|
72
|
-
setPolicyParams = _useState26[1];
|
|
73
|
-
var _useState27 = useState(),
|
|
72
|
+
_useState26 = _slicedToArray(_useState25, 1),
|
|
73
|
+
tasksManager = _useState26[0];
|
|
74
|
+
var _useState27 = useState(null),
|
|
74
75
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
policyParams = _useState28[0],
|
|
77
|
+
setPolicyParams = _useState28[1];
|
|
78
|
+
var _useState29 = useState(),
|
|
79
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
80
|
+
currentSelectedResources = _useState30[0],
|
|
81
|
+
setCurrentSelectedResources = _useState30[1];
|
|
77
82
|
var _useEngineContext = useEngineContext(),
|
|
78
83
|
appHelper = _useEngineContext.appHelper;
|
|
79
84
|
var symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
|
|
@@ -222,7 +227,9 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
222
227
|
closePolicy: closePolicy,
|
|
223
228
|
currentStepParams: currentStepParams,
|
|
224
229
|
currentSelectedResources: currentSelectedResources,
|
|
225
|
-
setCurrentSelectedResources: setCurrentSelectedResources
|
|
230
|
+
setCurrentSelectedResources: setCurrentSelectedResources,
|
|
231
|
+
cartDrawerOpen: cartDrawerOpen,
|
|
232
|
+
setCartDrawerOpen: setCartDrawerOpen
|
|
226
233
|
};
|
|
227
234
|
return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
|
|
228
235
|
value: value
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { isMobile, locales } from '@pisell/utils';
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
|
2
|
+
import { isIpad, isMobile, locales } from '@pisell/utils';
|
|
3
3
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
4
4
|
import { AppointmentBookingProvider } from "./context";
|
|
5
5
|
import Content from "./components/Content";
|
|
@@ -13,6 +13,9 @@ var AppointmentBooking = function AppointmentBooking() {
|
|
|
13
13
|
locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
|
|
14
14
|
var utils = contextUtils();
|
|
15
15
|
var appointmentBooking = useAppointmentBooking();
|
|
16
|
+
var isMobileLayout = useMemo(function () {
|
|
17
|
+
return isMobile() && !isIpad();
|
|
18
|
+
}, []);
|
|
16
19
|
useEffect(function () {
|
|
17
20
|
var _appointmentBooking$o;
|
|
18
21
|
var _ref = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
|
|
@@ -58,7 +61,7 @@ var AppointmentBooking = function AppointmentBooking() {
|
|
|
58
61
|
};
|
|
59
62
|
}, []);
|
|
60
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: "parallel-booking-wrap ".concat(
|
|
64
|
+
className: "parallel-booking-wrap ".concat(isMobileLayout ? 'parallel-booking-mobile-wrap' : '')
|
|
62
65
|
}, /*#__PURE__*/React.createElement(AppointmentBookingProvider, null, /*#__PURE__*/React.createElement(Content, null)));
|
|
63
66
|
};
|
|
64
67
|
export default AppointmentBooking;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { VenueBookingContextValue, VenueBookingProviderProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* VenueBookingProvider -- 场地预订全局 Context
|
|
5
|
+
* 管理步骤导航、场地选择状态、OS 模块集成
|
|
6
|
+
*/
|
|
7
|
+
export declare function VenueBookingProvider({ entryContext, children }: VenueBookingProviderProps): JSX.Element;
|
|
8
|
+
/** 消费 venueBooking Context 的 hook */
|
|
9
|
+
export declare function useVenueBookingContext(): VenueBookingContextValue;
|
|
@@ -751,7 +751,7 @@ export function VenueBookingProvider(_ref) {
|
|
|
751
751
|
|
|
752
752
|
/** 结账步骤提交订单(调用 OS venueBooking.submitOrder) */
|
|
753
753
|
var submitOrder = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
754
|
-
var _result$data, _viewModel$summary, result, orderId, totalAmount, _otherParams$openData
|
|
754
|
+
var _result$data, _viewModel$summary, result, orderId, totalAmount, otherParams, _otherParams$openData;
|
|
755
755
|
return _regeneratorRuntime().wrap(function _callee9$(_context10) {
|
|
756
756
|
while (1) switch (_context10.prev = _context10.next) {
|
|
757
757
|
case 0:
|
|
@@ -783,11 +783,11 @@ export function VenueBookingProvider(_ref) {
|
|
|
783
783
|
console.warn('[venueBooking] submitOrder succeeded but order_id is missing', result);
|
|
784
784
|
return _context10.abrupt("return");
|
|
785
785
|
case 15:
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
otherParams = getOtherParams(venueBookingModule);
|
|
787
|
+
if (!(typeof (utils === null || utils === void 0 ? void 0 : utils.action) === 'function' && otherParams !== null && otherParams !== void 0 && otherParams.openData['sale.require_payment_on_submit'])) {
|
|
788
|
+
_context10.next = 22;
|
|
788
789
|
break;
|
|
789
790
|
}
|
|
790
|
-
otherParams = getOtherParams(venueBookingModule); // 判断:如果订单金额为 0,或者没有开启支付方式,则直接跳成功页
|
|
791
791
|
if (!(totalAmount === 0 || (otherParams === null || otherParams === void 0 || (_otherParams$openData = otherParams.openData['checkout.checkout_options']) === null || _otherParams$openData === void 0 ? void 0 : _otherParams$openData.length) === 0)) {
|
|
792
792
|
_context10.next = 19;
|
|
793
793
|
break;
|
|
@@ -802,26 +802,31 @@ export function VenueBookingProvider(_ref) {
|
|
|
802
802
|
},
|
|
803
803
|
callback: function callback(e) {}
|
|
804
804
|
});
|
|
805
|
-
|
|
806
|
-
_context10.next = 26;
|
|
805
|
+
_context10.next = 23;
|
|
807
806
|
break;
|
|
808
807
|
case 22:
|
|
809
|
-
|
|
808
|
+
// 跳转到订单详情
|
|
809
|
+
location.replace("/order/details?id=".concat(orderId));
|
|
810
|
+
case 23:
|
|
811
|
+
_context10.next = 29;
|
|
812
|
+
break;
|
|
813
|
+
case 25:
|
|
814
|
+
_context10.prev = 25;
|
|
810
815
|
_context10.t0 = _context10["catch"](2);
|
|
811
816
|
message.error({
|
|
812
817
|
content: getSubmitOrderErrorMessage(_context10.t0),
|
|
813
818
|
duration: 2
|
|
814
819
|
});
|
|
815
820
|
console.warn('[venueBooking] submitOrder failed', _context10.t0);
|
|
816
|
-
case 26:
|
|
817
|
-
_context10.prev = 26;
|
|
818
|
-
setIsSubmittingOrder(false);
|
|
819
|
-
return _context10.finish(26);
|
|
820
821
|
case 29:
|
|
822
|
+
_context10.prev = 29;
|
|
823
|
+
setIsSubmittingOrder(false);
|
|
824
|
+
return _context10.finish(29);
|
|
825
|
+
case 32:
|
|
821
826
|
case "end":
|
|
822
827
|
return _context10.stop();
|
|
823
828
|
}
|
|
824
|
-
}, _callee9, null, [[2,
|
|
829
|
+
}, _callee9, null, [[2, 25, 29, 32]]);
|
|
825
830
|
})), [isSubmittingOrder, venueBookingModule, refreshViewModel, utils, viewModel === null || viewModel === void 0 || (_viewModel$summary2 = viewModel.summary) === null || _viewModel$summary2 === void 0 ? void 0 : _viewModel$summary2.total_amount]);
|
|
826
831
|
|
|
827
832
|
/** 带登录门禁的提交订单入口 */
|
|
@@ -15,6 +15,34 @@ import { VenueBookingProvider } from "./context";
|
|
|
15
15
|
import Content from "./components/Content";
|
|
16
16
|
import { normalizeEntryContext } from "./hooks";
|
|
17
17
|
import localeTexts from "./locales";
|
|
18
|
+
function getViewportHeight() {
|
|
19
|
+
var _window$visualViewpor;
|
|
20
|
+
if (typeof window === 'undefined') return undefined;
|
|
21
|
+
var visualViewportHeight = (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 ? void 0 : _window$visualViewpor.height;
|
|
22
|
+
if (visualViewportHeight && visualViewportHeight > 0) return Math.round(visualViewportHeight);
|
|
23
|
+
if (window.innerHeight > 0) return window.innerHeight;
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
function getViewportHeightFallback() {
|
|
27
|
+
var _CSS$supports, _CSS, _CSS$supports2, _CSS2;
|
|
28
|
+
if (typeof CSS !== 'undefined' && (_CSS$supports = (_CSS = CSS).supports) !== null && _CSS$supports !== void 0 && _CSS$supports.call(_CSS, 'height', '100dvh')) return '100dvh';
|
|
29
|
+
if (typeof CSS !== 'undefined' && (_CSS$supports2 = (_CSS2 = CSS).supports) !== null && _CSS$supports2 !== void 0 && _CSS$supports2.call(_CSS2, 'height', '100svh')) return '100svh';
|
|
30
|
+
return '100%';
|
|
31
|
+
}
|
|
32
|
+
function getViewportStyle(viewportHeight) {
|
|
33
|
+
if (viewportHeight === undefined) {
|
|
34
|
+
var fallbackHeight = getViewportHeightFallback();
|
|
35
|
+
return {
|
|
36
|
+
height: fallbackHeight,
|
|
37
|
+
minHeight: fallbackHeight
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'--vb-viewport-height': "".concat(viewportHeight, "px"),
|
|
42
|
+
height: 'var(--vb-viewport-height)',
|
|
43
|
+
minHeight: 'var(--vb-viewport-height)'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
18
46
|
|
|
19
47
|
/** 场地预订主组件 */
|
|
20
48
|
function VenueBooking(props) {
|
|
@@ -24,28 +52,38 @@ function VenueBooking(props) {
|
|
|
24
52
|
locales.init(localeTexts, (context === null || context === void 0 || (_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.locale) || 'en');
|
|
25
53
|
|
|
26
54
|
// h-full 依赖父链上每一层都有明确高度,但宿主环境(如 KeepAlive wrapper)可能打断此链。
|
|
27
|
-
//
|
|
28
|
-
var _useState = useState(
|
|
55
|
+
// iOS Chrome 的 100vh/innerHeight 容易受地址栏影响,优先用 visualViewport 的动态可见高度。
|
|
56
|
+
var _useState = useState(getViewportHeight),
|
|
29
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
58
|
viewportHeight = _useState2[0],
|
|
31
59
|
setViewportHeight = _useState2[1];
|
|
32
60
|
useEffect(function () {
|
|
33
|
-
|
|
34
|
-
|
|
61
|
+
var _window$visualViewpor2, _window$visualViewpor3;
|
|
62
|
+
var frameId;
|
|
63
|
+
function updateViewportHeight() {
|
|
64
|
+
if (frameId !== undefined) window.cancelAnimationFrame(frameId);
|
|
65
|
+
frameId = window.requestAnimationFrame(function () {
|
|
66
|
+
frameId = undefined;
|
|
67
|
+
setViewportHeight(getViewportHeight());
|
|
68
|
+
});
|
|
35
69
|
}
|
|
36
|
-
|
|
37
|
-
window.addEventListener('resize',
|
|
70
|
+
updateViewportHeight();
|
|
71
|
+
window.addEventListener('resize', updateViewportHeight);
|
|
72
|
+
window.addEventListener('orientationchange', updateViewportHeight);
|
|
73
|
+
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.addEventListener('resize', updateViewportHeight);
|
|
74
|
+
(_window$visualViewpor3 = window.visualViewport) === null || _window$visualViewpor3 === void 0 || _window$visualViewpor3.addEventListener('scroll', updateViewportHeight);
|
|
38
75
|
return function () {
|
|
39
|
-
|
|
76
|
+
var _window$visualViewpor4, _window$visualViewpor5;
|
|
77
|
+
if (frameId !== undefined) window.cancelAnimationFrame(frameId);
|
|
78
|
+
window.removeEventListener('resize', updateViewportHeight);
|
|
79
|
+
window.removeEventListener('orientationchange', updateViewportHeight);
|
|
80
|
+
(_window$visualViewpor4 = window.visualViewport) === null || _window$visualViewpor4 === void 0 || _window$visualViewpor4.removeEventListener('resize', updateViewportHeight);
|
|
81
|
+
(_window$visualViewpor5 = window.visualViewport) === null || _window$visualViewpor5 === void 0 || _window$visualViewpor5.removeEventListener('scroll', updateViewportHeight);
|
|
40
82
|
};
|
|
41
83
|
}, []);
|
|
42
84
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
85
|
className: "venue-booking-scope overflow-x-hidden overscroll-none bg-[#f5f5f3] text-zinc-900",
|
|
44
|
-
style: viewportHeight
|
|
45
|
-
height: viewportHeight
|
|
46
|
-
} : {
|
|
47
|
-
height: '100vh'
|
|
48
|
-
}
|
|
86
|
+
style: getViewportStyle(viewportHeight)
|
|
49
87
|
}, /*#__PURE__*/React.createElement(VenueBookingProvider, {
|
|
50
88
|
entryContext: entryContext
|
|
51
89
|
}, /*#__PURE__*/React.createElement(Content, null)));
|
|
@@ -43,10 +43,10 @@ var import_Total = __toESM(require("../Cart/Item/Total"));
|
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
var Footer = ({ onNext, isOpen }) => {
|
|
45
45
|
var _a;
|
|
46
|
-
const { carts, currentStep, isErrorHolder, setIsErrorHolder } = (0, import_context.useAppointmentBookingContext)();
|
|
46
|
+
const { carts, currentStep, isErrorHolder, setIsErrorHolder, cartDrawerOpen, setCartDrawerOpen } = (0, import_context.useAppointmentBookingContext)();
|
|
47
47
|
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
48
48
|
(0, import_react.useEffect)(() => {
|
|
49
|
-
|
|
49
|
+
setCartDrawerOpen(isErrorHolder || false);
|
|
50
50
|
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, isErrorHolder]);
|
|
51
51
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
52
52
|
import_materials.SectionFooters,
|
|
@@ -57,7 +57,7 @@ var Footer = ({ onNext, isOpen }) => {
|
|
|
57
57
|
import_materials.Button,
|
|
58
58
|
{
|
|
59
59
|
size: "large",
|
|
60
|
-
onClick: () =>
|
|
60
|
+
onClick: () => setCartDrawerOpen(true),
|
|
61
61
|
className: "section-footer-btn"
|
|
62
62
|
},
|
|
63
63
|
/* @__PURE__ */ import_react.default.createElement(import_materials.Image, { src: import_shopping_cart.default, preview: false })
|
|
@@ -66,9 +66,9 @@ var Footer = ({ onNext, isOpen }) => {
|
|
|
66
66
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
67
67
|
import_Cart.default,
|
|
68
68
|
{
|
|
69
|
-
open,
|
|
69
|
+
open: cartDrawerOpen,
|
|
70
70
|
onCancel: () => {
|
|
71
|
-
|
|
71
|
+
setCartDrawerOpen(false);
|
|
72
72
|
setIsErrorHolder(false);
|
|
73
73
|
},
|
|
74
74
|
onNext
|
|
@@ -42,7 +42,7 @@ var import_utils3 = require("../../utils");
|
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
44
44
|
const manualRef = (0, import_react.useRef)();
|
|
45
|
-
const { appointmentBooking, setLoading, currentStepParams, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
45
|
+
const { appointmentBooking, setLoading, currentStepParams, carts, cartDrawerOpen, setCartDrawerOpen } = (0, import_context.useAppointmentBookingContext)();
|
|
46
46
|
const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
47
47
|
const { setOtherData, getOtherData, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
48
48
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
@@ -86,8 +86,15 @@ var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
|
86
86
|
}, [appointmentBoard == null ? void 0 : appointmentBoard.resource_form_id]);
|
|
87
87
|
const updateFormStatus = (status) => {
|
|
88
88
|
if (status === "error") {
|
|
89
|
-
(0, import_utils3.nextStepLog)(utils, "表单内部错误");
|
|
90
89
|
setLoading(false);
|
|
90
|
+
(0, import_utils3.nextStepLog)(utils, "表单内部错误, 请填写完整表单", [
|
|
91
|
+
{ key: "isMobile", value: JSON.stringify(utils == null ? void 0 : utils.isMobile()) },
|
|
92
|
+
{ key: "cartDrawerOpen", value: JSON.stringify(cartDrawerOpen) }
|
|
93
|
+
]);
|
|
94
|
+
console.log("isErrorHolder11", utils, utils == null ? void 0 : utils.isMobile(), cartDrawerOpen);
|
|
95
|
+
if (cartDrawerOpen) {
|
|
96
|
+
setCartDrawerOpen(false);
|
|
97
|
+
}
|
|
91
98
|
}
|
|
92
99
|
};
|
|
93
100
|
const setFormStorage = (values) => {
|
|
@@ -56,6 +56,7 @@ var AppointmentBookingProvider = ({
|
|
|
56
56
|
const [currentResource, setCurrentResource] = (0, import_react.useState)(null);
|
|
57
57
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
58
58
|
const [isErrorHolder, setIsErrorHolder] = (0, import_react.useState)(false);
|
|
59
|
+
const [cartDrawerOpen, setCartDrawerOpen] = (0, import_react.useState)(false);
|
|
59
60
|
const [tasksManager] = (0, import_react.useState)(() => new import_tasks.TasksManager());
|
|
60
61
|
const [policyParams, setPolicyParams] = (0, import_react.useState)(null);
|
|
61
62
|
const [currentSelectedResources, setCurrentSelectedResources] = (0, import_react.useState)();
|
|
@@ -168,7 +169,9 @@ var AppointmentBookingProvider = ({
|
|
|
168
169
|
closePolicy,
|
|
169
170
|
currentStepParams,
|
|
170
171
|
currentSelectedResources,
|
|
171
|
-
setCurrentSelectedResources
|
|
172
|
+
setCurrentSelectedResources,
|
|
173
|
+
cartDrawerOpen,
|
|
174
|
+
setCartDrawerOpen
|
|
172
175
|
};
|
|
173
176
|
return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
|
|
174
177
|
};
|
|
@@ -47,6 +47,7 @@ var AppointmentBooking = () => {
|
|
|
47
47
|
import_utils.locales.init(import_locales.default, ((_b = (_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.locale) || "en");
|
|
48
48
|
const utils = (0, import_hooks.contextUtils)();
|
|
49
49
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
50
|
+
const isMobileLayout = (0, import_react.useMemo)(() => (0, import_utils.isMobile)() && !(0, import_utils.isIpad)(), []);
|
|
50
51
|
(0, import_react.useEffect)(() => {
|
|
51
52
|
var _a2;
|
|
52
53
|
const { bookingSubject } = ((_a2 = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a2.productModuleParams) || {};
|
|
@@ -83,7 +84,7 @@ var AppointmentBooking = () => {
|
|
|
83
84
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
84
85
|
"div",
|
|
85
86
|
{
|
|
86
|
-
className: `parallel-booking-wrap ${
|
|
87
|
+
className: `parallel-booking-wrap ${isMobileLayout ? "parallel-booking-mobile-wrap" : ""}`
|
|
87
88
|
},
|
|
88
89
|
/* @__PURE__ */ import_react.default.createElement(import_context.AppointmentBookingProvider, null, /* @__PURE__ */ import_react.default.createElement(import_Content.default, null))
|
|
89
90
|
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { VenueBookingContextValue, VenueBookingProviderProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* VenueBookingProvider -- 场地预订全局 Context
|
|
5
|
+
* 管理步骤导航、场地选择状态、OS 模块集成
|
|
6
|
+
*/
|
|
7
|
+
export declare function VenueBookingProvider({ entryContext, children }: VenueBookingProviderProps): JSX.Element;
|
|
8
|
+
/** 消费 venueBooking Context 的 hook */
|
|
9
|
+
export declare function useVenueBookingContext(): VenueBookingContextValue;
|
|
@@ -328,8 +328,8 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
328
328
|
console.warn("[venueBooking] submitOrder succeeded but order_id is missing", result);
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
const otherParams = (0, import_hooks.getOtherParams)(venueBookingModule);
|
|
332
|
+
if (typeof (utils == null ? void 0 : utils.action) === "function" && (otherParams == null ? void 0 : otherParams.openData["sale.require_payment_on_submit"])) {
|
|
333
333
|
if (totalAmount === 0 || ((_c2 = otherParams == null ? void 0 : otherParams.openData["checkout.checkout_options"]) == null ? void 0 : _c2.length) === 0) {
|
|
334
334
|
return location.replace(`/payment-finish/success?amount=${totalAmount}&order_id=${orderId}`);
|
|
335
335
|
}
|
|
@@ -342,6 +342,8 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
342
342
|
callback: (e) => {
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
|
+
} else {
|
|
346
|
+
location.replace(`/order/details?id=${orderId}`);
|
|
345
347
|
}
|
|
346
348
|
} catch (error) {
|
|
347
349
|
import_antd.message.error({
|
|
@@ -39,27 +39,71 @@ var import_context = require("./context");
|
|
|
39
39
|
var import_Content = __toESM(require("./components/Content"));
|
|
40
40
|
var import_hooks = require("./hooks");
|
|
41
41
|
var import_locales = __toESM(require("./locales"));
|
|
42
|
+
function getViewportHeight() {
|
|
43
|
+
var _a;
|
|
44
|
+
if (typeof window === "undefined") return void 0;
|
|
45
|
+
const visualViewportHeight = (_a = window.visualViewport) == null ? void 0 : _a.height;
|
|
46
|
+
if (visualViewportHeight && visualViewportHeight > 0) return Math.round(visualViewportHeight);
|
|
47
|
+
if (window.innerHeight > 0) return window.innerHeight;
|
|
48
|
+
return void 0;
|
|
49
|
+
}
|
|
50
|
+
function getViewportHeightFallback() {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (typeof CSS !== "undefined" && ((_a = CSS.supports) == null ? void 0 : _a.call(CSS, "height", "100dvh"))) return "100dvh";
|
|
53
|
+
if (typeof CSS !== "undefined" && ((_b = CSS.supports) == null ? void 0 : _b.call(CSS, "height", "100svh"))) return "100svh";
|
|
54
|
+
return "100%";
|
|
55
|
+
}
|
|
56
|
+
function getViewportStyle(viewportHeight) {
|
|
57
|
+
if (viewportHeight === void 0) {
|
|
58
|
+
const fallbackHeight = getViewportHeightFallback();
|
|
59
|
+
return {
|
|
60
|
+
height: fallbackHeight,
|
|
61
|
+
minHeight: fallbackHeight
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
"--vb-viewport-height": `${viewportHeight}px`,
|
|
66
|
+
height: "var(--vb-viewport-height)",
|
|
67
|
+
minHeight: "var(--vb-viewport-height)"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
42
70
|
function VenueBooking(props) {
|
|
43
71
|
var _a, _b, _c;
|
|
44
72
|
const context = (0, import_useEngineContext.default)();
|
|
45
73
|
const entryContext = (0, import_hooks.normalizeEntryContext)((_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props);
|
|
46
74
|
import_utils.locales.init(import_locales.default, ((_c = (_b = context == null ? void 0 : context.engine) == null ? void 0 : _b.props) == null ? void 0 : _c.locale) || "en");
|
|
47
75
|
const [viewportHeight, setViewportHeight] = (0, import_react.useState)(
|
|
48
|
-
|
|
76
|
+
getViewportHeight
|
|
49
77
|
);
|
|
50
78
|
(0, import_react.useEffect)(() => {
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
var _a2, _b2;
|
|
80
|
+
let frameId;
|
|
81
|
+
function updateViewportHeight() {
|
|
82
|
+
if (frameId !== void 0) window.cancelAnimationFrame(frameId);
|
|
83
|
+
frameId = window.requestAnimationFrame(() => {
|
|
84
|
+
frameId = void 0;
|
|
85
|
+
setViewportHeight(getViewportHeight());
|
|
86
|
+
});
|
|
53
87
|
}
|
|
54
|
-
|
|
55
|
-
window.addEventListener("resize",
|
|
56
|
-
|
|
88
|
+
updateViewportHeight();
|
|
89
|
+
window.addEventListener("resize", updateViewportHeight);
|
|
90
|
+
window.addEventListener("orientationchange", updateViewportHeight);
|
|
91
|
+
(_a2 = window.visualViewport) == null ? void 0 : _a2.addEventListener("resize", updateViewportHeight);
|
|
92
|
+
(_b2 = window.visualViewport) == null ? void 0 : _b2.addEventListener("scroll", updateViewportHeight);
|
|
93
|
+
return () => {
|
|
94
|
+
var _a3, _b3;
|
|
95
|
+
if (frameId !== void 0) window.cancelAnimationFrame(frameId);
|
|
96
|
+
window.removeEventListener("resize", updateViewportHeight);
|
|
97
|
+
window.removeEventListener("orientationchange", updateViewportHeight);
|
|
98
|
+
(_a3 = window.visualViewport) == null ? void 0 : _a3.removeEventListener("resize", updateViewportHeight);
|
|
99
|
+
(_b3 = window.visualViewport) == null ? void 0 : _b3.removeEventListener("scroll", updateViewportHeight);
|
|
100
|
+
};
|
|
57
101
|
}, []);
|
|
58
102
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
59
103
|
"div",
|
|
60
104
|
{
|
|
61
105
|
className: "venue-booking-scope overflow-x-hidden overscroll-none bg-[#f5f5f3] text-zinc-900",
|
|
62
|
-
style: viewportHeight
|
|
106
|
+
style: getViewportStyle(viewportHeight)
|
|
63
107
|
},
|
|
64
108
|
/* @__PURE__ */ import_react.default.createElement(import_context.VenueBookingProvider, { entryContext }, /* @__PURE__ */ import_react.default.createElement(import_Content.default, null))
|
|
65
109
|
);
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { TasksManager } from '../../utils/tasks';
|
|
3
|
-
interface AppointmentBookingContextType {
|
|
4
|
-
appointmentBooking: any;
|
|
5
|
-
times: any[];
|
|
6
|
-
resources: any[];
|
|
7
|
-
setTimes: (times: any[]) => void;
|
|
8
|
-
setResources: (lists: any[]) => void;
|
|
9
|
-
carts: any[];
|
|
10
|
-
summary: any;
|
|
11
|
-
setCarts: (val: any[]) => void;
|
|
12
|
-
setSummary: (val: any) => void;
|
|
13
|
-
currentStep: any;
|
|
14
|
-
setCurrentStep: (val: any) => void;
|
|
15
|
-
appHelper?: any;
|
|
16
|
-
symbolic?: any;
|
|
17
|
-
resourceOtherParams?: any;
|
|
18
|
-
setResourceOtherParams: (val: any) => void;
|
|
19
|
-
selectedTime: any;
|
|
20
|
-
setSelectedTime: (val: any) => void;
|
|
21
|
-
isAgreeDepositPolicy: boolean;
|
|
22
|
-
setIsAgreeDepositPolicy: (val: boolean) => void;
|
|
23
|
-
isLastStep: boolean;
|
|
24
|
-
tasksManager: TasksManager;
|
|
25
|
-
policyParams: any;
|
|
26
|
-
setPolicyParams: (val: any) => void;
|
|
27
|
-
openPolicy: (content: any, callback?: any) => void;
|
|
28
|
-
closePolicy: (val?: boolean) => void;
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
}
|
|
31
|
-
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
32
|
-
children: ReactNode;
|
|
33
|
-
}) => JSX.Element;
|
|
34
|
-
export declare const useAppointmentBookingContext: () => AppointmentBookingContextType | undefined;
|
|
35
|
-
export {};
|