pb-sxp-ui 1.16.24-alpha.2 → 1.16.25
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 +193 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +193 -138
- 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 +193 -138
- 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 +18 -16
- 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 +5 -12
- package/es/core/context/SxpDataSourceProvider.js +32 -10
- 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 +18 -16
- 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 +5 -12
- package/lib/core/context/SxpDataSourceProvider.js +32 -10
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -644,6 +644,7 @@ const DEFAULT_TAG = 'FOR U';
|
|
644
644
|
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 }) => {
|
645
645
|
var _a, _b, _c, _d, _e;
|
646
646
|
const [rtcList, setRtcList] = React.useState([]);
|
647
|
+
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
647
648
|
const [tagList, setTagList] = React.useState([]);
|
648
649
|
const [loading, setLoading] = React.useState(true);
|
649
650
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
@@ -737,7 +738,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
737
738
|
}, [bffDataSource]);
|
738
739
|
// bff API 请求方法
|
739
740
|
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
740
|
-
var _a;
|
741
|
+
var _a, _b;
|
741
742
|
if (!bffDataSource)
|
742
743
|
return;
|
743
744
|
const url = bffDataSource.url;
|
@@ -750,8 +751,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
750
751
|
val.split('=')[0];
|
751
752
|
val.split('=')[1];
|
752
753
|
});
|
754
|
+
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
753
755
|
return window
|
754
|
-
.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
|
756
|
+
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId, 'tenant-id': (_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id'] }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
|
755
757
|
? JSON.stringify({
|
756
758
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
757
759
|
})
|
@@ -1026,6 +1028,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1026
1028
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
1027
1029
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1028
1030
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1031
|
+
if (isDiyH5) {
|
1032
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1033
|
+
}
|
1029
1034
|
}
|
1030
1035
|
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));
|
1031
1036
|
if (isNotNullList) {
|
@@ -1065,12 +1070,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1065
1070
|
if (rtcList.length <= 0) {
|
1066
1071
|
return;
|
1067
1072
|
}
|
1073
|
+
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1074
|
+
setRtcList(rtcList.concat(firstRtcList));
|
1075
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1076
|
+
return;
|
1077
|
+
}
|
1068
1078
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1069
1079
|
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 })));
|
1070
1080
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1071
1081
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1072
1082
|
return data;
|
1073
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1083
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyH5, firstRtcList]);
|
1074
1084
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
1075
1085
|
var _a, _b, _c, _d, _e;
|
1076
1086
|
let expire = false;
|
@@ -1101,8 +1111,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1101
1111
|
// 用户信息都是公共的
|
1102
1112
|
if (!userInfo) {
|
1103
1113
|
userInfo = {
|
1104
|
-
|
1105
|
-
|
1114
|
+
productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
|
1115
|
+
// tpChannelId: 'H5' // 后端处理
|
1106
1116
|
};
|
1107
1117
|
}
|
1108
1118
|
const sessionID = storeAndLoadFeSessionId();
|
@@ -1136,7 +1146,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1136
1146
|
layoutVariantId,
|
1137
1147
|
globalConfig,
|
1138
1148
|
playbookType,
|
1139
|
-
bffDataSource
|
1149
|
+
bffDataSource,
|
1150
|
+
fakeUserId
|
1140
1151
|
]);
|
1141
1152
|
const getEventParamsByJson = React.useCallback((json, product) => {
|
1142
1153
|
var _a, _b, _c;
|
@@ -1269,13 +1280,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1269
1280
|
}
|
1270
1281
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
1271
1282
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1283
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1272
1284
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
1273
1285
|
return res === null || res === void 0 ? void 0 : res.success;
|
1274
|
-
}), [bffFetch]);
|
1286
|
+
}), [bffFetch, fakeUserId]);
|
1275
1287
|
const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1288
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1276
1289
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
1277
1290
|
return res === null || res === void 0 ? void 0 : res.success;
|
1278
|
-
}), [bffFetch]);
|
1291
|
+
}), [bffFetch, fakeUserId]);
|
1279
1292
|
const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1280
1293
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
1281
1294
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -1300,7 +1313,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1300
1313
|
}
|
1301
1314
|
}), [bffFetch, utmVal]);
|
1302
1315
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1303
|
-
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;
|
1316
|
+
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;
|
1304
1317
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1305
1318
|
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);
|
1306
1319
|
let fromKName = '';
|
@@ -1318,7 +1331,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1318
1331
|
}
|
1319
1332
|
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;
|
1320
1333
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1321
|
-
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: (
|
1334
|
+
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 })
|
1322
1335
|
});
|
1323
1336
|
}, [bffEventReport, isFromHashtag]);
|
1324
1337
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1420,6 +1433,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1420
1433
|
}
|
1421
1434
|
setRtcList(list);
|
1422
1435
|
setCacheRtcList(list);
|
1436
|
+
if (isDiyH5) {
|
1437
|
+
setFirstRtcList(list);
|
1438
|
+
}
|
1423
1439
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1424
1440
|
if (channel) {
|
1425
1441
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1455,6 +1471,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1455
1471
|
}
|
1456
1472
|
setRtcList(list);
|
1457
1473
|
setCacheRtcList(list);
|
1474
|
+
if (isDiyH5) {
|
1475
|
+
setFirstRtcList(list);
|
1476
|
+
}
|
1458
1477
|
}
|
1459
1478
|
})
|
1460
1479
|
.finally(() => {
|
@@ -1518,7 +1537,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1518
1537
|
refreshFeSession,
|
1519
1538
|
getAccount,
|
1520
1539
|
accountSonsent,
|
1521
|
-
isDiyH5
|
1540
|
+
isDiyH5,
|
1541
|
+
firstRtcList
|
1522
1542
|
} }, 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({
|
1523
1543
|
rtcList,
|
1524
1544
|
mutateLike: bffMutateLike,
|
@@ -1979,14 +1999,14 @@ var settingRender$f = [
|
|
1979
1999
|
* @Author: binruan@chatlabs.com
|
1980
2000
|
* @Date: 2024-03-12 10:59:06
|
1981
2001
|
* @LastEditors: binruan@chatlabs.com
|
1982
|
-
* @LastEditTime:
|
2002
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
1983
2003
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1984
2004
|
*
|
1985
2005
|
*/
|
1986
2006
|
function useEventReport() {
|
1987
2007
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1988
2008
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1989
|
-
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;
|
2009
|
+
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;
|
1990
2010
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1991
2011
|
if (i !== -1) {
|
1992
2012
|
return;
|
@@ -2019,11 +2039,11 @@ function useEventReport() {
|
|
2019
2039
|
contentFormat = 'image';
|
2020
2040
|
}
|
2021
2041
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
2022
|
-
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 : '',
|
2042
|
+
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 }))
|
2023
2043
|
});
|
2024
2044
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
2025
2045
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
2026
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
2046
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
2027
2047
|
let fromKName = '';
|
2028
2048
|
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))) {
|
2029
2049
|
fromKName = 'pdpPage';
|
@@ -2042,8 +2062,9 @@ function useEventReport() {
|
|
2042
2062
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2043
2063
|
position: position + '',
|
2044
2064
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2065
|
+
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 : '',
|
2045
2066
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2046
|
-
traceInfo: (
|
2067
|
+
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 : '',
|
2047
2068
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2048
2069
|
eventSubject: 'productView',
|
2049
2070
|
eventDescription: 'User browsed the product'
|
@@ -15858,7 +15879,7 @@ function WaterfallList(_a) {
|
|
15858
15879
|
* @Author: binruan@chatlabs.com
|
15859
15880
|
* @Date: 2024-01-10 10:58:24
|
15860
15881
|
* @LastEditors: binruan@chatlabs.com
|
15861
|
-
* @LastEditTime: 2025-
|
15882
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
15862
15883
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15863
15884
|
*
|
15864
15885
|
*/
|
@@ -15896,7 +15917,7 @@ const WaterFall = (props) => {
|
|
15896
15917
|
}
|
15897
15918
|
}, [waterFallData]);
|
15898
15919
|
const reportTagsView = React.useCallback(() => {
|
15899
|
-
var _a, _b, _c, _d, _e, _f;
|
15920
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15900
15921
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15901
15922
|
if (!rec)
|
15902
15923
|
return;
|
@@ -15916,9 +15937,10 @@ const WaterFall = (props) => {
|
|
15916
15937
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15917
15938
|
eventInfo: {
|
15918
15939
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15940
|
+
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 : '',
|
15919
15941
|
position: cacheActiveIndex + '',
|
15920
|
-
contentTags: JSON.stringify((
|
15921
|
-
traceInfo: (
|
15942
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
15943
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
15922
15944
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15923
15945
|
fromKName,
|
15924
15946
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -18000,21 +18022,22 @@ const LikeButton = (_a) => {
|
|
18000
18022
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
18001
18023
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
18002
18024
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
18003
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
18025
|
+
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, _6, _7;
|
18004
18026
|
if (state) {
|
18005
18027
|
// 先设置状态
|
18006
18028
|
setState(false);
|
18007
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
18029
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ itemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
18008
18030
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18009
18031
|
eventInfo: {
|
18010
18032
|
eventSubject: 'favoriteContentCanceled',
|
18011
18033
|
eventDescription: 'This content was unfavorite by the user',
|
18012
18034
|
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 : '',
|
18013
|
-
|
18014
|
-
|
18035
|
+
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 : '',
|
18036
|
+
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 : '',
|
18037
|
+
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 : []),
|
18015
18038
|
position: position + '',
|
18016
|
-
contentFormat: ((
|
18017
|
-
traceInfo: (
|
18039
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
18040
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18018
18041
|
}
|
18019
18042
|
});
|
18020
18043
|
// 如果接口调用失败,则回滚状态
|
@@ -18022,40 +18045,41 @@ const LikeButton = (_a) => {
|
|
18022
18045
|
setState(true);
|
18023
18046
|
}
|
18024
18047
|
else {
|
18025
|
-
const nRtcList = (
|
18048
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18026
18049
|
if (index === position) {
|
18027
18050
|
item.isCollected = false;
|
18028
18051
|
}
|
18029
18052
|
return item;
|
18030
|
-
})) !== null &&
|
18053
|
+
})) !== null && _s !== void 0 ? _s : [];
|
18031
18054
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18032
18055
|
}
|
18033
18056
|
}
|
18034
18057
|
else {
|
18035
18058
|
setState(true);
|
18036
|
-
const result = (
|
18059
|
+
const result = (_v = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData), itemId: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '' })))) !== null && _v !== void 0 ? _v : false;
|
18037
18060
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18038
18061
|
eventInfo: {
|
18039
18062
|
eventSubject: 'favoriteContent',
|
18040
18063
|
eventDescription: 'This content was favorite by the user',
|
18041
|
-
contentId: (
|
18042
|
-
|
18043
|
-
|
18064
|
+
contentId: (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
18065
|
+
sceneId: (_0 = (_z = (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.scene) === null || _z === void 0 ? void 0 : _z.sceneId) !== null && _0 !== void 0 ? _0 : '',
|
18066
|
+
contentName: (_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.title) !== null && _2 !== void 0 ? _2 : '',
|
18067
|
+
contentTags: JSON.stringify((_4 = (_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.tags) !== null && _4 !== void 0 ? _4 : []),
|
18044
18068
|
position: position + '',
|
18045
|
-
contentFormat: ((
|
18046
|
-
traceInfo: (
|
18069
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
18070
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
18047
18071
|
}
|
18048
18072
|
});
|
18049
18073
|
if (!result) {
|
18050
18074
|
setState(false);
|
18051
18075
|
}
|
18052
18076
|
else {
|
18053
|
-
const nRtcList = (
|
18077
|
+
const nRtcList = (_7 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18054
18078
|
if (index === position) {
|
18055
18079
|
item.isCollected = true;
|
18056
18080
|
}
|
18057
18081
|
return item;
|
18058
|
-
})) !== null &&
|
18082
|
+
})) !== null && _7 !== void 0 ? _7 : [];
|
18059
18083
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18060
18084
|
}
|
18061
18085
|
}
|
@@ -18092,7 +18116,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
18092
18116
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18093
18117
|
var _a, _b;
|
18094
18118
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
18095
|
-
const { bffEventReport, sxpParameter,
|
18119
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18096
18120
|
const videoStartTime = React.useRef(0);
|
18097
18121
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
18098
18122
|
const { isActive } = useSwiperSlide();
|
@@ -18158,6 +18182,23 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18158
18182
|
return;
|
18159
18183
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18160
18184
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18185
|
+
const handleEnd = () => {
|
18186
|
+
var _a, _b, _c, _d, _e, _f;
|
18187
|
+
if (!videoRef.current)
|
18188
|
+
return;
|
18189
|
+
if (isDiyH5) {
|
18190
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18191
|
+
if (!loopPlayRef.current)
|
18192
|
+
return;
|
18193
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18194
|
+
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;
|
18195
|
+
(_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);
|
18196
|
+
}
|
18197
|
+
}
|
18198
|
+
else {
|
18199
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18200
|
+
}
|
18201
|
+
};
|
18161
18202
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18162
18203
|
const handlePlaying = React.useCallback(() => {
|
18163
18204
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18166,7 +18207,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18166
18207
|
setIsLoadFinish(true);
|
18167
18208
|
}, []);
|
18168
18209
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18169
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18210
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
18170
18211
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18171
18212
|
return;
|
18172
18213
|
setIsPauseVideo(false);
|
@@ -18177,16 +18218,11 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18177
18218
|
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);
|
18178
18219
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18179
18220
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18180
|
-
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 : '',
|
18221
|
+
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) + '' }))
|
18181
18222
|
});
|
18182
18223
|
isFirstPlayRef.current = false;
|
18183
18224
|
}
|
18184
18225
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18185
|
-
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18186
|
-
if (isDiyH5) {
|
18187
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18188
|
-
}
|
18189
|
-
}, []);
|
18190
18226
|
const handLoadeddata = React.useCallback(() => {
|
18191
18227
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18192
18228
|
return;
|
@@ -18211,13 +18247,12 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18211
18247
|
const handleLoadedmetadata = React.useCallback(() => {
|
18212
18248
|
if (!videoRef.current)
|
18213
18249
|
return;
|
18214
|
-
setCurrentTimeByStartTime();
|
18215
18250
|
loadedTimeRef.current = new Date();
|
18216
18251
|
handleStartPlay();
|
18217
18252
|
handLoadeddata();
|
18218
18253
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18219
18254
|
const handleClickVideo = React.useCallback((type) => () => {
|
18220
|
-
var _a, _b, _c, _d, _e
|
18255
|
+
var _a, _b, _c, _d, _e;
|
18221
18256
|
if (!videoRef.current)
|
18222
18257
|
return;
|
18223
18258
|
if (!isLoadFinish)
|
@@ -18238,20 +18273,17 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18238
18273
|
break;
|
18239
18274
|
default:
|
18240
18275
|
if (isPause) {
|
18241
|
-
|
18242
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18243
|
-
}
|
18244
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18276
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
18245
18277
|
}
|
18246
18278
|
else {
|
18247
|
-
(
|
18279
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
18248
18280
|
}
|
18249
18281
|
setIsPauseVideo(!isPause);
|
18250
18282
|
break;
|
18251
18283
|
}
|
18252
18284
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18253
18285
|
const handlePause = React.useCallback(() => {
|
18254
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18286
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
18255
18287
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18256
18288
|
return;
|
18257
18289
|
if (activeIndex !== index)
|
@@ -18267,14 +18299,15 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18267
18299
|
eventSubject: 'playOverVideo',
|
18268
18300
|
eventDescription: 'User finished playing the video',
|
18269
18301
|
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 : '',
|
18270
|
-
|
18302
|
+
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 : '',
|
18303
|
+
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 : '',
|
18271
18304
|
endTime: videoCurrentTime,
|
18272
18305
|
videoDuration,
|
18273
18306
|
playDuration,
|
18274
|
-
contentTags: JSON.stringify((
|
18307
|
+
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 : []),
|
18275
18308
|
position: index + '',
|
18276
18309
|
contentFormat: 'video',
|
18277
|
-
traceInfo: (
|
18310
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18278
18311
|
}
|
18279
18312
|
});
|
18280
18313
|
}
|
@@ -18282,27 +18315,8 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18282
18315
|
const handleWaiting = React.useCallback(() => {
|
18283
18316
|
setWaiting(true);
|
18284
18317
|
}, []);
|
18285
|
-
const handleTimeUpload = () => {
|
18286
|
-
if (!videoRef.current || !isDiyH5)
|
18287
|
-
return;
|
18288
|
-
setTimeout(() => {
|
18289
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18290
|
-
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)) {
|
18291
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18292
|
-
if (!loopPlayRef.current)
|
18293
|
-
return;
|
18294
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18295
|
-
(_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);
|
18296
|
-
}
|
18297
|
-
else {
|
18298
|
-
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;
|
18299
|
-
(_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);
|
18300
|
-
}
|
18301
|
-
}
|
18302
|
-
});
|
18303
|
-
};
|
18304
18318
|
React.useEffect(() => {
|
18305
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18319
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18306
18320
|
if (!isActive)
|
18307
18321
|
return;
|
18308
18322
|
const videoSrc = videoUrl;
|
@@ -18323,7 +18337,6 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18323
18337
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18324
18338
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18325
18339
|
var _a;
|
18326
|
-
setCurrentTimeByStartTime();
|
18327
18340
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18328
18341
|
});
|
18329
18342
|
}
|
@@ -18337,12 +18350,11 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18337
18350
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18338
18351
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18339
18352
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18340
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18353
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
18341
18354
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18342
18355
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18343
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18344
18356
|
return () => {
|
18345
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18357
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18346
18358
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18347
18359
|
if (!isPause)
|
18348
18360
|
handlePause();
|
@@ -18354,10 +18366,9 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18354
18366
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18355
18367
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18356
18368
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18357
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18369
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
18358
18370
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18359
18371
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18360
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18361
18372
|
};
|
18362
18373
|
}, [isActive]);
|
18363
18374
|
React.useEffect(() => {
|
@@ -18568,19 +18579,45 @@ const Picture = (props) => {
|
|
18568
18579
|
}, onLoad: onShowFirstImage }))));
|
18569
18580
|
};
|
18570
18581
|
|
18571
|
-
const PictureGroup$4 = ({ imgUrls,
|
18582
|
+
const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
18572
18583
|
var _a, _b;
|
18573
18584
|
const { isActive } = useSwiperSlide();
|
18574
|
-
const {
|
18585
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
18575
18586
|
const [isLoad, setIsLoad] = React.useState(false);
|
18576
18587
|
const [imgInfo, setImgInfo] = React.useState();
|
18577
18588
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18578
|
-
const
|
18589
|
+
const imgsSwiperRef = React.useRef();
|
18579
18590
|
const isFirstPlayRef = React.useRef(true);
|
18591
|
+
const loopPlayRef = React.useRef(true);
|
18580
18592
|
const initTime = new Date();
|
18593
|
+
React.useImperativeHandle(ref, () => {
|
18594
|
+
return {
|
18595
|
+
setLoopPlay(v) {
|
18596
|
+
loopPlayRef.current = v;
|
18597
|
+
}
|
18598
|
+
};
|
18599
|
+
});
|
18600
|
+
React.useEffect(() => {
|
18601
|
+
let timerId;
|
18602
|
+
if (isLoad && isActive && isDiyH5) {
|
18603
|
+
timerId = setTimeout(() => {
|
18604
|
+
var _a, _b, _c, _d;
|
18605
|
+
if (!loopPlayRef.current)
|
18606
|
+
return;
|
18607
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18608
|
+
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;
|
18609
|
+
(_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);
|
18610
|
+
}
|
18611
|
+
}, 3000);
|
18612
|
+
}
|
18613
|
+
return () => {
|
18614
|
+
if (timerId)
|
18615
|
+
clearTimeout(timerId);
|
18616
|
+
};
|
18617
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18581
18618
|
React.useEffect(() => {
|
18582
18619
|
if (isLoad && isActive) {
|
18583
|
-
(
|
18620
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
18584
18621
|
if (openHashtag) {
|
18585
18622
|
onViewImageEndEvent(rec);
|
18586
18623
|
}
|
@@ -18590,7 +18627,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18590
18627
|
}
|
18591
18628
|
}
|
18592
18629
|
else {
|
18593
|
-
(
|
18630
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
18594
18631
|
}
|
18595
18632
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18596
18633
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18617,13 +18654,13 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18617
18654
|
};
|
18618
18655
|
}, [isActive, imgInfo]);
|
18619
18656
|
const handleMouseEnter = React.useCallback(() => {
|
18620
|
-
if (
|
18621
|
-
|
18657
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18658
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
18622
18659
|
}
|
18623
18660
|
}, []);
|
18624
18661
|
const handleMouseLeave = React.useCallback(() => {
|
18625
|
-
if (
|
18626
|
-
|
18662
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18663
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
18627
18664
|
}
|
18628
18665
|
}, []);
|
18629
18666
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18644,7 +18681,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18644
18681
|
enabled: true
|
18645
18682
|
}
|
18646
18683
|
}
|
18647
|
-
: {}), { loop: true, ref:
|
18684
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18648
18685
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18649
18686
|
fontSize: '14px'
|
18650
18687
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18661,7 +18698,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18661
18698
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18662
18699
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18663
18700
|
}))));
|
18664
|
-
};
|
18701
|
+
});
|
18665
18702
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18666
18703
|
|
18667
18704
|
/*
|
@@ -18941,7 +18978,7 @@ var NavBack$1 = React.memo(NavBack);
|
|
18941
18978
|
* @Author: binruan@chatlabs.com
|
18942
18979
|
* @Date: 2024-03-20 10:27:31
|
18943
18980
|
* @LastEditors: binruan@chatlabs.com
|
18944
|
-
* @LastEditTime: 2025-05-
|
18981
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
18945
18982
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18946
18983
|
*
|
18947
18984
|
*/
|
@@ -18961,6 +18998,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18961
18998
|
const skipLinkRef = React.useRef(false);
|
18962
18999
|
const [pageNum, setPageNum] = React.useState(2);
|
18963
19000
|
const videoWidgetRef = React.useRef(null);
|
19001
|
+
const pictureGroupRef = React.useRef(null);
|
18964
19002
|
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();
|
18965
19003
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18966
19004
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -19008,7 +19046,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19008
19046
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
19009
19047
|
}, [data, ctaType, swiperRef]);
|
19010
19048
|
const handleSessionCompleted = React.useCallback((fk) => {
|
19011
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
19049
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
19012
19050
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
19013
19051
|
let fromKName = '';
|
19014
19052
|
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))) {
|
@@ -19035,12 +19073,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19035
19073
|
eventSubject: 'sessionCompleted',
|
19036
19074
|
eventDescription: 'Session completed',
|
19037
19075
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
19038
|
-
|
19076
|
+
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 : '',
|
19077
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
19039
19078
|
position: activeIndex + '',
|
19040
19079
|
fromKName: fk || fromKName,
|
19041
19080
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19042
|
-
ctatId: (
|
19043
|
-
traceInfo: (
|
19081
|
+
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 : '',
|
19082
|
+
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 : ''
|
19044
19083
|
}
|
19045
19084
|
});
|
19046
19085
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19099,8 +19138,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19099
19138
|
refreshFeSession
|
19100
19139
|
]);
|
19101
19140
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
19102
|
-
var _a;
|
19141
|
+
var _a, _b;
|
19103
19142
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19143
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19104
19144
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19105
19145
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19106
19146
|
React.useEffect(() => {
|
@@ -19170,18 +19210,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19170
19210
|
return null;
|
19171
19211
|
}, [globalConfig, activeIndex, visList]);
|
19172
19212
|
const renderContent = React.useCallback((rec, index) => {
|
19173
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19213
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
19174
19214
|
if (rec === 'organic menu') {
|
19175
19215
|
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)));
|
19176
19216
|
}
|
19177
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
19217
|
+
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)) {
|
19178
19218
|
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 })));
|
19179
19219
|
}
|
19180
|
-
if ((
|
19181
|
-
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 }));
|
19220
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
19221
|
+
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 })));
|
19182
19222
|
}
|
19183
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19184
|
-
return (
|
19223
|
+
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) {
|
19224
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
19185
19225
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19186
19226
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19187
19227
|
const Component = withBindDataSource(t);
|
@@ -19219,7 +19259,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19219
19259
|
};
|
19220
19260
|
}, [isShowMore]);
|
19221
19261
|
const renderBottom = React.useCallback((rec, index) => {
|
19222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
19223
19263
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19224
19264
|
let cta = null;
|
19225
19265
|
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) {
|
@@ -19228,24 +19268,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19228
19268
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19229
19269
|
cta = '商品CTA';
|
19230
19270
|
}
|
19271
|
+
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)) {
|
19272
|
+
cta = '服务CTA';
|
19273
|
+
}
|
19231
19274
|
else {
|
19232
|
-
cta = (
|
19275
|
+
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;
|
19233
19276
|
}
|
19234
19277
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19235
19278
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19236
19279
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19237
|
-
((
|
19280
|
+
((_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));
|
19238
19281
|
return (React.createElement(React.Fragment, null,
|
19239
19282
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19240
|
-
((
|
19241
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19283
|
+
((_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' }),
|
19284
|
+
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` } },
|
19242
19285
|
React.createElement(Nudge, { nudge: nudge }),
|
19243
19286
|
((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' },
|
19244
19287
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19245
19288
|
React.createElement("div", null,
|
19246
|
-
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: (
|
19289
|
+
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 }),
|
19247
19290
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19248
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19291
|
+
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) }))),
|
19249
19292
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19250
19293
|
}
|
19251
19294
|
return null;
|
@@ -19284,7 +19327,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19284
19327
|
return null;
|
19285
19328
|
}, [globalConfig, waterFallData]);
|
19286
19329
|
const handleViewImageStartEnd = (item) => {
|
19287
|
-
var _a, _b, _c, _d, _e, _f;
|
19330
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19288
19331
|
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)) {
|
19289
19332
|
const endTime = Date.now();
|
19290
19333
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19293,10 +19336,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19293
19336
|
eventSubject: 'viewImageCarouselEnd',
|
19294
19337
|
eventDescription: 'User end view the image carousel',
|
19295
19338
|
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 : '',
|
19296
|
-
|
19339
|
+
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 : '',
|
19340
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19297
19341
|
imageEndTime: `${endTime}`,
|
19298
19342
|
playDuration: `${duration}`,
|
19299
|
-
contentTags: JSON.stringify((
|
19343
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19300
19344
|
position: activeIndex + '',
|
19301
19345
|
contentFormat: 'image',
|
19302
19346
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19305,7 +19349,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19305
19349
|
}
|
19306
19350
|
};
|
19307
19351
|
const handleSlideSkip = (item, position) => {
|
19308
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19352
|
+
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;
|
19309
19353
|
if (isPreview || waterFallData)
|
19310
19354
|
return;
|
19311
19355
|
const t = new Date() - curTime.current;
|
@@ -19331,7 +19375,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19331
19375
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19332
19376
|
position: position + '',
|
19333
19377
|
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 : '',
|
19334
|
-
|
19378
|
+
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 : '',
|
19379
|
+
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 : '',
|
19335
19380
|
contentFormat
|
19336
19381
|
}
|
19337
19382
|
});
|
@@ -19341,7 +19386,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19341
19386
|
}
|
19342
19387
|
};
|
19343
19388
|
const handleScrollEvent = (swiper) => {
|
19344
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19389
|
+
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;
|
19345
19390
|
const item = data[swiper.previousIndex];
|
19346
19391
|
if (!item)
|
19347
19392
|
return;
|
@@ -19358,11 +19403,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19358
19403
|
eventSubject: 'scrollDown',
|
19359
19404
|
eventDescription: 'User scroll down',
|
19360
19405
|
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 : '',
|
19361
|
-
|
19406
|
+
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 : '',
|
19407
|
+
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 : '',
|
19362
19408
|
requestId: null,
|
19363
|
-
traceInfo: (
|
19409
|
+
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 : '',
|
19364
19410
|
contentFormat,
|
19365
|
-
position: ((
|
19411
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
19366
19412
|
}
|
19367
19413
|
});
|
19368
19414
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19374,12 +19420,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19374
19420
|
eventInfo: {
|
19375
19421
|
eventSubject: 'scrollUp',
|
19376
19422
|
eventDescription: 'User scroll up',
|
19377
|
-
contentId: (
|
19378
|
-
|
19423
|
+
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 : '',
|
19424
|
+
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 : '',
|
19425
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19379
19426
|
requestId: null,
|
19380
|
-
traceInfo: (
|
19427
|
+
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 : '',
|
19381
19428
|
contentFormat,
|
19382
|
-
position: ((
|
19429
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
19383
19430
|
}
|
19384
19431
|
});
|
19385
19432
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19405,7 +19452,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19405
19452
|
}
|
19406
19453
|
}, [openHashtag, data, activeIndex]);
|
19407
19454
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19408
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19455
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
19409
19456
|
const item = data[activeIndex];
|
19410
19457
|
// 如果是图片集则上报事件
|
19411
19458
|
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)) {
|
@@ -19416,9 +19463,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19416
19463
|
eventSubject: 'viewImageCarouselStart',
|
19417
19464
|
eventDescription: 'User start view the image carousel',
|
19418
19465
|
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 : '',
|
19419
|
-
|
19466
|
+
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 : '',
|
19467
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19420
19468
|
imageStartTime: `${startTime}`,
|
19421
|
-
contentTags: JSON.stringify((
|
19469
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19422
19470
|
position: activeIndex + '',
|
19423
19471
|
contentFormat: 'image',
|
19424
19472
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19428,11 +19476,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19428
19476
|
if (enableCapi) {
|
19429
19477
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19430
19478
|
eventName: 'ViewContent',
|
19431
|
-
product: (
|
19479
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
19432
19480
|
});
|
19433
19481
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19434
19482
|
eventName: 'PageView',
|
19435
|
-
product: (
|
19483
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
19436
19484
|
});
|
19437
19485
|
}
|
19438
19486
|
}
|
@@ -19524,15 +19572,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19524
19572
|
swiperRef.current.swiper.allowTouchMove = true;
|
19525
19573
|
}, 500);
|
19526
19574
|
}, onActiveIndexChange: (swiper) => {
|
19575
|
+
var _a, _b;
|
19527
19576
|
setActiveIndex(swiper.activeIndex);
|
19528
19577
|
if (openHashtag)
|
19529
19578
|
return;
|
19530
19579
|
// 处理上滑下滑事件
|
19531
19580
|
handleScrollEvent(swiper);
|
19532
|
-
if (waterFallData || isEditor
|
19581
|
+
if (waterFallData || isEditor)
|
19533
19582
|
return;
|
19534
19583
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19535
19584
|
if (!isLoadMore) {
|
19585
|
+
if (isDiyH5) {
|
19586
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19587
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19588
|
+
}
|
19536
19589
|
setIsLoadMore(true);
|
19537
19590
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19538
19591
|
var _a;
|
@@ -19585,7 +19638,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19585
19638
|
}, []);
|
19586
19639
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19587
19640
|
const handlePlaying = React.useCallback(() => {
|
19588
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19641
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19589
19642
|
setIsPauseVideo(false);
|
19590
19643
|
const item = data[index];
|
19591
19644
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19598,14 +19651,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19598
19651
|
eventSubject: 'playVideo',
|
19599
19652
|
eventDescription: 'User played the video',
|
19600
19653
|
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 : '',
|
19601
|
-
|
19654
|
+
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 : '',
|
19655
|
+
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 : '',
|
19602
19656
|
playType,
|
19603
19657
|
startTime: videoCurrentTime,
|
19604
19658
|
videoDuration,
|
19605
|
-
contentTags: JSON.stringify((
|
19659
|
+
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 : []),
|
19606
19660
|
position: index + '',
|
19607
19661
|
contentFormat: 'video',
|
19608
|
-
traceInfo: (
|
19662
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19609
19663
|
}
|
19610
19664
|
});
|
19611
19665
|
setIsFirstPlay(false);
|
@@ -19644,7 +19698,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19644
19698
|
}
|
19645
19699
|
}, [isLoadFinish]);
|
19646
19700
|
const onPause = React.useCallback(() => {
|
19647
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19701
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19648
19702
|
const item = data[index];
|
19649
19703
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19650
19704
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19655,14 +19709,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19655
19709
|
eventSubject: 'playOverVideo',
|
19656
19710
|
eventDescription: 'User finished playing the video',
|
19657
19711
|
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 : '',
|
19658
|
-
|
19712
|
+
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 : '',
|
19713
|
+
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 : '',
|
19659
19714
|
endTime: videoCurrentTime,
|
19660
19715
|
videoDuration,
|
19661
19716
|
playDuration,
|
19662
|
-
contentTags: JSON.stringify((
|
19717
|
+
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 : []),
|
19663
19718
|
position: index + '',
|
19664
19719
|
contentFormat: 'video',
|
19665
|
-
traceInfo: (
|
19720
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19666
19721
|
}
|
19667
19722
|
});
|
19668
19723
|
}
|