@pisell/private-materials 3.0.211 → 3.0.213
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 +5 -5
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Cart/index.js +3 -1
- package/es/components/Sales/Checkout/index.js +6 -0
- package/es/components/Sales/Event/Detail.js +1 -1
- package/es/components/Sales/Init/index.d.ts +4 -0
- package/es/components/Sales/Init/index.js +6 -2
- package/es/components/Sales/Resource/serve.d.ts +1 -0
- package/es/components/Sales/Summary/index.d.ts +3 -0
- package/es/components/Sales/Summary/index.js +9 -3
- package/es/components/Sales/Summary/serve.d.ts +0 -2
- package/es/components/Sales/Summary/serve.js +0 -11
- package/es/components/Sales/Summary/utils.d.ts +15 -1
- package/es/components/Sales/Summary/utils.js +32 -3
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +6 -2
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +46 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -8
- package/es/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
- package/es/components/eventBooking/components/Provider/Cart/index.js +1 -5
- package/es/components/eventBooking/components/Provider/Cart/index.less +0 -2
- package/es/components/eventBooking/components/Provider/Content/index.js +24 -0
- package/es/components/eventBooking/components/Provider/Content/index.less +3 -2
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.js +1 -2
- package/es/components/eventBooking/components/Provider/Event/index.less +1 -1
- package/es/components/eventBooking/components/Provider/Footer/index.js +18 -11
- package/es/components/eventBooking/components/Provider/Footer/index.less +29 -5
- package/es/components/eventBooking/components/Provider/Header/index.js +4 -2
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.js +1 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.js +0 -1
- package/es/components/eventBooking/components/Provider/Resource/index.js +4 -21
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/index.js +142 -41
- package/es/components/eventBooking/components/bookingDetailModal/index.less +2 -2
- package/es/components/eventBooking/components/resourceDisplay/index.less +14 -0
- package/es/components/eventBooking/components/selectHolder/index.js +2 -6
- package/es/components/eventBooking/index.js +2 -1
- package/es/components/eventBooking/index.less +2 -0
- package/es/components/eventBooking/locales.d.ts +6 -3
- package/es/components/eventBooking/locales.js +22 -7
- package/es/components/eventBooking/utils.d.ts +9 -0
- package/es/components/eventBooking/utils.js +17 -0
- package/es/components/tabProduct/tabs/index.less +13 -3
- package/lib/components/Sales/Cart/index.js +6 -4
- package/lib/components/Sales/Checkout/index.js +3 -0
- package/lib/components/Sales/Event/Detail.js +1 -1
- package/lib/components/Sales/Init/index.d.ts +4 -0
- package/lib/components/Sales/Init/index.js +5 -2
- package/lib/components/Sales/Resource/serve.d.ts +1 -0
- package/lib/components/Sales/Summary/index.d.ts +3 -0
- package/lib/components/Sales/Summary/index.js +11 -3
- package/lib/components/Sales/Summary/serve.d.ts +0 -2
- package/lib/components/Sales/Summary/serve.js +0 -37
- package/lib/components/Sales/Summary/utils.d.ts +15 -1
- package/lib/components/Sales/Summary/utils.js +25 -5
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +5 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +82 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -9
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
- package/lib/components/eventBooking/components/Provider/Cart/index.js +1 -5
- package/lib/components/eventBooking/components/Provider/Cart/index.less +0 -2
- package/lib/components/eventBooking/components/Provider/Content/index.js +16 -0
- package/lib/components/eventBooking/components/Provider/Content/index.less +3 -2
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.js +1 -2
- package/lib/components/eventBooking/components/Provider/Event/index.less +1 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.js +14 -12
- package/lib/components/eventBooking/components/Provider/Footer/index.less +29 -5
- package/lib/components/eventBooking/components/Provider/Header/index.js +5 -2
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.js +1 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.js +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/index.js +4 -12
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +101 -22
- package/lib/components/eventBooking/components/bookingDetailModal/index.less +2 -2
- package/lib/components/eventBooking/components/resourceDisplay/index.less +14 -0
- package/lib/components/eventBooking/components/selectHolder/index.js +1 -1
- package/lib/components/eventBooking/index.js +2 -1
- package/lib/components/eventBooking/index.less +2 -0
- package/lib/components/eventBooking/locales.d.ts +6 -3
- package/lib/components/eventBooking/locales.js +10 -7
- package/lib/components/eventBooking/utils.d.ts +9 -0
- package/lib/components/eventBooking/utils.js +12 -2
- package/lib/components/tabProduct/tabs/index.less +13 -3
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
padding: 24px;
|
|
7
7
|
justify-content: space-between;
|
|
8
|
-
align-items:
|
|
8
|
+
align-items: center;
|
|
9
9
|
align-self: stretch;
|
|
10
10
|
background: #ffffff;
|
|
11
11
|
border-top: 1px solid #eaecf0;
|
|
@@ -13,15 +13,30 @@
|
|
|
13
13
|
.section-footer-left {
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-direction: column;
|
|
16
|
-
color: var(--
|
|
17
|
-
font-size:
|
|
16
|
+
color: var(--Gray-900, #101828);
|
|
17
|
+
font-size: 16px;
|
|
18
18
|
font-weight: 400;
|
|
19
|
-
line-height:
|
|
19
|
+
line-height: 24px;
|
|
20
|
+
> div {
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.gst-wrap {
|
|
25
|
+
color: var(--Gray-500, #667085);
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
line-height: 20px;
|
|
29
|
+
}
|
|
20
30
|
|
|
21
|
-
.
|
|
31
|
+
.event-total {
|
|
32
|
+
padding: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.event-amount {
|
|
22
36
|
font-size: 16px;
|
|
23
37
|
font-weight: 500;
|
|
24
38
|
line-height: 24px;
|
|
39
|
+
color: var(--Gray-900, #101828) !important;
|
|
25
40
|
}
|
|
26
41
|
}
|
|
27
42
|
|
|
@@ -36,5 +51,14 @@
|
|
|
36
51
|
display: flex;
|
|
37
52
|
align-items: center;
|
|
38
53
|
gap: 8px;
|
|
54
|
+
padding: 0;
|
|
55
|
+
width: 40px;
|
|
56
|
+
height: 40px;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
.pisell-lowcode-image {
|
|
59
|
+
width: 20px;
|
|
60
|
+
height: 20px;
|
|
61
|
+
line-height: 20px;
|
|
62
|
+
}
|
|
39
63
|
}
|
|
40
64
|
}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { locales } from '@pisell/utils';
|
|
3
3
|
import { useStep, useSales } from "../../../../Sales";
|
|
4
4
|
import ProgressBar from "../../progressBar";
|
|
5
|
+
import { resourceTitle } from "../../../utils";
|
|
5
6
|
import "./index.less";
|
|
6
7
|
var Header = function Header() {
|
|
7
8
|
var _steps$currentStepDat, _steps$currentStepDat2;
|
|
@@ -11,7 +12,8 @@ var Header = function Header() {
|
|
|
11
12
|
prevStep = _useStep.prevStep,
|
|
12
13
|
isFirstStep = _useStep.isFirstStep;
|
|
13
14
|
var _useSales = useSales(),
|
|
14
|
-
removeSessionStorage = _useSales.removeSessionStorage
|
|
15
|
+
removeSessionStorage = _useSales.removeSessionStorage,
|
|
16
|
+
data = _useSales.data;
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* @title: 步骤数据多语言
|
|
@@ -23,7 +25,7 @@ var Header = function Header() {
|
|
|
23
25
|
var steps = {
|
|
24
26
|
'select-category': {
|
|
25
27
|
title: locales.getText('pisell2.event.step')(1),
|
|
26
|
-
description: locales.getText('pisell2.event.select.category')
|
|
28
|
+
description: locales.getText('pisell2.event.select.category')(resourceTitle(data))
|
|
27
29
|
},
|
|
28
30
|
'select-event': {
|
|
29
31
|
title: locales.getText('pisell2.event.step')(2),
|
|
@@ -16,7 +16,7 @@ var InformationOptionsModal = function InformationOptionsModal(props) {
|
|
|
16
16
|
destroyOnClose: true,
|
|
17
17
|
footer: null,
|
|
18
18
|
onCancel: onCancel,
|
|
19
|
-
mobileModalHeight: '
|
|
19
|
+
mobileModalHeight: 'auto',
|
|
20
20
|
className: 'information-option-modal',
|
|
21
21
|
headerDivider: false
|
|
22
22
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { PisellViewGrid } from '@pisell/materials';
|
|
3
3
|
import { isMobile, locales } from '@pisell/utils';
|
|
4
4
|
import { useResource, useSales, useCart, useStep } from "../../../../Sales";
|
|
5
|
-
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
6
5
|
import ResourceDisplay from "../../resourceDisplay";
|
|
6
|
+
import { resourceTitle } from "../../../utils";
|
|
7
7
|
import "./index.less";
|
|
8
8
|
var Resource = function Resource() {
|
|
9
|
-
var _data$
|
|
9
|
+
var _data$resourceData, _data$resourceData$re;
|
|
10
10
|
var _useSales = useSales(),
|
|
11
11
|
data = _useSales.data;
|
|
12
12
|
var _useResource = useResource(),
|
|
@@ -16,7 +16,6 @@ var Resource = function Resource() {
|
|
|
16
16
|
createCartItem = _useCart.createCartItem;
|
|
17
17
|
var _useStep = useStep(),
|
|
18
18
|
nextStep = _useStep.nextStep;
|
|
19
|
-
var context = useEngineContext();
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* @title: 选择资源
|
|
@@ -54,27 +53,11 @@ var Resource = function Resource() {
|
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
55
|
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @title: 资源名称
|
|
60
|
-
* @description:
|
|
61
|
-
* @param {*} useMemo
|
|
62
|
-
* @return {*}
|
|
63
|
-
* @Author: WangHan
|
|
64
|
-
* @Date: 2025-02-08 15:28
|
|
65
|
-
*/
|
|
66
|
-
var resourceTitle = useMemo(function () {
|
|
67
|
-
var _data$initData, _data$initData$boardS, _data$initData$boardS2, _form$setting, _context$appHelper, _context$appHelper$ut, _translation;
|
|
68
|
-
var form = data === null || data === void 0 ? void 0 : (_data$initData = data.initData) === null || _data$initData === void 0 ? void 0 : (_data$initData$boardS = _data$initData.boardSetting) === null || _data$initData$boardS === void 0 ? void 0 : (_data$initData$boardS2 = _data$initData$boardS.event_v2_form) === null || _data$initData$boardS2 === void 0 ? void 0 : _data$initData$boardS2.form;
|
|
69
|
-
var title = (form === null || form === void 0 ? void 0 : (_form$setting = form.setting) === null || _form$setting === void 0 ? void 0 : _form$setting.title) || (form === null || form === void 0 ? void 0 : form.title);
|
|
70
|
-
var translation = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translation;
|
|
71
|
-
return (_translation = translation(title)) === null || _translation === void 0 ? void 0 : _translation.toLowerCase();
|
|
72
|
-
}, [data === null || data === void 0 ? void 0 : (_data$initData2 = data.initData) === null || _data$initData2 === void 0 ? void 0 : _data$initData2.boardSetting]);
|
|
73
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
57
|
className: "event-interface-resource-wrap ".concat(isMobile() ? 'event-interface-resource-mobile-wrap' : '')
|
|
75
58
|
}, /*#__PURE__*/React.createElement("span", {
|
|
76
59
|
className: "title"
|
|
77
|
-
}, locales.getText('pisell2.event.select.campus')(resourceTitle)), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
}, locales.getText('pisell2.event.select.campus')(resourceTitle(data))), /*#__PURE__*/React.createElement("div", {
|
|
78
61
|
className: "content"
|
|
79
62
|
}, data === null || data === void 0 ? void 0 : (_data$resourceData = data.resourceData) === null || _data$resourceData === void 0 ? void 0 : (_data$resourceData$re = _data$resourceData.resourceList) === null || _data$resourceData$re === void 0 ? void 0 : _data$resourceData$re.map(function (item, index) {
|
|
80
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCart, useSales } from "../../../Sales";
|
|
3
|
+
import { locales } from '@pisell/utils';
|
|
4
|
+
import { PisellCard } from '@pisell/materials';
|
|
5
|
+
import "./index.less";
|
|
6
|
+
var SelectProduct = function SelectProduct() {
|
|
7
|
+
var _cartData$cartItems2;
|
|
8
|
+
var _useSales = useSales(),
|
|
9
|
+
data = _useSales.data;
|
|
10
|
+
var _useCart = useCart(),
|
|
11
|
+
addToCart = _useCart.addToCart,
|
|
12
|
+
cartData = _useCart.cartData;
|
|
13
|
+
var handleAddToCart = function handleAddToCart(product) {
|
|
14
|
+
addToCart(product);
|
|
15
|
+
};
|
|
16
|
+
var renderProductCard = function renderProductCard(product) {
|
|
17
|
+
var _cartData$cartItems;
|
|
18
|
+
var isSelected = cartData === null || cartData === void 0 ? void 0 : (_cartData$cartItems = cartData.cartItems) === null || _cartData$cartItems === void 0 ? void 0 : _cartData$cartItems.some(function (item) {
|
|
19
|
+
return item.id === product.id;
|
|
20
|
+
});
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
key: product.id,
|
|
23
|
+
className: "product-card ".concat(isSelected ? 'product-card-selected' : ''),
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
return handleAddToCart(product);
|
|
26
|
+
}
|
|
27
|
+
}, /*#__PURE__*/React.createElement(PisellCard, {
|
|
28
|
+
bodyStyle: {
|
|
29
|
+
padding: '16px'
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: "product-content"
|
|
33
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: "product-title"
|
|
35
|
+
}, product.title), /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "product-price"
|
|
37
|
+
}, product.price, " ", product.currency))));
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "select-product-container"
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "step-header"
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "step-number"
|
|
45
|
+
}, "Step 1"), /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "step-title"
|
|
47
|
+
}, "Select Product")), /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "category-section"
|
|
49
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: "category-title"
|
|
51
|
+
}, "Other"), /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: "product-list"
|
|
53
|
+
}, renderProductCard({
|
|
54
|
+
id: '1',
|
|
55
|
+
title: 'appointment',
|
|
56
|
+
price: '1.00',
|
|
57
|
+
currency: 'AUD'
|
|
58
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "cart-section"
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "cart-title"
|
|
62
|
+
}, "Your cart"), cartData !== null && cartData !== void 0 && (_cartData$cartItems2 = cartData.cartItems) !== null && _cartData$cartItems2 !== void 0 && _cartData$cartItems2.length ? /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "cart-items"
|
|
64
|
+
}, cartData.cartItems.map(function (item) {
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
key: item.id,
|
|
67
|
+
className: "cart-item"
|
|
68
|
+
}, item.title);
|
|
69
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "cart-empty"
|
|
71
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: "cart-empty-icon"
|
|
73
|
+
}, "\uD83D\uDED2"), /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: "cart-empty-text"
|
|
75
|
+
}, locales.getText('pisell2.event.cart.empty')))));
|
|
76
|
+
};
|
|
77
|
+
export default SelectProduct;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.select-product-container {
|
|
2
|
+
padding: 24px;
|
|
3
|
+
background: #fff;
|
|
4
|
+
|
|
5
|
+
.step-header {
|
|
6
|
+
margin-bottom: 24px;
|
|
7
|
+
|
|
8
|
+
.step-number {
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
color: #666;
|
|
11
|
+
margin-bottom: 8px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.step-title {
|
|
15
|
+
font-size: 24px;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
color: #333;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.category-section {
|
|
22
|
+
margin-bottom: 24px;
|
|
23
|
+
|
|
24
|
+
.category-title {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
color: #333;
|
|
28
|
+
margin-bottom: 16px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.product-list {
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
34
|
+
gap: 16px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.product-card {
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
transition: all 0.3s;
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
transform: translateY(-2px);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.product-card-selected {
|
|
47
|
+
.pisell-card {
|
|
48
|
+
border-color: #1890ff;
|
|
49
|
+
background: rgba(24, 144, 255, 0.05);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.product-content {
|
|
54
|
+
text-align: center;
|
|
55
|
+
|
|
56
|
+
.product-title {
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
color: #333;
|
|
59
|
+
margin-bottom: 8px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.product-price {
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
color: #666;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cart-section {
|
|
70
|
+
background: #f5f5f5;
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
padding: 24px;
|
|
73
|
+
|
|
74
|
+
.cart-title {
|
|
75
|
+
font-size: 18px;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
color: #333;
|
|
78
|
+
margin-bottom: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.cart-empty {
|
|
82
|
+
text-align: center;
|
|
83
|
+
padding: 32px 0;
|
|
84
|
+
|
|
85
|
+
.cart-empty-icon {
|
|
86
|
+
font-size: 24px;
|
|
87
|
+
margin-bottom: 8px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.cart-empty-text {
|
|
91
|
+
color: #999;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.cart-items {
|
|
96
|
+
.cart-item {
|
|
97
|
+
padding: 12px;
|
|
98
|
+
background: #fff;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
margin-bottom: 8px;
|
|
101
|
+
|
|
102
|
+
&:last-child {
|
|
103
|
+
margin-bottom: 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 移动端适配
|
|
111
|
+
@media screen and (max-width: 768px) {
|
|
112
|
+
.select-product-container {
|
|
113
|
+
padding: 16px;
|
|
114
|
+
|
|
115
|
+
.step-header {
|
|
116
|
+
margin-bottom: 16px;
|
|
117
|
+
|
|
118
|
+
.step-title {
|
|
119
|
+
font-size: 20px;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.product-list {
|
|
124
|
+
grid-template-columns: 1fr !important;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.cart-section {
|
|
128
|
+
padding: 16px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -253,6 +253,7 @@ var CalendarDate = function CalendarDate(props, ref) {
|
|
|
253
253
|
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
254
254
|
open: open,
|
|
255
255
|
title: 'device',
|
|
256
|
+
mobileModalHeight: 'auto',
|
|
256
257
|
platform: isMobile() ? 'h5' : 'pc',
|
|
257
258
|
bodyStyle: {
|
|
258
259
|
padding: isMobile() ? '16px 24px' : 32
|
|
@@ -2,7 +2,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
-
function
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
12
|
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); }
|
|
@@ -46,6 +50,8 @@ var BookingDetailModal = function BookingDetailModal(props) {
|
|
|
46
50
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
47
51
|
openCheckout = _useState6[0],
|
|
48
52
|
setOpenCheckout = _useState6[1];
|
|
53
|
+
var isUserClickRef = useRef(false); // 添加用户点击标记
|
|
54
|
+
var scrollTimeoutRef = useRef(null);
|
|
49
55
|
|
|
50
56
|
/**
|
|
51
57
|
* @title: 详情锚点
|
|
@@ -96,53 +102,140 @@ var BookingDetailModal = function BookingDetailModal(props) {
|
|
|
96
102
|
}
|
|
97
103
|
};
|
|
98
104
|
|
|
99
|
-
//
|
|
105
|
+
// 修改滚动处理逻辑
|
|
100
106
|
useEffect(function () {
|
|
101
107
|
if (!modalContentRef.current || !open) return;
|
|
102
108
|
var handleScroll = function handleScroll() {
|
|
103
|
-
if (isScrolling) return;
|
|
109
|
+
if (isScrolling || isUserClickRef.current) return;
|
|
104
110
|
var container = modalContentRef.current;
|
|
105
111
|
if (!container) return;
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
if (scrollTimeoutRef.current) {
|
|
113
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
114
|
+
}
|
|
115
|
+
scrollTimeoutRef.current = setTimeout(function () {
|
|
116
|
+
var scrollTop = container.scrollTop;
|
|
117
|
+
var headerHeight = 58;
|
|
118
|
+
var containerHeight = container.clientHeight;
|
|
119
|
+
var scrollHeight = container.scrollHeight;
|
|
120
|
+
var viewportMiddle = headerHeight + (containerHeight - headerHeight) / 2;
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
_step;
|
|
112
|
-
try {
|
|
113
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
114
|
-
var option = _step.value;
|
|
122
|
+
// 获取所有section的位置信息
|
|
123
|
+
var sectionPositions = anchorOptions.map(function (option) {
|
|
115
124
|
var element = document.getElementById(option.id);
|
|
116
|
-
if (element)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
if (!element) return null;
|
|
126
|
+
var rect = element.getBoundingClientRect();
|
|
127
|
+
return {
|
|
128
|
+
id: option.id,
|
|
129
|
+
top: rect.top,
|
|
130
|
+
bottom: rect.bottom,
|
|
131
|
+
height: rect.height,
|
|
132
|
+
// 添加可见度计算
|
|
133
|
+
visibleTop: Math.max(rect.top, headerHeight),
|
|
134
|
+
visibleBottom: Math.min(rect.bottom, containerHeight),
|
|
135
|
+
// 计算元素中点到视口中点的距离
|
|
136
|
+
distanceToCenter: Math.abs((rect.top + rect.bottom) / 2 - viewportMiddle)
|
|
137
|
+
};
|
|
138
|
+
}).filter(function (section) {
|
|
139
|
+
return section !== null;
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// 特殊处理:检查是否在底部
|
|
143
|
+
var isAtBottom = Math.abs(scrollTop + containerHeight - scrollHeight) <= 2;
|
|
144
|
+
if (isAtBottom) {
|
|
145
|
+
var lastOption = anchorOptions[anchorOptions.length - 1];
|
|
146
|
+
if (activeTab !== lastOption.id) {
|
|
147
|
+
setActiveTab(lastOption.id);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 找到当前最合适的section
|
|
153
|
+
var bestSection = null;
|
|
154
|
+
|
|
155
|
+
// 计算每个section的可见比例和优先级
|
|
156
|
+
var sectionsWithPriority = sectionPositions.map(function (section) {
|
|
157
|
+
var visibleHeight = section.visibleBottom - section.visibleTop;
|
|
158
|
+
var visibilityRatio = visibleHeight / section.height;
|
|
159
|
+
|
|
160
|
+
// 计算元素顶部到视口顶部的距离(考虑 header)
|
|
161
|
+
var topDistance = Math.abs(section.top - headerHeight);
|
|
162
|
+
|
|
163
|
+
// 新的优先级计算方式
|
|
164
|
+
var priority =
|
|
165
|
+
// 基础可见度权重
|
|
166
|
+
visibilityRatio * 0.6 + (
|
|
167
|
+
// 小内容区域补偿
|
|
168
|
+
section.height < 200 ? 0.3 : 0) +
|
|
169
|
+
// 距离权重(反比,越近权重越大)
|
|
170
|
+
0.4 * (1 - Math.min(topDistance / containerHeight, 1));
|
|
171
|
+
return _objectSpread(_objectSpread({}, section), {}, {
|
|
172
|
+
visibilityRatio: visibilityRatio,
|
|
173
|
+
topDistance: topDistance,
|
|
174
|
+
priority: priority
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// 按优先级排序,但增加额外的判断条件
|
|
179
|
+
sectionsWithPriority.sort(function (a, b) {
|
|
180
|
+
// 如果两个section都有一定可见度,优先考虑顶部位置
|
|
181
|
+
if (a.visibilityRatio > 0.1 && b.visibilityRatio > 0.1) {
|
|
182
|
+
// 如果顶部距离相差不大,使用优先级
|
|
183
|
+
if (Math.abs(a.topDistance - b.topDistance) < 50) {
|
|
184
|
+
return b.priority - a.priority;
|
|
128
185
|
}
|
|
186
|
+
// 否则优先选择更靠近顶部的
|
|
187
|
+
return a.topDistance - b.topDistance;
|
|
188
|
+
}
|
|
189
|
+
// 其他情况使用优先级
|
|
190
|
+
return b.priority - a.priority;
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// 选择最合适的section
|
|
194
|
+
bestSection = sectionsWithPriority[0];
|
|
195
|
+
|
|
196
|
+
// 更新激活的tab时增加更多判断条件
|
|
197
|
+
if (bestSection && activeTab !== bestSection.id) {
|
|
198
|
+
var currentSection = sectionPositions.find(function (s) {
|
|
199
|
+
return s.id === activeTab;
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// 只有在满足以下条件之一时才切换:
|
|
203
|
+
// 1. 当前没有激活的section
|
|
204
|
+
// 2. 新section的优先级明显更高
|
|
205
|
+
// 3. 新section在视口中且更靠近顶部
|
|
206
|
+
if (!currentSection || bestSection.priority > (currentSection.priority || 0) + 0.2 || bestSection.visibilityRatio > 0.3 && bestSection.topDistance < currentSection.topDistance) {
|
|
207
|
+
setActiveTab(bestSection.id);
|
|
129
208
|
}
|
|
130
209
|
}
|
|
131
|
-
}
|
|
132
|
-
_iterator.e(err);
|
|
133
|
-
} finally {
|
|
134
|
-
_iterator.f();
|
|
135
|
-
}
|
|
210
|
+
}, 200);
|
|
136
211
|
};
|
|
137
212
|
var container = modalContentRef.current;
|
|
138
213
|
container.addEventListener('scroll', handleScroll);
|
|
139
|
-
|
|
140
|
-
// 初始化时执行一次
|
|
141
|
-
setTimeout(handleScroll, 100);
|
|
142
214
|
return function () {
|
|
143
|
-
|
|
215
|
+
container.removeEventListener('scroll', handleScroll);
|
|
216
|
+
if (scrollTimeoutRef.current) {
|
|
217
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
218
|
+
}
|
|
144
219
|
};
|
|
145
220
|
}, [anchorOptions, activeTab, open, isScrolling]);
|
|
221
|
+
var handleTabChange = function handleTabChange(key) {
|
|
222
|
+
if (isUserClickRef.current) {
|
|
223
|
+
// 如果是用户点击,立即更新并禁用滚动监听
|
|
224
|
+
setActiveTab(key);
|
|
225
|
+
setIsScrolling(true); // 临时禁用滚动监听
|
|
226
|
+
|
|
227
|
+
// 延长禁用时间,确保滚动完全结束
|
|
228
|
+
setTimeout(function () {
|
|
229
|
+
setIsScrolling(false);
|
|
230
|
+
isUserClickRef.current = false; // 重置点击标记
|
|
231
|
+
}, 1200); // 稍微延长时间
|
|
232
|
+
} else {
|
|
233
|
+
// 如果是滚动触发,只在非滚动状态下更新
|
|
234
|
+
if (!isScrolling && !isUserClickRef.current) {
|
|
235
|
+
setActiveTab(key);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
146
239
|
var content = function content() {
|
|
147
240
|
return /*#__PURE__*/React.createElement("div", {
|
|
148
241
|
className: "booking-detail-modal-content",
|
|
@@ -153,9 +246,11 @@ var BookingDetailModal = function BookingDetailModal(props) {
|
|
|
153
246
|
ref: tabsRef,
|
|
154
247
|
options: anchorOptions,
|
|
155
248
|
tab: activeTab,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
249
|
+
containerRef: modalContentRef,
|
|
250
|
+
onChange: handleTabChange,
|
|
251
|
+
onTabClick: function onTabClick() {
|
|
252
|
+
// 设置点击标记
|
|
253
|
+
isUserClickRef.current = true;
|
|
159
254
|
}
|
|
160
255
|
})), /*#__PURE__*/React.createElement("div", {
|
|
161
256
|
className: "content-wrapper"
|
|
@@ -223,20 +318,26 @@ var BookingDetailModal = function BookingDetailModal(props) {
|
|
|
223
318
|
return _ref.apply(this, arguments);
|
|
224
319
|
};
|
|
225
320
|
}();
|
|
321
|
+
|
|
322
|
+
// 监听弹窗打开/关闭状态,重置 activeTab
|
|
323
|
+
useEffect(function () {
|
|
324
|
+
if (open) {
|
|
325
|
+
setActiveTab('introduction');
|
|
326
|
+
// 重置其他相关状态
|
|
327
|
+
setIsScrolling(false);
|
|
328
|
+
isUserClickRef.current = false;
|
|
329
|
+
}
|
|
330
|
+
}, [open]);
|
|
226
331
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellModal, {
|
|
227
332
|
open: open,
|
|
228
333
|
title: locales.getText('pisell2.event.details'),
|
|
229
334
|
platform: isMobile() ? 'h5' : 'pc',
|
|
230
335
|
bodyStyle: {
|
|
231
|
-
padding: 0
|
|
232
|
-
overflow: 'hidden'
|
|
336
|
+
padding: 0
|
|
233
337
|
},
|
|
234
338
|
destroyOnClose: true,
|
|
235
|
-
mobileModalHeight: '80vh',
|
|
236
339
|
className: "booking-detail-modal",
|
|
237
|
-
onCancel:
|
|
238
|
-
return onCloseEventDetail();
|
|
239
|
-
},
|
|
340
|
+
onCancel: onCloseEventDetail,
|
|
240
341
|
okText: locales.getText('pisell2.event.add.to.cart'),
|
|
241
342
|
cancelVisible: false,
|
|
242
343
|
onOk: handleOk,
|