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/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: '' });
|
@@ -730,7 +731,7 @@
|
|
730
731
|
}, [bffDataSource]);
|
731
732
|
// bff API 请求方法
|
732
733
|
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
733
|
-
var _a;
|
734
|
+
var _a, _b;
|
734
735
|
if (!bffDataSource)
|
735
736
|
return;
|
736
737
|
const url = bffDataSource.url;
|
@@ -743,8 +744,9 @@
|
|
743
744
|
val.split('=')[0];
|
744
745
|
val.split('=')[1];
|
745
746
|
});
|
747
|
+
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
746
748
|
return window
|
747
|
-
.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
|
749
|
+
.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
|
748
750
|
? JSON.stringify({
|
749
751
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
750
752
|
})
|
@@ -1019,6 +1021,9 @@
|
|
1019
1021
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
1020
1022
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1021
1023
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1024
|
+
if (isDiyH5) {
|
1025
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1026
|
+
}
|
1022
1027
|
}
|
1023
1028
|
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));
|
1024
1029
|
if (isNotNullList) {
|
@@ -1058,12 +1063,17 @@
|
|
1058
1063
|
if (rtcList.length <= 0) {
|
1059
1064
|
return;
|
1060
1065
|
}
|
1066
|
+
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1067
|
+
setRtcList(rtcList.concat(firstRtcList));
|
1068
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1069
|
+
return;
|
1070
|
+
}
|
1061
1071
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1062
1072
|
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 })));
|
1063
1073
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1064
1074
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1065
1075
|
return data;
|
1066
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1076
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyH5, firstRtcList]);
|
1067
1077
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
1068
1078
|
var _a, _b, _c, _d, _e;
|
1069
1079
|
let expire = false;
|
@@ -1094,8 +1104,8 @@
|
|
1094
1104
|
// 用户信息都是公共的
|
1095
1105
|
if (!userInfo) {
|
1096
1106
|
userInfo = {
|
1097
|
-
|
1098
|
-
|
1107
|
+
productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
|
1108
|
+
// tpChannelId: 'H5' // 后端处理
|
1099
1109
|
};
|
1100
1110
|
}
|
1101
1111
|
const sessionID = storeAndLoadFeSessionId();
|
@@ -1129,7 +1139,8 @@
|
|
1129
1139
|
layoutVariantId,
|
1130
1140
|
globalConfig,
|
1131
1141
|
playbookType,
|
1132
|
-
bffDataSource
|
1142
|
+
bffDataSource,
|
1143
|
+
fakeUserId
|
1133
1144
|
]);
|
1134
1145
|
const getEventParamsByJson = React.useCallback((json, product) => {
|
1135
1146
|
var _a, _b, _c;
|
@@ -1262,13 +1273,15 @@
|
|
1262
1273
|
}
|
1263
1274
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
1264
1275
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1276
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1265
1277
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
1266
1278
|
return res === null || res === void 0 ? void 0 : res.success;
|
1267
|
-
}), [bffFetch]);
|
1279
|
+
}), [bffFetch, fakeUserId]);
|
1268
1280
|
const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1281
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1269
1282
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
1270
1283
|
return res === null || res === void 0 ? void 0 : res.success;
|
1271
|
-
}), [bffFetch]);
|
1284
|
+
}), [bffFetch, fakeUserId]);
|
1272
1285
|
const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1273
1286
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
1274
1287
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -1293,7 +1306,7 @@
|
|
1293
1306
|
}
|
1294
1307
|
}), [bffFetch, utmVal]);
|
1295
1308
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1296
|
-
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;
|
1309
|
+
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;
|
1297
1310
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1298
1311
|
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);
|
1299
1312
|
let fromKName = '';
|
@@ -1311,7 +1324,7 @@
|
|
1311
1324
|
}
|
1312
1325
|
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;
|
1313
1326
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1314
|
-
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: (
|
1327
|
+
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 })
|
1315
1328
|
});
|
1316
1329
|
}, [bffEventReport, isFromHashtag]);
|
1317
1330
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1413,6 +1426,9 @@
|
|
1413
1426
|
}
|
1414
1427
|
setRtcList(list);
|
1415
1428
|
setCacheRtcList(list);
|
1429
|
+
if (isDiyH5) {
|
1430
|
+
setFirstRtcList(list);
|
1431
|
+
}
|
1416
1432
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1417
1433
|
if (channel) {
|
1418
1434
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1448,6 +1464,9 @@
|
|
1448
1464
|
}
|
1449
1465
|
setRtcList(list);
|
1450
1466
|
setCacheRtcList(list);
|
1467
|
+
if (isDiyH5) {
|
1468
|
+
setFirstRtcList(list);
|
1469
|
+
}
|
1451
1470
|
}
|
1452
1471
|
})
|
1453
1472
|
.finally(() => {
|
@@ -1511,7 +1530,8 @@
|
|
1511
1530
|
refreshFeSession,
|
1512
1531
|
getAccount,
|
1513
1532
|
accountSonsent,
|
1514
|
-
isDiyH5
|
1533
|
+
isDiyH5,
|
1534
|
+
firstRtcList
|
1515
1535
|
} }, 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({
|
1516
1536
|
rtcList,
|
1517
1537
|
mutateLike: bffMutateLike,
|
@@ -1972,14 +1992,14 @@
|
|
1972
1992
|
* @Author: binruan@chatlabs.com
|
1973
1993
|
* @Date: 2024-03-12 10:59:06
|
1974
1994
|
* @LastEditors: binruan@chatlabs.com
|
1975
|
-
* @LastEditTime:
|
1995
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
1976
1996
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1977
1997
|
*
|
1978
1998
|
*/
|
1979
1999
|
function useEventReport() {
|
1980
2000
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1981
2001
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1982
|
-
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;
|
2002
|
+
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;
|
1983
2003
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1984
2004
|
if (i !== -1) {
|
1985
2005
|
return;
|
@@ -2012,11 +2032,11 @@
|
|
2012
2032
|
contentFormat = 'image';
|
2013
2033
|
}
|
2014
2034
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
2015
|
-
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 : '',
|
2035
|
+
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 }))
|
2016
2036
|
});
|
2017
2037
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
2018
2038
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
2019
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
2039
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
2020
2040
|
let fromKName = '';
|
2021
2041
|
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))) {
|
2022
2042
|
fromKName = 'pdpPage';
|
@@ -2035,8 +2055,9 @@
|
|
2035
2055
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2036
2056
|
position: position + '',
|
2037
2057
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2058
|
+
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 : '',
|
2038
2059
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2039
|
-
traceInfo: (
|
2060
|
+
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 : '',
|
2040
2061
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2041
2062
|
eventSubject: 'productView',
|
2042
2063
|
eventDescription: 'User browsed the product'
|
@@ -15851,7 +15872,7 @@ Made in Italy` })));
|
|
15851
15872
|
* @Author: binruan@chatlabs.com
|
15852
15873
|
* @Date: 2024-01-10 10:58:24
|
15853
15874
|
* @LastEditors: binruan@chatlabs.com
|
15854
|
-
* @LastEditTime: 2025-
|
15875
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
15855
15876
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15856
15877
|
*
|
15857
15878
|
*/
|
@@ -15889,7 +15910,7 @@ Made in Italy` })));
|
|
15889
15910
|
}
|
15890
15911
|
}, [waterFallData]);
|
15891
15912
|
const reportTagsView = React.useCallback(() => {
|
15892
|
-
var _a, _b, _c, _d, _e, _f;
|
15913
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15893
15914
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15894
15915
|
if (!rec)
|
15895
15916
|
return;
|
@@ -15909,9 +15930,10 @@ Made in Italy` })));
|
|
15909
15930
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15910
15931
|
eventInfo: {
|
15911
15932
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15933
|
+
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 : '',
|
15912
15934
|
position: cacheActiveIndex + '',
|
15913
|
-
contentTags: JSON.stringify((
|
15914
|
-
traceInfo: (
|
15935
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
15936
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
15915
15937
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15916
15938
|
fromKName,
|
15917
15939
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17993,21 +18015,22 @@ Made in Italy` })));
|
|
17993
18015
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17994
18016
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17995
18017
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17996
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
18018
|
+
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;
|
17997
18019
|
if (state) {
|
17998
18020
|
// 先设置状态
|
17999
18021
|
setState(false);
|
18000
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
18022
|
+
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;
|
18001
18023
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18002
18024
|
eventInfo: {
|
18003
18025
|
eventSubject: 'favoriteContentCanceled',
|
18004
18026
|
eventDescription: 'This content was unfavorite by the user',
|
18005
18027
|
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 : '',
|
18006
|
-
|
18007
|
-
|
18028
|
+
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 : '',
|
18029
|
+
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 : '',
|
18030
|
+
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 : []),
|
18008
18031
|
position: position + '',
|
18009
|
-
contentFormat: ((
|
18010
|
-
traceInfo: (
|
18032
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
18033
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18011
18034
|
}
|
18012
18035
|
});
|
18013
18036
|
// 如果接口调用失败,则回滚状态
|
@@ -18015,40 +18038,41 @@ Made in Italy` })));
|
|
18015
18038
|
setState(true);
|
18016
18039
|
}
|
18017
18040
|
else {
|
18018
|
-
const nRtcList = (
|
18041
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18019
18042
|
if (index === position) {
|
18020
18043
|
item.isCollected = false;
|
18021
18044
|
}
|
18022
18045
|
return item;
|
18023
|
-
})) !== null &&
|
18046
|
+
})) !== null && _s !== void 0 ? _s : [];
|
18024
18047
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18025
18048
|
}
|
18026
18049
|
}
|
18027
18050
|
else {
|
18028
18051
|
setState(true);
|
18029
|
-
const result = (
|
18052
|
+
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;
|
18030
18053
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18031
18054
|
eventInfo: {
|
18032
18055
|
eventSubject: 'favoriteContent',
|
18033
18056
|
eventDescription: 'This content was favorite by the user',
|
18034
|
-
contentId: (
|
18035
|
-
|
18036
|
-
|
18057
|
+
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 : '',
|
18058
|
+
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 : '',
|
18059
|
+
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 : '',
|
18060
|
+
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 : []),
|
18037
18061
|
position: position + '',
|
18038
|
-
contentFormat: ((
|
18039
|
-
traceInfo: (
|
18062
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
18063
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
18040
18064
|
}
|
18041
18065
|
});
|
18042
18066
|
if (!result) {
|
18043
18067
|
setState(false);
|
18044
18068
|
}
|
18045
18069
|
else {
|
18046
|
-
const nRtcList = (
|
18070
|
+
const nRtcList = (_7 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18047
18071
|
if (index === position) {
|
18048
18072
|
item.isCollected = true;
|
18049
18073
|
}
|
18050
18074
|
return item;
|
18051
|
-
})) !== null &&
|
18075
|
+
})) !== null && _7 !== void 0 ? _7 : [];
|
18052
18076
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18053
18077
|
}
|
18054
18078
|
}
|
@@ -18085,7 +18109,7 @@ Made in Italy` })));
|
|
18085
18109
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18086
18110
|
var _a, _b;
|
18087
18111
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
18088
|
-
const { bffEventReport, sxpParameter,
|
18112
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18089
18113
|
const videoStartTime = React.useRef(0);
|
18090
18114
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
18091
18115
|
const { isActive } = useSwiperSlide();
|
@@ -18151,6 +18175,23 @@ Made in Italy` })));
|
|
18151
18175
|
return;
|
18152
18176
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18153
18177
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18178
|
+
const handleEnd = () => {
|
18179
|
+
var _a, _b, _c, _d, _e, _f;
|
18180
|
+
if (!videoRef.current)
|
18181
|
+
return;
|
18182
|
+
if (isDiyH5) {
|
18183
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18184
|
+
if (!loopPlayRef.current)
|
18185
|
+
return;
|
18186
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18187
|
+
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;
|
18188
|
+
(_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);
|
18189
|
+
}
|
18190
|
+
}
|
18191
|
+
else {
|
18192
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18193
|
+
}
|
18194
|
+
};
|
18154
18195
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18155
18196
|
const handlePlaying = React.useCallback(() => {
|
18156
18197
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18159,7 +18200,7 @@ Made in Italy` })));
|
|
18159
18200
|
setIsLoadFinish(true);
|
18160
18201
|
}, []);
|
18161
18202
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18162
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18203
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
18163
18204
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18164
18205
|
return;
|
18165
18206
|
setIsPauseVideo(false);
|
@@ -18170,16 +18211,11 @@ Made in Italy` })));
|
|
18170
18211
|
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);
|
18171
18212
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18172
18213
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18173
|
-
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 : '',
|
18214
|
+
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) + '' }))
|
18174
18215
|
});
|
18175
18216
|
isFirstPlayRef.current = false;
|
18176
18217
|
}
|
18177
18218
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18178
|
-
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18179
|
-
if (isDiyH5) {
|
18180
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18181
|
-
}
|
18182
|
-
}, []);
|
18183
18219
|
const handLoadeddata = React.useCallback(() => {
|
18184
18220
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18185
18221
|
return;
|
@@ -18204,13 +18240,12 @@ Made in Italy` })));
|
|
18204
18240
|
const handleLoadedmetadata = React.useCallback(() => {
|
18205
18241
|
if (!videoRef.current)
|
18206
18242
|
return;
|
18207
|
-
setCurrentTimeByStartTime();
|
18208
18243
|
loadedTimeRef.current = new Date();
|
18209
18244
|
handleStartPlay();
|
18210
18245
|
handLoadeddata();
|
18211
18246
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18212
18247
|
const handleClickVideo = React.useCallback((type) => () => {
|
18213
|
-
var _a, _b, _c, _d, _e
|
18248
|
+
var _a, _b, _c, _d, _e;
|
18214
18249
|
if (!videoRef.current)
|
18215
18250
|
return;
|
18216
18251
|
if (!isLoadFinish)
|
@@ -18231,20 +18266,17 @@ Made in Italy` })));
|
|
18231
18266
|
break;
|
18232
18267
|
default:
|
18233
18268
|
if (isPause) {
|
18234
|
-
|
18235
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18236
|
-
}
|
18237
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18269
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
18238
18270
|
}
|
18239
18271
|
else {
|
18240
|
-
(
|
18272
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
18241
18273
|
}
|
18242
18274
|
setIsPauseVideo(!isPause);
|
18243
18275
|
break;
|
18244
18276
|
}
|
18245
18277
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18246
18278
|
const handlePause = React.useCallback(() => {
|
18247
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18279
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
18248
18280
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18249
18281
|
return;
|
18250
18282
|
if (activeIndex !== index)
|
@@ -18260,14 +18292,15 @@ Made in Italy` })));
|
|
18260
18292
|
eventSubject: 'playOverVideo',
|
18261
18293
|
eventDescription: 'User finished playing the video',
|
18262
18294
|
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 : '',
|
18263
|
-
|
18295
|
+
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 : '',
|
18296
|
+
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 : '',
|
18264
18297
|
endTime: videoCurrentTime,
|
18265
18298
|
videoDuration,
|
18266
18299
|
playDuration,
|
18267
|
-
contentTags: JSON.stringify((
|
18300
|
+
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 : []),
|
18268
18301
|
position: index + '',
|
18269
18302
|
contentFormat: 'video',
|
18270
|
-
traceInfo: (
|
18303
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18271
18304
|
}
|
18272
18305
|
});
|
18273
18306
|
}
|
@@ -18275,27 +18308,8 @@ Made in Italy` })));
|
|
18275
18308
|
const handleWaiting = React.useCallback(() => {
|
18276
18309
|
setWaiting(true);
|
18277
18310
|
}, []);
|
18278
|
-
const handleTimeUpload = () => {
|
18279
|
-
if (!videoRef.current || !isDiyH5)
|
18280
|
-
return;
|
18281
|
-
setTimeout(() => {
|
18282
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18283
|
-
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)) {
|
18284
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18285
|
-
if (!loopPlayRef.current)
|
18286
|
-
return;
|
18287
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18288
|
-
(_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);
|
18289
|
-
}
|
18290
|
-
else {
|
18291
|
-
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;
|
18292
|
-
(_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);
|
18293
|
-
}
|
18294
|
-
}
|
18295
|
-
});
|
18296
|
-
};
|
18297
18311
|
React.useEffect(() => {
|
18298
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18312
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18299
18313
|
if (!isActive)
|
18300
18314
|
return;
|
18301
18315
|
const videoSrc = videoUrl;
|
@@ -18316,7 +18330,6 @@ Made in Italy` })));
|
|
18316
18330
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18317
18331
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18318
18332
|
var _a;
|
18319
|
-
setCurrentTimeByStartTime();
|
18320
18333
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18321
18334
|
});
|
18322
18335
|
}
|
@@ -18330,12 +18343,11 @@ Made in Italy` })));
|
|
18330
18343
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18331
18344
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18332
18345
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18333
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18346
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
18334
18347
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18335
18348
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18336
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18337
18349
|
return () => {
|
18338
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18350
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18339
18351
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18340
18352
|
if (!isPause)
|
18341
18353
|
handlePause();
|
@@ -18347,10 +18359,9 @@ Made in Italy` })));
|
|
18347
18359
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18348
18360
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18349
18361
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18350
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18362
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
18351
18363
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18352
18364
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18353
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18354
18365
|
};
|
18355
18366
|
}, [isActive]);
|
18356
18367
|
React.useEffect(() => {
|
@@ -18561,19 +18572,45 @@ Made in Italy` })));
|
|
18561
18572
|
}, onLoad: onShowFirstImage }))));
|
18562
18573
|
};
|
18563
18574
|
|
18564
|
-
const PictureGroup$4 = ({ imgUrls,
|
18575
|
+
const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
18565
18576
|
var _a, _b;
|
18566
18577
|
const { isActive } = useSwiperSlide();
|
18567
|
-
const {
|
18578
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
18568
18579
|
const [isLoad, setIsLoad] = React.useState(false);
|
18569
18580
|
const [imgInfo, setImgInfo] = React.useState();
|
18570
18581
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18571
|
-
const
|
18582
|
+
const imgsSwiperRef = React.useRef();
|
18572
18583
|
const isFirstPlayRef = React.useRef(true);
|
18584
|
+
const loopPlayRef = React.useRef(true);
|
18573
18585
|
const initTime = new Date();
|
18586
|
+
React.useImperativeHandle(ref, () => {
|
18587
|
+
return {
|
18588
|
+
setLoopPlay(v) {
|
18589
|
+
loopPlayRef.current = v;
|
18590
|
+
}
|
18591
|
+
};
|
18592
|
+
});
|
18593
|
+
React.useEffect(() => {
|
18594
|
+
let timerId;
|
18595
|
+
if (isLoad && isActive && isDiyH5) {
|
18596
|
+
timerId = setTimeout(() => {
|
18597
|
+
var _a, _b, _c, _d;
|
18598
|
+
if (!loopPlayRef.current)
|
18599
|
+
return;
|
18600
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18601
|
+
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;
|
18602
|
+
(_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);
|
18603
|
+
}
|
18604
|
+
}, 3000);
|
18605
|
+
}
|
18606
|
+
return () => {
|
18607
|
+
if (timerId)
|
18608
|
+
clearTimeout(timerId);
|
18609
|
+
};
|
18610
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18574
18611
|
React.useEffect(() => {
|
18575
18612
|
if (isLoad && isActive) {
|
18576
|
-
(
|
18613
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
18577
18614
|
if (openHashtag) {
|
18578
18615
|
onViewImageEndEvent(rec);
|
18579
18616
|
}
|
@@ -18583,7 +18620,7 @@ Made in Italy` })));
|
|
18583
18620
|
}
|
18584
18621
|
}
|
18585
18622
|
else {
|
18586
|
-
(
|
18623
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
18587
18624
|
}
|
18588
18625
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18589
18626
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18610,13 +18647,13 @@ Made in Italy` })));
|
|
18610
18647
|
};
|
18611
18648
|
}, [isActive, imgInfo]);
|
18612
18649
|
const handleMouseEnter = React.useCallback(() => {
|
18613
|
-
if (
|
18614
|
-
|
18650
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18651
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
18615
18652
|
}
|
18616
18653
|
}, []);
|
18617
18654
|
const handleMouseLeave = React.useCallback(() => {
|
18618
|
-
if (
|
18619
|
-
|
18655
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18656
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
18620
18657
|
}
|
18621
18658
|
}, []);
|
18622
18659
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18637,7 +18674,7 @@ Made in Italy` })));
|
|
18637
18674
|
enabled: true
|
18638
18675
|
}
|
18639
18676
|
}
|
18640
|
-
: {}), { loop: true, ref:
|
18677
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18641
18678
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18642
18679
|
fontSize: '14px'
|
18643
18680
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18654,7 +18691,7 @@ Made in Italy` })));
|
|
18654
18691
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18655
18692
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18656
18693
|
}))));
|
18657
|
-
};
|
18694
|
+
});
|
18658
18695
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18659
18696
|
|
18660
18697
|
/*
|
@@ -18934,7 +18971,7 @@ Made in Italy` })));
|
|
18934
18971
|
* @Author: binruan@chatlabs.com
|
18935
18972
|
* @Date: 2024-03-20 10:27:31
|
18936
18973
|
* @LastEditors: binruan@chatlabs.com
|
18937
|
-
* @LastEditTime: 2025-05-
|
18974
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
18938
18975
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18939
18976
|
*
|
18940
18977
|
*/
|
@@ -18954,6 +18991,7 @@ Made in Italy` })));
|
|
18954
18991
|
const skipLinkRef = React.useRef(false);
|
18955
18992
|
const [pageNum, setPageNum] = React.useState(2);
|
18956
18993
|
const videoWidgetRef = React.useRef(null);
|
18994
|
+
const pictureGroupRef = React.useRef(null);
|
18957
18995
|
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();
|
18958
18996
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18959
18997
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -19001,7 +19039,7 @@ Made in Italy` })));
|
|
19001
19039
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
19002
19040
|
}, [data, ctaType, swiperRef]);
|
19003
19041
|
const handleSessionCompleted = React.useCallback((fk) => {
|
19004
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
19042
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
19005
19043
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
19006
19044
|
let fromKName = '';
|
19007
19045
|
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))) {
|
@@ -19028,12 +19066,13 @@ Made in Italy` })));
|
|
19028
19066
|
eventSubject: 'sessionCompleted',
|
19029
19067
|
eventDescription: 'Session completed',
|
19030
19068
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
19031
|
-
|
19069
|
+
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 : '',
|
19070
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
19032
19071
|
position: activeIndex + '',
|
19033
19072
|
fromKName: fk || fromKName,
|
19034
19073
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19035
|
-
ctatId: (
|
19036
|
-
traceInfo: (
|
19074
|
+
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 : '',
|
19075
|
+
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 : ''
|
19037
19076
|
}
|
19038
19077
|
});
|
19039
19078
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19092,8 +19131,9 @@ Made in Italy` })));
|
|
19092
19131
|
refreshFeSession
|
19093
19132
|
]);
|
19094
19133
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
19095
|
-
var _a;
|
19134
|
+
var _a, _b;
|
19096
19135
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19136
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19097
19137
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19098
19138
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19099
19139
|
React.useEffect(() => {
|
@@ -19163,18 +19203,18 @@ Made in Italy` })));
|
|
19163
19203
|
return null;
|
19164
19204
|
}, [globalConfig, activeIndex, visList]);
|
19165
19205
|
const renderContent = React.useCallback((rec, index) => {
|
19166
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19206
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
19167
19207
|
if (rec === 'organic menu') {
|
19168
19208
|
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)));
|
19169
19209
|
}
|
19170
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
19210
|
+
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)) {
|
19171
19211
|
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 })));
|
19172
19212
|
}
|
19173
|
-
if ((
|
19174
|
-
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 }));
|
19213
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
19214
|
+
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 })));
|
19175
19215
|
}
|
19176
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19177
|
-
return (
|
19216
|
+
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) {
|
19217
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
19178
19218
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19179
19219
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19180
19220
|
const Component = withBindDataSource(t);
|
@@ -19212,7 +19252,7 @@ Made in Italy` })));
|
|
19212
19252
|
};
|
19213
19253
|
}, [isShowMore]);
|
19214
19254
|
const renderBottom = React.useCallback((rec, index) => {
|
19215
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19255
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
19216
19256
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19217
19257
|
let cta = null;
|
19218
19258
|
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) {
|
@@ -19221,24 +19261,27 @@ Made in Italy` })));
|
|
19221
19261
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19222
19262
|
cta = '商品CTA';
|
19223
19263
|
}
|
19264
|
+
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)) {
|
19265
|
+
cta = '服务CTA';
|
19266
|
+
}
|
19224
19267
|
else {
|
19225
|
-
cta = (
|
19268
|
+
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;
|
19226
19269
|
}
|
19227
19270
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19228
19271
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19229
19272
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19230
|
-
((
|
19273
|
+
((_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));
|
19231
19274
|
return (React.createElement(React.Fragment, null,
|
19232
19275
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19233
|
-
((
|
19234
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19276
|
+
((_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' }),
|
19277
|
+
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` } },
|
19235
19278
|
React.createElement(Nudge, { nudge: nudge }),
|
19236
19279
|
((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' },
|
19237
19280
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19238
19281
|
React.createElement("div", null,
|
19239
|
-
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: (
|
19282
|
+
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 }),
|
19240
19283
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19241
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19284
|
+
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) }))),
|
19242
19285
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19243
19286
|
}
|
19244
19287
|
return null;
|
@@ -19277,7 +19320,7 @@ Made in Italy` })));
|
|
19277
19320
|
return null;
|
19278
19321
|
}, [globalConfig, waterFallData]);
|
19279
19322
|
const handleViewImageStartEnd = (item) => {
|
19280
|
-
var _a, _b, _c, _d, _e, _f;
|
19323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19281
19324
|
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)) {
|
19282
19325
|
const endTime = Date.now();
|
19283
19326
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19286,10 +19329,11 @@ Made in Italy` })));
|
|
19286
19329
|
eventSubject: 'viewImageCarouselEnd',
|
19287
19330
|
eventDescription: 'User end view the image carousel',
|
19288
19331
|
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 : '',
|
19289
|
-
|
19332
|
+
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 : '',
|
19333
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19290
19334
|
imageEndTime: `${endTime}`,
|
19291
19335
|
playDuration: `${duration}`,
|
19292
|
-
contentTags: JSON.stringify((
|
19336
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19293
19337
|
position: activeIndex + '',
|
19294
19338
|
contentFormat: 'image',
|
19295
19339
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19298,7 +19342,7 @@ Made in Italy` })));
|
|
19298
19342
|
}
|
19299
19343
|
};
|
19300
19344
|
const handleSlideSkip = (item, position) => {
|
19301
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
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;
|
19302
19346
|
if (isPreview || waterFallData)
|
19303
19347
|
return;
|
19304
19348
|
const t = new Date() - curTime.current;
|
@@ -19324,7 +19368,8 @@ Made in Italy` })));
|
|
19324
19368
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19325
19369
|
position: position + '',
|
19326
19370
|
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 : '',
|
19327
|
-
|
19371
|
+
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 : '',
|
19372
|
+
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 : '',
|
19328
19373
|
contentFormat
|
19329
19374
|
}
|
19330
19375
|
});
|
@@ -19334,7 +19379,7 @@ Made in Italy` })));
|
|
19334
19379
|
}
|
19335
19380
|
};
|
19336
19381
|
const handleScrollEvent = (swiper) => {
|
19337
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19382
|
+
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;
|
19338
19383
|
const item = data[swiper.previousIndex];
|
19339
19384
|
if (!item)
|
19340
19385
|
return;
|
@@ -19351,11 +19396,12 @@ Made in Italy` })));
|
|
19351
19396
|
eventSubject: 'scrollDown',
|
19352
19397
|
eventDescription: 'User scroll down',
|
19353
19398
|
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 : '',
|
19354
|
-
|
19399
|
+
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 : '',
|
19400
|
+
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 : '',
|
19355
19401
|
requestId: null,
|
19356
|
-
traceInfo: (
|
19402
|
+
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 : '',
|
19357
19403
|
contentFormat,
|
19358
|
-
position: ((
|
19404
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
19359
19405
|
}
|
19360
19406
|
});
|
19361
19407
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19367,12 +19413,13 @@ Made in Italy` })));
|
|
19367
19413
|
eventInfo: {
|
19368
19414
|
eventSubject: 'scrollUp',
|
19369
19415
|
eventDescription: 'User scroll up',
|
19370
|
-
contentId: (
|
19371
|
-
|
19416
|
+
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 : '',
|
19417
|
+
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 : '',
|
19418
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19372
19419
|
requestId: null,
|
19373
|
-
traceInfo: (
|
19420
|
+
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 : '',
|
19374
19421
|
contentFormat,
|
19375
|
-
position: ((
|
19422
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
19376
19423
|
}
|
19377
19424
|
});
|
19378
19425
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19398,7 +19445,7 @@ Made in Italy` })));
|
|
19398
19445
|
}
|
19399
19446
|
}, [openHashtag, data, activeIndex]);
|
19400
19447
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19401
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19448
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
19402
19449
|
const item = data[activeIndex];
|
19403
19450
|
// 如果是图片集则上报事件
|
19404
19451
|
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)) {
|
@@ -19409,9 +19456,10 @@ Made in Italy` })));
|
|
19409
19456
|
eventSubject: 'viewImageCarouselStart',
|
19410
19457
|
eventDescription: 'User start view the image carousel',
|
19411
19458
|
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 : '',
|
19412
|
-
|
19459
|
+
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 : '',
|
19460
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19413
19461
|
imageStartTime: `${startTime}`,
|
19414
|
-
contentTags: JSON.stringify((
|
19462
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19415
19463
|
position: activeIndex + '',
|
19416
19464
|
contentFormat: 'image',
|
19417
19465
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19421,11 +19469,11 @@ Made in Italy` })));
|
|
19421
19469
|
if (enableCapi) {
|
19422
19470
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19423
19471
|
eventName: 'ViewContent',
|
19424
|
-
product: (
|
19472
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
19425
19473
|
});
|
19426
19474
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19427
19475
|
eventName: 'PageView',
|
19428
|
-
product: (
|
19476
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
19429
19477
|
});
|
19430
19478
|
}
|
19431
19479
|
}
|
@@ -19517,15 +19565,20 @@ Made in Italy` })));
|
|
19517
19565
|
swiperRef.current.swiper.allowTouchMove = true;
|
19518
19566
|
}, 500);
|
19519
19567
|
}, onActiveIndexChange: (swiper) => {
|
19568
|
+
var _a, _b;
|
19520
19569
|
setActiveIndex(swiper.activeIndex);
|
19521
19570
|
if (openHashtag)
|
19522
19571
|
return;
|
19523
19572
|
// 处理上滑下滑事件
|
19524
19573
|
handleScrollEvent(swiper);
|
19525
|
-
if (waterFallData || isEditor
|
19574
|
+
if (waterFallData || isEditor)
|
19526
19575
|
return;
|
19527
19576
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19528
19577
|
if (!isLoadMore) {
|
19578
|
+
if (isDiyH5) {
|
19579
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19580
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19581
|
+
}
|
19529
19582
|
setIsLoadMore(true);
|
19530
19583
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19531
19584
|
var _a;
|
@@ -19578,7 +19631,7 @@ Made in Italy` })));
|
|
19578
19631
|
}, []);
|
19579
19632
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19580
19633
|
const handlePlaying = React.useCallback(() => {
|
19581
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19634
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19582
19635
|
setIsPauseVideo(false);
|
19583
19636
|
const item = data[index];
|
19584
19637
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19591,14 +19644,15 @@ Made in Italy` })));
|
|
19591
19644
|
eventSubject: 'playVideo',
|
19592
19645
|
eventDescription: 'User played the video',
|
19593
19646
|
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 : '',
|
19594
|
-
|
19647
|
+
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 : '',
|
19648
|
+
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 : '',
|
19595
19649
|
playType,
|
19596
19650
|
startTime: videoCurrentTime,
|
19597
19651
|
videoDuration,
|
19598
|
-
contentTags: JSON.stringify((
|
19652
|
+
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 : []),
|
19599
19653
|
position: index + '',
|
19600
19654
|
contentFormat: 'video',
|
19601
|
-
traceInfo: (
|
19655
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19602
19656
|
}
|
19603
19657
|
});
|
19604
19658
|
setIsFirstPlay(false);
|
@@ -19637,7 +19691,7 @@ Made in Italy` })));
|
|
19637
19691
|
}
|
19638
19692
|
}, [isLoadFinish]);
|
19639
19693
|
const onPause = React.useCallback(() => {
|
19640
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19694
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19641
19695
|
const item = data[index];
|
19642
19696
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19643
19697
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19648,14 +19702,15 @@ Made in Italy` })));
|
|
19648
19702
|
eventSubject: 'playOverVideo',
|
19649
19703
|
eventDescription: 'User finished playing the video',
|
19650
19704
|
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 : '',
|
19651
|
-
|
19705
|
+
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 : '',
|
19706
|
+
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 : '',
|
19652
19707
|
endTime: videoCurrentTime,
|
19653
19708
|
videoDuration,
|
19654
19709
|
playDuration,
|
19655
|
-
contentTags: JSON.stringify((
|
19710
|
+
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 : []),
|
19656
19711
|
position: index + '',
|
19657
19712
|
contentFormat: 'video',
|
19658
|
-
traceInfo: (
|
19713
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19659
19714
|
}
|
19660
19715
|
});
|
19661
19716
|
}
|