pb-sxp-ui 1.3.0 → 1.3.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/dist/index.cjs +207 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +207 -78
- 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 +207 -78
- 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 +3 -2
- package/es/core/components/SxpPageRender/WaterFall/List.js +8 -4
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -3
- package/es/core/components/SxpPageRender/index.js +29 -21
- package/es/core/context/EditorContext.js +2 -0
- package/es/core/context/SxpDataSourceProvider.js +33 -10
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +2 -2
- package/es/materials/sxp/HashTag/settingRender.d.ts +6 -7
- package/es/materials/sxp/HashTag/settingRender.js +9 -0
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +5 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +4 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +8 -5
- package/es/materials/sxp/popup/AppointForm/settingRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +21 -13
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +24 -16
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +4 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +10 -0
- package/es/materials/sxp/template/Link/settingRender.js +5 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +3 -2
- package/lib/core/components/SxpPageRender/WaterFall/List.js +8 -4
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +7 -3
- package/lib/core/components/SxpPageRender/index.js +28 -20
- package/lib/core/context/EditorContext.js +2 -0
- package/lib/core/context/SxpDataSourceProvider.js +33 -10
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +2 -2
- package/lib/materials/sxp/HashTag/settingRender.d.ts +6 -7
- package/lib/materials/sxp/HashTag/settingRender.js +9 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +5 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +4 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +8 -5
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +12 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +21 -13
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +3 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +24 -16
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +13 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +4 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +10 -0
- package/lib/materials/sxp/template/Link/settingRender.js +5 -0
- package/package.json +1 -1
@@ -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, _w;
|
8
8
|
const touchRef = useRef(null);
|
9
9
|
const fTouchRef = useRef(null);
|
10
10
|
const touchMoveRef = useRef(null);
|
@@ -126,7 +126,8 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
126
126
|
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
127
127
|
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
128
|
React.createElement("div", { ref: ref, style: {
|
129
|
-
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H
|
129
|
+
height: (isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H) -
|
130
|
+
((_w = (_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.popupBg) === null || _w === void 0 ? void 0 : _w.bottomMargin),
|
130
131
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden'
|
131
132
|
} }, children)))))), modalEleRef.current);
|
132
133
|
};
|
@@ -6,9 +6,10 @@ import previewData from './preview.json';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
import { css } from '@emotion/css';
|
8
8
|
import { setFontForText } from '../../../../core/utils/tool';
|
9
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
9
10
|
const WaterfallFlowItem = (props) => {
|
10
11
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
11
|
-
const { swiperRef, setRtcList, setOpenHashtag,
|
12
|
+
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
12
13
|
const [showVideo, setShowVideo] = useState(false);
|
13
14
|
const imgDom = useRef(null);
|
14
15
|
const ref = useRef(null);
|
@@ -121,7 +122,8 @@ const WaterfallFlowItem = (props) => {
|
|
121
122
|
export default function WaterfallList(_a) {
|
122
123
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
123
124
|
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
124
|
-
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
125
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
|
126
|
+
const { jumpToWeb } = useEventReport();
|
125
127
|
const [list, setList] = useState();
|
126
128
|
const [data, setData] = useState();
|
127
129
|
const [isLoadingData, setIsLoadingData] = useState(false);
|
@@ -157,10 +159,12 @@ export default function WaterfallList(_a) {
|
|
157
159
|
}
|
158
160
|
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
159
161
|
const handleClickLink = () => {
|
160
|
-
var _a, _b;
|
162
|
+
var _a, _b, _c, _d, _e;
|
161
163
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
162
164
|
reportTagsView();
|
163
|
-
|
165
|
+
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
166
|
+
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
167
|
+
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
164
168
|
}
|
165
169
|
};
|
166
170
|
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -6,6 +6,7 @@ import previewData from './preview.json';
|
|
6
6
|
import FormatImage from '../FormatImage';
|
7
7
|
import { css } from '@emotion/css';
|
8
8
|
import { setFontForText } from '../../../../core/utils/tool';
|
9
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
9
10
|
const WaterfallFlowItem = (props) => {
|
10
11
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
11
12
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
@@ -113,7 +114,8 @@ const WaterfallFlowItem = (props) => {
|
|
113
114
|
export default function WaterfallList(_a) {
|
114
115
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
115
116
|
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
116
|
-
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
117
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
|
118
|
+
const { jumpToWeb } = useEventReport();
|
117
119
|
const scrollParent = useRef(null);
|
118
120
|
const [scrollTop, setScrollTop] = useState(0);
|
119
121
|
const [data, setData] = useState();
|
@@ -265,10 +267,12 @@ export default function WaterfallList(_a) {
|
|
265
267
|
};
|
266
268
|
}, [onScroll, scrollParent]);
|
267
269
|
const handleClickLink = () => {
|
268
|
-
var _a, _b;
|
270
|
+
var _a, _b, _c, _d, _e;
|
269
271
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
270
272
|
reportTagsView();
|
271
|
-
|
273
|
+
const rec = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec;
|
274
|
+
jumpToWeb(rec, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProduct, (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta, cacheActiveIndex, (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo);
|
275
|
+
window.location.href = window.getJointUtmLink((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link);
|
272
276
|
}
|
273
277
|
};
|
274
278
|
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -20,7 +20,7 @@ import './index.less';
|
|
20
20
|
import { useEventReport } from '../../../core/hooks/useEventReport';
|
21
21
|
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
22
22
|
import Tagbar from './Tagbar';
|
23
|
-
import { getFeUserId, getSlideSkipState
|
23
|
+
import { getFeUserId, getSlideSkipState } from '../../../core/utils/localStore';
|
24
24
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
25
25
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
26
26
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -35,8 +35,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
35
35
|
const [isReload, setIsReload] = useState(new Date().getTime());
|
36
36
|
const skipLinkRef = useRef(false);
|
37
37
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = useSxpDataSource();
|
38
|
-
const { backMainFeed } = useEventReport();
|
39
|
-
const { productView } = useEventReport();
|
38
|
+
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
40
39
|
const isShowFingerTip = useMemo(() => {
|
41
40
|
return data.length > 0 && !loading && (getFeUserId() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
42
41
|
}, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
|
@@ -176,15 +175,39 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
176
175
|
const height = useMemo(() => {
|
177
176
|
return containerHeight - minusHeight - tagHeight;
|
178
177
|
}, [globalConfig, containerHeight, tagHeight]);
|
178
|
+
const visList = useMemo(() => {
|
179
|
+
var _a;
|
180
|
+
const list = activeIndex === 0 && !waterFallData
|
181
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
182
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
183
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
184
|
+
return item;
|
185
|
+
}
|
186
|
+
else {
|
187
|
+
return null;
|
188
|
+
}
|
189
|
+
});
|
190
|
+
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
191
|
+
}, [data, activeIndex, waterFallData]);
|
179
192
|
const renderLogo = useMemo(() => {
|
180
|
-
var _a, _b;
|
193
|
+
var _a, _b, _c, _d;
|
181
194
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
182
195
|
const link = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.value;
|
183
|
-
|
196
|
+
const isExternalLink = ((_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoBar) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
197
|
+
const rec = visList[activeIndex];
|
198
|
+
return (React.createElement("div", Object.assign({ className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } }, (link && {
|
199
|
+
onClick: () => {
|
200
|
+
var _a, _b, _c, _d;
|
201
|
+
if (isExternalLink) {
|
202
|
+
jumpToWeb(rec, (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct, (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindCta, activeIndex, ((_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || ((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.traceInfo));
|
203
|
+
}
|
204
|
+
new Function(link)();
|
205
|
+
}
|
206
|
+
})),
|
184
207
|
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
185
208
|
}
|
186
209
|
return null;
|
187
|
-
}, [globalConfig]);
|
210
|
+
}, [globalConfig, activeIndex, visList]);
|
188
211
|
const renderContent = useCallback((rec, index) => {
|
189
212
|
var _a, _b, _c, _d;
|
190
213
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
@@ -321,7 +344,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
321
344
|
traceInfo: (_u = (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_t = item === null || item === void 0 ? void 0 : item.product) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : ''
|
322
345
|
}
|
323
346
|
});
|
324
|
-
setSlideSkipState();
|
325
347
|
skipLinkRef.current = true;
|
326
348
|
window.location.href = window.getJointUtmLink(link);
|
327
349
|
}
|
@@ -403,20 +425,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
403
425
|
});
|
404
426
|
}
|
405
427
|
};
|
406
|
-
const visList = useMemo(() => {
|
407
|
-
var _a;
|
408
|
-
const list = activeIndex === 0 && !waterFallData
|
409
|
-
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
410
|
-
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
411
|
-
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
412
|
-
return item;
|
413
|
-
}
|
414
|
-
else {
|
415
|
-
return null;
|
416
|
-
}
|
417
|
-
});
|
418
|
-
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
419
|
-
}, [data, activeIndex, waterFallData]);
|
420
428
|
const renderToggleButton = useCallback((visible) => {
|
421
429
|
var _a, _b, _c, _d, _e, _f;
|
422
430
|
if (!visible)
|
@@ -2,6 +2,7 @@ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useStat
|
|
2
2
|
import { cloneDeep } from 'lodash';
|
3
3
|
import DataSourceProvider from './DataSourceProvider';
|
4
4
|
import { uuid } from '../../core/utils/tool';
|
5
|
+
import { setSlideSkipState } from '../utils/localStore';
|
5
6
|
const item = {
|
6
7
|
id: uuid(6, 10),
|
7
8
|
item: {
|
@@ -75,6 +76,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
75
76
|
});
|
76
77
|
typeof window !== 'undefined' &&
|
77
78
|
(window.getJointUtmLink = (url) => {
|
79
|
+
setSlideSkipState();
|
78
80
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
79
81
|
return url + (utmVal ? '&' + utmVal : '');
|
80
82
|
}
|
@@ -93,7 +93,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
93
93
|
.catch((err) => Promise.reject(err));
|
94
94
|
}, [bffDataSource]);
|
95
95
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
96
|
-
var _d, _e, _f, _g, _h;
|
96
|
+
var _d, _e, _f, _g, _h, _j, _k;
|
97
97
|
query = 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}]` }));
|
98
98
|
if (utmVal) {
|
99
99
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
@@ -104,7 +104,30 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
104
104
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
105
105
|
}
|
106
106
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isEditor) {
|
107
|
-
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1
|
107
|
+
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] }));
|
108
|
+
if (!(query === null || query === void 0 ? void 0 : query.channel))
|
109
|
+
return;
|
110
|
+
let list = [];
|
111
|
+
let result = null;
|
112
|
+
let pageNum = 1;
|
113
|
+
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
114
|
+
var _l, _m, _o, _p;
|
115
|
+
query.pageNum = pageNum;
|
116
|
+
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
117
|
+
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
118
|
+
return undefined;
|
119
|
+
}
|
120
|
+
const rec = (_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.recList) === null || _m === void 0 ? void 0 : _m[0];
|
121
|
+
list = list.concat((_p = (_o = result === null || result === void 0 ? void 0 : result.data) === null || _o === void 0 ? void 0 : _o.recList) !== null && _p !== void 0 ? _p : []);
|
122
|
+
if ((rec === null || rec === void 0 ? void 0 : rec.product) || (rec === null || rec === void 0 ? void 0 : rec.video)) {
|
123
|
+
pageNum = pageNum + 1;
|
124
|
+
yield recurveRecList(query);
|
125
|
+
}
|
126
|
+
});
|
127
|
+
yield recurveRecList(query);
|
128
|
+
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
129
|
+
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 });
|
130
|
+
return Object.assign(Object.assign({}, result.data), { recList: list });
|
108
131
|
}
|
109
132
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
110
133
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
@@ -115,12 +138,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
115
138
|
return result === null || result === void 0 ? void 0 : result.data;
|
116
139
|
}), [bffFetch, utmVal, maxSize, defaultSize, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, channelQueryList, isEditor]);
|
117
140
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
118
|
-
var
|
141
|
+
var _q, _r, _s, _t;
|
119
142
|
if (rtcList.length <= 0) {
|
120
143
|
return;
|
121
144
|
}
|
122
145
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
123
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
146
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_q = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _q === void 0 ? void 0 : _q.itemId) && { productFilter: (_r = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _r === void 0 ? void 0 : _r.itemId })), (((_s = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _s === void 0 ? void 0 : _s.itemId) && { contentFilter: (_t = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _t === void 0 ? void 0 : _t.itemId })), { themeTag: themeTag.current }));
|
124
147
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
125
148
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
126
149
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
@@ -183,17 +206,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
183
206
|
return res === null || res === void 0 ? void 0 : res.success;
|
184
207
|
}), [bffFetch]);
|
185
208
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
186
|
-
var
|
209
|
+
var _u, _v, _w, _x, _y;
|
187
210
|
if (!utmVal || !isShowTag)
|
188
211
|
return;
|
189
212
|
try {
|
190
|
-
const val = (
|
213
|
+
const val = (_w = (_v = (_u = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _u === void 0 ? void 0 : _u.filter((val) => {
|
191
214
|
var _a, _b;
|
192
215
|
const key = val.split('=')[0];
|
193
216
|
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);
|
194
|
-
})) === null ||
|
217
|
+
})) === null || _v === void 0 ? void 0 : _v.join('&')) !== null && _w !== void 0 ? _w : '';
|
195
218
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
196
|
-
setTagList((
|
219
|
+
setTagList((_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.tags) !== null && _y !== void 0 ? _y : []);
|
197
220
|
}
|
198
221
|
catch (e) {
|
199
222
|
console.log('e', e);
|
@@ -270,7 +293,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
270
293
|
});
|
271
294
|
}, [isShowConsent]);
|
272
295
|
useEffect(() => {
|
273
|
-
if (!isInit.current)
|
296
|
+
if (!isInit.current && !isEditor)
|
274
297
|
return;
|
275
298
|
setLoading(true);
|
276
299
|
bffGetTagList();
|
@@ -282,7 +305,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
282
305
|
.finally(() => {
|
283
306
|
setLoading(false);
|
284
307
|
});
|
285
|
-
}, [
|
308
|
+
}, [bffGetTagList, isEditor, getRecommendVideos]);
|
286
309
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
287
310
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
288
311
|
rtcList,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RecItemType } from '../components/SxpPageRender/typing';
|
2
2
|
export declare function useEventReport(): {
|
3
|
-
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
|
3
|
+
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number, traceInfo?: string) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
5
|
backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
|
6
6
|
};
|
@@ -3,7 +3,7 @@ import { useSxpDataSource } from './useSxpDataSource';
|
|
3
3
|
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
4
4
|
export function useEventReport() {
|
5
5
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
|
6
|
-
const jumpToWeb = useCallback((data, product, cta, position) => {
|
6
|
+
const jumpToWeb = useCallback((data, product, cta, position, traceInfo) => {
|
7
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;
|
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))) {
|
@@ -36,7 +36,7 @@ export function useEventReport() {
|
|
36
36
|
position: position + '',
|
37
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
38
|
ctatId: (_w = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _w !== void 0 ? _w : '',
|
39
|
-
traceInfo: (_9 = (_6 = (_4 = (_0 = (_x = 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 : ''
|
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
40
|
}
|
41
41
|
});
|
42
42
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
@@ -1,11 +1,4 @@
|
|
1
1
|
declare const _default: ({
|
2
|
-
title: string;
|
3
|
-
child: {
|
4
|
-
type: string;
|
5
|
-
label: string;
|
6
|
-
name: string[];
|
7
|
-
}[];
|
8
|
-
} | {
|
9
2
|
title: string;
|
10
3
|
child: ({
|
11
4
|
type: string;
|
@@ -126,6 +119,12 @@ declare const _default: ({
|
|
126
119
|
})[];
|
127
120
|
name?: undefined;
|
128
121
|
initialValue?: undefined;
|
122
|
+
} | {
|
123
|
+
label: string;
|
124
|
+
type: string;
|
125
|
+
name: string[];
|
126
|
+
initialValue?: undefined;
|
127
|
+
child?: undefined;
|
129
128
|
})[];
|
130
129
|
})[];
|
131
130
|
export default _default;
|
@@ -99,6 +99,10 @@ export default [
|
|
99
99
|
{
|
100
100
|
label: '标题对齐',
|
101
101
|
type: 'TextAlign'
|
102
|
+
},
|
103
|
+
{
|
104
|
+
label: '间距',
|
105
|
+
type: 'TextSpace'
|
102
106
|
}
|
103
107
|
]
|
104
108
|
}
|
@@ -184,6 +188,11 @@ export default [
|
|
184
188
|
{
|
185
189
|
type: 'TextAlign',
|
186
190
|
name: ['props', 'buttonStyle']
|
191
|
+
},
|
192
|
+
{
|
193
|
+
label: '间距',
|
194
|
+
type: 'TextSpace',
|
195
|
+
name: ['props', 'buttonStyle']
|
187
196
|
}
|
188
197
|
]
|
189
198
|
},
|
@@ -64,13 +64,16 @@ declare const _default: ({
|
|
64
64
|
})[];
|
65
65
|
name?: undefined;
|
66
66
|
options?: undefined;
|
67
|
-
}
|
67
|
+
})[];
|
68
|
+
type?: undefined;
|
69
|
+
label?: undefined;
|
70
|
+
name?: undefined;
|
71
|
+
} | {
|
72
|
+
title: string;
|
73
|
+
child: {
|
68
74
|
type: string;
|
69
75
|
name: string[];
|
70
|
-
|
71
|
-
child?: undefined;
|
72
|
-
options?: undefined;
|
73
|
-
})[];
|
76
|
+
}[];
|
74
77
|
type?: undefined;
|
75
78
|
label?: undefined;
|
76
79
|
name?: undefined;
|
@@ -68,6 +68,11 @@ export default [
|
|
68
68
|
type: 'TextAlign',
|
69
69
|
name: ['textStyle']
|
70
70
|
},
|
71
|
+
{
|
72
|
+
label: '标题间距',
|
73
|
+
type: 'TextSpace',
|
74
|
+
name: ['textStyle']
|
75
|
+
},
|
71
76
|
{
|
72
77
|
label: '表单布局',
|
73
78
|
type: 'Radius',
|
@@ -126,10 +131,12 @@ export default [
|
|
126
131
|
]
|
127
132
|
},
|
128
133
|
{
|
134
|
+
label: '提交按钮文本样式',
|
129
135
|
type: 'TextStyle',
|
130
136
|
name: ['props', 'submitButtonStyle']
|
131
137
|
},
|
132
138
|
{
|
139
|
+
label: '提交按钮对齐',
|
133
140
|
type: 'TextAlign',
|
134
141
|
name: ['props', 'submitButtonStyle']
|
135
142
|
},
|
@@ -137,6 +144,11 @@ export default [
|
|
137
144
|
label: '提交按钮颜色',
|
138
145
|
type: 'Color',
|
139
146
|
name: ['props', 'submitBgColor']
|
147
|
+
},
|
148
|
+
{
|
149
|
+
label: '提交按钮间距',
|
150
|
+
type: 'TextSpace',
|
151
|
+
name: ['props', 'submitButtonStyle']
|
140
152
|
}
|
141
153
|
]
|
142
154
|
},
|
@@ -25,7 +25,9 @@ export interface ICommodityDetailProps {
|
|
25
25
|
commodityStyles?: {
|
26
26
|
title: CSSProperties;
|
27
27
|
collection: CSSProperties;
|
28
|
-
price: CSSProperties
|
28
|
+
price: CSSProperties & {
|
29
|
+
enableFormattedPrice?: boolean;
|
30
|
+
};
|
29
31
|
info: CSSProperties;
|
30
32
|
taxInfo: CSSProperties;
|
31
33
|
};
|
@@ -12,7 +12,7 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
|
12
12
|
import { setFontForText } from '../../../../core/utils/tool';
|
13
13
|
import CommodityGroup from '../../template/components/CommodityGroup';
|
14
14
|
const CommodityDetail = (_a) => {
|
15
|
-
var _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;
|
15
|
+
var _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;
|
16
16
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
|
17
17
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
|
18
18
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -20,6 +20,7 @@ const CommodityDetail = (_a) => {
|
|
20
20
|
const [showModal, setShowModal] = useState(false);
|
21
21
|
const [show3DModal, setShow3DModal] = useState(false);
|
22
22
|
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
23
|
+
const ref = useRef();
|
23
24
|
const data = isPost ? rec : popupDetailData;
|
24
25
|
let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
|
25
26
|
let cta = isPost
|
@@ -59,17 +60,20 @@ const CommodityDetail = (_a) => {
|
|
59
60
|
};
|
60
61
|
}, []);
|
61
62
|
const priceText = useMemo(() => {
|
62
|
-
var _a, _b, _c, _d, _e;
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
64
|
+
const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
|
63
65
|
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
64
|
-
return `${(
|
65
|
-
|
66
|
-
|
66
|
+
return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
|
67
|
+
? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
|
68
|
+
minimumFractionDigits: 0
|
69
|
+
})) !== null && _g !== void 0 ? _g : ''
|
70
|
+
: product === null || product === void 0 ? void 0 : product.price}`;
|
67
71
|
}
|
68
72
|
else {
|
69
73
|
return '$7,000';
|
70
74
|
}
|
71
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
72
|
-
const width = (isPreview ? 375 : (
|
75
|
+
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
|
76
|
+
const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
|
73
77
|
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
74
78
|
const renderContent = ({ isPost }) => {
|
75
79
|
var _a, _b, _c, _d;
|
@@ -110,6 +114,10 @@ const CommodityDetail = (_a) => {
|
|
110
114
|
popupCurTimeRef.current = new Date();
|
111
115
|
setCheckCommodityIndex(index);
|
112
116
|
checkCommodityIndexRef.current = index;
|
117
|
+
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
118
|
+
ref.current.swiper.slideTo(0);
|
119
|
+
ref.current.swiper.autoplay.start();
|
120
|
+
}
|
113
121
|
}, []);
|
114
122
|
const renderCommodityGroup = useCallback(() => {
|
115
123
|
var _a, _b, _c;
|
@@ -125,18 +133,18 @@ const CommodityDetail = (_a) => {
|
|
125
133
|
};
|
126
134
|
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
127
135
|
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
128
|
-
const iframeUrl = ((
|
136
|
+
const iframeUrl = ((_x = (_w = data === null || data === void 0 ? void 0 : data.video) === null || _w === void 0 ? void 0 : _w.bindProduct) === null || _x === void 0 ? void 0 : _x.remark) || ((_0 = (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProducts) === null || _z === void 0 ? void 0 : _z[0]) === null || _0 === void 0 ? void 0 : _0.remark) || ((_1 = data === null || data === void 0 ? void 0 : data.product) === null || _1 === void 0 ? void 0 : _1.remark);
|
129
137
|
return (React.createElement(React.Fragment, null,
|
130
138
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
131
139
|
React.createElement("div", { style: { position: 'relative' } },
|
132
|
-
product && ((
|
140
|
+
product && ((_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
133
141
|
clickable: true,
|
134
142
|
bulletActiveClass: 'swipe-item-active-bullet',
|
135
143
|
clickableClass: getDotsAlign
|
136
144
|
}, loop: true, autoplay: {
|
137
145
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
138
|
-
} },
|
139
|
-
React.createElement(React.Fragment, null, (
|
146
|
+
}, ref: ref },
|
147
|
+
React.createElement(React.Fragment, null, (_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.map((src) => {
|
140
148
|
var _a;
|
141
149
|
return (React.createElement(SwiperSlide, { key: src },
|
142
150
|
React.createElement("div", { style: {
|
@@ -152,7 +160,7 @@ const CommodityDetail = (_a) => {
|
|
152
160
|
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
153
161
|
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
154
162
|
})))),
|
155
|
-
!((
|
163
|
+
!((_4 = product === null || product === void 0 ? void 0 : product.homePage) === null || _4 === void 0 ? void 0 : _4.length) && (React.createElement("div", { className: css({
|
156
164
|
height,
|
157
165
|
width
|
158
166
|
}) },
|
@@ -160,7 +168,7 @@ const CommodityDetail = (_a) => {
|
|
160
168
|
objectFit: 'cover',
|
161
169
|
width: '100%',
|
162
170
|
height: '100%'
|
163
|
-
}), src: (
|
171
|
+
}), src: (_5 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _5 !== void 0 ? _5 : bottom_image, alt: 'pdp image' }))),
|
164
172
|
(iframeUrl && iframeIcon) ||
|
165
173
|
(!product && iframeIcon && (React.createElement("div", { style: {
|
166
174
|
padding: '5px 10px',
|
@@ -147,6 +147,13 @@ declare const _default: ({
|
|
147
147
|
options?: undefined;
|
148
148
|
initialValue?: undefined;
|
149
149
|
child?: undefined;
|
150
|
+
} | {
|
151
|
+
label: string;
|
152
|
+
type: string;
|
153
|
+
name: string[];
|
154
|
+
initialValue: boolean;
|
155
|
+
options?: undefined;
|
156
|
+
child?: undefined;
|
150
157
|
})[];
|
151
158
|
}[];
|
152
159
|
} | {
|
@@ -205,6 +212,12 @@ declare const _default: ({
|
|
205
212
|
})[];
|
206
213
|
name?: undefined;
|
207
214
|
initialValue?: undefined;
|
215
|
+
} | {
|
216
|
+
label: string;
|
217
|
+
type: string;
|
218
|
+
name: string[];
|
219
|
+
initialValue?: undefined;
|
220
|
+
child?: undefined;
|
208
221
|
})[];
|
209
222
|
} | {
|
210
223
|
title: string;
|