pb-sxp-ui 1.16.19 → 1.16.20
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 +192 -228
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +192 -228
- 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 +192 -228
- 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 +16 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
- package/es/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +37 -53
- package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/es/core/context/SxpDataSourceProvider.js +63 -63
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +37 -53
- package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/lib/core/context/SxpDataSourceProvider.js +63 -63
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
@@ -45,7 +45,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
45
45
|
const skipLinkRef = (0, react_1.useRef)(false);
|
46
46
|
const [pageNum, setPageNum] = (0, react_1.useState)(2);
|
47
47
|
const videoWidgetRef = (0, react_1.useRef)(null);
|
48
|
-
const pictureGroupRef = (0, react_1.useRef)(null);
|
49
48
|
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 } = (0, hooks_1.useSxpDataSource)();
|
50
49
|
const { backMainFeed, productView, jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
51
50
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
@@ -93,7 +92,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
93
92
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
94
93
|
}, [data, ctaType, swiperRef]);
|
95
94
|
const handleSessionCompleted = (0, react_1.useCallback)((fk) => {
|
96
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
95
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
97
96
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
98
97
|
let fromKName = '';
|
99
98
|
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))) {
|
@@ -120,13 +119,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
120
119
|
eventSubject: 'sessionCompleted',
|
121
120
|
eventDescription: 'Session completed',
|
122
121
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
123
|
-
|
124
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
122
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
125
123
|
position: activeIndex + '',
|
126
124
|
fromKName: fk || fromKName,
|
127
125
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
128
|
-
ctatId: (
|
129
|
-
traceInfo: (
|
126
|
+
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 : '',
|
127
|
+
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 : ''
|
130
128
|
}
|
131
129
|
});
|
132
130
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -182,9 +180,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
182
180
|
refreshFeSession
|
183
181
|
]);
|
184
182
|
const handleSessionExpire = (0, react_1.useCallback)((0, lodash_1.debounce)(() => {
|
185
|
-
var _a
|
183
|
+
var _a;
|
186
184
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
187
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
188
185
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
189
186
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
190
187
|
(0, react_1.useEffect)(() => {
|
@@ -254,18 +251,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
254
251
|
return null;
|
255
252
|
}, [globalConfig, activeIndex, visList]);
|
256
253
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
257
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
254
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
258
255
|
if (rec === 'organic menu') {
|
259
256
|
return (react_1.default.createElement(MultiPosts_1.default, 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)));
|
260
257
|
}
|
261
|
-
if ((
|
258
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
262
259
|
return (react_1.default.createElement(VideoWidget_1.default, 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 })));
|
263
260
|
}
|
264
|
-
if ((
|
265
|
-
return (react_1.default.createElement(PictureGroup_1.default,
|
261
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
262
|
+
return (react_1.default.createElement(PictureGroup_1.default, { 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 }));
|
266
263
|
}
|
267
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
268
|
-
return (
|
264
|
+
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) {
|
265
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
269
266
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
270
267
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
271
268
|
const Component = (0, withBindDataSource_1.default)(t);
|
@@ -303,7 +300,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
303
300
|
};
|
304
301
|
}, [isShowMore]);
|
305
302
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
306
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
307
304
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
308
305
|
let cta = null;
|
309
306
|
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) {
|
@@ -312,27 +309,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
312
309
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
313
310
|
cta = '商品CTA';
|
314
311
|
}
|
315
|
-
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)) {
|
316
|
-
cta = '服务CTA';
|
317
|
-
}
|
318
312
|
else {
|
319
|
-
cta = (
|
313
|
+
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;
|
320
314
|
}
|
321
315
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
322
316
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
323
317
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
324
|
-
((
|
318
|
+
((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
|
325
319
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
326
320
|
isNineProduct && (react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
327
|
-
((
|
328
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
321
|
+
((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
322
|
+
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
329
323
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
330
324
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
331
325
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
332
326
|
react_1.default.createElement("div", null,
|
333
|
-
react_1.default.createElement(ExpandableText_1.default, { 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: (
|
327
|
+
react_1.default.createElement(ExpandableText_1.default, { 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: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', 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 }),
|
334
328
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
335
|
-
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (
|
329
|
+
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
336
330
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
337
331
|
}
|
338
332
|
return null;
|
@@ -371,7 +365,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
371
365
|
return null;
|
372
366
|
}, [globalConfig, waterFallData]);
|
373
367
|
const handleViewImageStartEnd = (item) => {
|
374
|
-
var _a, _b, _c, _d, _e, _f
|
368
|
+
var _a, _b, _c, _d, _e, _f;
|
375
369
|
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)) {
|
376
370
|
const endTime = Date.now();
|
377
371
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -380,11 +374,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
380
374
|
eventSubject: 'viewImageCarouselEnd',
|
381
375
|
eventDescription: 'User end view the image carousel',
|
382
376
|
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 : '',
|
383
|
-
|
384
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
377
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
385
378
|
imageEndTime: `${endTime}`,
|
386
379
|
playDuration: `${duration}`,
|
387
|
-
contentTags: JSON.stringify((
|
380
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
388
381
|
position: activeIndex + '',
|
389
382
|
contentFormat: 'image',
|
390
383
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -393,7 +386,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
393
386
|
}
|
394
387
|
};
|
395
388
|
const handleSlideSkip = (item, position) => {
|
396
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
389
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
397
390
|
if (isPreview || waterFallData)
|
398
391
|
return;
|
399
392
|
const t = new Date() - curTime.current;
|
@@ -419,8 +412,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
419
412
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
420
413
|
position: position + '',
|
421
414
|
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 : '',
|
422
|
-
|
423
|
-
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 : '',
|
415
|
+
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 : '',
|
424
416
|
contentFormat
|
425
417
|
}
|
426
418
|
});
|
@@ -430,7 +422,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
430
422
|
}
|
431
423
|
};
|
432
424
|
const handleScrollEvent = (swiper) => {
|
433
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
425
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
434
426
|
const item = data[swiper.previousIndex];
|
435
427
|
if (!item)
|
436
428
|
return;
|
@@ -447,12 +439,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
447
439
|
eventSubject: 'scrollDown',
|
448
440
|
eventDescription: 'User scroll down',
|
449
441
|
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 : '',
|
450
|
-
|
451
|
-
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 : '',
|
442
|
+
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 : '',
|
452
443
|
requestId: null,
|
453
|
-
traceInfo: (
|
444
|
+
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 : '',
|
454
445
|
contentFormat,
|
455
|
-
position: ((
|
446
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
456
447
|
}
|
457
448
|
});
|
458
449
|
handleViewImageStartEnd(item);
|
@@ -463,13 +454,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
463
454
|
eventInfo: {
|
464
455
|
eventSubject: 'scrollUp',
|
465
456
|
eventDescription: 'User scroll up',
|
466
|
-
contentId: (
|
467
|
-
|
468
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
457
|
+
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 : '',
|
458
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
469
459
|
requestId: null,
|
470
|
-
traceInfo: (
|
460
|
+
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 : '',
|
471
461
|
contentFormat,
|
472
|
-
position: ((
|
462
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
473
463
|
}
|
474
464
|
});
|
475
465
|
handleViewImageStartEnd(item);
|
@@ -493,7 +483,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
493
483
|
}
|
494
484
|
}, [openHashtag, data, activeIndex]);
|
495
485
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
496
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
497
487
|
const item = data[activeIndex];
|
498
488
|
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)) {
|
499
489
|
const startTime = Date.now();
|
@@ -503,10 +493,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
503
493
|
eventSubject: 'viewImageCarouselStart',
|
504
494
|
eventDescription: 'User start view the image carousel',
|
505
495
|
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 : '',
|
506
|
-
|
507
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
496
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
508
497
|
imageStartTime: `${startTime}`,
|
509
|
-
contentTags: JSON.stringify((
|
498
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
510
499
|
position: activeIndex + '',
|
511
500
|
contentFormat: 'image',
|
512
501
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -516,11 +505,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
516
505
|
if (enableCapi) {
|
517
506
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
518
507
|
eventName: 'ViewContent',
|
519
|
-
product: (
|
508
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
520
509
|
});
|
521
510
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
522
511
|
eventName: 'PageView',
|
523
|
-
product: (
|
512
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
524
513
|
});
|
525
514
|
}
|
526
515
|
}
|
@@ -612,19 +601,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
612
601
|
swiperRef.current.swiper.allowTouchMove = true;
|
613
602
|
}, 500);
|
614
603
|
}, onActiveIndexChange: (swiper) => {
|
615
|
-
var _a, _b;
|
616
604
|
setActiveIndex(swiper.activeIndex);
|
617
605
|
if (openHashtag)
|
618
606
|
return;
|
619
607
|
handleScrollEvent(swiper);
|
620
|
-
if (waterFallData || isEditor)
|
608
|
+
if (waterFallData || isEditor || isDiyH5)
|
621
609
|
return;
|
622
610
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
623
611
|
if (!isLoadMore) {
|
624
|
-
if (isDiyH5) {
|
625
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
626
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
627
|
-
}
|
628
612
|
setIsLoadMore(true);
|
629
613
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
630
614
|
var _a;
|
@@ -21,8 +21,12 @@ export interface ISxpDataSourceContext {
|
|
21
21
|
value: string;
|
22
22
|
}>;
|
23
23
|
}) => Promise<boolean | undefined>;
|
24
|
-
mutateUnlike?: (body:
|
25
|
-
|
24
|
+
mutateUnlike?: (body: {
|
25
|
+
videoItemId: string;
|
26
|
+
}) => Promise<boolean>;
|
27
|
+
mutateLike?: (body: {
|
28
|
+
content: string;
|
29
|
+
}) => Promise<boolean>;
|
26
30
|
popupDetailData?: RecItemType;
|
27
31
|
setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
|
28
32
|
loadVideos?: (page: number) => Promise<RecommendVideoResultType | undefined>;
|
@@ -89,7 +93,6 @@ export interface ISxpDataSourceContext {
|
|
89
93
|
getAccount?: () => Promise<any>;
|
90
94
|
accountSonsent?: (v: boolean) => Promise<boolean>;
|
91
95
|
isDiyH5?: boolean;
|
92
|
-
firstRtcList?: RecItemType[];
|
93
96
|
}
|
94
97
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
95
98
|
export interface SxpDataSourceProviderProps {
|
@@ -103,8 +106,12 @@ export interface SxpDataSourceProviderProps {
|
|
103
106
|
value: string;
|
104
107
|
}>;
|
105
108
|
}) => Promise<boolean | undefined>;
|
106
|
-
mutateUnlike: (body:
|
107
|
-
|
109
|
+
mutateUnlike: (body: {
|
110
|
+
videoItemId: string;
|
111
|
+
}) => Promise<boolean>;
|
112
|
+
mutateLike: (body: {
|
113
|
+
content: string;
|
114
|
+
}) => Promise<boolean>;
|
108
115
|
pageData?: PageData;
|
109
116
|
}) => ReactNode;
|
110
117
|
utmVal?: string;
|
@@ -23,7 +23,6 @@ exports.DEFAULT_TAG = 'FOR U';
|
|
23
23
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, isDiyH5, onUpdateSchema, onUpdateChannel }) => {
|
24
24
|
var _a, _b, _c, _d, _e;
|
25
25
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
26
|
-
const [firstRtcList, setFirstRtcList] = (0, react_1.useState)([]);
|
27
26
|
const [tagList, setTagList] = (0, react_1.useState)([]);
|
28
27
|
const [loading, setLoading] = (0, react_1.useState)(true);
|
29
28
|
const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
|
@@ -110,7 +109,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
110
109
|
return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + (0, localStore_1.storeAndLoadFeUserId)();
|
111
110
|
}, [bffDataSource]);
|
112
111
|
const bffFetch = (0, react_1.useCallback)((path, options, isBota = true) => {
|
113
|
-
var _a
|
112
|
+
var _a;
|
114
113
|
if (!bffDataSource)
|
115
114
|
return;
|
116
115
|
const url = bffDataSource.url;
|
@@ -125,9 +124,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
125
124
|
const value = val.split('=')[1];
|
126
125
|
params[key] = value;
|
127
126
|
});
|
128
|
-
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
129
127
|
return window
|
130
|
-
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId
|
128
|
+
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
|
131
129
|
? JSON.stringify({
|
132
130
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
133
131
|
})
|
@@ -247,45 +245,64 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
247
245
|
console.error('解析请求URL失败:', error);
|
248
246
|
return _originalFetch.apply(this, arguments_1);
|
249
247
|
}
|
250
|
-
if (!url.includes('https://www.google-analytics.com/g/collect')) {
|
251
|
-
return _originalFetch.apply(this, arguments_1);
|
252
|
-
}
|
253
248
|
try {
|
254
249
|
const response = _originalFetch.apply(this, arguments_1);
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
250
|
+
if (url.includes('https://i.giesswein.com/nb-collector')) {
|
251
|
+
if ((init === null || init === void 0 ? void 0 : init.method) === 'POST' && typeof (init === null || init === void 0 ? void 0 : init.body) === 'string') {
|
252
|
+
try {
|
253
|
+
const payload = JSON.parse(init.body);
|
254
|
+
if (payload && Array.isArray(payload.data)) {
|
255
|
+
payload.data.forEach((item) => {
|
256
|
+
if (item && item.e) {
|
257
|
+
bffCollectEvent({
|
258
|
+
eventName: item.e,
|
259
|
+
eventSource: 'Northbeam Pixel'
|
260
|
+
});
|
261
|
+
}
|
262
|
+
});
|
263
|
+
}
|
268
264
|
}
|
269
|
-
|
270
|
-
|
271
|
-
let match;
|
272
|
-
while ((match = regex.exec(queryString)) !== null) {
|
273
|
-
matches.push(decodeURIComponent(match[1]));
|
265
|
+
catch (e) {
|
266
|
+
console.error('Failed to parse Northbeam event', e);
|
274
267
|
}
|
275
|
-
return matches;
|
276
268
|
}
|
277
|
-
|
278
|
-
|
269
|
+
}
|
270
|
+
if (url.includes('https://www.google-analytics.com/g/collect')) {
|
271
|
+
const urlObj = new URL(url);
|
272
|
+
const params = Object.fromEntries(urlObj.searchParams.entries());
|
273
|
+
const body = (_a = arguments_1[1]) === null || _a === void 0 ? void 0 : _a.body;
|
274
|
+
if (params === null || params === void 0 ? void 0 : params.en) {
|
279
275
|
bffCollectEvent({
|
280
|
-
eventName: en,
|
276
|
+
eventName: params === null || params === void 0 ? void 0 : params.en,
|
281
277
|
eventSource: 'Google Analytics'
|
282
278
|
});
|
283
|
-
}
|
279
|
+
}
|
280
|
+
else if (body) {
|
281
|
+
function extractAllEnValuesSplit(queryString) {
|
282
|
+
if (typeof queryString !== 'string') {
|
283
|
+
return [];
|
284
|
+
}
|
285
|
+
const matches = [];
|
286
|
+
const regex = /en=([^&\r\n]*)/g;
|
287
|
+
let match;
|
288
|
+
while ((match = regex.exec(queryString)) !== null) {
|
289
|
+
matches.push(decodeURIComponent(match[1]));
|
290
|
+
}
|
291
|
+
return matches;
|
292
|
+
}
|
293
|
+
const enValues = extractAllEnValuesSplit(body);
|
294
|
+
enValues === null || enValues === void 0 ? void 0 : enValues.forEach((en) => {
|
295
|
+
bffCollectEvent({
|
296
|
+
eventName: en,
|
297
|
+
eventSource: 'Google Analytics'
|
298
|
+
});
|
299
|
+
});
|
300
|
+
}
|
284
301
|
}
|
285
302
|
return response;
|
286
303
|
}
|
287
304
|
catch (error) {
|
288
|
-
console.error(
|
305
|
+
console.error(error);
|
289
306
|
throw error;
|
290
307
|
}
|
291
308
|
});
|
@@ -349,9 +366,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
349
366
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
350
367
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
351
368
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
352
|
-
if (isDiyH5) {
|
353
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
354
|
-
}
|
355
369
|
}
|
356
370
|
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
357
371
|
if (isNotNullList) {
|
@@ -391,17 +405,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
391
405
|
if (rtcList.length <= 0) {
|
392
406
|
return;
|
393
407
|
}
|
394
|
-
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
395
|
-
setRtcList(rtcList.concat(firstRtcList));
|
396
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
397
|
-
return;
|
398
|
-
}
|
399
408
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
400
409
|
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
401
410
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
402
411
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
403
412
|
return data;
|
404
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
413
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
405
414
|
const refreshFeSession = (0, react_1.useCallback)((enableReSid, event) => {
|
406
415
|
var _a, _b, _c, _d, _e;
|
407
416
|
let expire = false;
|
@@ -429,9 +438,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
429
438
|
return;
|
430
439
|
}
|
431
440
|
if (!userInfo) {
|
432
|
-
userInfo = {
|
433
|
-
productUserId: fakeUserId
|
434
|
-
};
|
441
|
+
userInfo = {};
|
435
442
|
}
|
436
443
|
const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
|
437
444
|
const params = {};
|
@@ -464,8 +471,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
464
471
|
layoutVariantId,
|
465
472
|
globalConfig,
|
466
473
|
playbookType,
|
467
|
-
bffDataSource
|
468
|
-
fakeUserId
|
474
|
+
bffDataSource
|
469
475
|
]);
|
470
476
|
const getEventParamsByJson = (0, react_1.useCallback)((json, product) => {
|
471
477
|
var _a, _b, _c;
|
@@ -529,7 +535,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
529
535
|
return jsonParams;
|
530
536
|
}, [fakeUserId]);
|
531
537
|
const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
|
532
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
538
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
533
539
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
534
540
|
return;
|
535
541
|
}
|
@@ -576,18 +582,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
576
582
|
if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
|
577
583
|
window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
|
578
584
|
}
|
579
|
-
|
585
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_f = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _f === void 0 ? void 0 : _f.trackPageView) === 'function') {
|
586
|
+
window === null || window === void 0 ? void 0 : window.Northbeam.trackPageView();
|
587
|
+
}
|
588
|
+
const converApiEventParamsJson = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _g === void 0 ? void 0 : _g[eventName];
|
580
589
|
if (enabledMetaConversionApi && converApiEventParamsJson) {
|
581
590
|
const body = getEventParamsByJson(converApiEventParamsJson, product);
|
582
591
|
const params = {};
|
583
592
|
const queryString = location.search.slice(1);
|
584
|
-
(
|
593
|
+
(_h = (0, tool_1.splitUrlParams)(queryString)) === null || _h === void 0 ? void 0 : _h.forEach((val) => {
|
585
594
|
const key = val.split('=')[0];
|
586
595
|
const value = val.split('=')[1];
|
587
596
|
params[key] = value;
|
588
597
|
});
|
589
598
|
const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
|
590
|
-
bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(
|
599
|
+
bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_j = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _j === void 0 ? void 0 : _j['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
|
591
600
|
method: 'POST',
|
592
601
|
body,
|
593
602
|
type: 'beacon'
|
@@ -595,15 +604,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
595
604
|
}
|
596
605
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
597
606
|
const bffMutateLike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
598
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
599
607
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
600
608
|
return res === null || res === void 0 ? void 0 : res.success;
|
601
|
-
}), [bffFetch
|
609
|
+
}), [bffFetch]);
|
602
610
|
const bffMutateUnlike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
603
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
604
611
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
605
612
|
return res === null || res === void 0 ? void 0 : res.success;
|
606
|
-
}), [bffFetch
|
613
|
+
}), [bffFetch]);
|
607
614
|
const bffSubmitForm = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
608
615
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
609
616
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -627,7 +634,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
627
634
|
}
|
628
635
|
}), [bffFetch, utmVal]);
|
629
636
|
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
630
|
-
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
|
637
|
+
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;
|
631
638
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
632
639
|
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);
|
633
640
|
let fromKName = '';
|
@@ -645,7 +652,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
645
652
|
}
|
646
653
|
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;
|
647
654
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
648
|
-
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 : '',
|
655
|
+
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 })
|
649
656
|
});
|
650
657
|
}, [bffEventReport, isFromHashtag]);
|
651
658
|
const h5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -747,9 +754,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
747
754
|
}
|
748
755
|
setRtcList(list);
|
749
756
|
setCacheRtcList(list);
|
750
|
-
if (isDiyH5) {
|
751
|
-
setFirstRtcList(list);
|
752
|
-
}
|
753
757
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
754
758
|
if (channel) {
|
755
759
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -784,9 +788,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
784
788
|
}
|
785
789
|
setRtcList(list);
|
786
790
|
setCacheRtcList(list);
|
787
|
-
if (isDiyH5) {
|
788
|
-
setFirstRtcList(list);
|
789
|
-
}
|
790
791
|
}
|
791
792
|
})
|
792
793
|
.finally(() => {
|
@@ -850,8 +851,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
850
851
|
refreshFeSession,
|
851
852
|
getAccount,
|
852
853
|
accountSonsent,
|
853
|
-
isDiyH5
|
854
|
-
firstRtcList
|
854
|
+
isDiyH5
|
855
855
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
856
856
|
rtcList,
|
857
857
|
mutateLike: bffMutateLike,
|