pb-sxp-ui 1.16.16 → 1.16.17
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 +182 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +182 -130
- 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 +182 -130
- 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 +10 -8
- package/es/core/components/SxpPageRender/LikeButton/index.js +17 -15
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
- package/es/core/components/SxpPageRender/VideoWidget/index.js +32 -45
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +53 -37
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +21 -4
- 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/PictureGroup/index.d.ts +5 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +32 -45
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +53 -37
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +21 -4
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -637,6 +637,7 @@
|
|
637
637
|
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 }) => {
|
638
638
|
var _a, _b, _c, _d, _e;
|
639
639
|
const [rtcList, setRtcList] = React.useState([]);
|
640
|
+
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
640
641
|
const [tagList, setTagList] = React.useState([]);
|
641
642
|
const [loading, setLoading] = React.useState(true);
|
642
643
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
@@ -743,6 +744,7 @@
|
|
743
744
|
val.split('=')[0];
|
744
745
|
val.split('=')[1];
|
745
746
|
});
|
747
|
+
options.body = Object.assign(Object.assign({}, options.body), { tenant_id: fakeUserId });
|
746
748
|
return window
|
747
749
|
.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
|
748
750
|
? JSON.stringify({
|
@@ -988,6 +990,9 @@
|
|
988
990
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
989
991
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
990
992
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
993
|
+
if (isDiyH5) {
|
994
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
995
|
+
}
|
991
996
|
}
|
992
997
|
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));
|
993
998
|
if (isNotNullList) {
|
@@ -1027,12 +1032,17 @@
|
|
1027
1032
|
if (rtcList.length <= 0) {
|
1028
1033
|
return;
|
1029
1034
|
}
|
1035
|
+
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1036
|
+
setRtcList(rtcList.concat(firstRtcList));
|
1037
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1038
|
+
return;
|
1039
|
+
}
|
1030
1040
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1031
1041
|
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 })));
|
1032
1042
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1033
1043
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1034
1044
|
return data;
|
1035
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1045
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyH5, firstRtcList]);
|
1036
1046
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
1037
1047
|
var _a, _b, _c, _d, _e;
|
1038
1048
|
let expire = false;
|
@@ -1259,7 +1269,7 @@
|
|
1259
1269
|
}
|
1260
1270
|
}), [bffFetch, utmVal]);
|
1261
1271
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1262
|
-
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;
|
1272
|
+
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;
|
1263
1273
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1264
1274
|
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);
|
1265
1275
|
let fromKName = '';
|
@@ -1277,7 +1287,7 @@
|
|
1277
1287
|
}
|
1278
1288
|
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;
|
1279
1289
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1280
|
-
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: (
|
1290
|
+
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 })
|
1281
1291
|
});
|
1282
1292
|
}, [bffEventReport, isFromHashtag]);
|
1283
1293
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1379,6 +1389,9 @@
|
|
1379
1389
|
}
|
1380
1390
|
setRtcList(list);
|
1381
1391
|
setCacheRtcList(list);
|
1392
|
+
if (isDiyH5) {
|
1393
|
+
setFirstRtcList(list);
|
1394
|
+
}
|
1382
1395
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1383
1396
|
if (channel) {
|
1384
1397
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1414,6 +1427,9 @@
|
|
1414
1427
|
}
|
1415
1428
|
setRtcList(list);
|
1416
1429
|
setCacheRtcList(list);
|
1430
|
+
if (isDiyH5) {
|
1431
|
+
setFirstRtcList(list);
|
1432
|
+
}
|
1417
1433
|
}
|
1418
1434
|
})
|
1419
1435
|
.finally(() => {
|
@@ -1477,7 +1493,8 @@
|
|
1477
1493
|
refreshFeSession,
|
1478
1494
|
getAccount,
|
1479
1495
|
accountSonsent,
|
1480
|
-
isDiyH5
|
1496
|
+
isDiyH5,
|
1497
|
+
firstRtcList
|
1481
1498
|
} }, isShowConsent ? (React.createElement(Consent$4, 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({
|
1482
1499
|
rtcList,
|
1483
1500
|
mutateLike: bffMutateLike,
|
@@ -1938,14 +1955,14 @@
|
|
1938
1955
|
* @Author: binruan@chatlabs.com
|
1939
1956
|
* @Date: 2024-03-12 10:59:06
|
1940
1957
|
* @LastEditors: binruan@chatlabs.com
|
1941
|
-
* @LastEditTime:
|
1958
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
1942
1959
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1943
1960
|
*
|
1944
1961
|
*/
|
1945
1962
|
function useEventReport() {
|
1946
1963
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1947
1964
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1948
|
-
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;
|
1965
|
+
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;
|
1949
1966
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1950
1967
|
if (i !== -1) {
|
1951
1968
|
return;
|
@@ -1978,11 +1995,11 @@
|
|
1978
1995
|
contentFormat = 'image';
|
1979
1996
|
}
|
1980
1997
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1981
|
-
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 : '',
|
1998
|
+
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 }))
|
1982
1999
|
});
|
1983
2000
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1984
2001
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1985
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
2002
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
1986
2003
|
let fromKName = '';
|
1987
2004
|
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))) {
|
1988
2005
|
fromKName = 'pdpPage';
|
@@ -2001,8 +2018,9 @@
|
|
2001
2018
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2002
2019
|
position: position + '',
|
2003
2020
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2021
|
+
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 : '',
|
2004
2022
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2005
|
-
traceInfo: (
|
2023
|
+
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 : '',
|
2006
2024
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2007
2025
|
eventSubject: 'productView',
|
2008
2026
|
eventDescription: 'User browsed the product'
|
@@ -15817,7 +15835,7 @@ Made in Italy` })));
|
|
15817
15835
|
* @Author: binruan@chatlabs.com
|
15818
15836
|
* @Date: 2024-01-10 10:58:24
|
15819
15837
|
* @LastEditors: binruan@chatlabs.com
|
15820
|
-
* @LastEditTime: 2025-
|
15838
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
15821
15839
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15822
15840
|
*
|
15823
15841
|
*/
|
@@ -15855,7 +15873,7 @@ Made in Italy` })));
|
|
15855
15873
|
}
|
15856
15874
|
}, [waterFallData]);
|
15857
15875
|
const reportTagsView = React.useCallback(() => {
|
15858
|
-
var _a, _b, _c, _d, _e, _f;
|
15876
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15859
15877
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15860
15878
|
if (!rec)
|
15861
15879
|
return;
|
@@ -15875,9 +15893,10 @@ Made in Italy` })));
|
|
15875
15893
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15876
15894
|
eventInfo: {
|
15877
15895
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15896
|
+
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 : '',
|
15878
15897
|
position: cacheActiveIndex + '',
|
15879
|
-
contentTags: JSON.stringify((
|
15880
|
-
traceInfo: (
|
15898
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
15899
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
15881
15900
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15882
15901
|
fromKName,
|
15883
15902
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17959,7 +17978,7 @@ Made in Italy` })));
|
|
17959
17978
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17960
17979
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17961
17980
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17962
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17981
|
+
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;
|
17963
17982
|
if (state) {
|
17964
17983
|
// 先设置状态
|
17965
17984
|
setState(false);
|
@@ -17969,11 +17988,12 @@ Made in Italy` })));
|
|
17969
17988
|
eventSubject: 'favoriteContentCanceled',
|
17970
17989
|
eventDescription: 'This content was unfavorite by the user',
|
17971
17990
|
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 : '',
|
17972
|
-
|
17973
|
-
|
17991
|
+
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 : '',
|
17992
|
+
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 : '',
|
17993
|
+
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 : []),
|
17974
17994
|
position: position + '',
|
17975
|
-
contentFormat: ((
|
17976
|
-
traceInfo: (
|
17995
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
17996
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
17977
17997
|
}
|
17978
17998
|
});
|
17979
17999
|
// 如果接口调用失败,则回滚状态
|
@@ -17981,40 +18001,41 @@ Made in Italy` })));
|
|
17981
18001
|
setState(true);
|
17982
18002
|
}
|
17983
18003
|
else {
|
17984
|
-
const nRtcList = (
|
18004
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17985
18005
|
if (index === position) {
|
17986
18006
|
item.isCollected = false;
|
17987
18007
|
}
|
17988
18008
|
return item;
|
17989
|
-
})) !== null &&
|
18009
|
+
})) !== null && _s !== void 0 ? _s : [];
|
17990
18010
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17991
18011
|
}
|
17992
18012
|
}
|
17993
18013
|
else {
|
17994
18014
|
setState(true);
|
17995
|
-
const result = (
|
18015
|
+
const result = (_t = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _t !== void 0 ? _t : false;
|
17996
18016
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17997
18017
|
eventInfo: {
|
17998
18018
|
eventSubject: 'favoriteContent',
|
17999
18019
|
eventDescription: 'This content was favorite by the user',
|
18000
|
-
contentId: (
|
18001
|
-
|
18002
|
-
|
18020
|
+
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 : '',
|
18021
|
+
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 : '',
|
18022
|
+
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 : '',
|
18023
|
+
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 : []),
|
18003
18024
|
position: position + '',
|
18004
|
-
contentFormat: ((
|
18005
|
-
traceInfo: (
|
18025
|
+
contentFormat: ((_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.url) ? 'video' : 'image',
|
18026
|
+
traceInfo: (_4 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _4 === void 0 ? void 0 : _4.traceInfo
|
18006
18027
|
}
|
18007
18028
|
});
|
18008
18029
|
if (!result) {
|
18009
18030
|
setState(false);
|
18010
18031
|
}
|
18011
18032
|
else {
|
18012
|
-
const nRtcList = (
|
18033
|
+
const nRtcList = (_5 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18013
18034
|
if (index === position) {
|
18014
18035
|
item.isCollected = true;
|
18015
18036
|
}
|
18016
18037
|
return item;
|
18017
|
-
})) !== null &&
|
18038
|
+
})) !== null && _5 !== void 0 ? _5 : [];
|
18018
18039
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18019
18040
|
}
|
18020
18041
|
}
|
@@ -18051,7 +18072,7 @@ Made in Italy` })));
|
|
18051
18072
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18052
18073
|
var _a, _b;
|
18053
18074
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
18054
|
-
const { bffEventReport, sxpParameter,
|
18075
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18055
18076
|
const videoStartTime = React.useRef(0);
|
18056
18077
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
18057
18078
|
const { isActive } = useSwiperSlide();
|
@@ -18117,6 +18138,23 @@ Made in Italy` })));
|
|
18117
18138
|
return;
|
18118
18139
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18119
18140
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18141
|
+
const handleEnd = () => {
|
18142
|
+
var _a, _b, _c, _d, _e, _f;
|
18143
|
+
if (!videoRef.current)
|
18144
|
+
return;
|
18145
|
+
if (isDiyH5) {
|
18146
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18147
|
+
if (!loopPlayRef.current)
|
18148
|
+
return;
|
18149
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18150
|
+
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
18151
|
+
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
|
18152
|
+
}
|
18153
|
+
}
|
18154
|
+
else {
|
18155
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18156
|
+
}
|
18157
|
+
};
|
18120
18158
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18121
18159
|
const handlePlaying = React.useCallback(() => {
|
18122
18160
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18125,7 +18163,7 @@ Made in Italy` })));
|
|
18125
18163
|
setIsLoadFinish(true);
|
18126
18164
|
}, []);
|
18127
18165
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18128
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18166
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
18129
18167
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18130
18168
|
return;
|
18131
18169
|
setIsPauseVideo(false);
|
@@ -18136,16 +18174,11 @@ Made in Italy` })));
|
|
18136
18174
|
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);
|
18137
18175
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18138
18176
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18139
|
-
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 : '',
|
18177
|
+
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) + '' }))
|
18140
18178
|
});
|
18141
18179
|
isFirstPlayRef.current = false;
|
18142
18180
|
}
|
18143
18181
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18144
|
-
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18145
|
-
if (isDiyH5) {
|
18146
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18147
|
-
}
|
18148
|
-
}, []);
|
18149
18182
|
const handLoadeddata = React.useCallback(() => {
|
18150
18183
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18151
18184
|
return;
|
@@ -18170,13 +18203,12 @@ Made in Italy` })));
|
|
18170
18203
|
const handleLoadedmetadata = React.useCallback(() => {
|
18171
18204
|
if (!videoRef.current)
|
18172
18205
|
return;
|
18173
|
-
setCurrentTimeByStartTime();
|
18174
18206
|
loadedTimeRef.current = new Date();
|
18175
18207
|
handleStartPlay();
|
18176
18208
|
handLoadeddata();
|
18177
18209
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18178
18210
|
const handleClickVideo = React.useCallback((type) => () => {
|
18179
|
-
var _a, _b, _c, _d, _e
|
18211
|
+
var _a, _b, _c, _d, _e;
|
18180
18212
|
if (!videoRef.current)
|
18181
18213
|
return;
|
18182
18214
|
if (!isLoadFinish)
|
@@ -18197,20 +18229,17 @@ Made in Italy` })));
|
|
18197
18229
|
break;
|
18198
18230
|
default:
|
18199
18231
|
if (isPause) {
|
18200
|
-
|
18201
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18202
|
-
}
|
18203
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18232
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
18204
18233
|
}
|
18205
18234
|
else {
|
18206
|
-
(
|
18235
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
18207
18236
|
}
|
18208
18237
|
setIsPauseVideo(!isPause);
|
18209
18238
|
break;
|
18210
18239
|
}
|
18211
18240
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18212
18241
|
const handlePause = React.useCallback(() => {
|
18213
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18242
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
18214
18243
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18215
18244
|
return;
|
18216
18245
|
if (activeIndex !== index)
|
@@ -18226,14 +18255,15 @@ Made in Italy` })));
|
|
18226
18255
|
eventSubject: 'playOverVideo',
|
18227
18256
|
eventDescription: 'User finished playing the video',
|
18228
18257
|
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 : '',
|
18229
|
-
|
18258
|
+
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 : '',
|
18259
|
+
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 : '',
|
18230
18260
|
endTime: videoCurrentTime,
|
18231
18261
|
videoDuration,
|
18232
18262
|
playDuration,
|
18233
|
-
contentTags: JSON.stringify((
|
18263
|
+
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 : []),
|
18234
18264
|
position: index + '',
|
18235
18265
|
contentFormat: 'video',
|
18236
|
-
traceInfo: (
|
18266
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18237
18267
|
}
|
18238
18268
|
});
|
18239
18269
|
}
|
@@ -18241,27 +18271,8 @@ Made in Italy` })));
|
|
18241
18271
|
const handleWaiting = React.useCallback(() => {
|
18242
18272
|
setWaiting(true);
|
18243
18273
|
}, []);
|
18244
|
-
const handleTimeUpload = () => {
|
18245
|
-
if (!videoRef.current || !isDiyH5)
|
18246
|
-
return;
|
18247
|
-
setTimeout(() => {
|
18248
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18249
|
-
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)) {
|
18250
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18251
|
-
if (!loopPlayRef.current)
|
18252
|
-
return;
|
18253
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18254
|
-
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
|
18255
|
-
}
|
18256
|
-
else {
|
18257
|
-
const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
|
18258
|
-
(_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
|
18259
|
-
}
|
18260
|
-
}
|
18261
|
-
});
|
18262
|
-
};
|
18263
18274
|
React.useEffect(() => {
|
18264
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18275
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18265
18276
|
if (!isActive)
|
18266
18277
|
return;
|
18267
18278
|
const videoSrc = videoUrl;
|
@@ -18282,7 +18293,6 @@ Made in Italy` })));
|
|
18282
18293
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18283
18294
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18284
18295
|
var _a;
|
18285
|
-
setCurrentTimeByStartTime();
|
18286
18296
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18287
18297
|
});
|
18288
18298
|
}
|
@@ -18296,12 +18306,11 @@ Made in Italy` })));
|
|
18296
18306
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18297
18307
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18298
18308
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18299
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18309
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
18300
18310
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18301
18311
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18302
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18303
18312
|
return () => {
|
18304
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18313
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18305
18314
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18306
18315
|
if (!isPause)
|
18307
18316
|
handlePause();
|
@@ -18313,10 +18322,9 @@ Made in Italy` })));
|
|
18313
18322
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18314
18323
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18315
18324
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18316
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18325
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
18317
18326
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18318
18327
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18319
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18320
18328
|
};
|
18321
18329
|
}, [isActive]);
|
18322
18330
|
React.useEffect(() => {
|
@@ -18527,19 +18535,45 @@ Made in Italy` })));
|
|
18527
18535
|
}, onLoad: onShowFirstImage }))));
|
18528
18536
|
};
|
18529
18537
|
|
18530
|
-
const PictureGroup$4 = ({ imgUrls,
|
18538
|
+
const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
18531
18539
|
var _a, _b;
|
18532
18540
|
const { isActive } = useSwiperSlide();
|
18533
|
-
const {
|
18541
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
18534
18542
|
const [isLoad, setIsLoad] = React.useState(false);
|
18535
18543
|
const [imgInfo, setImgInfo] = React.useState();
|
18536
18544
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18537
|
-
const
|
18545
|
+
const imgsSwiperRef = React.useRef();
|
18538
18546
|
const isFirstPlayRef = React.useRef(true);
|
18547
|
+
const loopPlayRef = React.useRef(true);
|
18539
18548
|
const initTime = new Date();
|
18549
|
+
React.useImperativeHandle(ref, () => {
|
18550
|
+
return {
|
18551
|
+
setLoopPlay(v) {
|
18552
|
+
loopPlayRef.current = v;
|
18553
|
+
}
|
18554
|
+
};
|
18555
|
+
});
|
18556
|
+
React.useEffect(() => {
|
18557
|
+
let timerId;
|
18558
|
+
if (isLoad && isActive && isDiyH5) {
|
18559
|
+
timerId = setTimeout(() => {
|
18560
|
+
var _a, _b, _c, _d;
|
18561
|
+
if (!loopPlayRef.current)
|
18562
|
+
return;
|
18563
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18564
|
+
const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
18565
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
|
18566
|
+
}
|
18567
|
+
}, 3000);
|
18568
|
+
}
|
18569
|
+
return () => {
|
18570
|
+
if (timerId)
|
18571
|
+
clearTimeout(timerId);
|
18572
|
+
};
|
18573
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18540
18574
|
React.useEffect(() => {
|
18541
18575
|
if (isLoad && isActive) {
|
18542
|
-
(
|
18576
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
18543
18577
|
if (openHashtag) {
|
18544
18578
|
onViewImageEndEvent(rec);
|
18545
18579
|
}
|
@@ -18549,7 +18583,7 @@ Made in Italy` })));
|
|
18549
18583
|
}
|
18550
18584
|
}
|
18551
18585
|
else {
|
18552
|
-
(
|
18586
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
18553
18587
|
}
|
18554
18588
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18555
18589
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18576,13 +18610,13 @@ Made in Italy` })));
|
|
18576
18610
|
};
|
18577
18611
|
}, [isActive, imgInfo]);
|
18578
18612
|
const handleMouseEnter = React.useCallback(() => {
|
18579
|
-
if (
|
18580
|
-
|
18613
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18614
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
18581
18615
|
}
|
18582
18616
|
}, []);
|
18583
18617
|
const handleMouseLeave = React.useCallback(() => {
|
18584
|
-
if (
|
18585
|
-
|
18618
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18619
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
18586
18620
|
}
|
18587
18621
|
}, []);
|
18588
18622
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18603,7 +18637,7 @@ Made in Italy` })));
|
|
18603
18637
|
enabled: true
|
18604
18638
|
}
|
18605
18639
|
}
|
18606
|
-
: {}), { loop: true, ref:
|
18640
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18607
18641
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18608
18642
|
fontSize: '14px'
|
18609
18643
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18620,7 +18654,7 @@ Made in Italy` })));
|
|
18620
18654
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18621
18655
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18622
18656
|
}))));
|
18623
|
-
};
|
18657
|
+
});
|
18624
18658
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18625
18659
|
|
18626
18660
|
/*
|
@@ -18900,7 +18934,7 @@ Made in Italy` })));
|
|
18900
18934
|
* @Author: binruan@chatlabs.com
|
18901
18935
|
* @Date: 2024-03-20 10:27:31
|
18902
18936
|
* @LastEditors: binruan@chatlabs.com
|
18903
|
-
* @LastEditTime: 2025-05-
|
18937
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
18904
18938
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18905
18939
|
*
|
18906
18940
|
*/
|
@@ -18920,6 +18954,7 @@ Made in Italy` })));
|
|
18920
18954
|
const skipLinkRef = React.useRef(false);
|
18921
18955
|
const [pageNum, setPageNum] = React.useState(2);
|
18922
18956
|
const videoWidgetRef = React.useRef(null);
|
18957
|
+
const pictureGroupRef = React.useRef(null);
|
18923
18958
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
|
18924
18959
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18925
18960
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -18967,7 +19002,7 @@ Made in Italy` })));
|
|
18967
19002
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18968
19003
|
}, [data, ctaType, swiperRef]);
|
18969
19004
|
const handleSessionCompleted = React.useCallback((fk) => {
|
18970
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
19005
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
18971
19006
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18972
19007
|
let fromKName = '';
|
18973
19008
|
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))) {
|
@@ -18994,12 +19029,13 @@ Made in Italy` })));
|
|
18994
19029
|
eventSubject: 'sessionCompleted',
|
18995
19030
|
eventDescription: 'Session completed',
|
18996
19031
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18997
|
-
|
19032
|
+
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 : '',
|
19033
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
18998
19034
|
position: activeIndex + '',
|
18999
19035
|
fromKName: fk || fromKName,
|
19000
19036
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19001
|
-
ctatId: (
|
19002
|
-
traceInfo: (
|
19037
|
+
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 : '',
|
19038
|
+
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 : ''
|
19003
19039
|
}
|
19004
19040
|
});
|
19005
19041
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19058,8 +19094,9 @@ Made in Italy` })));
|
|
19058
19094
|
refreshFeSession
|
19059
19095
|
]);
|
19060
19096
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
19061
|
-
var _a;
|
19097
|
+
var _a, _b;
|
19062
19098
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19099
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19063
19100
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19064
19101
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19065
19102
|
React.useEffect(() => {
|
@@ -19129,18 +19166,18 @@ Made in Italy` })));
|
|
19129
19166
|
return null;
|
19130
19167
|
}, [globalConfig, activeIndex, visList]);
|
19131
19168
|
const renderContent = React.useCallback((rec, index) => {
|
19132
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19169
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
19133
19170
|
if (rec === 'organic menu') {
|
19134
19171
|
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)));
|
19135
19172
|
}
|
19136
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
19173
|
+
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)) {
|
19137
19174
|
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 })));
|
19138
19175
|
}
|
19139
|
-
if ((
|
19140
|
-
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 }));
|
19176
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
19177
|
+
return (React.createElement(PictureGroup$5, Object.assign({ data: data }, (activeIndex === index && { ref: pictureGroupRef }), { 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, swiperRef: swiperRef })));
|
19141
19178
|
}
|
19142
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19143
|
-
return (
|
19179
|
+
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) {
|
19180
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
19144
19181
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19145
19182
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19146
19183
|
const Component = withBindDataSource(t);
|
@@ -19178,7 +19215,7 @@ Made in Italy` })));
|
|
19178
19215
|
};
|
19179
19216
|
}, [isShowMore]);
|
19180
19217
|
const renderBottom = React.useCallback((rec, index) => {
|
19181
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19218
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
19182
19219
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19183
19220
|
let cta = null;
|
19184
19221
|
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) {
|
@@ -19187,24 +19224,27 @@ Made in Italy` })));
|
|
19187
19224
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19188
19225
|
cta = '商品CTA';
|
19189
19226
|
}
|
19227
|
+
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)) {
|
19228
|
+
cta = '服务CTA';
|
19229
|
+
}
|
19190
19230
|
else {
|
19191
|
-
cta = (
|
19231
|
+
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;
|
19192
19232
|
}
|
19193
19233
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19194
19234
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19195
19235
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19196
|
-
((
|
19236
|
+
((_j = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _j === void 0 ? void 0 : _j.includes((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type));
|
19197
19237
|
return (React.createElement(React.Fragment, null,
|
19198
19238
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19199
|
-
((
|
19200
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19239
|
+
((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
19240
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _m !== void 0 ? _m : 40}px` } },
|
19201
19241
|
React.createElement(Nudge, { nudge: nudge }),
|
19202
19242
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
19203
19243
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19204
19244
|
React.createElement("div", null,
|
19205
|
-
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: (
|
19245
|
+
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: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : '', 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 }),
|
19206
19246
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19207
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19247
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.hashTags) !== null && _r !== void 0 ? _r : [], itemId: (_s = rec === null || rec === void 0 ? void 0 : rec.video) === null || _s === void 0 ? void 0 : _s.itemId, itemType: ((_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
19208
19248
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19209
19249
|
}
|
19210
19250
|
return null;
|
@@ -19243,7 +19283,7 @@ Made in Italy` })));
|
|
19243
19283
|
return null;
|
19244
19284
|
}, [globalConfig, waterFallData]);
|
19245
19285
|
const handleViewImageStartEnd = (item) => {
|
19246
|
-
var _a, _b, _c, _d, _e, _f;
|
19286
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19247
19287
|
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)) {
|
19248
19288
|
const endTime = Date.now();
|
19249
19289
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19252,10 +19292,11 @@ Made in Italy` })));
|
|
19252
19292
|
eventSubject: 'viewImageCarouselEnd',
|
19253
19293
|
eventDescription: 'User end view the image carousel',
|
19254
19294
|
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 : '',
|
19255
|
-
|
19295
|
+
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 : '',
|
19296
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19256
19297
|
imageEndTime: `${endTime}`,
|
19257
19298
|
playDuration: `${duration}`,
|
19258
|
-
contentTags: JSON.stringify((
|
19299
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19259
19300
|
position: activeIndex + '',
|
19260
19301
|
contentFormat: 'image',
|
19261
19302
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19264,7 +19305,7 @@ Made in Italy` })));
|
|
19264
19305
|
}
|
19265
19306
|
};
|
19266
19307
|
const handleSlideSkip = (item, position) => {
|
19267
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19308
|
+
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;
|
19268
19309
|
if (isPreview || waterFallData)
|
19269
19310
|
return;
|
19270
19311
|
const t = new Date() - curTime.current;
|
@@ -19290,7 +19331,8 @@ Made in Italy` })));
|
|
19290
19331
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19291
19332
|
position: position + '',
|
19292
19333
|
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 : '',
|
19293
|
-
|
19334
|
+
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 : '',
|
19335
|
+
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 : '',
|
19294
19336
|
contentFormat
|
19295
19337
|
}
|
19296
19338
|
});
|
@@ -19300,7 +19342,7 @@ Made in Italy` })));
|
|
19300
19342
|
}
|
19301
19343
|
};
|
19302
19344
|
const handleScrollEvent = (swiper) => {
|
19303
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19345
|
+
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;
|
19304
19346
|
const item = data[swiper.previousIndex];
|
19305
19347
|
if (!item)
|
19306
19348
|
return;
|
@@ -19317,11 +19359,12 @@ Made in Italy` })));
|
|
19317
19359
|
eventSubject: 'scrollDown',
|
19318
19360
|
eventDescription: 'User scroll down',
|
19319
19361
|
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 : '',
|
19320
|
-
|
19362
|
+
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 : '',
|
19363
|
+
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 : '',
|
19321
19364
|
requestId: null,
|
19322
|
-
traceInfo: (
|
19365
|
+
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 : '',
|
19323
19366
|
contentFormat,
|
19324
|
-
position: ((
|
19367
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
19325
19368
|
}
|
19326
19369
|
});
|
19327
19370
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19333,12 +19376,13 @@ Made in Italy` })));
|
|
19333
19376
|
eventInfo: {
|
19334
19377
|
eventSubject: 'scrollUp',
|
19335
19378
|
eventDescription: 'User scroll up',
|
19336
|
-
contentId: (
|
19337
|
-
|
19379
|
+
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 : '',
|
19380
|
+
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 : '',
|
19381
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19338
19382
|
requestId: null,
|
19339
|
-
traceInfo: (
|
19383
|
+
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 : '',
|
19340
19384
|
contentFormat,
|
19341
|
-
position: ((
|
19385
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
19342
19386
|
}
|
19343
19387
|
});
|
19344
19388
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19364,7 +19408,7 @@ Made in Italy` })));
|
|
19364
19408
|
}
|
19365
19409
|
}, [openHashtag, data, activeIndex]);
|
19366
19410
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19367
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19411
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
19368
19412
|
const item = data[activeIndex];
|
19369
19413
|
// 如果是图片集则上报事件
|
19370
19414
|
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)) {
|
@@ -19375,9 +19419,10 @@ Made in Italy` })));
|
|
19375
19419
|
eventSubject: 'viewImageCarouselStart',
|
19376
19420
|
eventDescription: 'User start view the image carousel',
|
19377
19421
|
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 : '',
|
19378
|
-
|
19422
|
+
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 : '',
|
19423
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19379
19424
|
imageStartTime: `${startTime}`,
|
19380
|
-
contentTags: JSON.stringify((
|
19425
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19381
19426
|
position: activeIndex + '',
|
19382
19427
|
contentFormat: 'image',
|
19383
19428
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19387,11 +19432,11 @@ Made in Italy` })));
|
|
19387
19432
|
if (enableCapi) {
|
19388
19433
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19389
19434
|
eventName: 'ViewContent',
|
19390
|
-
product: (
|
19435
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
19391
19436
|
});
|
19392
19437
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19393
19438
|
eventName: 'PageView',
|
19394
|
-
product: (
|
19439
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
19395
19440
|
});
|
19396
19441
|
}
|
19397
19442
|
}
|
@@ -19483,15 +19528,20 @@ Made in Italy` })));
|
|
19483
19528
|
swiperRef.current.swiper.allowTouchMove = true;
|
19484
19529
|
}, 500);
|
19485
19530
|
}, onActiveIndexChange: (swiper) => {
|
19531
|
+
var _a, _b;
|
19486
19532
|
setActiveIndex(swiper.activeIndex);
|
19487
19533
|
if (openHashtag)
|
19488
19534
|
return;
|
19489
19535
|
// 处理上滑下滑事件
|
19490
19536
|
handleScrollEvent(swiper);
|
19491
|
-
if (waterFallData || isEditor
|
19537
|
+
if (waterFallData || isEditor)
|
19492
19538
|
return;
|
19493
19539
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19494
19540
|
if (!isLoadMore) {
|
19541
|
+
if (isDiyH5) {
|
19542
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19543
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19544
|
+
}
|
19495
19545
|
setIsLoadMore(true);
|
19496
19546
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19497
19547
|
var _a;
|
@@ -19544,7 +19594,7 @@ Made in Italy` })));
|
|
19544
19594
|
}, []);
|
19545
19595
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19546
19596
|
const handlePlaying = React.useCallback(() => {
|
19547
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19597
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19548
19598
|
setIsPauseVideo(false);
|
19549
19599
|
const item = data[index];
|
19550
19600
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19557,14 +19607,15 @@ Made in Italy` })));
|
|
19557
19607
|
eventSubject: 'playVideo',
|
19558
19608
|
eventDescription: 'User played the video',
|
19559
19609
|
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 : '',
|
19560
|
-
|
19610
|
+
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 : '',
|
19611
|
+
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 : '',
|
19561
19612
|
playType,
|
19562
19613
|
startTime: videoCurrentTime,
|
19563
19614
|
videoDuration,
|
19564
|
-
contentTags: JSON.stringify((
|
19615
|
+
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 : []),
|
19565
19616
|
position: index + '',
|
19566
19617
|
contentFormat: 'video',
|
19567
|
-
traceInfo: (
|
19618
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19568
19619
|
}
|
19569
19620
|
});
|
19570
19621
|
setIsFirstPlay(false);
|
@@ -19603,7 +19654,7 @@ Made in Italy` })));
|
|
19603
19654
|
}
|
19604
19655
|
}, [isLoadFinish]);
|
19605
19656
|
const onPause = React.useCallback(() => {
|
19606
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19657
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19607
19658
|
const item = data[index];
|
19608
19659
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19609
19660
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19614,14 +19665,15 @@ Made in Italy` })));
|
|
19614
19665
|
eventSubject: 'playOverVideo',
|
19615
19666
|
eventDescription: 'User finished playing the video',
|
19616
19667
|
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 : '',
|
19617
|
-
|
19668
|
+
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 : '',
|
19669
|
+
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 : '',
|
19618
19670
|
endTime: videoCurrentTime,
|
19619
19671
|
videoDuration,
|
19620
19672
|
playDuration,
|
19621
|
-
contentTags: JSON.stringify((
|
19673
|
+
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 : []),
|
19622
19674
|
position: index + '',
|
19623
19675
|
contentFormat: 'video',
|
19624
|
-
traceInfo: (
|
19676
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19625
19677
|
}
|
19626
19678
|
});
|
19627
19679
|
}
|