pb-sxp-ui 1.16.19 → 1.16.20
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.js
CHANGED
@@ -622,7 +622,6 @@ const DEFAULT_TAG = 'FOR U';
|
|
622
622
|
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 }) => {
|
623
623
|
var _a, _b, _c, _d, _e;
|
624
624
|
const [rtcList, setRtcList] = useState([]);
|
625
|
-
const [firstRtcList, setFirstRtcList] = useState([]);
|
626
625
|
const [tagList, setTagList] = useState([]);
|
627
626
|
const [loading, setLoading] = useState(true);
|
628
627
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
@@ -716,7 +715,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
716
715
|
}, [bffDataSource]);
|
717
716
|
// bff API 请求方法
|
718
717
|
const bffFetch = useCallback((path, options, isBota = true) => {
|
719
|
-
var _a
|
718
|
+
var _a;
|
720
719
|
if (!bffDataSource)
|
721
720
|
return;
|
722
721
|
const url = bffDataSource.url;
|
@@ -729,9 +728,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
729
728
|
val.split('=')[0];
|
730
729
|
val.split('=')[1];
|
731
730
|
});
|
732
|
-
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
733
731
|
return window
|
734
|
-
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId
|
732
|
+
.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
|
735
733
|
? JSON.stringify({
|
736
734
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
737
735
|
})
|
@@ -866,50 +864,66 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
866
864
|
console.error('解析请求URL失败:', error);
|
867
865
|
return _originalFetch.apply(this, arguments_1);
|
868
866
|
}
|
869
|
-
// 非GA4请求直接放行
|
870
|
-
if (!url.includes('https://www.google-analytics.com/g/collect')) {
|
871
|
-
return _originalFetch.apply(this, arguments_1);
|
872
|
-
}
|
873
|
-
// 检查是否是 GA4 收集端点
|
874
867
|
try {
|
875
868
|
// 1. 先执行原始请求
|
876
869
|
const response = _originalFetch.apply(this, arguments_1);
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
return [];
|
870
|
+
if (url.includes('https://i.giesswein.com/nb-collector')) {
|
871
|
+
if ((init === null || init === void 0 ? void 0 : init.method) === 'POST' && typeof (init === null || init === void 0 ? void 0 : init.body) === 'string') {
|
872
|
+
try {
|
873
|
+
const payload = JSON.parse(init.body);
|
874
|
+
if (payload && Array.isArray(payload.data)) {
|
875
|
+
payload.data.forEach((item) => {
|
876
|
+
if (item && item.e) {
|
877
|
+
bffCollectEvent({
|
878
|
+
eventName: item.e,
|
879
|
+
eventSource: 'Northbeam Pixel'
|
880
|
+
});
|
881
|
+
}
|
882
|
+
});
|
883
|
+
}
|
892
884
|
}
|
893
|
-
|
894
|
-
|
895
|
-
let match;
|
896
|
-
while ((match = regex.exec(queryString)) !== null) {
|
897
|
-
matches.push(decodeURIComponent(match[1]));
|
885
|
+
catch (e) {
|
886
|
+
console.error('Failed to parse Northbeam event', e);
|
898
887
|
}
|
899
|
-
return matches;
|
900
888
|
}
|
901
|
-
|
902
|
-
|
889
|
+
}
|
890
|
+
// 检查是否是 GA4 收集端点
|
891
|
+
if (url.includes('https://www.google-analytics.com/g/collect')) {
|
892
|
+
const urlObj = new URL(url);
|
893
|
+
const params = Object.fromEntries(urlObj.searchParams.entries());
|
894
|
+
const body = (_a = arguments_1[1]) === null || _a === void 0 ? void 0 : _a.body;
|
895
|
+
if (params === null || params === void 0 ? void 0 : params.en) {
|
903
896
|
bffCollectEvent({
|
904
|
-
eventName: en,
|
897
|
+
eventName: params === null || params === void 0 ? void 0 : params.en,
|
905
898
|
eventSource: 'Google Analytics'
|
906
899
|
});
|
907
|
-
}
|
900
|
+
}
|
901
|
+
else if (body) {
|
902
|
+
function extractAllEnValuesSplit(queryString) {
|
903
|
+
if (typeof queryString !== 'string') {
|
904
|
+
return [];
|
905
|
+
}
|
906
|
+
const matches = [];
|
907
|
+
const regex = /en=([^&\r\n]*)/g;
|
908
|
+
let match;
|
909
|
+
while ((match = regex.exec(queryString)) !== null) {
|
910
|
+
matches.push(decodeURIComponent(match[1]));
|
911
|
+
}
|
912
|
+
return matches;
|
913
|
+
}
|
914
|
+
const enValues = extractAllEnValuesSplit(body);
|
915
|
+
enValues === null || enValues === void 0 ? void 0 : enValues.forEach((en) => {
|
916
|
+
bffCollectEvent({
|
917
|
+
eventName: en,
|
918
|
+
eventSource: 'Google Analytics'
|
919
|
+
});
|
920
|
+
});
|
921
|
+
}
|
908
922
|
}
|
909
923
|
return response;
|
910
924
|
}
|
911
925
|
catch (error) {
|
912
|
-
console.error(
|
926
|
+
console.error(error);
|
913
927
|
throw error;
|
914
928
|
}
|
915
929
|
});
|
@@ -975,9 +989,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
975
989
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
976
990
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
977
991
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
978
|
-
if (isDiyH5) {
|
979
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
980
|
-
}
|
981
992
|
}
|
982
993
|
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));
|
983
994
|
if (isNotNullList) {
|
@@ -1017,17 +1028,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1017
1028
|
if (rtcList.length <= 0) {
|
1018
1029
|
return;
|
1019
1030
|
}
|
1020
|
-
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1021
|
-
setRtcList(rtcList.concat(firstRtcList));
|
1022
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1023
|
-
return;
|
1024
|
-
}
|
1025
1031
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1026
1032
|
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 })));
|
1027
1033
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1028
1034
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1029
1035
|
return data;
|
1030
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
1036
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1031
1037
|
const refreshFeSession = useCallback((enableReSid, event) => {
|
1032
1038
|
var _a, _b, _c, _d, _e;
|
1033
1039
|
let expire = false;
|
@@ -1058,8 +1064,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1058
1064
|
// 用户信息都是公共的
|
1059
1065
|
if (!userInfo) {
|
1060
1066
|
userInfo = {
|
1061
|
-
|
1062
|
-
|
1067
|
+
// productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
|
1068
|
+
// tpChannelId: 'H5' // 后端处理
|
1063
1069
|
};
|
1064
1070
|
}
|
1065
1071
|
const sessionID = storeAndLoadFeSessionId();
|
@@ -1093,8 +1099,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1093
1099
|
layoutVariantId,
|
1094
1100
|
globalConfig,
|
1095
1101
|
playbookType,
|
1096
|
-
bffDataSource
|
1097
|
-
fakeUserId
|
1102
|
+
bffDataSource
|
1098
1103
|
]);
|
1099
1104
|
const getEventParamsByJson = useCallback((json, product) => {
|
1100
1105
|
var _a, _b, _c;
|
@@ -1158,7 +1163,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1158
1163
|
return jsonParams;
|
1159
1164
|
}, [fakeUserId]);
|
1160
1165
|
const bffFbReport = useCallback(({ eventName, product }) => {
|
1161
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
1166
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
1162
1167
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
1163
1168
|
return;
|
1164
1169
|
}
|
@@ -1205,18 +1210,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1205
1210
|
if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
|
1206
1211
|
window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
|
1207
1212
|
}
|
1208
|
-
|
1213
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_f = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _f === void 0 ? void 0 : _f.trackPageView) === 'function') {
|
1214
|
+
window === null || window === void 0 ? void 0 : window.Northbeam.trackPageView();
|
1215
|
+
}
|
1216
|
+
const converApiEventParamsJson = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _g === void 0 ? void 0 : _g[eventName];
|
1209
1217
|
if (enabledMetaConversionApi && converApiEventParamsJson) {
|
1210
1218
|
const body = getEventParamsByJson(converApiEventParamsJson, product);
|
1211
1219
|
const params = {};
|
1212
1220
|
const queryString = location.search.slice(1);
|
1213
|
-
(
|
1221
|
+
(_h = splitUrlParams(queryString)) === null || _h === void 0 ? void 0 : _h.forEach((val) => {
|
1214
1222
|
const key = val.split('=')[0];
|
1215
1223
|
const value = val.split('=')[1];
|
1216
1224
|
params[key] = value;
|
1217
1225
|
});
|
1218
1226
|
const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
|
1219
|
-
bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(
|
1227
|
+
bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_j = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _j === void 0 ? void 0 : _j['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
|
1220
1228
|
method: 'POST',
|
1221
1229
|
body,
|
1222
1230
|
type: 'beacon'
|
@@ -1224,15 +1232,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1224
1232
|
}
|
1225
1233
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
1226
1234
|
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1227
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1228
1235
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
1229
1236
|
return res === null || res === void 0 ? void 0 : res.success;
|
1230
|
-
}), [bffFetch
|
1237
|
+
}), [bffFetch]);
|
1231
1238
|
const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1232
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1233
1239
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
1234
1240
|
return res === null || res === void 0 ? void 0 : res.success;
|
1235
|
-
}), [bffFetch
|
1241
|
+
}), [bffFetch]);
|
1236
1242
|
const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1237
1243
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
1238
1244
|
return res === null || res === void 0 ? void 0 : res.success;
|
@@ -1257,7 +1263,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1257
1263
|
}
|
1258
1264
|
}), [bffFetch, utmVal]);
|
1259
1265
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
1260
|
-
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
|
1266
|
+
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;
|
1261
1267
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1262
1268
|
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);
|
1263
1269
|
let fromKName = '';
|
@@ -1275,7 +1281,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1275
1281
|
}
|
1276
1282
|
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;
|
1277
1283
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1278
|
-
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 : '',
|
1284
|
+
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 })
|
1279
1285
|
});
|
1280
1286
|
}, [bffEventReport, isFromHashtag]);
|
1281
1287
|
const h5EnterLink = useCallback(() => {
|
@@ -1377,9 +1383,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1377
1383
|
}
|
1378
1384
|
setRtcList(list);
|
1379
1385
|
setCacheRtcList(list);
|
1380
|
-
if (isDiyH5) {
|
1381
|
-
setFirstRtcList(list);
|
1382
|
-
}
|
1383
1386
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1384
1387
|
if (channel) {
|
1385
1388
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1415,9 +1418,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1415
1418
|
}
|
1416
1419
|
setRtcList(list);
|
1417
1420
|
setCacheRtcList(list);
|
1418
|
-
if (isDiyH5) {
|
1419
|
-
setFirstRtcList(list);
|
1420
|
-
}
|
1421
1421
|
}
|
1422
1422
|
})
|
1423
1423
|
.finally(() => {
|
@@ -1481,8 +1481,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1481
1481
|
refreshFeSession,
|
1482
1482
|
getAccount,
|
1483
1483
|
accountSonsent,
|
1484
|
-
isDiyH5
|
1485
|
-
firstRtcList
|
1484
|
+
isDiyH5
|
1486
1485
|
} }, 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({
|
1487
1486
|
rtcList,
|
1488
1487
|
mutateLike: bffMutateLike,
|
@@ -1943,14 +1942,14 @@ var settingRender$f = [
|
|
1943
1942
|
* @Author: binruan@chatlabs.com
|
1944
1943
|
* @Date: 2024-03-12 10:59:06
|
1945
1944
|
* @LastEditors: binruan@chatlabs.com
|
1946
|
-
* @LastEditTime:
|
1945
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1947
1946
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1948
1947
|
*
|
1949
1948
|
*/
|
1950
1949
|
function useEventReport() {
|
1951
1950
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1952
1951
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
1953
|
-
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
|
1952
|
+
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;
|
1954
1953
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1955
1954
|
if (i !== -1) {
|
1956
1955
|
return;
|
@@ -1983,11 +1982,11 @@ function useEventReport() {
|
|
1983
1982
|
contentFormat = 'image';
|
1984
1983
|
}
|
1985
1984
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1986
|
-
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 : '',
|
1985
|
+
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 }))
|
1987
1986
|
});
|
1988
1987
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1989
1988
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
1990
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
1989
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1991
1990
|
let fromKName = '';
|
1992
1991
|
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))) {
|
1993
1992
|
fromKName = 'pdpPage';
|
@@ -2006,9 +2005,8 @@ function useEventReport() {
|
|
2006
2005
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2007
2006
|
position: position + '',
|
2008
2007
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2009
|
-
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 : '',
|
2010
2008
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2011
|
-
traceInfo: (
|
2009
|
+
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 : '',
|
2012
2010
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2013
2011
|
eventSubject: 'productView',
|
2014
2012
|
eventDescription: 'User browsed the product'
|
@@ -15823,7 +15821,7 @@ function WaterfallList(_a) {
|
|
15823
15821
|
* @Author: binruan@chatlabs.com
|
15824
15822
|
* @Date: 2024-01-10 10:58:24
|
15825
15823
|
* @LastEditors: binruan@chatlabs.com
|
15826
|
-
* @LastEditTime: 2025-
|
15824
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15827
15825
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15828
15826
|
*
|
15829
15827
|
*/
|
@@ -15861,7 +15859,7 @@ const WaterFall = (props) => {
|
|
15861
15859
|
}
|
15862
15860
|
}, [waterFallData]);
|
15863
15861
|
const reportTagsView = useCallback(() => {
|
15864
|
-
var _a, _b, _c, _d, _e, _f
|
15862
|
+
var _a, _b, _c, _d, _e, _f;
|
15865
15863
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15866
15864
|
if (!rec)
|
15867
15865
|
return;
|
@@ -15881,10 +15879,9 @@ const WaterFall = (props) => {
|
|
15881
15879
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15882
15880
|
eventInfo: {
|
15883
15881
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15884
|
-
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 : '',
|
15885
15882
|
position: cacheActiveIndex + '',
|
15886
|
-
contentTags: JSON.stringify((
|
15887
|
-
traceInfo: (
|
15883
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
15884
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
15888
15885
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15889
15886
|
fromKName,
|
15890
15887
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17966,22 +17963,21 @@ const LikeButton = (_a) => {
|
|
17966
17963
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17967
17964
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17968
17965
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17969
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
17966
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17970
17967
|
if (state) {
|
17971
17968
|
// 先设置状态
|
17972
17969
|
setState(false);
|
17973
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
17970
|
+
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;
|
17974
17971
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17975
17972
|
eventInfo: {
|
17976
17973
|
eventSubject: 'favoriteContentCanceled',
|
17977
17974
|
eventDescription: 'This content was unfavorite by the user',
|
17978
17975
|
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 : '',
|
17979
|
-
|
17980
|
-
|
17981
|
-
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 : []),
|
17976
|
+
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 : '',
|
17977
|
+
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 : []),
|
17982
17978
|
position: position + '',
|
17983
|
-
contentFormat: ((
|
17984
|
-
traceInfo: (
|
17979
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
17980
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
17985
17981
|
}
|
17986
17982
|
});
|
17987
17983
|
// 如果接口调用失败,则回滚状态
|
@@ -17989,41 +17985,40 @@ const LikeButton = (_a) => {
|
|
17989
17985
|
setState(true);
|
17990
17986
|
}
|
17991
17987
|
else {
|
17992
|
-
const nRtcList = (
|
17988
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17993
17989
|
if (index === position) {
|
17994
17990
|
item.isCollected = false;
|
17995
17991
|
}
|
17996
17992
|
return item;
|
17997
|
-
})) !== null &&
|
17993
|
+
})) !== null && _p !== void 0 ? _p : [];
|
17998
17994
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17999
17995
|
}
|
18000
17996
|
}
|
18001
17997
|
else {
|
18002
17998
|
setState(true);
|
18003
|
-
const result = (
|
17999
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
18004
18000
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18005
18001
|
eventInfo: {
|
18006
18002
|
eventSubject: 'favoriteContent',
|
18007
18003
|
eventDescription: 'This content was favorite by the user',
|
18008
|
-
contentId: (
|
18009
|
-
|
18010
|
-
|
18011
|
-
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 : []),
|
18004
|
+
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 : '',
|
18005
|
+
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 : '',
|
18006
|
+
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 : []),
|
18012
18007
|
position: position + '',
|
18013
|
-
contentFormat: ((
|
18014
|
-
traceInfo: (
|
18008
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
18009
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
18015
18010
|
}
|
18016
18011
|
});
|
18017
18012
|
if (!result) {
|
18018
18013
|
setState(false);
|
18019
18014
|
}
|
18020
18015
|
else {
|
18021
|
-
const nRtcList = (
|
18016
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18022
18017
|
if (index === position) {
|
18023
18018
|
item.isCollected = true;
|
18024
18019
|
}
|
18025
18020
|
return item;
|
18026
|
-
})) !== null &&
|
18021
|
+
})) !== null && _z !== void 0 ? _z : [];
|
18027
18022
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18028
18023
|
}
|
18029
18024
|
}
|
@@ -18060,7 +18055,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
18060
18055
|
const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18061
18056
|
var _a, _b;
|
18062
18057
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
18063
|
-
const { bffEventReport, sxpParameter,
|
18058
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18064
18059
|
const videoStartTime = useRef(0);
|
18065
18060
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
18066
18061
|
const { isActive } = useSwiperSlide();
|
@@ -18126,23 +18121,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18126
18121
|
return;
|
18127
18122
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18128
18123
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18129
|
-
const handleEnd = () => {
|
18130
|
-
var _a, _b, _c, _d, _e, _f;
|
18131
|
-
if (!videoRef.current)
|
18132
|
-
return;
|
18133
|
-
if (isDiyH5) {
|
18134
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18135
|
-
if (!loopPlayRef.current)
|
18136
|
-
return;
|
18137
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18138
|
-
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;
|
18139
|
-
(_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);
|
18140
|
-
}
|
18141
|
-
}
|
18142
|
-
else {
|
18143
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18144
|
-
}
|
18145
|
-
};
|
18146
18124
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18147
18125
|
const handlePlaying = useCallback(() => {
|
18148
18126
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18151,7 +18129,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18151
18129
|
setIsLoadFinish(true);
|
18152
18130
|
}, []);
|
18153
18131
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18154
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
18132
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18155
18133
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18156
18134
|
return;
|
18157
18135
|
setIsPauseVideo(false);
|
@@ -18162,11 +18140,16 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18162
18140
|
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);
|
18163
18141
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18164
18142
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
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 : '',
|
18143
|
+
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) + '' }))
|
18166
18144
|
});
|
18167
18145
|
isFirstPlayRef.current = false;
|
18168
18146
|
}
|
18169
18147
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18148
|
+
const setCurrentTimeByStartTime = useCallback(() => {
|
18149
|
+
if (isDiyH5) {
|
18150
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18151
|
+
}
|
18152
|
+
}, []);
|
18170
18153
|
const handLoadeddata = useCallback(() => {
|
18171
18154
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18172
18155
|
return;
|
@@ -18191,12 +18174,13 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18191
18174
|
const handleLoadedmetadata = useCallback(() => {
|
18192
18175
|
if (!videoRef.current)
|
18193
18176
|
return;
|
18177
|
+
setCurrentTimeByStartTime();
|
18194
18178
|
loadedTimeRef.current = new Date();
|
18195
18179
|
handleStartPlay();
|
18196
18180
|
handLoadeddata();
|
18197
18181
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18198
18182
|
const handleClickVideo = useCallback((type) => () => {
|
18199
|
-
var _a, _b, _c, _d, _e;
|
18183
|
+
var _a, _b, _c, _d, _e, _f;
|
18200
18184
|
if (!videoRef.current)
|
18201
18185
|
return;
|
18202
18186
|
if (!isLoadFinish)
|
@@ -18217,17 +18201,20 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18217
18201
|
break;
|
18218
18202
|
default:
|
18219
18203
|
if (isPause) {
|
18220
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
18204
|
+
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)) {
|
18205
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18206
|
+
}
|
18207
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18221
18208
|
}
|
18222
18209
|
else {
|
18223
|
-
(
|
18210
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
18224
18211
|
}
|
18225
18212
|
setIsPauseVideo(!isPause);
|
18226
18213
|
break;
|
18227
18214
|
}
|
18228
18215
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18229
18216
|
const handlePause = useCallback(() => {
|
18230
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
18217
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18231
18218
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18232
18219
|
return;
|
18233
18220
|
if (activeIndex !== index)
|
@@ -18243,15 +18230,14 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18243
18230
|
eventSubject: 'playOverVideo',
|
18244
18231
|
eventDescription: 'User finished playing the video',
|
18245
18232
|
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 : '',
|
18246
|
-
|
18247
|
-
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 : '',
|
18233
|
+
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 : '',
|
18248
18234
|
endTime: videoCurrentTime,
|
18249
18235
|
videoDuration,
|
18250
18236
|
playDuration,
|
18251
|
-
contentTags: JSON.stringify((
|
18237
|
+
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 : []),
|
18252
18238
|
position: index + '',
|
18253
18239
|
contentFormat: 'video',
|
18254
|
-
traceInfo: (
|
18240
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18255
18241
|
}
|
18256
18242
|
});
|
18257
18243
|
}
|
@@ -18259,8 +18245,27 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18259
18245
|
const handleWaiting = useCallback(() => {
|
18260
18246
|
setWaiting(true);
|
18261
18247
|
}, []);
|
18248
|
+
const handleTimeUpload = () => {
|
18249
|
+
if (!videoRef.current || !isDiyH5)
|
18250
|
+
return;
|
18251
|
+
setTimeout(() => {
|
18252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18253
|
+
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)) {
|
18254
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18255
|
+
if (!loopPlayRef.current)
|
18256
|
+
return;
|
18257
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18258
|
+
(_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);
|
18259
|
+
}
|
18260
|
+
else {
|
18261
|
+
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;
|
18262
|
+
(_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);
|
18263
|
+
}
|
18264
|
+
}
|
18265
|
+
});
|
18266
|
+
};
|
18262
18267
|
useEffect(() => {
|
18263
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18268
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18264
18269
|
if (!isActive)
|
18265
18270
|
return;
|
18266
18271
|
const videoSrc = videoUrl;
|
@@ -18281,6 +18286,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18281
18286
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18282
18287
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18283
18288
|
var _a;
|
18289
|
+
setCurrentTimeByStartTime();
|
18284
18290
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18285
18291
|
});
|
18286
18292
|
}
|
@@ -18294,11 +18300,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18294
18300
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18295
18301
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18296
18302
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18297
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18303
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
18298
18304
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18299
18305
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18306
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18300
18307
|
return () => {
|
18301
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18308
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18302
18309
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18303
18310
|
if (!isPause)
|
18304
18311
|
handlePause();
|
@@ -18310,9 +18317,10 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
18310
18317
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18311
18318
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18312
18319
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18313
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18320
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
18314
18321
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18315
18322
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18323
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18316
18324
|
};
|
18317
18325
|
}, [isActive]);
|
18318
18326
|
useEffect(() => {
|
@@ -18523,45 +18531,19 @@ const Picture = (props) => {
|
|
18523
18531
|
}, onLoad: onShowFirstImage }))));
|
18524
18532
|
};
|
18525
18533
|
|
18526
|
-
const PictureGroup$4 =
|
18534
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18527
18535
|
var _a, _b;
|
18528
18536
|
const { isActive } = useSwiperSlide();
|
18529
|
-
const {
|
18537
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
18530
18538
|
const [isLoad, setIsLoad] = useState(false);
|
18531
18539
|
const [imgInfo, setImgInfo] = useState();
|
18532
18540
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
18533
|
-
const
|
18541
|
+
const swiperRef = useRef();
|
18534
18542
|
const isFirstPlayRef = useRef(true);
|
18535
|
-
const loopPlayRef = useRef(true);
|
18536
18543
|
const initTime = new Date();
|
18537
|
-
useImperativeHandle(ref, () => {
|
18538
|
-
return {
|
18539
|
-
setLoopPlay(v) {
|
18540
|
-
loopPlayRef.current = v;
|
18541
|
-
}
|
18542
|
-
};
|
18543
|
-
});
|
18544
|
-
useEffect(() => {
|
18545
|
-
let timerId;
|
18546
|
-
if (isLoad && isActive && isDiyH5) {
|
18547
|
-
timerId = setTimeout(() => {
|
18548
|
-
var _a, _b, _c, _d;
|
18549
|
-
if (!loopPlayRef.current)
|
18550
|
-
return;
|
18551
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18552
|
-
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;
|
18553
|
-
(_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);
|
18554
|
-
}
|
18555
|
-
}, 3000);
|
18556
|
-
}
|
18557
|
-
return () => {
|
18558
|
-
if (timerId)
|
18559
|
-
clearTimeout(timerId);
|
18560
|
-
};
|
18561
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18562
18544
|
useEffect(() => {
|
18563
18545
|
if (isLoad && isActive) {
|
18564
|
-
(
|
18546
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
18565
18547
|
if (openHashtag) {
|
18566
18548
|
onViewImageEndEvent(rec);
|
18567
18549
|
}
|
@@ -18571,7 +18553,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18571
18553
|
}
|
18572
18554
|
}
|
18573
18555
|
else {
|
18574
|
-
(
|
18556
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
18575
18557
|
}
|
18576
18558
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18577
18559
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18598,13 +18580,13 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18598
18580
|
};
|
18599
18581
|
}, [isActive, imgInfo]);
|
18600
18582
|
const handleMouseEnter = useCallback(() => {
|
18601
|
-
if (
|
18602
|
-
|
18583
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18584
|
+
swiperRef.current.swiper.autoplay.stop();
|
18603
18585
|
}
|
18604
18586
|
}, []);
|
18605
18587
|
const handleMouseLeave = useCallback(() => {
|
18606
|
-
if (
|
18607
|
-
|
18588
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18589
|
+
swiperRef.current.swiper.autoplay.start();
|
18608
18590
|
}
|
18609
18591
|
}, []);
|
18610
18592
|
const handleSlideChange = useCallback((swiper) => {
|
@@ -18625,7 +18607,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18625
18607
|
enabled: true
|
18626
18608
|
}
|
18627
18609
|
}
|
18628
|
-
: {}), { loop: true, ref:
|
18610
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18629
18611
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18630
18612
|
fontSize: '14px'
|
18631
18613
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18642,7 +18624,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
18642
18624
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18643
18625
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18644
18626
|
}))));
|
18645
|
-
}
|
18627
|
+
};
|
18646
18628
|
var PictureGroup$5 = memo(PictureGroup$4);
|
18647
18629
|
|
18648
18630
|
/*
|
@@ -18922,7 +18904,7 @@ var NavBack$1 = memo(NavBack);
|
|
18922
18904
|
* @Author: binruan@chatlabs.com
|
18923
18905
|
* @Date: 2024-03-20 10:27:31
|
18924
18906
|
* @LastEditors: binruan@chatlabs.com
|
18925
|
-
* @LastEditTime: 2025-05-
|
18907
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18926
18908
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18927
18909
|
*
|
18928
18910
|
*/
|
@@ -18942,7 +18924,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18942
18924
|
const skipLinkRef = useRef(false);
|
18943
18925
|
const [pageNum, setPageNum] = useState(2);
|
18944
18926
|
const videoWidgetRef = useRef(null);
|
18945
|
-
const pictureGroupRef = useRef(null);
|
18946
18927
|
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();
|
18947
18928
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18948
18929
|
const isShowFingerTip = useMemo(() => {
|
@@ -18990,7 +18971,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18990
18971
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18991
18972
|
}, [data, ctaType, swiperRef]);
|
18992
18973
|
const handleSessionCompleted = useCallback((fk) => {
|
18993
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
18974
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
18994
18975
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18995
18976
|
let fromKName = '';
|
18996
18977
|
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))) {
|
@@ -19017,13 +18998,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19017
18998
|
eventSubject: 'sessionCompleted',
|
19018
18999
|
eventDescription: 'Session completed',
|
19019
19000
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
19020
|
-
|
19021
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
19001
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
19022
19002
|
position: activeIndex + '',
|
19023
19003
|
fromKName: fk || fromKName,
|
19024
19004
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19025
|
-
ctatId: (
|
19026
|
-
traceInfo: (
|
19005
|
+
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 : '',
|
19006
|
+
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 : ''
|
19027
19007
|
}
|
19028
19008
|
});
|
19029
19009
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19082,9 +19062,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19082
19062
|
refreshFeSession
|
19083
19063
|
]);
|
19084
19064
|
const handleSessionExpire = useCallback(debounce(() => {
|
19085
|
-
var _a
|
19065
|
+
var _a;
|
19086
19066
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19087
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19088
19067
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19089
19068
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19090
19069
|
useEffect(() => {
|
@@ -19154,18 +19133,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19154
19133
|
return null;
|
19155
19134
|
}, [globalConfig, activeIndex, visList]);
|
19156
19135
|
const renderContent = useCallback((rec, index) => {
|
19157
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
19136
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19158
19137
|
if (rec === 'organic menu') {
|
19159
19138
|
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)));
|
19160
19139
|
}
|
19161
|
-
if ((
|
19140
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
19162
19141
|
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 })));
|
19163
19142
|
}
|
19164
|
-
if ((
|
19165
|
-
return (React.createElement(PictureGroup$5,
|
19143
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
19144
|
+
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 }));
|
19166
19145
|
}
|
19167
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19168
|
-
return (
|
19146
|
+
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) {
|
19147
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
19169
19148
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19170
19149
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19171
19150
|
const Component = withBindDataSource(t);
|
@@ -19203,7 +19182,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19203
19182
|
};
|
19204
19183
|
}, [isShowMore]);
|
19205
19184
|
const renderBottom = useCallback((rec, index) => {
|
19206
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
19185
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19207
19186
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19208
19187
|
let cta = null;
|
19209
19188
|
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) {
|
@@ -19212,27 +19191,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19212
19191
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19213
19192
|
cta = '商品CTA';
|
19214
19193
|
}
|
19215
|
-
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)) {
|
19216
|
-
cta = '服务CTA';
|
19217
|
-
}
|
19218
19194
|
else {
|
19219
|
-
cta = (
|
19195
|
+
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;
|
19220
19196
|
}
|
19221
19197
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19222
19198
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19223
19199
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19224
|
-
((
|
19200
|
+
((_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));
|
19225
19201
|
return (React.createElement(React.Fragment, null,
|
19226
19202
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19227
|
-
((
|
19228
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19203
|
+
((_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' }),
|
19204
|
+
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` } },
|
19229
19205
|
React.createElement(Nudge, { nudge: nudge }),
|
19230
19206
|
((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' },
|
19231
19207
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19232
19208
|
React.createElement("div", null,
|
19233
|
-
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: (
|
19209
|
+
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 }),
|
19234
19210
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19235
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19211
|
+
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) }))),
|
19236
19212
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19237
19213
|
}
|
19238
19214
|
return null;
|
@@ -19271,7 +19247,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19271
19247
|
return null;
|
19272
19248
|
}, [globalConfig, waterFallData]);
|
19273
19249
|
const handleViewImageStartEnd = (item) => {
|
19274
|
-
var _a, _b, _c, _d, _e, _f
|
19250
|
+
var _a, _b, _c, _d, _e, _f;
|
19275
19251
|
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)) {
|
19276
19252
|
const endTime = Date.now();
|
19277
19253
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19280,11 +19256,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19280
19256
|
eventSubject: 'viewImageCarouselEnd',
|
19281
19257
|
eventDescription: 'User end view the image carousel',
|
19282
19258
|
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 : '',
|
19283
|
-
|
19284
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19259
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19285
19260
|
imageEndTime: `${endTime}`,
|
19286
19261
|
playDuration: `${duration}`,
|
19287
|
-
contentTags: JSON.stringify((
|
19262
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19288
19263
|
position: activeIndex + '',
|
19289
19264
|
contentFormat: 'image',
|
19290
19265
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19293,7 +19268,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19293
19268
|
}
|
19294
19269
|
};
|
19295
19270
|
const handleSlideSkip = (item, position) => {
|
19296
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
19271
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19297
19272
|
if (isPreview || waterFallData)
|
19298
19273
|
return;
|
19299
19274
|
const t = new Date() - curTime.current;
|
@@ -19319,8 +19294,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19319
19294
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19320
19295
|
position: position + '',
|
19321
19296
|
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 : '',
|
19322
|
-
|
19323
|
-
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 : '',
|
19297
|
+
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 : '',
|
19324
19298
|
contentFormat
|
19325
19299
|
}
|
19326
19300
|
});
|
@@ -19330,7 +19304,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19330
19304
|
}
|
19331
19305
|
};
|
19332
19306
|
const handleScrollEvent = (swiper) => {
|
19333
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
19307
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19334
19308
|
const item = data[swiper.previousIndex];
|
19335
19309
|
if (!item)
|
19336
19310
|
return;
|
@@ -19347,12 +19321,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19347
19321
|
eventSubject: 'scrollDown',
|
19348
19322
|
eventDescription: 'User scroll down',
|
19349
19323
|
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 : '',
|
19350
|
-
|
19351
|
-
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 : '',
|
19324
|
+
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 : '',
|
19352
19325
|
requestId: null,
|
19353
|
-
traceInfo: (
|
19326
|
+
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 : '',
|
19354
19327
|
contentFormat,
|
19355
|
-
position: ((
|
19328
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
19356
19329
|
}
|
19357
19330
|
});
|
19358
19331
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19364,13 +19337,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19364
19337
|
eventInfo: {
|
19365
19338
|
eventSubject: 'scrollUp',
|
19366
19339
|
eventDescription: 'User scroll up',
|
19367
|
-
contentId: (
|
19368
|
-
|
19369
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19340
|
+
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 : '',
|
19341
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19370
19342
|
requestId: null,
|
19371
|
-
traceInfo: (
|
19343
|
+
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 : '',
|
19372
19344
|
contentFormat,
|
19373
|
-
position: ((
|
19345
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19374
19346
|
}
|
19375
19347
|
});
|
19376
19348
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19396,7 +19368,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19396
19368
|
}
|
19397
19369
|
}, [openHashtag, data, activeIndex]);
|
19398
19370
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19399
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19371
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19400
19372
|
const item = data[activeIndex];
|
19401
19373
|
// 如果是图片集则上报事件
|
19402
19374
|
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)) {
|
@@ -19407,10 +19379,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19407
19379
|
eventSubject: 'viewImageCarouselStart',
|
19408
19380
|
eventDescription: 'User start view the image carousel',
|
19409
19381
|
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 : '',
|
19410
|
-
|
19411
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19382
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19412
19383
|
imageStartTime: `${startTime}`,
|
19413
|
-
contentTags: JSON.stringify((
|
19384
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19414
19385
|
position: activeIndex + '',
|
19415
19386
|
contentFormat: 'image',
|
19416
19387
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19420,11 +19391,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19420
19391
|
if (enableCapi) {
|
19421
19392
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19422
19393
|
eventName: 'ViewContent',
|
19423
|
-
product: (
|
19394
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19424
19395
|
});
|
19425
19396
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19426
19397
|
eventName: 'PageView',
|
19427
|
-
product: (
|
19398
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19428
19399
|
});
|
19429
19400
|
}
|
19430
19401
|
}
|
@@ -19516,20 +19487,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19516
19487
|
swiperRef.current.swiper.allowTouchMove = true;
|
19517
19488
|
}, 500);
|
19518
19489
|
}, onActiveIndexChange: (swiper) => {
|
19519
|
-
var _a, _b;
|
19520
19490
|
setActiveIndex(swiper.activeIndex);
|
19521
19491
|
if (openHashtag)
|
19522
19492
|
return;
|
19523
19493
|
// 处理上滑下滑事件
|
19524
19494
|
handleScrollEvent(swiper);
|
19525
|
-
if (waterFallData || isEditor)
|
19495
|
+
if (waterFallData || isEditor || isDiyH5)
|
19526
19496
|
return;
|
19527
19497
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19528
19498
|
if (!isLoadMore) {
|
19529
|
-
if (isDiyH5) {
|
19530
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19531
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19532
|
-
}
|
19533
19499
|
setIsLoadMore(true);
|
19534
19500
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19535
19501
|
var _a;
|
@@ -19582,7 +19548,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19582
19548
|
}, []);
|
19583
19549
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19584
19550
|
const handlePlaying = useCallback(() => {
|
19585
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19551
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19586
19552
|
setIsPauseVideo(false);
|
19587
19553
|
const item = data[index];
|
19588
19554
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19595,15 +19561,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19595
19561
|
eventSubject: 'playVideo',
|
19596
19562
|
eventDescription: 'User played the video',
|
19597
19563
|
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 : '',
|
19598
|
-
|
19599
|
-
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 : '',
|
19564
|
+
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 : '',
|
19600
19565
|
playType,
|
19601
19566
|
startTime: videoCurrentTime,
|
19602
19567
|
videoDuration,
|
19603
|
-
contentTags: JSON.stringify((
|
19568
|
+
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 : []),
|
19604
19569
|
position: index + '',
|
19605
19570
|
contentFormat: 'video',
|
19606
|
-
traceInfo: (
|
19571
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19607
19572
|
}
|
19608
19573
|
});
|
19609
19574
|
setIsFirstPlay(false);
|
@@ -19642,7 +19607,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19642
19607
|
}
|
19643
19608
|
}, [isLoadFinish]);
|
19644
19609
|
const onPause = useCallback(() => {
|
19645
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19610
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19646
19611
|
const item = data[index];
|
19647
19612
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19648
19613
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19653,15 +19618,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19653
19618
|
eventSubject: 'playOverVideo',
|
19654
19619
|
eventDescription: 'User finished playing the video',
|
19655
19620
|
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 : '',
|
19656
|
-
|
19657
|
-
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 : '',
|
19621
|
+
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 : '',
|
19658
19622
|
endTime: videoCurrentTime,
|
19659
19623
|
videoDuration,
|
19660
19624
|
playDuration,
|
19661
|
-
contentTags: JSON.stringify((
|
19625
|
+
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 : []),
|
19662
19626
|
position: index + '',
|
19663
19627
|
contentFormat: 'video',
|
19664
|
-
traceInfo: (
|
19628
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19665
19629
|
}
|
19666
19630
|
});
|
19667
19631
|
}
|