pb-sxp-ui 1.15.22 → 1.15.23-alpha.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 +103 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +103 -86
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +103 -86
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/es/core/components/SxpPageRender/LikeButton/index.js +17 -15
- package/es/core/components/SxpPageRender/VideoWidget/index.js +20 -18
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +42 -33
- package/es/core/context/SxpDataSourceProvider.js +2 -2
- package/es/core/hooks/useEventReport.js +6 -5
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/lib/core/components/SxpPageRender/LikeButton/index.js +17 -15
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +20 -18
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +42 -33
- package/lib/core/context/SxpDataSourceProvider.js +2 -2
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -1095,7 +1095,7 @@
|
|
1095
1095
|
}
|
1096
1096
|
}), [bffFetch, utmVal]);
|
1097
1097
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1098
|
-
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;
|
1098
|
+
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, _14;
|
1099
1099
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1100
1100
|
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);
|
1101
1101
|
let fromKName = '';
|
@@ -1113,7 +1113,7 @@
|
|
1113
1113
|
}
|
1114
1114
|
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;
|
1115
1115
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1116
|
-
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: (
|
1116
|
+
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 : '', sceneId: (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_13 = (_10 = (_5 = (_1 = (_y = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_4 = (_3 = (_2 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.bindCta) === null || _4 === void 0 ? void 0 : _4.traceInfo) !== null && _5 !== void 0 ? _5 : (_9 = (_8 = (_7 = (_6 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _6 === void 0 ? void 0 : _6.bindProducts) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '', fromKName, fromKPage: (_14 = location === null || location === void 0 ? void 0 : location.href) !== null && _14 !== void 0 ? _14 : '', contentFormat })
|
1117
1117
|
});
|
1118
1118
|
}, [bffEventReport, isFromHashtag]);
|
1119
1119
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1774,14 +1774,14 @@
|
|
1774
1774
|
* @Author: binruan@chatlabs.com
|
1775
1775
|
* @Date: 2024-03-12 10:59:06
|
1776
1776
|
* @LastEditors: binruan@chatlabs.com
|
1777
|
-
* @LastEditTime:
|
1777
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
1778
1778
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1779
1779
|
*
|
1780
1780
|
*/
|
1781
1781
|
function useEventReport() {
|
1782
1782
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1783
1783
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1784
|
-
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;
|
1784
|
+
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, _14, _15, _16;
|
1785
1785
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1786
1786
|
if (i !== -1) {
|
1787
1787
|
return;
|
@@ -1814,11 +1814,11 @@
|
|
1814
1814
|
contentFormat = 'image';
|
1815
1815
|
}
|
1816
1816
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1817
|
-
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 : '',
|
1817
|
+
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 : '', sceneId: (_2 = (_1 = (_0 = data === null || data === void 0 ? void 0 : data.video) === null || _0 === void 0 ? void 0 : _0.scene) === null || _1 === void 0 ? void 0 : _1.sceneId) !== null && _2 !== void 0 ? _2 : '', ctatId: (_3 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _3 !== void 0 ? _3 : '', traceInfo: (_16 = (_13 = (_11 = (_7 = (_4 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _4 !== void 0 ? _4 : (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProduct) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.video) === null || _8 === void 0 ? void 0 : _8.bindProducts) === null || _9 === void 0 ? void 0 : _9[0]) === null || _10 === void 0 ? void 0 : _10.traceInfo) !== null && _11 !== void 0 ? _11 : (_12 = data === null || data === void 0 ? void 0 : data.product) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_15 = (_14 = data === null || data === void 0 ? void 0 : data.video) === null || _14 === void 0 ? void 0 : _14.bindCta) === null || _15 === void 0 ? void 0 : _15.traceInfo) !== null && _16 !== void 0 ? _16 : '' }, (contentFormat && { contentFormat }))
|
1818
1818
|
});
|
1819
1819
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1820
1820
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1821
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1821
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
1822
1822
|
let fromKName = '';
|
1823
1823
|
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))) {
|
1824
1824
|
fromKName = 'pdpPage';
|
@@ -1837,8 +1837,9 @@
|
|
1837
1837
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1838
1838
|
position: position + '',
|
1839
1839
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1840
|
+
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 : '',
|
1840
1841
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1841
|
-
traceInfo: (
|
1842
|
+
traceInfo: (_s = (_q = (_l = (_h = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProducts) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_r = data === null || data === void 0 ? void 0 : data.product) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : '',
|
1842
1843
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1843
1844
|
eventSubject: 'productView',
|
1844
1845
|
eventDescription: 'User browsed the product'
|
@@ -15498,7 +15499,7 @@ Made in Italy` })));
|
|
15498
15499
|
* @Author: binruan@chatlabs.com
|
15499
15500
|
* @Date: 2024-01-10 10:58:24
|
15500
15501
|
* @LastEditors: binruan@chatlabs.com
|
15501
|
-
* @LastEditTime: 2025-
|
15502
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
15502
15503
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15503
15504
|
*
|
15504
15505
|
*/
|
@@ -15536,7 +15537,7 @@ Made in Italy` })));
|
|
15536
15537
|
}
|
15537
15538
|
}, [waterFallData]);
|
15538
15539
|
const reportTagsView = React.useCallback(() => {
|
15539
|
-
var _a, _b, _c, _d, _e, _f;
|
15540
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15540
15541
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15541
15542
|
if (!rec)
|
15542
15543
|
return;
|
@@ -15556,9 +15557,10 @@ Made in Italy` })));
|
|
15556
15557
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15557
15558
|
eventInfo: {
|
15558
15559
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15560
|
+
sceneId: (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
15559
15561
|
position: cacheActiveIndex + '',
|
15560
|
-
contentTags: JSON.stringify((
|
15561
|
-
traceInfo: (
|
15562
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
15563
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
15562
15564
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15563
15565
|
fromKName,
|
15564
15566
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17639,7 +17641,7 @@ Made in Italy` })));
|
|
17639
17641
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17640
17642
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17641
17643
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17642
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17644
|
+
var _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;
|
17643
17645
|
if (state) {
|
17644
17646
|
// 先设置状态
|
17645
17647
|
setState(false);
|
@@ -17649,11 +17651,12 @@ Made in Italy` })));
|
|
17649
17651
|
eventSubject: 'favoriteContentCanceled',
|
17650
17652
|
eventDescription: 'This content was unfavorite by the user',
|
17651
17653
|
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
17652
|
-
|
17653
|
-
|
17654
|
+
sceneId: (_k = (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '',
|
17655
|
+
contentName: (_m = (_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '',
|
17656
|
+
contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
|
17654
17657
|
position: position + '',
|
17655
|
-
contentFormat: ((
|
17656
|
-
traceInfo: (
|
17658
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
17659
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
17657
17660
|
}
|
17658
17661
|
});
|
17659
17662
|
// 如果接口调用失败,则回滚状态
|
@@ -17661,40 +17664,41 @@ Made in Italy` })));
|
|
17661
17664
|
setState(true);
|
17662
17665
|
}
|
17663
17666
|
else {
|
17664
|
-
const nRtcList = (
|
17667
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17665
17668
|
if (index === position) {
|
17666
17669
|
item.isCollected = false;
|
17667
17670
|
}
|
17668
17671
|
return item;
|
17669
|
-
})) !== null &&
|
17672
|
+
})) !== null && _s !== void 0 ? _s : [];
|
17670
17673
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17671
17674
|
}
|
17672
17675
|
}
|
17673
17676
|
else {
|
17674
17677
|
setState(true);
|
17675
|
-
const result = (
|
17678
|
+
const result = (_t = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _t !== void 0 ? _t : false;
|
17676
17679
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17677
17680
|
eventInfo: {
|
17678
17681
|
eventSubject: 'favoriteContent',
|
17679
17682
|
eventDescription: 'This content was favorite by the user',
|
17680
|
-
contentId: (
|
17681
|
-
|
17682
|
-
|
17683
|
+
contentId: (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.itemId) !== null && _v !== void 0 ? _v : '',
|
17684
|
+
sceneId: (_y = (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.scene) === null || _x === void 0 ? void 0 : _x.sceneId) !== null && _y !== void 0 ? _y : '',
|
17685
|
+
contentName: (_0 = (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.title) !== null && _0 !== void 0 ? _0 : '',
|
17686
|
+
contentTags: JSON.stringify((_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.tags) !== null && _2 !== void 0 ? _2 : []),
|
17683
17687
|
position: position + '',
|
17684
|
-
contentFormat: ((
|
17685
|
-
traceInfo: (
|
17688
|
+
contentFormat: ((_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.url) ? 'video' : 'image',
|
17689
|
+
traceInfo: (_4 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _4 === void 0 ? void 0 : _4.traceInfo
|
17686
17690
|
}
|
17687
17691
|
});
|
17688
17692
|
if (!result) {
|
17689
17693
|
setState(false);
|
17690
17694
|
}
|
17691
17695
|
else {
|
17692
|
-
const nRtcList = (
|
17696
|
+
const nRtcList = (_5 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17693
17697
|
if (index === position) {
|
17694
17698
|
item.isCollected = true;
|
17695
17699
|
}
|
17696
17700
|
return item;
|
17697
|
-
})) !== null &&
|
17701
|
+
})) !== null && _5 !== void 0 ? _5 : [];
|
17698
17702
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17699
17703
|
}
|
17700
17704
|
}
|
@@ -17805,7 +17809,7 @@ Made in Italy` })));
|
|
17805
17809
|
setIsLoadFinish(true);
|
17806
17810
|
}, []);
|
17807
17811
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
17808
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
17812
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
17809
17813
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17810
17814
|
return;
|
17811
17815
|
setIsPauseVideo(false);
|
@@ -17816,14 +17820,15 @@ Made in Italy` })));
|
|
17816
17820
|
const videoCurrentTime = ((_h = (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) !== null && _h !== void 0 ? _h : 0).toFixed(2);
|
17817
17821
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
17818
17822
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17819
|
-
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
17823
|
+
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', sceneId: (_o = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.scene) === null || _m === void 0 ? void 0 : _m.sceneId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
|
17820
17824
|
});
|
17821
17825
|
isFirstPlayRef.current = false;
|
17822
17826
|
}
|
17823
17827
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17824
17828
|
const setCurrentTimeByStartTime = React.useCallback(() => {
|
17829
|
+
var _a;
|
17825
17830
|
if (isDiyH5) {
|
17826
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
17831
|
+
videoRef.current.currentTime = (_a = scene === null || scene === void 0 ? void 0 : scene.startTime) !== null && _a !== void 0 ? _a : 0;
|
17827
17832
|
}
|
17828
17833
|
}, []);
|
17829
17834
|
const handLoadeddata = React.useCallback(() => {
|
@@ -17856,7 +17861,7 @@ Made in Italy` })));
|
|
17856
17861
|
handLoadeddata();
|
17857
17862
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
17858
17863
|
const handleClickVideo = React.useCallback((type) => () => {
|
17859
|
-
var _a, _b, _c, _d, _e, _f;
|
17864
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
17860
17865
|
if (!videoRef.current)
|
17861
17866
|
return;
|
17862
17867
|
if (!isLoadFinish)
|
@@ -17877,20 +17882,20 @@ Made in Italy` })));
|
|
17877
17882
|
break;
|
17878
17883
|
default:
|
17879
17884
|
if (isPause) {
|
17880
|
-
if (
|
17881
|
-
|
17885
|
+
if (Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= ((_e = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _e !== void 0 ? _e : (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.duration)) {
|
17886
|
+
setCurrentTimeByStartTime();
|
17882
17887
|
}
|
17883
|
-
(
|
17888
|
+
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.play();
|
17884
17889
|
}
|
17885
17890
|
else {
|
17886
|
-
(
|
17891
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.pause();
|
17887
17892
|
}
|
17888
17893
|
setIsPauseVideo(!isPause);
|
17889
17894
|
break;
|
17890
17895
|
}
|
17891
17896
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17892
17897
|
const handlePause = React.useCallback(() => {
|
17893
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
17898
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
17894
17899
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17895
17900
|
return;
|
17896
17901
|
if (activeIndex !== index)
|
@@ -17906,14 +17911,15 @@ Made in Italy` })));
|
|
17906
17911
|
eventSubject: 'playOverVideo',
|
17907
17912
|
eventDescription: 'User finished playing the video',
|
17908
17913
|
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 : '',
|
17909
|
-
|
17914
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
17915
|
+
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 : '',
|
17910
17916
|
endTime: videoCurrentTime,
|
17911
17917
|
videoDuration,
|
17912
17918
|
playDuration,
|
17913
|
-
contentTags: JSON.stringify((
|
17919
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
17914
17920
|
position: index + '',
|
17915
17921
|
contentFormat: 'video',
|
17916
|
-
traceInfo: (
|
17922
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
17917
17923
|
}
|
17918
17924
|
});
|
17919
17925
|
}
|
@@ -17925,17 +17931,17 @@ Made in Italy` })));
|
|
17925
17931
|
if (!videoRef.current || !isDiyH5)
|
17926
17932
|
return;
|
17927
17933
|
setTimeout(() => {
|
17928
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
17929
|
-
if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
17930
|
-
(
|
17934
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
17935
|
+
if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration)) {
|
17936
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
17931
17937
|
if (!loopPlayRef.current)
|
17932
17938
|
return;
|
17933
17939
|
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
17934
|
-
(
|
17940
|
+
(_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(0);
|
17935
17941
|
}
|
17936
17942
|
else {
|
17937
|
-
const i = (
|
17938
|
-
(
|
17943
|
+
const i = (_h = (_g = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _g === void 0 ? void 0 : _g.swiper) === null || _h === void 0 ? void 0 : _h.activeIndex;
|
17944
|
+
(_k = (_j = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _j === void 0 ? void 0 : _j.swiper) === null || _k === void 0 ? void 0 : _k.slideTo(i + 1);
|
17939
17945
|
}
|
17940
17946
|
}
|
17941
17947
|
});
|
@@ -18580,7 +18586,7 @@ Made in Italy` })));
|
|
18580
18586
|
* @Author: binruan@chatlabs.com
|
18581
18587
|
* @Date: 2024-03-20 10:27:31
|
18582
18588
|
* @LastEditors: binruan@chatlabs.com
|
18583
|
-
* @LastEditTime: 2025-05-
|
18589
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
18584
18590
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18585
18591
|
*
|
18586
18592
|
*/
|
@@ -18647,7 +18653,7 @@ Made in Italy` })));
|
|
18647
18653
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18648
18654
|
}, [data, ctaType, swiperRef]);
|
18649
18655
|
const handleSessionCompleted = React.useCallback((fk) => {
|
18650
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
18656
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
18651
18657
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18652
18658
|
let fromKName = '';
|
18653
18659
|
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))) {
|
@@ -18674,12 +18680,13 @@ Made in Italy` })));
|
|
18674
18680
|
eventSubject: 'sessionCompleted',
|
18675
18681
|
eventDescription: 'Session completed',
|
18676
18682
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18677
|
-
|
18683
|
+
sceneId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.scene) === null || _p === void 0 ? void 0 : _p.sceneId) !== null && _q !== void 0 ? _q : '',
|
18684
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
18678
18685
|
position: activeIndex + '',
|
18679
18686
|
fromKName: fk || fromKName,
|
18680
18687
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
18681
|
-
ctatId: (
|
18682
|
-
traceInfo: (
|
18688
|
+
ctatId: (_u = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
18689
|
+
traceInfo: (_y = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = item === null || item === void 0 ? void 0 : item.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : ''
|
18683
18690
|
}
|
18684
18691
|
});
|
18685
18692
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -18809,18 +18816,18 @@ Made in Italy` })));
|
|
18809
18816
|
return null;
|
18810
18817
|
}, [globalConfig, activeIndex, visList]);
|
18811
18818
|
const renderContent = React.useCallback((rec, index) => {
|
18812
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18819
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
18813
18820
|
if (rec === 'organic menu') {
|
18814
18821
|
return (React.createElement(MultiPosts$2, 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)));
|
18815
18822
|
}
|
18816
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
18823
|
+
if (((_h = (_g = rec.video) === null || _g === void 0 ? void 0 : _g.scene) === null || _h === void 0 ? void 0 : _h.mediaUrl) || ((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.url)) {
|
18817
18824
|
return (React.createElement(VideoWidget$5, 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 })));
|
18818
18825
|
}
|
18819
|
-
if ((
|
18826
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
18820
18827
|
return (React.createElement(PictureGroup$5, { 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 }));
|
18821
18828
|
}
|
18822
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
18823
|
-
return (
|
18829
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _l === void 0 ? void 0 : _l.length) > 0) {
|
18830
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
18824
18831
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
18825
18832
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
18826
18833
|
const Component = withBindDataSource(t);
|
@@ -18858,7 +18865,7 @@ Made in Italy` })));
|
|
18858
18865
|
};
|
18859
18866
|
}, [isShowMore]);
|
18860
18867
|
const renderBottom = React.useCallback((rec, index) => {
|
18861
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18868
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
18862
18869
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
18863
18870
|
let cta = null;
|
18864
18871
|
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) {
|
@@ -18867,20 +18874,23 @@ Made in Italy` })));
|
|
18867
18874
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
18868
18875
|
cta = '商品CTA';
|
18869
18876
|
}
|
18877
|
+
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)) {
|
18878
|
+
cta = '服务CTA';
|
18879
|
+
}
|
18870
18880
|
else {
|
18871
|
-
cta = (
|
18881
|
+
cta = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.itemId;
|
18872
18882
|
}
|
18873
18883
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
18874
18884
|
return (React.createElement(React.Fragment, null,
|
18875
|
-
((
|
18876
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
18885
|
+
((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
18886
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _k !== void 0 ? _k : 40}px` } },
|
18877
18887
|
React.createElement(Nudge, { nudge: nudge }),
|
18878
18888
|
(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' },
|
18879
18889
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
18880
18890
|
React.createElement("div", null,
|
18881
|
-
React.createElement(ExpandableText$1, { 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: (
|
18891
|
+
React.createElement(ExpandableText$1, { 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: (_m = (_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', 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 }),
|
18882
18892
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
18883
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
18893
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.hashTags) !== null && _p !== void 0 ? _p : [], itemId: (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId, itemType: ((_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
18884
18894
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
18885
18895
|
}
|
18886
18896
|
return null;
|
@@ -18918,7 +18928,7 @@ Made in Italy` })));
|
|
18918
18928
|
return null;
|
18919
18929
|
}, [globalConfig, waterFallData]);
|
18920
18930
|
const handleViewImageStartEnd = (item) => {
|
18921
|
-
var _a, _b, _c, _d, _e, _f;
|
18931
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18922
18932
|
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)) {
|
18923
18933
|
const endTime = Date.now();
|
18924
18934
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -18927,10 +18937,11 @@ Made in Italy` })));
|
|
18927
18937
|
eventSubject: 'viewImageCarouselEnd',
|
18928
18938
|
eventDescription: 'User end view the image carousel',
|
18929
18939
|
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 : '',
|
18930
|
-
|
18940
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
18941
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
18931
18942
|
imageEndTime: `${endTime}`,
|
18932
18943
|
playDuration: `${duration}`,
|
18933
|
-
contentTags: JSON.stringify((
|
18944
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
18934
18945
|
position: activeIndex + '',
|
18935
18946
|
contentFormat: 'image',
|
18936
18947
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -18939,7 +18950,7 @@ Made in Italy` })));
|
|
18939
18950
|
}
|
18940
18951
|
};
|
18941
18952
|
const handleSlideSkip = (item, position) => {
|
18942
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
18953
|
+
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;
|
18943
18954
|
if (isPreview || waterFallData)
|
18944
18955
|
return;
|
18945
18956
|
const t = new Date() - curTime.current;
|
@@ -18965,7 +18976,8 @@ Made in Italy` })));
|
|
18965
18976
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
18966
18977
|
position: position + '',
|
18967
18978
|
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 : '',
|
18968
|
-
|
18979
|
+
sceneId: (_w = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.scene) === null || _v === void 0 ? void 0 : _v.sceneId) !== null && _w !== void 0 ? _w : '',
|
18980
|
+
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 : '',
|
18969
18981
|
contentFormat
|
18970
18982
|
}
|
18971
18983
|
});
|
@@ -18975,7 +18987,7 @@ Made in Italy` })));
|
|
18975
18987
|
}
|
18976
18988
|
};
|
18977
18989
|
const handleScrollEvent = (swiper) => {
|
18978
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
18990
|
+
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;
|
18979
18991
|
const item = data[swiper.previousIndex];
|
18980
18992
|
if (!item)
|
18981
18993
|
return;
|
@@ -18992,11 +19004,12 @@ Made in Italy` })));
|
|
18992
19004
|
eventSubject: 'scrollDown',
|
18993
19005
|
eventDescription: 'User scroll down',
|
18994
19006
|
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 : '',
|
18995
|
-
|
19007
|
+
sceneId: (_h = (_g = (_f = item === null || item === void 0 ? void 0 : item.video) === null || _f === void 0 ? void 0 : _f.scene) === null || _g === void 0 ? void 0 : _g.sceneId) !== null && _h !== void 0 ? _h : '',
|
19008
|
+
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 : '',
|
18996
19009
|
requestId: null,
|
18997
|
-
traceInfo: (
|
19010
|
+
traceInfo: (_p = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
18998
19011
|
contentFormat,
|
18999
|
-
position: ((
|
19012
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
19000
19013
|
}
|
19001
19014
|
});
|
19002
19015
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19008,12 +19021,13 @@ Made in Italy` })));
|
|
19008
19021
|
eventInfo: {
|
19009
19022
|
eventSubject: 'scrollUp',
|
19010
19023
|
eventDescription: 'User scroll up',
|
19011
|
-
contentId: (
|
19012
|
-
|
19024
|
+
contentId: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
19025
|
+
sceneId: (_v = (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.scene) === null || _u === void 0 ? void 0 : _u.sceneId) !== null && _v !== void 0 ? _v : '',
|
19026
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19013
19027
|
requestId: null,
|
19014
|
-
traceInfo: (
|
19028
|
+
traceInfo: (_1 = (_z = (_y = item === null || item === void 0 ? void 0 : item.video) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_0 = item === null || item === void 0 ? void 0 : item.product) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '',
|
19015
19029
|
contentFormat,
|
19016
|
-
position: ((
|
19030
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
19017
19031
|
}
|
19018
19032
|
});
|
19019
19033
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19039,7 +19053,7 @@ Made in Italy` })));
|
|
19039
19053
|
}
|
19040
19054
|
}, [openHashtag, data, activeIndex]);
|
19041
19055
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19042
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19056
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
19043
19057
|
const item = data[activeIndex];
|
19044
19058
|
// 如果是图片集则上报事件
|
19045
19059
|
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)) {
|
@@ -19050,9 +19064,10 @@ Made in Italy` })));
|
|
19050
19064
|
eventSubject: 'viewImageCarouselStart',
|
19051
19065
|
eventDescription: 'User start view the image carousel',
|
19052
19066
|
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 : '',
|
19053
|
-
|
19067
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
19068
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19054
19069
|
imageStartTime: `${startTime}`,
|
19055
|
-
contentTags: JSON.stringify((
|
19070
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19056
19071
|
position: activeIndex + '',
|
19057
19072
|
contentFormat: 'image',
|
19058
19073
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19062,11 +19077,11 @@ Made in Italy` })));
|
|
19062
19077
|
if (enableCapi) {
|
19063
19078
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19064
19079
|
eventName: 'ViewContent',
|
19065
|
-
product: (
|
19080
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
19066
19081
|
});
|
19067
19082
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19068
19083
|
eventName: 'PageView',
|
19069
|
-
product: (
|
19084
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
19070
19085
|
});
|
19071
19086
|
}
|
19072
19087
|
}
|
@@ -19219,7 +19234,7 @@ Made in Italy` })));
|
|
19219
19234
|
}, []);
|
19220
19235
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19221
19236
|
const handlePlaying = React.useCallback(() => {
|
19222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19237
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19223
19238
|
setIsPauseVideo(false);
|
19224
19239
|
const item = data[index];
|
19225
19240
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19232,14 +19247,15 @@ Made in Italy` })));
|
|
19232
19247
|
eventSubject: 'playVideo',
|
19233
19248
|
eventDescription: 'User played the video',
|
19234
19249
|
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 : '',
|
19235
|
-
|
19250
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
19251
|
+
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 : '',
|
19236
19252
|
playType,
|
19237
19253
|
startTime: videoCurrentTime,
|
19238
19254
|
videoDuration,
|
19239
|
-
contentTags: JSON.stringify((
|
19255
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
19240
19256
|
position: index + '',
|
19241
19257
|
contentFormat: 'video',
|
19242
|
-
traceInfo: (
|
19258
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19243
19259
|
}
|
19244
19260
|
});
|
19245
19261
|
setIsFirstPlay(false);
|
@@ -19278,7 +19294,7 @@ Made in Italy` })));
|
|
19278
19294
|
}
|
19279
19295
|
}, [isLoadFinish]);
|
19280
19296
|
const onPause = React.useCallback(() => {
|
19281
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19297
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19282
19298
|
const item = data[index];
|
19283
19299
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19284
19300
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19289,14 +19305,15 @@ Made in Italy` })));
|
|
19289
19305
|
eventSubject: 'playOverVideo',
|
19290
19306
|
eventDescription: 'User finished playing the video',
|
19291
19307
|
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 : '',
|
19292
|
-
|
19308
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
19309
|
+
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 : '',
|
19293
19310
|
endTime: videoCurrentTime,
|
19294
19311
|
videoDuration,
|
19295
19312
|
playDuration,
|
19296
|
-
contentTags: JSON.stringify((
|
19313
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
19297
19314
|
position: index + '',
|
19298
19315
|
contentFormat: 'video',
|
19299
|
-
traceInfo: (
|
19316
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19300
19317
|
}
|
19301
19318
|
});
|
19302
19319
|
}
|