pb-sxp-ui 1.15.43 → 1.16.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 +281 -205
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +125 -0
- package/dist/index.js +281 -205
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +281 -205
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -37
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +6 -6
- package/es/core/components/SxpPageRender/VideoWidget/index.js +44 -34
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +38 -47
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- package/es/core/hooks/useEventReport.js +5 -6
- package/es/materials/sxp/template/NineCommodity/index.d.ts +18 -0
- package/es/materials/sxp/template/NineCommodity/index.js +39 -0
- package/es/materials/sxp/template/NineCommodity/interactionRender.d.ts +9 -0
- package/es/materials/sxp/template/NineCommodity/interactionRender.js +12 -0
- package/es/materials/sxp/template/NineCommodity/material.d.ts +2 -0
- package/es/materials/sxp/template/NineCommodity/material.js +52 -0
- package/es/materials/sxp/template/index.d.ts +1 -0
- package/es/materials/sxp/template/index.js +1 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/LikeButton/index.js +15 -17
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -36
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +6 -6
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +44 -34
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +38 -47
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.js +5 -6
- package/lib/materials/sxp/template/NineCommodity/index.d.ts +18 -0
- package/lib/materials/sxp/template/NineCommodity/index.js +41 -0
- package/lib/materials/sxp/template/NineCommodity/interactionRender.d.ts +9 -0
- package/lib/materials/sxp/template/NineCommodity/interactionRender.js +14 -0
- package/lib/materials/sxp/template/NineCommodity/material.d.ts +2 -0
- package/lib/materials/sxp/template/NineCommodity/material.js +56 -0
- package/lib/materials/sxp/template/index.d.ts +1 -0
- package/lib/materials/sxp/template/index.js +1 -0
- package/package.json +1 -1
@@ -42,7 +42,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
42
42
|
const skipLinkRef = useRef(false);
|
43
43
|
const [pageNum, setPageNum] = useState(2);
|
44
44
|
const videoWidgetRef = useRef(null);
|
45
|
-
const pictureGroupRef = useRef(null);
|
46
45
|
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, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
|
47
46
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
48
47
|
const isShowFingerTip = useMemo(() => {
|
@@ -90,7 +89,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
90
89
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
91
90
|
}, [data, ctaType, swiperRef]);
|
92
91
|
const handleSessionCompleted = useCallback((fk) => {
|
93
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
92
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
94
93
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
95
94
|
let fromKName = '';
|
96
95
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
@@ -117,13 +116,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
117
116
|
eventSubject: 'sessionCompleted',
|
118
117
|
eventDescription: 'Session completed',
|
119
118
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
120
|
-
|
121
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
119
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
122
120
|
position: activeIndex + '',
|
123
121
|
fromKName: fk || fromKName,
|
124
122
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
125
|
-
ctatId: (
|
126
|
-
traceInfo: (
|
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 : '',
|
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 : ''
|
127
125
|
}
|
128
126
|
});
|
129
127
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -179,9 +177,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
179
177
|
refreshFeSession
|
180
178
|
]);
|
181
179
|
const handleSessionExpire = useCallback(debounce(() => {
|
182
|
-
var _a
|
180
|
+
var _a;
|
183
181
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
184
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
185
182
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
186
183
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
187
184
|
useEffect(() => {
|
@@ -251,18 +248,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
251
248
|
return null;
|
252
249
|
}, [globalConfig, activeIndex, visList]);
|
253
250
|
const renderContent = useCallback((rec, index) => {
|
254
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
251
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
255
252
|
if (rec === 'organic menu') {
|
256
253
|
return (React.createElement(MultiPosts, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
257
254
|
}
|
258
|
-
if ((
|
255
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
259
256
|
return (React.createElement(VideoWidget, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef })));
|
260
257
|
}
|
261
|
-
if ((
|
262
|
-
return (React.createElement(PictureGroup,
|
258
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
259
|
+
return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
263
260
|
}
|
264
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
265
|
-
return (
|
261
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
262
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
266
263
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
267
264
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
268
265
|
const Component = withBindDataSource(t);
|
@@ -300,7 +297,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
300
297
|
};
|
301
298
|
}, [isShowMore]);
|
302
299
|
const renderBottom = useCallback((rec, index) => {
|
303
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
300
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
304
301
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
305
302
|
let cta = null;
|
306
303
|
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
@@ -309,23 +306,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
309
306
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
310
307
|
cta = '商品CTA';
|
311
308
|
}
|
312
|
-
else if (tempMap && ((_d = Object.keys(tempMap)) === null || _d === void 0 ? void 0 : _d.includes('服务CTA')) && ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId)) {
|
313
|
-
cta = '服务CTA';
|
314
|
-
}
|
315
309
|
else {
|
316
|
-
cta = (
|
310
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
317
311
|
}
|
318
312
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
313
|
+
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) && index === 1;
|
319
314
|
return (React.createElement(React.Fragment, null,
|
320
|
-
((
|
321
|
-
|
315
|
+
isNineProduct && (React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
316
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
317
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px` } },
|
322
318
|
React.createElement(Nudge, { nudge: nudge }),
|
323
|
-
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
319
|
+
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
324
320
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
325
321
|
React.createElement("div", null,
|
326
|
-
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
322
|
+
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
327
323
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
328
|
-
React.createElement(Hashtag, { index: activeIndex, tags: (
|
324
|
+
React.createElement(Hashtag, { index: activeIndex, tags: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.hashTags) !== null && _l !== void 0 ? _l : [], itemId: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.itemId, itemType: ((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
329
325
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
330
326
|
}
|
331
327
|
return null;
|
@@ -363,7 +359,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
363
359
|
return null;
|
364
360
|
}, [globalConfig, waterFallData]);
|
365
361
|
const handleViewImageStartEnd = (item) => {
|
366
|
-
var _a, _b, _c, _d, _e, _f
|
362
|
+
var _a, _b, _c, _d, _e, _f;
|
367
363
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
368
364
|
const endTime = Date.now();
|
369
365
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -372,11 +368,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
372
368
|
eventSubject: 'viewImageCarouselEnd',
|
373
369
|
eventDescription: 'User end view the image carousel',
|
374
370
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
375
|
-
|
376
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
371
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
377
372
|
imageEndTime: `${endTime}`,
|
378
373
|
playDuration: `${duration}`,
|
379
|
-
contentTags: JSON.stringify((
|
374
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
380
375
|
position: activeIndex + '',
|
381
376
|
contentFormat: 'image',
|
382
377
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -385,7 +380,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
385
380
|
}
|
386
381
|
};
|
387
382
|
const handleSlideSkip = (item, position) => {
|
388
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
383
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
389
384
|
if (isPreview || waterFallData)
|
390
385
|
return;
|
391
386
|
const t = new Date() - curTime.current;
|
@@ -411,8 +406,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
411
406
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
412
407
|
position: position + '',
|
413
408
|
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
414
|
-
|
415
|
-
traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
|
409
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
416
410
|
contentFormat
|
417
411
|
}
|
418
412
|
});
|
@@ -422,7 +416,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
422
416
|
}
|
423
417
|
};
|
424
418
|
const handleScrollEvent = (swiper) => {
|
425
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
419
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
426
420
|
const item = data[swiper.previousIndex];
|
427
421
|
if (!item)
|
428
422
|
return;
|
@@ -439,12 +433,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
439
433
|
eventSubject: 'scrollDown',
|
440
434
|
eventDescription: 'User scroll down',
|
441
435
|
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
442
|
-
|
443
|
-
productId: (_k = (_j = item === null || item === void 0 ? void 0 : item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
436
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
444
437
|
requestId: null,
|
445
|
-
traceInfo: (
|
438
|
+
traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
|
446
439
|
contentFormat,
|
447
|
-
position: ((
|
440
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
448
441
|
}
|
449
442
|
});
|
450
443
|
handleViewImageStartEnd(item);
|
@@ -455,13 +448,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
455
448
|
eventInfo: {
|
456
449
|
eventSubject: 'scrollUp',
|
457
450
|
eventDescription: 'User scroll up',
|
458
|
-
contentId: (
|
459
|
-
|
460
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
451
|
+
contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
452
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
461
453
|
requestId: null,
|
462
|
-
traceInfo: (
|
454
|
+
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 : '',
|
463
455
|
contentFormat,
|
464
|
-
position: ((
|
456
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
465
457
|
}
|
466
458
|
});
|
467
459
|
handleViewImageStartEnd(item);
|
@@ -485,7 +477,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
485
477
|
}
|
486
478
|
}, [openHashtag, data, activeIndex]);
|
487
479
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
488
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
480
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
489
481
|
const item = data[activeIndex];
|
490
482
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
491
483
|
const startTime = Date.now();
|
@@ -495,10 +487,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
495
487
|
eventSubject: 'viewImageCarouselStart',
|
496
488
|
eventDescription: 'User start view the image carousel',
|
497
489
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
498
|
-
|
499
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
490
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
500
491
|
imageStartTime: `${startTime}`,
|
501
|
-
contentTags: JSON.stringify((
|
492
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
502
493
|
position: activeIndex + '',
|
503
494
|
contentFormat: 'image',
|
504
495
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -508,11 +499,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
508
499
|
if (enableCapi) {
|
509
500
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
510
501
|
eventName: 'ViewContent',
|
511
|
-
product: (
|
502
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
512
503
|
});
|
513
504
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
514
505
|
eventName: 'PageView',
|
515
|
-
product: (
|
506
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
516
507
|
});
|
517
508
|
}
|
518
509
|
}
|
@@ -449,7 +449,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
449
449
|
}
|
450
450
|
}), [bffFetch, utmVal]);
|
451
451
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
452
|
-
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
|
452
|
+
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;
|
453
453
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
454
454
|
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);
|
455
455
|
let fromKName = '';
|
@@ -467,7 +467,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
467
467
|
}
|
468
468
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.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 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
|
469
469
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
470
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
470
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
471
471
|
});
|
472
472
|
}, [bffEventReport, isFromHashtag]);
|
473
473
|
const h5EnterLink = useCallback(() => {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { useCallback } from 'react';
|
2
|
-
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
3
2
|
import { useSxpDataSource } from './useSxpDataSource';
|
3
|
+
import { DEFAULT_TAG } from '../context/SxpDataSourceProvider';
|
4
4
|
export function useEventReport() {
|
5
5
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
6
6
|
const jumpToWeb = useCallback((e, 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, _10, _11, _12, _13
|
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
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
9
9
|
if (i !== -1) {
|
10
10
|
return;
|
@@ -37,11 +37,11 @@ export function useEventReport() {
|
|
37
37
|
contentFormat = 'image';
|
38
38
|
}
|
39
39
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
40
|
-
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 : '',
|
40
|
+
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
41
|
});
|
42
42
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
43
43
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
44
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
45
45
|
let fromKName = '';
|
46
46
|
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))) {
|
47
47
|
fromKName = 'pdpPage';
|
@@ -60,9 +60,8 @@ export function useEventReport() {
|
|
60
60
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
61
61
|
position: position + '',
|
62
62
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
63
|
-
sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
64
63
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
65
|
-
traceInfo: (
|
64
|
+
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 : '',
|
66
65
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
67
66
|
eventSubject: 'productView',
|
68
67
|
eventDescription: 'User browsed the product'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ICtaTempStylesType } from '../components/typing';
|
3
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
4
|
+
export interface INineCommodityProps {
|
5
|
+
content?: string;
|
6
|
+
style?: Record<string, any>;
|
7
|
+
bgImg?: Record<string, any> | string;
|
8
|
+
recData?: RecItemType;
|
9
|
+
onClick?: () => void;
|
10
|
+
bottom_image?: string;
|
11
|
+
ctaTempStyles?: ICtaTempStylesType;
|
12
|
+
isExternalLink?: boolean;
|
13
|
+
index?: number;
|
14
|
+
translateY?: number;
|
15
|
+
isActive?: boolean;
|
16
|
+
}
|
17
|
+
declare const _default: React.NamedExoticComponent<INineCommodityProps>;
|
18
|
+
export default _default;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import React, { memo, useState } from 'react';
|
3
|
+
import Img from '../components/Img';
|
4
|
+
import EventProvider from '../components/EventProvider';
|
5
|
+
import styles from './index.module.less';
|
6
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
7
|
+
import { setFontForText } from '../../../../core/utils/tool';
|
8
|
+
const NineCommodity = (_a) => {
|
9
|
+
var _b, _c;
|
10
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
11
|
+
const { sxpParameter } = useSxpDataSource();
|
12
|
+
const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [{}, {}, {}, {}, {}, {}, {}, {}, {}]);
|
13
|
+
return (React.createElement("div", { className: styles.nineProduct },
|
14
|
+
React.createElement("div", { className: styles.gridContainer }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
15
|
+
var _a, _b, _c, _d, _e, _f;
|
16
|
+
if (itemIndex < 9) {
|
17
|
+
return (React.createElement(React.Fragment, { key: itemIndex }, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", { className: styles.gridItem, role: 'listitem' },
|
18
|
+
React.createElement("div", { className: styles.gridBox },
|
19
|
+
React.createElement(EventProvider, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex, index: index }, props, { style: {
|
20
|
+
flexDirection: 'column',
|
21
|
+
width: '100%',
|
22
|
+
height: 'auto'
|
23
|
+
} }),
|
24
|
+
React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: {
|
25
|
+
aspectRatio: '1/1',
|
26
|
+
objectFit: 'cover',
|
27
|
+
width: '100%',
|
28
|
+
display: 'block'
|
29
|
+
}, isActive: isActive }),
|
30
|
+
React.createElement("div", { className: styles.buttonWrapper, "aria-label": (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now', dangerouslySetInnerHTML: {
|
31
|
+
__html: setFontForText("item?.bindCta?.enTitle ?? 'Shop Now', ctaTempStyles?.ctaTitle")
|
32
|
+
} })))))));
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
return null;
|
36
|
+
}
|
37
|
+
}))));
|
38
|
+
};
|
39
|
+
export default memo(NineCommodity);
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import settingRender from '../components/settingRender';
|
2
|
+
import interactionRender from './interactionRender';
|
3
|
+
import NineCommodityComponent from '.';
|
4
|
+
import { createMaterial } from '../../../../core/create';
|
5
|
+
const NineCommodity = createMaterial(NineCommodityComponent, {
|
6
|
+
displayName: '推荐多商品-透明底',
|
7
|
+
icon: '',
|
8
|
+
category: 'template',
|
9
|
+
type: 'NineCommodity',
|
10
|
+
related: {
|
11
|
+
interactionRender,
|
12
|
+
settingRender,
|
13
|
+
bindableProps: []
|
14
|
+
},
|
15
|
+
defaulSetting: {
|
16
|
+
props: {
|
17
|
+
ctaTempStyles: {
|
18
|
+
img: {
|
19
|
+
borderRadius: 3,
|
20
|
+
width: 60,
|
21
|
+
height: 60,
|
22
|
+
marginRight: 8
|
23
|
+
},
|
24
|
+
title: {
|
25
|
+
fontSize: 12,
|
26
|
+
color: '#fff',
|
27
|
+
textAlign: 'left'
|
28
|
+
},
|
29
|
+
ctaTitle: {
|
30
|
+
fontSize: 10,
|
31
|
+
color: '#fff',
|
32
|
+
textAlign: 'center',
|
33
|
+
width: 130,
|
34
|
+
height: 20,
|
35
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
36
|
+
}
|
37
|
+
}
|
38
|
+
},
|
39
|
+
style: {
|
40
|
+
padding: 7,
|
41
|
+
width: 236,
|
42
|
+
height: 74,
|
43
|
+
borderRadius: 3,
|
44
|
+
backgroundColor: 'rgba(0,0,0,.3)',
|
45
|
+
marginBottom: 8
|
46
|
+
}
|
47
|
+
},
|
48
|
+
w: 100,
|
49
|
+
h: 40,
|
50
|
+
sort: 3
|
51
|
+
});
|
52
|
+
export { NineCommodity };
|
@@ -25,7 +25,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
25
25
|
}, []);
|
26
26
|
const PAUSE_ICON = (0, useIconLink_1.useIconLink)('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
27
27
|
const handlePlaying = (0, react_1.useCallback)(() => {
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
29
29
|
setIsPauseVideo(false);
|
30
30
|
const item = data[index];
|
31
31
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -38,15 +38,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
38
38
|
eventSubject: 'playVideo',
|
39
39
|
eventDescription: 'User played the video',
|
40
40
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
41
|
-
|
42
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
41
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
43
42
|
playType,
|
44
43
|
startTime: videoCurrentTime,
|
45
44
|
videoDuration,
|
46
|
-
contentTags: JSON.stringify((
|
45
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
47
46
|
position: index + '',
|
48
47
|
contentFormat: 'video',
|
49
|
-
traceInfo: (
|
48
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
50
49
|
}
|
51
50
|
});
|
52
51
|
setIsFirstPlay(false);
|
@@ -85,7 +84,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
85
84
|
}
|
86
85
|
}, [isLoadFinish]);
|
87
86
|
const onPause = (0, react_1.useCallback)(() => {
|
88
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
89
88
|
const item = data[index];
|
90
89
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
91
90
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -96,15 +95,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
96
95
|
eventSubject: 'playOverVideo',
|
97
96
|
eventDescription: 'User finished playing the video',
|
98
97
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
99
|
-
|
100
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
98
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
101
99
|
endTime: videoCurrentTime,
|
102
100
|
videoDuration,
|
103
101
|
playDuration,
|
104
|
-
contentTags: JSON.stringify((
|
102
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
105
103
|
position: index + '',
|
106
104
|
contentFormat: 'video',
|
107
|
-
traceInfo: (
|
105
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
108
106
|
}
|
109
107
|
});
|
110
108
|
}
|