pb-sxp-ui 1.16.19 → 1.16.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +192 -228
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +192 -228
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +192 -228
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
- package/es/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +37 -53
- package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/es/core/context/SxpDataSourceProvider.js +63 -63
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +37 -53
- package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/lib/core/context/SxpDataSourceProvider.js +63 -63
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -644,7 +644,6 @@ 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([]);
|
648
647
|
const [tagList, setTagList] = React.useState([]);
|
649
648
|
const [loading, setLoading] = React.useState(true);
|
650
649
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
@@ -738,7 +737,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
738
737
|
}, [bffDataSource]);
|
739
738
|
// bff API 请求方法
|
740
739
|
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
741
|
-
var _a
|
740
|
+
var _a;
|
742
741
|
if (!bffDataSource)
|
743
742
|
return;
|
744
743
|
const url = bffDataSource.url;
|
@@ -751,9 +750,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
751
750
|
val.split('=')[0];
|
752
751
|
val.split('=')[1];
|
753
752
|
});
|
754
|
-
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
755
753
|
return window
|
756
|
-
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId
|
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
|
757
755
|
? JSON.stringify({
|
758
756
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
759
757
|
})
|
@@ -888,50 +886,66 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
888
886
|
console.error('解析请求URL失败:', error);
|
889
887
|
return _originalFetch.apply(this, arguments_1);
|
890
888
|
}
|
891
|
-
// 非GA4请求直接放行
|
892
|
-
if (!url.includes('https://www.google-analytics.com/g/collect')) {
|
893
|
-
return _originalFetch.apply(this, arguments_1);
|
894
|
-
}
|
895
|
-
// 检查是否是 GA4 收集端点
|
896
889
|
try {
|
897
890
|
// 1. 先执行原始请求
|
898
891
|
const response = _originalFetch.apply(this, arguments_1);
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
return [];
|
892
|
+
if (url.includes('https://i.giesswein.com/nb-collector')) {
|
893
|
+
if ((init === null || init === void 0 ? void 0 : init.method) === 'POST' && typeof (init === null || init === void 0 ? void 0 : init.body) === 'string') {
|
894
|
+
try {
|
895
|
+
const payload = JSON.parse(init.body);
|
896
|
+
if (payload && Array.isArray(payload.data)) {
|
897
|
+
payload.data.forEach((item) => {
|
898
|
+
if (item && item.e) {
|
899
|
+
bffCollectEvent({
|
900
|
+
eventName: item.e,
|
901
|
+
eventSource: 'Northbeam Pixel'
|
902
|
+
});
|
903
|
+
}
|
904
|
+
});
|
905
|
+
}
|
914
906
|
}
|
915
|
-
|
916
|
-
|
917
|
-
let match;
|
918
|
-
while ((match = regex.exec(queryString)) !== null) {
|
919
|
-
matches.push(decodeURIComponent(match[1]));
|
907
|
+
catch (e) {
|
908
|
+
console.error('Failed to parse Northbeam event', e);
|
920
909
|
}
|
921
|
-
return matches;
|
922
910
|
}
|
923
|
-
|
924
|
-
|
911
|
+
}
|
912
|
+
// 检查是否是 GA4 收集端点
|
913
|
+
if (url.includes('https://www.google-analytics.com/g/collect')) {
|
914
|
+
const urlObj = new URL(url);
|
915
|
+
const params = Object.fromEntries(urlObj.searchParams.entries());
|
916
|
+
const body = (_a = arguments_1[1]) === null || _a === void 0 ? void 0 : _a.body;
|
917
|
+
if (params === null || params === void 0 ? void 0 : params.en) {
|
925
918
|
bffCollectEvent({
|
926
|
-
eventName: en,
|
919
|
+
eventName: params === null || params === void 0 ? void 0 : params.en,
|
927
920
|
eventSource: 'Google Analytics'
|
928
921
|
});
|
929
|
-
}
|
922
|
+
}
|
923
|
+
else if (body) {
|
924
|
+
function extractAllEnValuesSplit(queryString) {
|
925
|
+
if (typeof queryString !== 'string') {
|
926
|
+
return [];
|
927
|
+
}
|
928
|
+
const matches = [];
|
929
|
+
const regex = /en=([^&\r\n]*)/g;
|
930
|
+
let match;
|
931
|
+
while ((match = regex.exec(queryString)) !== null) {
|
932
|
+
matches.push(decodeURIComponent(match[1]));
|
933
|
+
}
|
934
|
+
return matches;
|
935
|
+
}
|
936
|
+
const enValues = extractAllEnValuesSplit(body);
|
937
|
+
enValues === null || enValues === void 0 ? void 0 : enValues.forEach((en) => {
|
938
|
+
bffCollectEvent({
|
939
|
+
eventName: en,
|
940
|
+
eventSource: 'Google Analytics'
|
941
|
+
});
|
942
|
+
});
|
943
|
+
}
|
930
944
|
}
|
931
945
|
return response;
|
932
946
|
}
|
933
947
|
catch (error) {
|
934
|
-
console.error(
|
948
|
+
console.error(error);
|
935
949
|
throw error;
|
936
950
|
}
|
937
951
|
});
|
@@ -997,9 +1011,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
997
1011
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
998
1012
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
999
1013
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1000
|
-
if (isDiyH5) {
|
1001
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1002
|
-
}
|
1003
1014
|
}
|
1004
1015
|
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));
|
1005
1016
|
if (isNotNullList) {
|
@@ -1039,17 +1050,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1039
1050
|
if (rtcList.length <= 0) {
|
1040
1051
|
return;
|
1041
1052
|
}
|
1042
|
-
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1043
|
-
setRtcList(rtcList.concat(firstRtcList));
|
1044
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1045
|
-
return;
|
1046
|
-
}
|
1047
1053
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1048
1054
|
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 })));
|
1049
1055
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1050
1056
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1051
1057
|
return data;
|
1052
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
1058
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1053
1059
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
1054
1060
|
var _a, _b, _c, _d, _e;
|
1055
1061
|
let expire = false;
|
@@ -1080,8 +1086,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1080
1086
|
// 用户信息都是公共的
|
1081
1087
|
if (!userInfo) {
|
1082
1088
|
userInfo = {
|
1083
|
-
|
1084
|
-
|
1089
|
+
// productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
|
1090
|
+
// tpChannelId: 'H5' // 后端处理
|
1085
1091
|
};
|
1086
1092
|
}
|
1087
1093
|
const sessionID = storeAndLoadFeSessionId();
|
@@ -1115,8 +1121,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1115
1121
|
layoutVariantId,
|
1116
1122
|
globalConfig,
|
1117
1123
|
playbookType,
|
1118
|
-
bffDataSource
|
1119
|
-
fakeUserId
|
1124
|
+
bffDataSource
|
1120
1125
|
]);
|
1121
1126
|
const getEventParamsByJson = React.useCallback((json, product) => {
|
1122
1127
|
var _a, _b, _c;
|
@@ -1180,7 +1185,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1180
1185
|
return jsonParams;
|
1181
1186
|
}, [fakeUserId]);
|
1182
1187
|
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
1183
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
1188
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
1184
1189
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
1185
1190
|
return;
|
1186
1191
|
}
|
@@ -1227,18 +1232,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1227
1232
|
if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
|
1228
1233
|
window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
|
1229
1234
|
}
|
1230
|
-
|
1235
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'function' && typeof ((_f = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _f === void 0 ? void 0 : _f.trackPageView) === 'function') {
|
1236
|
+
(_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView();
|
1237
|
+
}
|
1238
|
+
const converApiEventParamsJson = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _h === void 0 ? void 0 : _h[eventName];
|
1231
1239
|
if (enabledMetaConversionApi && converApiEventParamsJson) {
|
1232
1240
|
const body = getEventParamsByJson(converApiEventParamsJson, product);
|
1233
1241
|
const params = {};
|
1234
1242
|
const queryString = location.search.slice(1);
|
1235
|
-
(
|
1243
|
+
(_j = splitUrlParams(queryString)) === null || _j === void 0 ? void 0 : _j.forEach((val) => {
|
1236
1244
|
const key = val.split('=')[0];
|
1237
1245
|
const value = val.split('=')[1];
|
1238
1246
|
params[key] = value;
|
1239
1247
|
});
|
1240
1248
|
const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
|
1241
|
-
bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(
|
1249
|
+
bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_k = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _k === void 0 ? void 0 : _k['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
|
1242
1250
|
method: 'POST',
|
1243
1251
|
body,
|
1244
1252
|
type: 'beacon'
|
@@ -1246,15 +1254,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1246
1254
|
}
|
1247
1255
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
1248
1256
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1249
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1250
1257
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
1251
1258
|
return res === null || res === void 0 ? void 0 : res.success;
|
1252
|
-
}), [bffFetch
|
1259
|
+
}), [bffFetch]);
|
1253
1260
|
const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1254
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1255
1261
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
1256
1262
|
return res === null || res === void 0 ? void 0 : res.success;
|
1257
|
-
}), [bffFetch
|
1263
|
+
}), [bffFetch]);
|
1258
1264
|
const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1259
1265
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
1260
1266
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -1279,7 +1285,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1279
1285
|
}
|
1280
1286
|
}), [bffFetch, utmVal]);
|
1281
1287
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1282
|
-
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
|
1288
|
+
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;
|
1283
1289
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1284
1290
|
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);
|
1285
1291
|
let fromKName = '';
|
@@ -1297,7 +1303,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1297
1303
|
}
|
1298
1304
|
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;
|
1299
1305
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1300
|
-
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 : '',
|
1306
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
1301
1307
|
});
|
1302
1308
|
}, [bffEventReport, isFromHashtag]);
|
1303
1309
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1399,9 +1405,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1399
1405
|
}
|
1400
1406
|
setRtcList(list);
|
1401
1407
|
setCacheRtcList(list);
|
1402
|
-
if (isDiyH5) {
|
1403
|
-
setFirstRtcList(list);
|
1404
|
-
}
|
1405
1408
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1406
1409
|
if (channel) {
|
1407
1410
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1437,9 +1440,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1437
1440
|
}
|
1438
1441
|
setRtcList(list);
|
1439
1442
|
setCacheRtcList(list);
|
1440
|
-
if (isDiyH5) {
|
1441
|
-
setFirstRtcList(list);
|
1442
|
-
}
|
1443
1443
|
}
|
1444
1444
|
})
|
1445
1445
|
.finally(() => {
|
@@ -1503,8 +1503,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1503
1503
|
refreshFeSession,
|
1504
1504
|
getAccount,
|
1505
1505
|
accountSonsent,
|
1506
|
-
isDiyH5
|
1507
|
-
firstRtcList
|
1506
|
+
isDiyH5
|
1508
1507
|
} }, 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({
|
1509
1508
|
rtcList,
|
1510
1509
|
mutateLike: bffMutateLike,
|
@@ -1965,14 +1964,14 @@ var settingRender$f = [
|
|
1965
1964
|
* @Author: binruan@chatlabs.com
|
1966
1965
|
* @Date: 2024-03-12 10:59:06
|
1967
1966
|
* @LastEditors: binruan@chatlabs.com
|
1968
|
-
* @LastEditTime:
|
1967
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1969
1968
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1970
1969
|
*
|
1971
1970
|
*/
|
1972
1971
|
function useEventReport() {
|
1973
1972
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1974
1973
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1975
|
-
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
|
1974
|
+
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;
|
1976
1975
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1977
1976
|
if (i !== -1) {
|
1978
1977
|
return;
|
@@ -2005,11 +2004,11 @@ function useEventReport() {
|
|
2005
2004
|
contentFormat = 'image';
|
2006
2005
|
}
|
2007
2006
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
2008
|
-
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 : '',
|
2007
|
+
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 : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
2009
2008
|
});
|
2010
2009
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
2011
2010
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
2012
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
2011
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
2013
2012
|
let fromKName = '';
|
2014
2013
|
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))) {
|
2015
2014
|
fromKName = 'pdpPage';
|
@@ -2028,9 +2027,8 @@ function useEventReport() {
|
|
2028
2027
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2029
2028
|
position: position + '',
|
2030
2029
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2031
|
-
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 : '',
|
2032
2030
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2033
|
-
traceInfo: (
|
2031
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
2034
2032
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2035
2033
|
eventSubject: 'productView',
|
2036
2034
|
eventDescription: 'User browsed the product'
|
@@ -15845,7 +15843,7 @@ function WaterfallList(_a) {
|
|
15845
15843
|
* @Author: binruan@chatlabs.com
|
15846
15844
|
* @Date: 2024-01-10 10:58:24
|
15847
15845
|
* @LastEditors: binruan@chatlabs.com
|
15848
|
-
* @LastEditTime: 2025-
|
15846
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15849
15847
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15850
15848
|
*
|
15851
15849
|
*/
|
@@ -15883,7 +15881,7 @@ const WaterFall = (props) => {
|
|
15883
15881
|
}
|
15884
15882
|
}, [waterFallData]);
|
15885
15883
|
const reportTagsView = React.useCallback(() => {
|
15886
|
-
var _a, _b, _c, _d, _e, _f
|
15884
|
+
var _a, _b, _c, _d, _e, _f;
|
15887
15885
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15888
15886
|
if (!rec)
|
15889
15887
|
return;
|
@@ -15903,10 +15901,9 @@ const WaterFall = (props) => {
|
|
15903
15901
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15904
15902
|
eventInfo: {
|
15905
15903
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15906
|
-
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 : '',
|
15907
15904
|
position: cacheActiveIndex + '',
|
15908
|
-
contentTags: JSON.stringify((
|
15909
|
-
traceInfo: (
|
15905
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
15906
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
15910
15907
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15911
15908
|
fromKName,
|
15912
15909
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17988,22 +17985,21 @@ const LikeButton = (_a) => {
|
|
17988
17985
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17989
17986
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17990
17987
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17991
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
17988
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17992
17989
|
if (state) {
|
17993
17990
|
// 先设置状态
|
17994
17991
|
setState(false);
|
17995
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
17992
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_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;
|
17996
17993
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17997
17994
|
eventInfo: {
|
17998
17995
|
eventSubject: 'favoriteContentCanceled',
|
17999
17996
|
eventDescription: 'This content was unfavorite by the user',
|
18000
17997
|
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 : '',
|
18001
|
-
|
18002
|
-
|
18003
|
-
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 : []),
|
17998
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
17999
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
18004
18000
|
position: position + '',
|
18005
|
-
contentFormat: ((
|
18006
|
-
traceInfo: (
|
18001
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
18002
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18007
18003
|
}
|
18008
18004
|
});
|
18009
18005
|
// 如果接口调用失败,则回滚状态
|
@@ -18011,41 +18007,40 @@ const LikeButton = (_a) => {
|
|
18011
18007
|
setState(true);
|
18012
18008
|
}
|
18013
18009
|
else {
|
18014
|
-
const nRtcList = (
|
18010
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18015
18011
|
if (index === position) {
|
18016
18012
|
item.isCollected = false;
|
18017
18013
|
}
|
18018
18014
|
return item;
|
18019
|
-
})) !== null &&
|
18015
|
+
})) !== null && _p !== void 0 ? _p : [];
|
18020
18016
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18021
18017
|
}
|
18022
18018
|
}
|
18023
18019
|
else {
|
18024
18020
|
setState(true);
|
18025
|
-
const result = (
|
18021
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
18026
18022
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18027
18023
|
eventInfo: {
|
18028
18024
|
eventSubject: 'favoriteContent',
|
18029
18025
|
eventDescription: 'This content was favorite by the user',
|
18030
|
-
contentId: (
|
18031
|
-
|
18032
|
-
|
18033
|
-
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 : []),
|
18026
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
18027
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
18028
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
18034
18029
|
position: position + '',
|
18035
|
-
contentFormat: ((
|
18036
|
-
traceInfo: (
|
18030
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
18031
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
18037
18032
|
}
|
18038
18033
|
});
|
18039
18034
|
if (!result) {
|
18040
18035
|
setState(false);
|
18041
18036
|
}
|
18042
18037
|
else {
|
18043
|
-
const nRtcList = (
|
18038
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18044
18039
|
if (index === position) {
|
18045
18040
|
item.isCollected = true;
|
18046
18041
|
}
|
18047
18042
|
return item;
|
18048
|
-
})) !== null &&
|
18043
|
+
})) !== null && _z !== void 0 ? _z : [];
|
18049
18044
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18050
18045
|
}
|
18051
18046
|
}
|
@@ -18082,7 +18077,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
18082
18077
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18083
18078
|
var _a, _b;
|
18084
18079
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
18085
|
-
const { bffEventReport, sxpParameter,
|
18080
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18086
18081
|
const videoStartTime = React.useRef(0);
|
18087
18082
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
18088
18083
|
const { isActive } = useSwiperSlide();
|
@@ -18148,23 +18143,6 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18148
18143
|
return;
|
18149
18144
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18150
18145
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18151
|
-
const handleEnd = () => {
|
18152
|
-
var _a, _b, _c, _d, _e, _f;
|
18153
|
-
if (!videoRef.current)
|
18154
|
-
return;
|
18155
|
-
if (isDiyH5) {
|
18156
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18157
|
-
if (!loopPlayRef.current)
|
18158
|
-
return;
|
18159
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18160
|
-
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;
|
18161
|
-
(_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);
|
18162
|
-
}
|
18163
|
-
}
|
18164
|
-
else {
|
18165
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18166
|
-
}
|
18167
|
-
};
|
18168
18146
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18169
18147
|
const handlePlaying = React.useCallback(() => {
|
18170
18148
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18173,7 +18151,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18173
18151
|
setIsLoadFinish(true);
|
18174
18152
|
}, []);
|
18175
18153
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18176
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
18154
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18177
18155
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18178
18156
|
return;
|
18179
18157
|
setIsPauseVideo(false);
|
@@ -18184,11 +18162,16 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18184
18162
|
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);
|
18185
18163
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18186
18164
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18187
|
-
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 : '',
|
18165
|
+
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 : '', contentName: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []), position: index + '', contentFormat: 'video', traceInfo: (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.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) + '' }))
|
18188
18166
|
});
|
18189
18167
|
isFirstPlayRef.current = false;
|
18190
18168
|
}
|
18191
18169
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18170
|
+
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18171
|
+
if (isDiyH5) {
|
18172
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18173
|
+
}
|
18174
|
+
}, []);
|
18192
18175
|
const handLoadeddata = React.useCallback(() => {
|
18193
18176
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18194
18177
|
return;
|
@@ -18213,12 +18196,13 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18213
18196
|
const handleLoadedmetadata = React.useCallback(() => {
|
18214
18197
|
if (!videoRef.current)
|
18215
18198
|
return;
|
18199
|
+
setCurrentTimeByStartTime();
|
18216
18200
|
loadedTimeRef.current = new Date();
|
18217
18201
|
handleStartPlay();
|
18218
18202
|
handLoadeddata();
|
18219
18203
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18220
18204
|
const handleClickVideo = React.useCallback((type) => () => {
|
18221
|
-
var _a, _b, _c, _d, _e;
|
18205
|
+
var _a, _b, _c, _d, _e, _f;
|
18222
18206
|
if (!videoRef.current)
|
18223
18207
|
return;
|
18224
18208
|
if (!isLoadFinish)
|
@@ -18239,17 +18223,20 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18239
18223
|
break;
|
18240
18224
|
default:
|
18241
18225
|
if (isPause) {
|
18242
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
18226
|
+
if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
|
18227
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18228
|
+
}
|
18229
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18243
18230
|
}
|
18244
18231
|
else {
|
18245
|
-
(
|
18232
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
18246
18233
|
}
|
18247
18234
|
setIsPauseVideo(!isPause);
|
18248
18235
|
break;
|
18249
18236
|
}
|
18250
18237
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18251
18238
|
const handlePause = React.useCallback(() => {
|
18252
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
18239
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18253
18240
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18254
18241
|
return;
|
18255
18242
|
if (activeIndex !== index)
|
@@ -18265,15 +18252,14 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18265
18252
|
eventSubject: 'playOverVideo',
|
18266
18253
|
eventDescription: 'User finished playing the video',
|
18267
18254
|
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 : '',
|
18268
|
-
|
18269
|
-
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 : '',
|
18255
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
18270
18256
|
endTime: videoCurrentTime,
|
18271
18257
|
videoDuration,
|
18272
18258
|
playDuration,
|
18273
|
-
contentTags: JSON.stringify((
|
18259
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
18274
18260
|
position: index + '',
|
18275
18261
|
contentFormat: 'video',
|
18276
|
-
traceInfo: (
|
18262
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18277
18263
|
}
|
18278
18264
|
});
|
18279
18265
|
}
|
@@ -18281,8 +18267,27 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18281
18267
|
const handleWaiting = React.useCallback(() => {
|
18282
18268
|
setWaiting(true);
|
18283
18269
|
}, []);
|
18270
|
+
const handleTimeUpload = () => {
|
18271
|
+
if (!videoRef.current || !isDiyH5)
|
18272
|
+
return;
|
18273
|
+
setTimeout(() => {
|
18274
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18275
|
+
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)) {
|
18276
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18277
|
+
if (!loopPlayRef.current)
|
18278
|
+
return;
|
18279
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18280
|
+
(_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);
|
18281
|
+
}
|
18282
|
+
else {
|
18283
|
+
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;
|
18284
|
+
(_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);
|
18285
|
+
}
|
18286
|
+
}
|
18287
|
+
});
|
18288
|
+
};
|
18284
18289
|
React.useEffect(() => {
|
18285
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18290
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18286
18291
|
if (!isActive)
|
18287
18292
|
return;
|
18288
18293
|
const videoSrc = videoUrl;
|
@@ -18303,6 +18308,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18303
18308
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18304
18309
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18305
18310
|
var _a;
|
18311
|
+
setCurrentTimeByStartTime();
|
18306
18312
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18307
18313
|
});
|
18308
18314
|
}
|
@@ -18316,11 +18322,12 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18316
18322
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18317
18323
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18318
18324
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18319
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18325
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
18320
18326
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18321
18327
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18328
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18322
18329
|
return () => {
|
18323
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18330
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18324
18331
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18325
18332
|
if (!isPause)
|
18326
18333
|
handlePause();
|
@@ -18332,9 +18339,10 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18332
18339
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18333
18340
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18334
18341
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18335
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18342
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
18336
18343
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18337
18344
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18345
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18338
18346
|
};
|
18339
18347
|
}, [isActive]);
|
18340
18348
|
React.useEffect(() => {
|
@@ -18545,45 +18553,19 @@ const Picture = (props) => {
|
|
18545
18553
|
}, onLoad: onShowFirstImage }))));
|
18546
18554
|
};
|
18547
18555
|
|
18548
|
-
const PictureGroup$4 =
|
18556
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18549
18557
|
var _a, _b;
|
18550
18558
|
const { isActive } = useSwiperSlide();
|
18551
|
-
const {
|
18559
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
18552
18560
|
const [isLoad, setIsLoad] = React.useState(false);
|
18553
18561
|
const [imgInfo, setImgInfo] = React.useState();
|
18554
18562
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18555
|
-
const
|
18563
|
+
const swiperRef = React.useRef();
|
18556
18564
|
const isFirstPlayRef = React.useRef(true);
|
18557
|
-
const loopPlayRef = React.useRef(true);
|
18558
18565
|
const initTime = new Date();
|
18559
|
-
React.useImperativeHandle(ref, () => {
|
18560
|
-
return {
|
18561
|
-
setLoopPlay(v) {
|
18562
|
-
loopPlayRef.current = v;
|
18563
|
-
}
|
18564
|
-
};
|
18565
|
-
});
|
18566
|
-
React.useEffect(() => {
|
18567
|
-
let timerId;
|
18568
|
-
if (isLoad && isActive && isDiyH5) {
|
18569
|
-
timerId = setTimeout(() => {
|
18570
|
-
var _a, _b, _c, _d;
|
18571
|
-
if (!loopPlayRef.current)
|
18572
|
-
return;
|
18573
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18574
|
-
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;
|
18575
|
-
(_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);
|
18576
|
-
}
|
18577
|
-
}, 3000);
|
18578
|
-
}
|
18579
|
-
return () => {
|
18580
|
-
if (timerId)
|
18581
|
-
clearTimeout(timerId);
|
18582
|
-
};
|
18583
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18584
18566
|
React.useEffect(() => {
|
18585
18567
|
if (isLoad && isActive) {
|
18586
|
-
(
|
18568
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
18587
18569
|
if (openHashtag) {
|
18588
18570
|
onViewImageEndEvent(rec);
|
18589
18571
|
}
|
@@ -18593,7 +18575,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18593
18575
|
}
|
18594
18576
|
}
|
18595
18577
|
else {
|
18596
|
-
(
|
18578
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
18597
18579
|
}
|
18598
18580
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18599
18581
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18620,13 +18602,13 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18620
18602
|
};
|
18621
18603
|
}, [isActive, imgInfo]);
|
18622
18604
|
const handleMouseEnter = React.useCallback(() => {
|
18623
|
-
if (
|
18624
|
-
|
18605
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18606
|
+
swiperRef.current.swiper.autoplay.stop();
|
18625
18607
|
}
|
18626
18608
|
}, []);
|
18627
18609
|
const handleMouseLeave = React.useCallback(() => {
|
18628
|
-
if (
|
18629
|
-
|
18610
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18611
|
+
swiperRef.current.swiper.autoplay.start();
|
18630
18612
|
}
|
18631
18613
|
}, []);
|
18632
18614
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18647,7 +18629,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18647
18629
|
enabled: true
|
18648
18630
|
}
|
18649
18631
|
}
|
18650
|
-
: {}), { loop: true, ref:
|
18632
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18651
18633
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18652
18634
|
fontSize: '14px'
|
18653
18635
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18664,7 +18646,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18664
18646
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18665
18647
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18666
18648
|
}))));
|
18667
|
-
}
|
18649
|
+
};
|
18668
18650
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18669
18651
|
|
18670
18652
|
/*
|
@@ -18944,7 +18926,7 @@ var NavBack$1 = React.memo(NavBack);
|
|
18944
18926
|
* @Author: binruan@chatlabs.com
|
18945
18927
|
* @Date: 2024-03-20 10:27:31
|
18946
18928
|
* @LastEditors: binruan@chatlabs.com
|
18947
|
-
* @LastEditTime: 2025-05-
|
18929
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18948
18930
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18949
18931
|
*
|
18950
18932
|
*/
|
@@ -18964,7 +18946,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18964
18946
|
const skipLinkRef = React.useRef(false);
|
18965
18947
|
const [pageNum, setPageNum] = React.useState(2);
|
18966
18948
|
const videoWidgetRef = React.useRef(null);
|
18967
|
-
const pictureGroupRef = React.useRef(null);
|
18968
18949
|
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();
|
18969
18950
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18970
18951
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -19012,7 +18993,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19012
18993
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
19013
18994
|
}, [data, ctaType, swiperRef]);
|
19014
18995
|
const handleSessionCompleted = React.useCallback((fk) => {
|
19015
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
18996
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
19016
18997
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
19017
18998
|
let fromKName = '';
|
19018
18999
|
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))) {
|
@@ -19039,13 +19020,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19039
19020
|
eventSubject: 'sessionCompleted',
|
19040
19021
|
eventDescription: 'Session completed',
|
19041
19022
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
19042
|
-
|
19043
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
19023
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
19044
19024
|
position: activeIndex + '',
|
19045
19025
|
fromKName: fk || fromKName,
|
19046
19026
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19047
|
-
ctatId: (
|
19048
|
-
traceInfo: (
|
19027
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19028
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
19049
19029
|
}
|
19050
19030
|
});
|
19051
19031
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19104,9 +19084,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19104
19084
|
refreshFeSession
|
19105
19085
|
]);
|
19106
19086
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
19107
|
-
var _a
|
19087
|
+
var _a;
|
19108
19088
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19109
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19110
19089
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19111
19090
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19112
19091
|
React.useEffect(() => {
|
@@ -19176,18 +19155,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19176
19155
|
return null;
|
19177
19156
|
}, [globalConfig, activeIndex, visList]);
|
19178
19157
|
const renderContent = React.useCallback((rec, index) => {
|
19179
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
19158
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19180
19159
|
if (rec === 'organic menu') {
|
19181
19160
|
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)));
|
19182
19161
|
}
|
19183
|
-
if ((
|
19162
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
19184
19163
|
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 })));
|
19185
19164
|
}
|
19186
|
-
if ((
|
19187
|
-
return (React.createElement(PictureGroup$5,
|
19165
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
19166
|
+
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 }));
|
19188
19167
|
}
|
19189
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19190
|
-
return (
|
19168
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
19169
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
19191
19170
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19192
19171
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19193
19172
|
const Component = withBindDataSource(t);
|
@@ -19225,7 +19204,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19225
19204
|
};
|
19226
19205
|
}, [isShowMore]);
|
19227
19206
|
const renderBottom = React.useCallback((rec, index) => {
|
19228
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
19207
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19229
19208
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19230
19209
|
let cta = null;
|
19231
19210
|
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) {
|
@@ -19234,27 +19213,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19234
19213
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19235
19214
|
cta = '商品CTA';
|
19236
19215
|
}
|
19237
|
-
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)) {
|
19238
|
-
cta = '服务CTA';
|
19239
|
-
}
|
19240
19216
|
else {
|
19241
|
-
cta = (
|
19217
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
19242
19218
|
}
|
19243
19219
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19244
19220
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19245
19221
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19246
|
-
((
|
19222
|
+
((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
|
19247
19223
|
return (React.createElement(React.Fragment, null,
|
19248
19224
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19249
|
-
((
|
19250
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19225
|
+
((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
19226
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
19251
19227
|
React.createElement(Nudge, { nudge: nudge }),
|
19252
19228
|
((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' },
|
19253
19229
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19254
19230
|
React.createElement("div", null,
|
19255
|
-
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: (
|
19231
|
+
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: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
19256
19232
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19257
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19233
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
19258
19234
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19259
19235
|
}
|
19260
19236
|
return null;
|
@@ -19293,7 +19269,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19293
19269
|
return null;
|
19294
19270
|
}, [globalConfig, waterFallData]);
|
19295
19271
|
const handleViewImageStartEnd = (item) => {
|
19296
|
-
var _a, _b, _c, _d, _e, _f
|
19272
|
+
var _a, _b, _c, _d, _e, _f;
|
19297
19273
|
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)) {
|
19298
19274
|
const endTime = Date.now();
|
19299
19275
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19302,11 +19278,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19302
19278
|
eventSubject: 'viewImageCarouselEnd',
|
19303
19279
|
eventDescription: 'User end view the image carousel',
|
19304
19280
|
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 : '',
|
19305
|
-
|
19306
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19281
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19307
19282
|
imageEndTime: `${endTime}`,
|
19308
19283
|
playDuration: `${duration}`,
|
19309
|
-
contentTags: JSON.stringify((
|
19284
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19310
19285
|
position: activeIndex + '',
|
19311
19286
|
contentFormat: 'image',
|
19312
19287
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19315,7 +19290,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19315
19290
|
}
|
19316
19291
|
};
|
19317
19292
|
const handleSlideSkip = (item, position) => {
|
19318
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
19293
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19319
19294
|
if (isPreview || waterFallData)
|
19320
19295
|
return;
|
19321
19296
|
const t = new Date() - curTime.current;
|
@@ -19341,8 +19316,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19341
19316
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19342
19317
|
position: position + '',
|
19343
19318
|
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 : '',
|
19344
|
-
|
19345
|
-
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 : '',
|
19319
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
19346
19320
|
contentFormat
|
19347
19321
|
}
|
19348
19322
|
});
|
@@ -19352,7 +19326,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19352
19326
|
}
|
19353
19327
|
};
|
19354
19328
|
const handleScrollEvent = (swiper) => {
|
19355
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
19329
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19356
19330
|
const item = data[swiper.previousIndex];
|
19357
19331
|
if (!item)
|
19358
19332
|
return;
|
@@ -19369,12 +19343,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19369
19343
|
eventSubject: 'scrollDown',
|
19370
19344
|
eventDescription: 'User scroll down',
|
19371
19345
|
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 : '',
|
19372
|
-
|
19373
|
-
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 : '',
|
19346
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
19374
19347
|
requestId: null,
|
19375
|
-
traceInfo: (
|
19348
|
+
traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
|
19376
19349
|
contentFormat,
|
19377
|
-
position: ((
|
19350
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
19378
19351
|
}
|
19379
19352
|
});
|
19380
19353
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19386,13 +19359,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19386
19359
|
eventInfo: {
|
19387
19360
|
eventSubject: 'scrollUp',
|
19388
19361
|
eventDescription: 'User scroll up',
|
19389
|
-
contentId: (
|
19390
|
-
|
19391
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19362
|
+
contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
|
19363
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19392
19364
|
requestId: null,
|
19393
|
-
traceInfo: (
|
19365
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
|
19394
19366
|
contentFormat,
|
19395
|
-
position: ((
|
19367
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19396
19368
|
}
|
19397
19369
|
});
|
19398
19370
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19418,7 +19390,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19418
19390
|
}
|
19419
19391
|
}, [openHashtag, data, activeIndex]);
|
19420
19392
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19421
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19393
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19422
19394
|
const item = data[activeIndex];
|
19423
19395
|
// 如果是图片集则上报事件
|
19424
19396
|
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)) {
|
@@ -19429,10 +19401,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19429
19401
|
eventSubject: 'viewImageCarouselStart',
|
19430
19402
|
eventDescription: 'User start view the image carousel',
|
19431
19403
|
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 : '',
|
19432
|
-
|
19433
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19404
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19434
19405
|
imageStartTime: `${startTime}`,
|
19435
|
-
contentTags: JSON.stringify((
|
19406
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19436
19407
|
position: activeIndex + '',
|
19437
19408
|
contentFormat: 'image',
|
19438
19409
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19442,11 +19413,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19442
19413
|
if (enableCapi) {
|
19443
19414
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19444
19415
|
eventName: 'ViewContent',
|
19445
|
-
product: (
|
19416
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19446
19417
|
});
|
19447
19418
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19448
19419
|
eventName: 'PageView',
|
19449
|
-
product: (
|
19420
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19450
19421
|
});
|
19451
19422
|
}
|
19452
19423
|
}
|
@@ -19538,20 +19509,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19538
19509
|
swiperRef.current.swiper.allowTouchMove = true;
|
19539
19510
|
}, 500);
|
19540
19511
|
}, onActiveIndexChange: (swiper) => {
|
19541
|
-
var _a, _b;
|
19542
19512
|
setActiveIndex(swiper.activeIndex);
|
19543
19513
|
if (openHashtag)
|
19544
19514
|
return;
|
19545
19515
|
// 处理上滑下滑事件
|
19546
19516
|
handleScrollEvent(swiper);
|
19547
|
-
if (waterFallData || isEditor)
|
19517
|
+
if (waterFallData || isEditor || isDiyH5)
|
19548
19518
|
return;
|
19549
19519
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19550
19520
|
if (!isLoadMore) {
|
19551
|
-
if (isDiyH5) {
|
19552
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19553
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19554
|
-
}
|
19555
19521
|
setIsLoadMore(true);
|
19556
19522
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19557
19523
|
var _a;
|
@@ -19604,7 +19570,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19604
19570
|
}, []);
|
19605
19571
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19606
19572
|
const handlePlaying = React.useCallback(() => {
|
19607
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19573
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19608
19574
|
setIsPauseVideo(false);
|
19609
19575
|
const item = data[index];
|
19610
19576
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19617,15 +19583,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19617
19583
|
eventSubject: 'playVideo',
|
19618
19584
|
eventDescription: 'User played the video',
|
19619
19585
|
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 : '',
|
19620
|
-
|
19621
|
-
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 : '',
|
19586
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
19622
19587
|
playType,
|
19623
19588
|
startTime: videoCurrentTime,
|
19624
19589
|
videoDuration,
|
19625
|
-
contentTags: JSON.stringify((
|
19590
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
19626
19591
|
position: index + '',
|
19627
19592
|
contentFormat: 'video',
|
19628
|
-
traceInfo: (
|
19593
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19629
19594
|
}
|
19630
19595
|
});
|
19631
19596
|
setIsFirstPlay(false);
|
@@ -19664,7 +19629,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19664
19629
|
}
|
19665
19630
|
}, [isLoadFinish]);
|
19666
19631
|
const onPause = React.useCallback(() => {
|
19667
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19632
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19668
19633
|
const item = data[index];
|
19669
19634
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19670
19635
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19675,15 +19640,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19675
19640
|
eventSubject: 'playOverVideo',
|
19676
19641
|
eventDescription: 'User finished playing the video',
|
19677
19642
|
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 : '',
|
19678
|
-
|
19679
|
-
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 : '',
|
19643
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
19680
19644
|
endTime: videoCurrentTime,
|
19681
19645
|
videoDuration,
|
19682
19646
|
playDuration,
|
19683
|
-
contentTags: JSON.stringify((
|
19647
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
19684
19648
|
position: index + '',
|
19685
19649
|
contentFormat: 'video',
|
19686
|
-
traceInfo: (
|
19650
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19687
19651
|
}
|
19688
19652
|
});
|
19689
19653
|
}
|