pb-sxp-ui 1.2.6 → 1.2.8
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 +119 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -3
- package/dist/index.js +119 -107
- 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 +119 -107
- 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/FormatImage.d.ts +1 -0
- package/es/core/components/SxpPageRender/FormatImage.js +23 -5
- package/es/core/components/SxpPageRender/Popup/index.js +5 -5
- package/es/core/components/SxpPageRender/VideoWidget/index.js +2 -2
- package/es/core/components/SxpPageRender/index.js +12 -6
- package/es/core/context/SxpDataSourceProvider.js +25 -15
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/materials/sxp/cta/AniLink/index.js +1 -1
- package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +0 -3
- package/es/materials/sxp/cta/AniLink/interactionRender.js +1 -2
- package/es/materials/sxp/cta/AniLink/material.js +9 -1
- package/es/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +0 -10
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +1 -7
- package/es/materials/sxp/cta/AniLinkPopup/material.js +17 -10
- package/es/materials/sxp/popup/CommodityList/index.d.ts +0 -1
- package/es/materials/sxp/popup/CommodityList/index.js +2 -1
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
- package/es/materials/sxp/template/components/CommodityGroup.js +2 -1
- package/lib/core/components/SxpPageRender/FormatImage.d.ts +1 -0
- package/lib/core/components/SxpPageRender/FormatImage.js +23 -5
- package/lib/core/components/SxpPageRender/Popup/index.js +5 -5
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +12 -6
- package/lib/core/context/SxpDataSourceProvider.js +25 -15
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/materials/sxp/cta/AniLink/index.js +1 -1
- package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +0 -3
- package/lib/materials/sxp/cta/AniLink/interactionRender.js +1 -2
- package/lib/materials/sxp/cta/AniLink/material.js +9 -1
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +0 -10
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +1 -7
- package/lib/materials/sxp/cta/AniLinkPopup/material.js +17 -10
- package/lib/materials/sxp/popup/CommodityList/index.d.ts +0 -1
- package/lib/materials/sxp/popup/CommodityList/index.js +2 -1
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
- package/lib/materials/sxp/template/components/CommodityGroup.js +2 -1
- package/package.json +1 -1
@@ -1,10 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
+
const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
|
4
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
6
|
const FormatImage = (0, react_1.forwardRef)((props, ref) => {
|
6
|
-
const { src, onLoad, style, className, loading } = props;
|
7
|
+
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
7
8
|
const [imgSrc, setImgSrc] = (0, react_1.useState)();
|
9
|
+
const imgRef = (0, react_1.useRef)(null);
|
8
10
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
9
11
|
setSrc: (v) => {
|
10
12
|
setImgSrc(v);
|
@@ -13,15 +15,31 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
|
|
13
15
|
(0, react_1.useEffect)(() => {
|
14
16
|
setImgSrc(src);
|
15
17
|
}, [src]);
|
16
|
-
|
18
|
+
(0, react_1.useEffect)(() => {
|
19
|
+
const onShow = () => {
|
20
|
+
var _a, _b;
|
21
|
+
if (src && ((_b = (_a = imgRef === null || imgRef === void 0 ? void 0 : imgRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === 'none') {
|
22
|
+
imgRef.current.src = '';
|
23
|
+
imgRef.current.src = src;
|
24
|
+
}
|
25
|
+
};
|
26
|
+
event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
27
|
+
return () => {
|
28
|
+
event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
29
|
+
};
|
30
|
+
}, [src]);
|
17
31
|
return (react_1.default.createElement(react_1.default.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
|
18
32
|
react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
19
33
|
react_1.default.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
20
34
|
react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
21
|
-
react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
35
|
+
react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
|
36
|
+
if (imgRef.current)
|
37
|
+
imgRef.current.style.display = 'block';
|
22
38
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
23
|
-
}, alt:
|
39
|
+
}, alt: alt }))) : (react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
|
40
|
+
if (imgRef.current)
|
41
|
+
imgRef.current.style.display = 'block';
|
24
42
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
25
|
-
}, alt:
|
43
|
+
}, alt: alt }))));
|
26
44
|
});
|
27
45
|
exports.default = (0, react_1.memo)(FormatImage);
|
@@ -28,7 +28,7 @@ const Popup = () => {
|
|
28
28
|
}
|
29
29
|
}, [popup]);
|
30
30
|
const handleClose = () => {
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
32
32
|
if (!popup ||
|
33
33
|
(popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
|
34
34
|
!visible ||
|
@@ -39,10 +39,10 @@ const Popup = () => {
|
|
39
39
|
const value = (_d = (_c = (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.popupList) === null || _d === void 0 ? void 0 : _d.find((item) => (item === null || item === void 0 ? void 0 : item.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
|
40
40
|
if (((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'CommodityDetail' || ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type) === 'CommodityDetailDiroNew') {
|
41
41
|
const data = popupDetailData;
|
42
|
-
let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
|
43
|
-
let cta = (
|
42
|
+
let product = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : (_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];
|
43
|
+
let cta = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProduct) === null || _m === void 0 ? void 0 : _m.bindCta) !== null && _o !== void 0 ? _o : (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.bindCta;
|
44
44
|
if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
|
45
|
-
const p = (
|
45
|
+
const p = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
|
46
46
|
if (p) {
|
47
47
|
product = p;
|
48
48
|
cta = p === null || p === void 0 ? void 0 : p.bindCta;
|
@@ -68,7 +68,7 @@ const Popup = () => {
|
|
68
68
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
69
69
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
70
70
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
71
|
-
return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose
|
71
|
+
return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
72
72
|
}
|
73
73
|
else {
|
74
74
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
@@ -343,7 +343,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
343
343
|
} },
|
344
344
|
react_1.default.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
345
345
|
react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
346
|
-
react_1.default.createElement(
|
346
|
+
isPauseVideo && (react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))),
|
347
347
|
renderPoster,
|
348
348
|
renderLoading)) : (react_1.default.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
|
349
349
|
position: 'relative',
|
@@ -354,6 +354,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
354
354
|
react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
355
355
|
renderPoster,
|
356
356
|
renderLoading,
|
357
|
-
react_1.default.createElement(
|
357
|
+
isPauseVideo && react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
|
358
358
|
};
|
359
359
|
exports.default = (0, react_1.memo)(VideoWidget);
|
@@ -33,6 +33,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
33
33
|
const viewTime = (0, react_1.useRef)();
|
34
34
|
const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
|
35
35
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
36
|
+
const [isReload, setIsReload] = (0, react_1.useState)(false);
|
37
|
+
const skipLinkRef = (0, react_1.useRef)(false);
|
36
38
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = (0, hooks_1.useSxpDataSource)();
|
37
39
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
38
40
|
const { productView } = (0, useEventReport_1.useEventReport)();
|
@@ -81,7 +83,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
81
83
|
(0, react_1.useEffect)(() => {
|
82
84
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
83
85
|
const visibleChange = () => {
|
84
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
85
87
|
const repCond = !openHashtag && !isShowConsent;
|
86
88
|
if (document.visibilityState === 'hidden') {
|
87
89
|
if (repCond) {
|
@@ -119,11 +121,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
119
121
|
fromKName,
|
120
122
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
121
123
|
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
122
|
-
traceInfo: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : ''
|
124
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
123
125
|
}
|
124
126
|
});
|
125
127
|
}
|
126
128
|
else if (document.visibilityState === 'visible') {
|
129
|
+
if (skipLinkRef.current === true) {
|
130
|
+
setIsReload(true);
|
131
|
+
}
|
127
132
|
handleH5EnterLink();
|
128
133
|
if (repCond) {
|
129
134
|
handleViewImageStartEvent(activeIndex);
|
@@ -163,7 +168,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
163
168
|
const minusHeight = (0, react_1.useMemo)(() => {
|
164
169
|
let minusHeight = 0;
|
165
170
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
166
|
-
minusHeight +=
|
171
|
+
minusHeight += 56;
|
167
172
|
}
|
168
173
|
return minusHeight;
|
169
174
|
}, []);
|
@@ -289,7 +294,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
289
294
|
}
|
290
295
|
};
|
291
296
|
const handleSlideSkip = (item, position) => {
|
292
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
297
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
293
298
|
if (isPreview || waterFallData)
|
294
299
|
return;
|
295
300
|
const t = new Date() - curTime.current;
|
@@ -308,10 +313,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
308
313
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
309
314
|
position: position + '',
|
310
315
|
contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
311
|
-
traceInfo: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : ''
|
316
|
+
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 : ''
|
312
317
|
}
|
313
318
|
});
|
314
319
|
(0, localStore_1.setSlideSkipState)();
|
320
|
+
skipLinkRef.current = true;
|
315
321
|
window.location.href = window.getJointUtmLink(link);
|
316
322
|
}
|
317
323
|
}
|
@@ -424,7 +430,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
424
430
|
renderBottom(rec, index),
|
425
431
|
renderLikeButton(rec, index)))))));
|
426
432
|
});
|
427
|
-
}, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
|
433
|
+
}, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage, isReload]);
|
428
434
|
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
429
435
|
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
430
436
|
return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
@@ -43,6 +43,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
43
43
|
var _a, _b, _c, _d;
|
44
44
|
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;
|
45
45
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
|
46
|
+
const getFilterRecList = (0, react_1.useCallback)((data) => {
|
47
|
+
var _a;
|
48
|
+
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
49
|
+
const nList = (_a = recList === null || recList === void 0 ? void 0 : recList.map((item) => {
|
50
|
+
var _a, _b, _c, _d, _e, _f;
|
51
|
+
if (((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
52
|
+
const bindProducts = (_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e.filter((item) => !!(item === null || item === void 0 ? void 0 : item.bindCta))) !== null && _f !== void 0 ? _f : [];
|
53
|
+
return Object.assign(Object.assign({}, item), { video: Object.assign(Object.assign({}, item === null || item === void 0 ? void 0 : item.video), { bindProducts }) });
|
54
|
+
}
|
55
|
+
return item;
|
56
|
+
})) !== null && _a !== void 0 ? _a : [];
|
57
|
+
return nList;
|
58
|
+
}, []);
|
46
59
|
(0, react_1.useEffect)(() => {
|
47
60
|
const handleChangeThemeTag = (tag) => {
|
48
61
|
themeTag.current = tag;
|
@@ -109,7 +122,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
109
122
|
return result === null || result === void 0 ? void 0 : result.data;
|
110
123
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
111
124
|
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
112
|
-
var _j, _k;
|
113
125
|
if (rtcList.length <= 0) {
|
114
126
|
return;
|
115
127
|
}
|
@@ -119,8 +131,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
119
131
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
120
132
|
themeTag: themeTag.current
|
121
133
|
});
|
122
|
-
setRtcList(rtcList.concat((
|
123
|
-
setCacheRtcList(cacheRtcList.concat((
|
134
|
+
setRtcList(rtcList.concat(getFilterRecList(data)));
|
135
|
+
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
124
136
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
125
137
|
const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo }) => {
|
126
138
|
if (!enableReportEvent) {
|
@@ -178,24 +190,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
178
190
|
return res === null || res === void 0 ? void 0 : res.success;
|
179
191
|
}), [bffFetch]);
|
180
192
|
const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
181
|
-
var
|
193
|
+
var _j, _k, _l, _m, _o;
|
182
194
|
if (!utmVal || !isShowTag)
|
183
195
|
return;
|
184
196
|
try {
|
185
|
-
const val = (
|
197
|
+
const val = (_l = (_k = (_j = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _j === void 0 ? void 0 : _j.filter((val) => {
|
186
198
|
var _a, _b;
|
187
199
|
const key = val.split('=')[0];
|
188
200
|
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);
|
189
|
-
})) === null ||
|
201
|
+
})) === null || _k === void 0 ? void 0 : _k.join('&')) !== null && _l !== void 0 ? _l : '';
|
190
202
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
191
|
-
setTagList((
|
203
|
+
setTagList((_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []);
|
192
204
|
}
|
193
205
|
catch (e) {
|
194
206
|
console.log('e', e);
|
195
207
|
}
|
196
208
|
}), [bffFetch, utmVal, isShowTag]);
|
197
209
|
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
198
|
-
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;
|
210
|
+
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;
|
199
211
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
200
212
|
const isProd = ((_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.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
201
213
|
let fromKName = '';
|
@@ -209,7 +221,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
209
221
|
fromKName = 'imagePage';
|
210
222
|
}
|
211
223
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
212
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (
|
224
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_2 = (_z = (_u = (_q = (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProduct) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : (_y = (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.bindProducts) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.bindCta) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_1 = (_0 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '', fromKName, fromKPage: (_3 = location === null || location === void 0 ? void 0 : location.href) !== null && _3 !== void 0 ? _3 : '' })
|
213
225
|
});
|
214
226
|
}, [bffEventReport, isFromHashtag]);
|
215
227
|
const h5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -249,9 +261,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
249
261
|
bffGetTagList();
|
250
262
|
getRecommendVideos()
|
251
263
|
.then((data) => {
|
252
|
-
|
253
|
-
|
254
|
-
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
264
|
+
setRtcList(getFilterRecList(data));
|
265
|
+
setCacheRtcList(getFilterRecList(data));
|
255
266
|
})
|
256
267
|
.finally(() => {
|
257
268
|
bffEventReport({
|
@@ -271,9 +282,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
271
282
|
bffGetTagList();
|
272
283
|
getRecommendVideos()
|
273
284
|
.then((data) => {
|
274
|
-
|
275
|
-
|
276
|
-
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
285
|
+
setRtcList(getFilterRecList(data));
|
286
|
+
setCacheRtcList(getFilterRecList(data));
|
277
287
|
})
|
278
288
|
.finally(() => {
|
279
289
|
setLoading(false);
|
@@ -7,7 +7,7 @@ const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
|
7
7
|
function useEventReport() {
|
8
8
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
|
9
9
|
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
|
10
|
-
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;
|
10
|
+
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;
|
11
11
|
let fromKName = '';
|
12
12
|
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))) {
|
13
13
|
fromKName = 'pdpPage';
|
@@ -38,12 +38,12 @@ function useEventReport() {
|
|
38
38
|
position: position + '',
|
39
39
|
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
40
40
|
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
41
|
-
traceInfo: (
|
41
|
+
traceInfo: (_1 = (_y = (_w = (_s = (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_v = (_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = data === null || data === void 0 ? void 0 : data.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = data === null || data === void 0 ? void 0 : data.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : ''
|
42
42
|
}
|
43
43
|
});
|
44
44
|
}, [bffEventReport, popupDetailData, isFromHashtag]);
|
45
45
|
const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
|
46
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
47
47
|
let fromKName = '';
|
48
48
|
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))) {
|
49
49
|
fromKName = 'pdpPage';
|
@@ -63,7 +63,7 @@ function useEventReport() {
|
|
63
63
|
position: position + '',
|
64
64
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
65
65
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
66
|
-
traceInfo: (
|
66
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== 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.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
67
67
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
68
68
|
eventSubject: 'productView',
|
69
69
|
eventDescription: 'User browsed the product'
|
@@ -37,7 +37,7 @@ const AniLink = (_a) => {
|
|
37
37
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
38
38
|
}
|
39
39
|
};
|
40
|
-
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情
|
40
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
|
41
41
|
const aniTimStyle = (0, react_1.useMemo)(() => {
|
42
42
|
var _a, _b;
|
43
43
|
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
@@ -11,7 +11,6 @@ declare const _default: ({
|
|
11
11
|
name: string[];
|
12
12
|
label: string;
|
13
13
|
options?: undefined;
|
14
|
-
initialValue?: undefined;
|
15
14
|
fieldProps?: undefined;
|
16
15
|
addonAfter?: undefined;
|
17
16
|
} | {
|
@@ -22,7 +21,6 @@ declare const _default: ({
|
|
22
21
|
label: string;
|
23
22
|
value: number;
|
24
23
|
}[];
|
25
|
-
initialValue: number;
|
26
24
|
fieldProps: {
|
27
25
|
style: {
|
28
26
|
width: string;
|
@@ -35,7 +33,6 @@ declare const _default: ({
|
|
35
33
|
name: string[];
|
36
34
|
addonAfter: string;
|
37
35
|
options?: undefined;
|
38
|
-
initialValue?: undefined;
|
39
36
|
fieldProps?: undefined;
|
40
37
|
})[];
|
41
38
|
})[];
|
@@ -22,7 +22,15 @@ const AniLink = (0, create_1.createMaterial)(_1.default, {
|
|
22
22
|
ctaTitle: {
|
23
23
|
fontSize: 15,
|
24
24
|
color: '#fff',
|
25
|
-
textAlign: '
|
25
|
+
textAlign: 'center'
|
26
|
+
}
|
27
|
+
},
|
28
|
+
event: {
|
29
|
+
animation: {
|
30
|
+
backgroundColor: '#F40082',
|
31
|
+
name: 1,
|
32
|
+
delay: 1000,
|
33
|
+
duration: 2000
|
26
34
|
}
|
27
35
|
}
|
28
36
|
},
|
@@ -37,7 +37,7 @@ const AniLinkPopup = (_a) => {
|
|
37
37
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
38
38
|
}
|
39
39
|
};
|
40
|
-
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情
|
40
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
|
41
41
|
const aniTimStyle = (0, react_1.useMemo)(() => {
|
42
42
|
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
43
43
|
if (ani) {
|
@@ -69,7 +69,7 @@ const AniLinkPopup = (_a) => {
|
|
69
69
|
react_1.default.createElement("div", { onClick: onClose, className: index_module_less_1.default['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
|
70
70
|
react_1.default.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: index_module_less_1.default['modal-icon-wrapper-img'] })),
|
71
71
|
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
72
|
-
(!recData || (product === null || product === void 0 ? void 0 : product.title)) && (react_1.default.createElement("div", { className: index_module_less_1.default['
|
72
|
+
(!recData || (product === null || product === void 0 ? void 0 : product.title)) && (react_1.default.createElement("div", { className: index_module_less_1.default['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
73
73
|
__html: (0, tool_1.setFontForText)((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
|
74
74
|
} })),
|
75
75
|
react_1.default.createElement("div", { className: index_module_less_1.default['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_0 = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _0 === void 0 ? void 0 : _0.height) + 'px' }), dangerouslySetInnerHTML: {
|
@@ -7,14 +7,6 @@ declare const _default: ({
|
|
7
7
|
} | {
|
8
8
|
title: string;
|
9
9
|
child: ({
|
10
|
-
type: string;
|
11
|
-
name: string[];
|
12
|
-
label: string;
|
13
|
-
options?: undefined;
|
14
|
-
initialValue?: undefined;
|
15
|
-
fieldProps?: undefined;
|
16
|
-
addonAfter?: undefined;
|
17
|
-
} | {
|
18
10
|
type: string;
|
19
11
|
name: string[];
|
20
12
|
label: string;
|
@@ -22,7 +14,6 @@ declare const _default: ({
|
|
22
14
|
label: string;
|
23
15
|
value: number;
|
24
16
|
}[];
|
25
|
-
initialValue: number;
|
26
17
|
fieldProps: {
|
27
18
|
style: {
|
28
19
|
width: string;
|
@@ -35,7 +26,6 @@ declare const _default: ({
|
|
35
26
|
name: string[];
|
36
27
|
addonAfter: string;
|
37
28
|
options?: undefined;
|
38
|
-
initialValue?: undefined;
|
39
29
|
fieldProps?: undefined;
|
40
30
|
})[];
|
41
31
|
})[];
|
@@ -13,22 +13,16 @@ exports.default = [
|
|
13
13
|
{
|
14
14
|
title: '动画效果',
|
15
15
|
child: [
|
16
|
-
{
|
17
|
-
type: 'Color',
|
18
|
-
name: ['animation', 'backgroundColor'],
|
19
|
-
label: '动画颜色'
|
20
|
-
},
|
21
16
|
{
|
22
17
|
type: 'Select',
|
23
18
|
name: ['animation', 'name'],
|
24
19
|
label: '动画',
|
25
20
|
options: [
|
26
21
|
{
|
27
|
-
label: '
|
22
|
+
label: '默认',
|
28
23
|
value: 1
|
29
24
|
}
|
30
25
|
],
|
31
|
-
initialValue: 1,
|
32
26
|
fieldProps: {
|
33
27
|
style: {
|
34
28
|
width: '100%'
|
@@ -21,32 +21,39 @@ const AniLinkPopup = (0, create_1.createMaterial)(_1.default, {
|
|
21
21
|
ctaTempStyles: {
|
22
22
|
img: {
|
23
23
|
borderRadius: 3,
|
24
|
-
width:
|
25
|
-
height:
|
26
|
-
marginBottom:
|
24
|
+
width: 108,
|
25
|
+
height: 108,
|
26
|
+
marginBottom: 0
|
27
27
|
},
|
28
28
|
title: {
|
29
|
-
fontSize:
|
29
|
+
fontSize: 14,
|
30
30
|
color: '#000',
|
31
31
|
textAlign: 'left'
|
32
32
|
},
|
33
33
|
ctaTitle: {
|
34
|
-
|
34
|
+
width: 108,
|
35
|
+
height: 22,
|
36
|
+
fontSize: 12,
|
35
37
|
color: '#fff',
|
36
38
|
textAlign: 'center',
|
37
|
-
width: 76,
|
38
|
-
height: 20,
|
39
39
|
backgroundColor: 'rgba(0,0,0,1)'
|
40
40
|
}
|
41
|
+
},
|
42
|
+
event: {
|
43
|
+
animation: {
|
44
|
+
name: 1,
|
45
|
+
delay: 1000,
|
46
|
+
duration: 2000
|
47
|
+
}
|
41
48
|
}
|
42
49
|
},
|
43
50
|
style: {
|
44
|
-
width:
|
45
|
-
height:
|
51
|
+
width: 120,
|
52
|
+
height: 185,
|
46
53
|
borderRadius: 3,
|
47
54
|
backgroundColor: 'rgba(255,255,255,1)',
|
48
55
|
padding: 7,
|
49
|
-
margin:
|
56
|
+
margin: 15
|
50
57
|
}
|
51
58
|
},
|
52
59
|
w: 100,
|
@@ -11,12 +11,13 @@ const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
|
|
11
11
|
const lodash_1 = require("lodash");
|
12
12
|
const CommodityList = (_a) => {
|
13
13
|
var _b, _c;
|
14
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle,
|
14
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
|
15
15
|
const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
16
16
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
17
17
|
const { popup } = (0, hooks_1.useEditor)();
|
18
18
|
const recData = isPost ? rec : popupDetailData;
|
19
19
|
const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
|
20
|
+
const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
20
21
|
const priceText = (0, react_1.useCallback)((product) => {
|
21
22
|
var _a, _b, _c, _d, _e;
|
22
23
|
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
@@ -12,7 +12,7 @@ interface ICommodityGroupProps {
|
|
12
12
|
style?: CSSProperties;
|
13
13
|
onCLick?: (i: number) => void;
|
14
14
|
popupDetailData?: ISxpDataSourceContext['popupDetailData'];
|
15
|
-
check
|
15
|
+
check: number;
|
16
16
|
}
|
17
17
|
declare const _default: React.NamedExoticComponent<ICommodityGroupProps>;
|
18
18
|
export default _default;
|
@@ -15,7 +15,8 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
|
|
15
15
|
const handleClick = (item, index) => {
|
16
16
|
if (check === index)
|
17
17
|
return;
|
18
|
-
|
18
|
+
const prevItem = products === null || products === void 0 ? void 0 : products[check];
|
19
|
+
productView(popupDetailData, prevItem, prevItem === null || prevItem === void 0 ? void 0 : prevItem.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
19
20
|
onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
|
20
21
|
};
|
21
22
|
return (react_1.default.createElement(react_1.default.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (react_1.default.createElement(Scroll_1.default, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|