pb-sxp-ui 1.3.8 → 1.4.1
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +197 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +0 -4
- package/dist/index.js +197 -72
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +197 -72
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Modal/index.js +10 -4
- package/es/core/components/SxpPageRender/PictureGroup/index.js +11 -5
- package/es/core/components/SxpPageRender/index.d.ts +3 -0
- package/es/core/components/SxpPageRender/index.js +14 -9
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -1
- package/es/core/context/SxpDataSourceProvider.js +22 -15
- package/es/core/hooks/useEventReport.js +9 -16
- package/es/materials/sxp/popup/AppointForm/Form.js +1 -1
- package/es/materials/sxp/popup/AppointForm/index.js +31 -8
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +3 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +15 -5
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +31 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +31 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +10 -4
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +11 -5
- package/lib/core/components/SxpPageRender/index.d.ts +3 -0
- package/lib/core/components/SxpPageRender/index.js +14 -9
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -1
- package/lib/core/context/SxpDataSourceProvider.js +22 -15
- package/lib/core/hooks/useEventReport.js +9 -16
- package/lib/materials/sxp/popup/AppointForm/Form.js +1 -1
- package/lib/materials/sxp/popup/AppointForm/index.js +30 -7
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +3 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +15 -5
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +31 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +31 -0
- package/package.json +111 -111
@@ -4,7 +4,7 @@ import * as ReactDOM from 'react-dom';
|
|
4
4
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
6
6
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
8
8
|
const touchRef = useRef(null);
|
9
9
|
const fTouchRef = useRef(null);
|
10
10
|
const touchMoveRef = useRef(null);
|
@@ -16,6 +16,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
16
16
|
const modalEleRef = useRef(null);
|
17
17
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
18
18
|
const { schema: _schema } = useEditor();
|
19
|
+
const [scrollTop, setScrollTop] = useState(15);
|
19
20
|
useEffect(() => {
|
20
21
|
const parentNode = document.getElementById('sxp-render');
|
21
22
|
const node = document.getElementById('pb-modal');
|
@@ -123,11 +124,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
123
124
|
onTouchStart: handleTouchStart,
|
124
125
|
onTouchEnd: handleTouchEnd
|
125
126
|
})),
|
126
|
-
React.createElement("div", {
|
127
|
+
React.createElement("div", { className: 'modal-icon-wrapper', onClick: onClose, style: { top: scrollTop } },
|
127
128
|
React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: 'modal-icon' })),
|
128
|
-
React.createElement("div", { ref: ref, style: {
|
129
|
+
React.createElement("div", Object.assign({ ref: ref, style: {
|
129
130
|
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
|
130
131
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
|
131
|
-
} },
|
132
|
+
} }, (((_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.enableFixedCloseButton) && {
|
133
|
+
onScroll: (e) => {
|
134
|
+
var _a;
|
135
|
+
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
136
|
+
}
|
137
|
+
})), children)))))), modalEleRef.current);
|
132
138
|
};
|
133
139
|
export default memo(Modal);
|
@@ -5,7 +5,7 @@ import Picture from './Picture';
|
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
import { css } from '@emotion/css';
|
7
7
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
8
|
-
var _a
|
8
|
+
var _a;
|
9
9
|
const ref = useRef();
|
10
10
|
const { isActive } = useSwiperSlide();
|
11
11
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
@@ -32,11 +32,17 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
32
32
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
33
33
|
clickable: true,
|
34
34
|
bulletActiveClass: 'swipe-item-active-bullet'
|
35
|
-
}, className: css(Object.assign({}, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) && {
|
36
|
-
'.swiper-pagination': {
|
37
|
-
|
35
|
+
}, className: css(Object.assign(Object.assign({ '.swiper-pagination': Object.assign(Object.assign({}, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) && { bottom: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom })), { fontSize: '14px' }) }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
36
|
+
'.swiper-pagination-bullet': {
|
37
|
+
backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor,
|
38
|
+
opacity: 1
|
38
39
|
}
|
39
|
-
}))
|
40
|
+
})), ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor) && {
|
41
|
+
'.swipe-item-active-bullet': {
|
42
|
+
backgroundColor: `${imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsActiveColor}!important`,
|
43
|
+
opacity: 1
|
44
|
+
}
|
45
|
+
}))), height: height, loop: true, autoplay: { delay: ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _a !== void 0 ? _a : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, index) => {
|
40
46
|
return (React.createElement(SwiperSlide, { key: index },
|
41
47
|
React.createElement(Picture, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
42
48
|
})));
|
@@ -8,6 +8,8 @@ export type postConfigType = {
|
|
8
8
|
bgWay?: '1' | '2';
|
9
9
|
bgColor?: string;
|
10
10
|
marginBottom?: number;
|
11
|
+
dotsActiveColor?: string;
|
12
|
+
dotsBgColor?: string;
|
11
13
|
};
|
12
14
|
export interface ISxpPageRenderProps {
|
13
15
|
globalConfig?: {
|
@@ -48,6 +50,7 @@ export interface ISxpPageRenderProps {
|
|
48
50
|
enablePreview?: boolean;
|
49
51
|
enableSwiperTip?: boolean;
|
50
52
|
logoBar?: any;
|
53
|
+
textUnderlineOffset?: number;
|
51
54
|
};
|
52
55
|
descStyle?: CSSProperties;
|
53
56
|
tipText?: {
|
@@ -23,7 +23,7 @@ import Tagbar from './Tagbar';
|
|
23
23
|
import { getFeUserId, getSlideSkipState } from '../../../core/utils/localStore';
|
24
24
|
import { isEqual } from 'lodash';
|
25
25
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
27
27
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
28
28
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
29
29
|
const { schema } = useEditor();
|
@@ -35,7 +35,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
35
35
|
const [isShowMore, setIsShowMore] = useState(false);
|
36
36
|
const [isReload, setIsReload] = useState(new Date().getTime());
|
37
37
|
const skipLinkRef = useRef(false);
|
38
|
-
const
|
38
|
+
const [pageNum, setPageNum] = useState(2);
|
39
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData } = useSxpDataSource();
|
39
40
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
40
41
|
const isShowFingerTip = useMemo(() => {
|
41
42
|
return data.length > 0 && !loading && (getFeUserId() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -191,8 +192,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
191
192
|
return null;
|
192
193
|
}
|
193
194
|
});
|
194
|
-
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
195
|
-
}, [data, activeIndex, waterFallData, isEditor]);
|
195
|
+
return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
|
196
|
+
}, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
|
196
197
|
const renderLogo = useMemo(() => {
|
197
198
|
var _a, _b, _c, _d;
|
198
199
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
@@ -477,8 +478,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
477
478
|
isReload,
|
478
479
|
renderToggleButton
|
479
480
|
]);
|
480
|
-
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
481
|
-
waterFallData && (React.createElement(Navbar, { icon: left, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b =
|
481
|
+
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: { textUnderlineOffset: `${(_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) !== null && _a !== void 0 ? _a : 0}px` } },
|
482
|
+
waterFallData && (React.createElement(Navbar, { icon: left, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_f = (_e = (_d = (_c = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.item) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.textStyles) === null || _f === void 0 ? void 0 : _f.hashTagTitle), { color: '#fff' }), onClose: () => {
|
482
483
|
const isEq = isEqual(rtcList, cacheRtcList);
|
483
484
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
484
485
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
@@ -489,7 +490,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
489
490
|
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
490
491
|
top: minusHeight
|
491
492
|
} }),
|
492
|
-
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((
|
493
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _g !== void 0 ? _g : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
493
494
|
React.createElement(Swiper, { style: {
|
494
495
|
marginTop: tagHeight
|
495
496
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -507,8 +508,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
507
508
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
508
509
|
if (!isLoadMore) {
|
509
510
|
setIsLoadMore(true);
|
510
|
-
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(
|
511
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
512
|
+
var _a;
|
511
513
|
setIsLoadMore(false);
|
514
|
+
if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
515
|
+
setPageNum((pageNum + 1));
|
516
|
+
}
|
512
517
|
});
|
513
518
|
}
|
514
519
|
}
|
@@ -516,6 +521,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
516
521
|
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
517
522
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
518
523
|
renderView),
|
519
|
-
React.createElement(WaterFall, Object.assign({}, (
|
524
|
+
React.createElement(WaterFall, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props))));
|
520
525
|
};
|
521
526
|
export default SxpPageRender;
|
@@ -25,7 +25,7 @@ export interface ISxpDataSourceContext {
|
|
25
25
|
}) => Promise<boolean>;
|
26
26
|
popupDetailData?: RecItemType;
|
27
27
|
setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
|
28
|
-
loadVideos?: (page: number) => Promise<
|
28
|
+
loadVideos?: (page: number) => Promise<RecommendVideoResultType | undefined>;
|
29
29
|
getRecommendVideos?: (query?: {
|
30
30
|
maxSize?: number;
|
31
31
|
defaultSize?: number;
|
@@ -82,6 +82,7 @@ export interface ISxpDataSourceContext {
|
|
82
82
|
popupCurTimeRef?: any;
|
83
83
|
checkCommodityIndexRef?: any;
|
84
84
|
isEditor?: boolean;
|
85
|
+
isNoMoreData?: boolean;
|
85
86
|
}
|
86
87
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
87
88
|
export interface SxpDataSourceProviderProps {
|
@@ -37,6 +37,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
37
37
|
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
38
38
|
const checkCommodityIndexRef = useRef(-1);
|
39
39
|
const popupCurTimeRef = useRef(null);
|
40
|
+
const [isNoMoreData, setIsNoMoreData] = useState(false);
|
40
41
|
const isShowConsent = useMemo(() => {
|
41
42
|
var _a, _b, _c, _d;
|
42
43
|
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
@@ -93,7 +94,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
93
94
|
.catch((err) => Promise.reject(err));
|
94
95
|
}, [bffDataSource]);
|
95
96
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
96
|
-
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
97
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
97
98
|
query = Object.assign(Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` })), { pageNum: query === null || query === void 0 ? void 0 : query.pageNum });
|
98
99
|
if (utmVal) {
|
99
100
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
@@ -103,9 +104,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
103
104
|
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
104
105
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
105
106
|
}
|
106
|
-
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
107
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_j = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _j !== void 0 ? _j : 1 });
|
108
|
-
}
|
109
107
|
if (isEditor) {
|
110
108
|
let pageNum = 1;
|
111
109
|
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
|
@@ -116,15 +114,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
116
114
|
let list = [];
|
117
115
|
let result = null;
|
118
116
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
119
|
-
var
|
117
|
+
var _t, _u, _v, _w, _x, _y;
|
120
118
|
query.pageNum = pageNum;
|
121
119
|
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
122
120
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
123
121
|
return undefined;
|
124
122
|
}
|
125
123
|
setLoading(false);
|
126
|
-
const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.every((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
127
124
|
list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
|
125
|
+
const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
128
126
|
if (isNotNullList) {
|
129
127
|
pageNum = pageNum + 1;
|
130
128
|
yield recurveRecList(query);
|
@@ -132,9 +130,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
132
130
|
});
|
133
131
|
yield recurveRecList(query);
|
134
132
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
135
|
-
setCurReqInfo({ rtc: (
|
133
|
+
setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
|
136
134
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
137
135
|
}
|
136
|
+
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
137
|
+
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
|
138
|
+
}
|
138
139
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
139
140
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
140
141
|
return undefined;
|
@@ -144,19 +145,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
144
145
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
145
146
|
let list = [];
|
146
147
|
list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
|
148
|
+
const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
149
|
+
if (!isNotNullList) {
|
150
|
+
setIsNoMoreData(true);
|
151
|
+
}
|
147
152
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
148
153
|
}
|
149
154
|
return result === null || result === void 0 ? void 0 : result.data;
|
150
155
|
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList]);
|
151
156
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
152
|
-
var
|
157
|
+
var _z, _0, _1, _2;
|
153
158
|
if (rtcList.length <= 0) {
|
154
159
|
return;
|
155
160
|
}
|
156
161
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
157
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
162
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: (_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: (_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
158
163
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
159
164
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
165
|
+
return data;
|
160
166
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
161
167
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
162
168
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
@@ -196,7 +202,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
196
202
|
eventName,
|
197
203
|
actionSource,
|
198
204
|
eventSourceUrl,
|
199
|
-
userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), {
|
205
|
+
userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { clientUserAgent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
|
200
206
|
},
|
201
207
|
type: 'beacon'
|
202
208
|
});
|
@@ -214,17 +220,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
214
220
|
return res === null || res === void 0 ? void 0 : res.success;
|
215
221
|
}), [bffFetch]);
|
216
222
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
217
|
-
var
|
223
|
+
var _3, _4, _5, _6, _7;
|
218
224
|
if (!utmVal || !isShowTag)
|
219
225
|
return;
|
220
226
|
try {
|
221
|
-
const val = (
|
227
|
+
const val = (_5 = (_4 = (_3 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _3 === void 0 ? void 0 : _3.filter((val) => {
|
222
228
|
var _a, _b;
|
223
229
|
const key = val.split('=')[0];
|
224
230
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
225
|
-
})) === null ||
|
231
|
+
})) === null || _4 === void 0 ? void 0 : _4.join('&')) !== null && _5 !== void 0 ? _5 : '';
|
226
232
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
227
|
-
setTagList((
|
233
|
+
setTagList((_7 = (_6 = result === null || result === void 0 ? void 0 : result.data) === null || _6 === void 0 ? void 0 : _6.tags) !== null && _7 !== void 0 ? _7 : []);
|
228
234
|
}
|
229
235
|
catch (e) {
|
230
236
|
console.log('e', e);
|
@@ -371,7 +377,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
371
377
|
globalConfig,
|
372
378
|
popupCurTimeRef,
|
373
379
|
checkCommodityIndexRef,
|
374
|
-
isEditor
|
380
|
+
isEditor,
|
381
|
+
isNoMoreData
|
375
382
|
} }, isShowConsent ? (React.createElement(Consent, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
376
383
|
rtcList,
|
377
384
|
mutateLike: bffMutateLike,
|
@@ -4,7 +4,7 @@ import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
|
4
4
|
export function useEventReport() {
|
5
5
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
6
6
|
const jumpToWeb = useCallback((data, product, cta, position, traceInfo) => {
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
8
8
|
let fromKName = '';
|
9
9
|
if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
10
10
|
fromKName = 'pdpPage';
|
@@ -22,22 +22,15 @@ export function useEventReport() {
|
|
22
22
|
fromKName = 'productPage';
|
23
23
|
}
|
24
24
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = data === null || data === void 0 ? void 0 : data.product) === null || _q === void 0 ? void 0 : _q.tags;
|
25
|
+
let contentFormat = null;
|
26
|
+
if ((_r = data === null || data === void 0 ? void 0 : data.video) === null || _r === void 0 ? void 0 : _r.url) {
|
27
|
+
contentFormat = 'video';
|
28
|
+
}
|
29
|
+
else if (((_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && ((_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.imgUrls) === null || _u === void 0 ? void 0 : _u.length)) {
|
30
|
+
contentFormat = 'image';
|
31
|
+
}
|
25
32
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
26
|
-
eventInfo: {
|
27
|
-
eventSubject: 'jumpToWeb',
|
28
|
-
eventDescription: 'User jumped to website',
|
29
|
-
productId: (_r = product === null || product === void 0 ? void 0 : product.itemId) !== null && _r !== void 0 ? _r : '',
|
30
|
-
productName: (_s = product === null || product === void 0 ? void 0 : product.title) !== null && _s !== void 0 ? _s : '',
|
31
|
-
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
32
|
-
productCollection: (_t = product === null || product === void 0 ? void 0 : product.collection) !== null && _t !== void 0 ? _t : '',
|
33
|
-
fromKName,
|
34
|
-
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
35
|
-
contentTags: contentTags ? JSON.stringify(contentTags) : '',
|
36
|
-
position: position + '',
|
37
|
-
contentId: (_v = (_u = data === null || data === void 0 ? void 0 : data.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
|
38
|
-
ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
|
39
|
-
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProduct) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_3 = (_2 = (_1 = data === null || data === void 0 ? void 0 : data.video) === null || _1 === void 0 ? void 0 : _1.bindProducts) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_5 = data === null || data === void 0 ? void 0 : data.product) === null || _5 === void 0 ? void 0 : _5.traceInfo) !== null && _6 !== void 0 ? _6 : (_8 = (_7 = data === null || data === void 0 ? void 0 : data.video) === null || _7 === void 0 ? void 0 : _7.bindCta) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : ''
|
40
|
-
}
|
33
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
41
34
|
});
|
42
35
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
43
36
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
@@ -3,6 +3,6 @@ import React from 'react';
|
|
3
3
|
const Form = ({ layout, columns, onChange }) => {
|
4
4
|
return (React.createElement(React.Fragment, null, columns === null || columns === void 0 ? void 0 : columns.map((item, index) => (React.createElement("div", { key: index, className: 'pb-appoint-form-container-item', style: { flexDirection: layout === 'horizontal' ? 'row' : 'column' } },
|
5
5
|
layout !== 'inline' && React.createElement("label", { className: 'pb-appoint-form-container-label' }, item === null || item === void 0 ? void 0 : item.title),
|
6
|
-
(item === null || item === void 0 ? void 0 : item.valueType) === 'text' && (React.createElement("input", Object.assign({ className: 'pb-appoint-form-container-input', type: 'text', placeholder: layout === 'inline' ? item === null || item === void 0 ? void 0 : item.title : '请输入', name: item === null || item === void 0 ? void 0 : item.dataIndex }, (onChange && { onChange
|
6
|
+
(item === null || item === void 0 ? void 0 : item.valueType) === 'text' && (React.createElement("input", Object.assign({ className: 'pb-appoint-form-container-input', type: 'text', placeholder: layout === 'inline' ? item === null || item === void 0 ? void 0 : item.title : '请输入', name: item === null || item === void 0 ? void 0 : item.dataIndex }, (onChange && { onChange })))))))));
|
7
7
|
};
|
8
8
|
export default memo(Form);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __awaiter, __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
|
-
import React, { memo, useCallback, useMemo, useState } from 'react';
|
3
|
+
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
4
4
|
import { cloneDeep, debounce } from 'lodash';
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
import './index.less';
|
@@ -8,10 +8,13 @@ import { useEventReport } from '../../../../core/hooks/useEventReport';
|
|
8
8
|
import { setFontForText } from '../../../../core/utils/tool';
|
9
9
|
import Form from './Form';
|
10
10
|
const AppointForm = (_a) => {
|
11
|
+
var _b, _c;
|
11
12
|
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType = 'inline', isExternalLink, isPopup, onClick, onClose, submitButtonStyle } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "isExternalLink", "isPopup", "onClick", "onClose", "submitButtonStyle"]);
|
12
13
|
const { submitForm, popupDetailData } = useSxpDataSource();
|
13
14
|
const { jumpToWeb } = useEventReport();
|
14
15
|
const [loading, setLoading] = useState(false);
|
16
|
+
const [formData, setFormData] = useState({});
|
17
|
+
const [marginTop, setMarginTop] = useState(0);
|
15
18
|
const defaultColumns = useMemo(() => [
|
16
19
|
{
|
17
20
|
title: '',
|
@@ -38,7 +41,7 @@ const AppointForm = (_a) => {
|
|
38
41
|
key: '4'
|
39
42
|
}
|
40
43
|
], []);
|
41
|
-
const
|
44
|
+
const originalHeight = ((_b = document === null || document === void 0 ? void 0 : document.documentElement) === null || _b === void 0 ? void 0 : _b.clientHeight) || ((_c = document === null || document === void 0 ? void 0 : document.body) === null || _c === void 0 ? void 0 : _c.clientHeight);
|
42
45
|
const columnsData = useMemo(() => {
|
43
46
|
return cloneDeep(columns) || defaultColumns;
|
44
47
|
}, [columns, defaultColumns]);
|
@@ -47,17 +50,17 @@ const AppointForm = (_a) => {
|
|
47
50
|
setFormData(Object.assign(Object.assign({}, formData), { [name]: value }));
|
48
51
|
}, [formData]);
|
49
52
|
const handleSubmit = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
50
|
-
var
|
53
|
+
var _d, _e, _f, _g, _h;
|
51
54
|
const vals = formData;
|
52
55
|
if (!vals)
|
53
56
|
return;
|
54
|
-
const arr = (
|
57
|
+
const arr = (_e = (_d = Object.keys(vals)) === null || _d === void 0 ? void 0 : _d.map((key) => {
|
55
58
|
var _a;
|
56
59
|
return ({
|
57
60
|
name: key,
|
58
61
|
value: (_a = vals[key]) !== null && _a !== void 0 ? _a : ''
|
59
62
|
});
|
60
|
-
})) === null ||
|
63
|
+
})) === null || _e === void 0 ? void 0 : _e.filter((item) => item === null || item === void 0 ? void 0 : item.value);
|
61
64
|
if (!arr || !(arr === null || arr === void 0 ? void 0 : arr.length))
|
62
65
|
return;
|
63
66
|
setLoading(true);
|
@@ -66,8 +69,8 @@ const AppointForm = (_a) => {
|
|
66
69
|
if (res) {
|
67
70
|
if (isExternalLink) {
|
68
71
|
const data = popupDetailData;
|
69
|
-
const product = (
|
70
|
-
const cta = (
|
72
|
+
const product = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
73
|
+
const cta = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.bindCta;
|
71
74
|
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
72
75
|
jumpToWeb(data, product, cta, position);
|
73
76
|
}
|
@@ -77,11 +80,31 @@ const AppointForm = (_a) => {
|
|
77
80
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
78
81
|
}
|
79
82
|
}), 1000);
|
83
|
+
useEffect(() => {
|
84
|
+
const handleScroll = () => {
|
85
|
+
var _a, _b;
|
86
|
+
const userAgent = navigator.userAgent;
|
87
|
+
const isAndroid = userAgent.toLowerCase().includes('android');
|
88
|
+
if (!isAndroid)
|
89
|
+
return;
|
90
|
+
const resizeHeight = ((_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || ((_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight);
|
91
|
+
if (resizeHeight < originalHeight) {
|
92
|
+
setMarginTop(50);
|
93
|
+
}
|
94
|
+
else {
|
95
|
+
setMarginTop(0);
|
96
|
+
}
|
97
|
+
};
|
98
|
+
window.addEventListener('resize', handleScroll);
|
99
|
+
return () => {
|
100
|
+
window.removeEventListener('resize', handleScroll);
|
101
|
+
};
|
102
|
+
}, []);
|
80
103
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
81
104
|
React.createElement("div", { className: `pb-appoint-form-title ${css(Object.assign({}, textStyle))}`, dangerouslySetInnerHTML: {
|
82
105
|
__html: setFontForText(title, textStyle)
|
83
106
|
} }),
|
84
|
-
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
107
|
+
React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { marginTop })) }, props),
|
85
108
|
React.createElement("div", { className: 'pb-appoint-form-container' },
|
86
109
|
React.createElement(Form, { columns: columnsData, layout: layoutType, onChange: handleChange }))),
|
87
110
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
@@ -21,6 +21,9 @@ export interface ICommodityDetailProps {
|
|
21
21
|
dotsAlign: 'left' | 'center' | 'right';
|
22
22
|
delay: number;
|
23
23
|
translateY?: number;
|
24
|
+
dotsBgColor?: string;
|
25
|
+
dotsActiveColor?: string;
|
26
|
+
dotsMarginBottom?: number;
|
24
27
|
};
|
25
28
|
commodityStyles?: {
|
26
29
|
title: CSSProperties;
|
@@ -91,10 +91,10 @@ const CommodityDetail = (_a) => {
|
|
91
91
|
__html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
92
92
|
} }),
|
93
93
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
94
|
-
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
95
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
96
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
97
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
94
|
+
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
95
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
96
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
97
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
98
98
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
99
99
|
};
|
100
100
|
const renderBtn = () => {
|
@@ -143,7 +143,17 @@ const CommodityDetail = (_a) => {
|
|
143
143
|
clickableClass: getDotsAlign
|
144
144
|
}, loop: true, autoplay: {
|
145
145
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
146
|
-
}, ref: ref },
|
146
|
+
}, ref: ref, className: css(Object.assign(Object.assign({ '.swiper-pagination': Object.assign(Object.assign({}, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) && { bottom: swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom })), { fontSize: '14px' }) }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
|
147
|
+
'.swiper-pagination-bullet': {
|
148
|
+
backgroundColor: swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor,
|
149
|
+
opacity: 1
|
150
|
+
}
|
151
|
+
})), ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor) && {
|
152
|
+
'.swipe-item-active-bullet': {
|
153
|
+
backgroundColor: `${swiper === null || swiper === void 0 ? void 0 : swiper.dotsActiveColor}!important`,
|
154
|
+
opacity: 1
|
155
|
+
}
|
156
|
+
}))) },
|
147
157
|
React.createElement(React.Fragment, null, (_x = product === null || product === void 0 ? void 0 : product.homePage) === null || _x === void 0 ? void 0 : _x.map((src) => {
|
148
158
|
var _a;
|
149
159
|
return (React.createElement(SwiperSlide, { key: src },
|
@@ -232,5 +232,18 @@ declare const _default: ({
|
|
232
232
|
name: string[];
|
233
233
|
text?: undefined;
|
234
234
|
})[];
|
235
|
+
} | {
|
236
|
+
title: string;
|
237
|
+
child: ({
|
238
|
+
label: string;
|
239
|
+
name: string[];
|
240
|
+
type: string;
|
241
|
+
addonAfter?: undefined;
|
242
|
+
} | {
|
243
|
+
label: string;
|
244
|
+
name: string[];
|
245
|
+
type: string;
|
246
|
+
addonAfter: string;
|
247
|
+
})[];
|
235
248
|
})[];
|
236
249
|
export default _default;
|
@@ -326,5 +326,36 @@ export default [
|
|
326
326
|
name: ['props', 'iframeBgColor']
|
327
327
|
}
|
328
328
|
]
|
329
|
+
},
|
330
|
+
{
|
331
|
+
title: '轮播指示器',
|
332
|
+
child: [
|
333
|
+
{
|
334
|
+
label: '背景色',
|
335
|
+
name: ['props', 'swiper', 'dotsBgColor'],
|
336
|
+
type: 'Color'
|
337
|
+
},
|
338
|
+
{
|
339
|
+
label: '选中色',
|
340
|
+
name: ['props', 'swiper', 'dotsActiveColor'],
|
341
|
+
type: 'Color'
|
342
|
+
},
|
343
|
+
{
|
344
|
+
label: '底边距',
|
345
|
+
name: ['props', 'swiper', 'dotsMarginBottom'],
|
346
|
+
type: 'Number',
|
347
|
+
addonAfter: 'px'
|
348
|
+
}
|
349
|
+
]
|
350
|
+
},
|
351
|
+
{
|
352
|
+
title: '关闭按钮',
|
353
|
+
child: [
|
354
|
+
{
|
355
|
+
label: '跟随弹窗滚动',
|
356
|
+
type: 'Switch',
|
357
|
+
name: ['props', 'enableFixedCloseButton']
|
358
|
+
}
|
359
|
+
]
|
329
360
|
}
|
330
361
|
];
|
@@ -21,6 +21,9 @@ export interface ICommodityDetailDiroNewProps {
|
|
21
21
|
dotsAlign: 'left' | 'center' | 'right';
|
22
22
|
delay: number;
|
23
23
|
translateY?: number;
|
24
|
+
dotsBgColor?: string;
|
25
|
+
dotsActiveColor?: string;
|
26
|
+
dotsMarginBottom?: number;
|
24
27
|
};
|
25
28
|
commodityStyles?: {
|
26
29
|
title: CSSProperties;
|