pb-sxp-ui 1.16.13 → 1.16.15
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 +292 -183
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +292 -183
- 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 +292 -183
- 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 +15 -17
- 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 +0 -1
- package/es/core/context/SxpDataSourceProvider.js +147 -22
- 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 +15 -17
- 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 +0 -1
- package/lib/core/context/SxpDataSourceProvider.js +147 -22
- 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: '' });
|
@@ -737,7 +736,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
737
736
|
return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
|
738
737
|
}, [bffDataSource]);
|
739
738
|
// bff API 请求方法
|
740
|
-
const bffFetch = React.useCallback((path, options) => {
|
739
|
+
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
741
740
|
var _a;
|
742
741
|
if (!bffDataSource)
|
743
742
|
return;
|
@@ -752,7 +751,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
752
751
|
val.split('=')[1];
|
753
752
|
});
|
754
753
|
return window
|
755
|
-
.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'
|
754
|
+
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
|
756
755
|
? JSON.stringify({
|
757
756
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
758
757
|
})
|
@@ -760,6 +759,166 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
760
759
|
.then((res) => res.json())
|
761
760
|
.catch((err) => Promise.reject(err));
|
762
761
|
}, [bffDataSource, fakeUserId]);
|
762
|
+
const bffCollectEvent = React.useCallback((params) => {
|
763
|
+
var _a;
|
764
|
+
const body = {
|
765
|
+
eventName: params === null || params === void 0 ? void 0 : params.eventName,
|
766
|
+
eventSource: params === null || params === void 0 ? void 0 : params.eventSource
|
767
|
+
// eventInfo: params?.eventInfo ? JSON.stringify(params?.eventInfo) : ''
|
768
|
+
};
|
769
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v1/data/collect/${(_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']}/${params === null || params === void 0 ? void 0 : params.eventName}`, {
|
770
|
+
method: 'POST',
|
771
|
+
body,
|
772
|
+
type: 'beacon'
|
773
|
+
}, false);
|
774
|
+
}, [bffFetch, bffDataSource]);
|
775
|
+
React.useEffect(() => {
|
776
|
+
if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
777
|
+
const OriginalImage = window.Image;
|
778
|
+
window.Image = function () {
|
779
|
+
const img = new OriginalImage();
|
780
|
+
// 劫持 src 的 setter
|
781
|
+
const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
|
782
|
+
Object.defineProperty(img, 'src', {
|
783
|
+
set(value) {
|
784
|
+
// 继续正常设置 src
|
785
|
+
originalSrcDescriptor.set.call(this, value);
|
786
|
+
img.onload = function () {
|
787
|
+
// 检查是否是目标 URL
|
788
|
+
if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
|
789
|
+
// 解析 URL 参数
|
790
|
+
const url = new URL(value);
|
791
|
+
const params = Object.fromEntries(url.searchParams.entries());
|
792
|
+
bffCollectEvent({
|
793
|
+
eventName: params === null || params === void 0 ? void 0 : params.ev,
|
794
|
+
eventSource: 'Meta Pixel'
|
795
|
+
});
|
796
|
+
}
|
797
|
+
};
|
798
|
+
},
|
799
|
+
get() {
|
800
|
+
return originalSrcDescriptor.get.call(this);
|
801
|
+
}
|
802
|
+
});
|
803
|
+
return img;
|
804
|
+
};
|
805
|
+
}
|
806
|
+
}, [bffCollectEvent]);
|
807
|
+
React.useEffect(() => {
|
808
|
+
// 类型安全声明
|
809
|
+
const navigatorWithBeacon = navigator;
|
810
|
+
if (!navigatorWithBeacon.sendBeacon) {
|
811
|
+
console.warn('navigator.sendBeacon is not supported');
|
812
|
+
return;
|
813
|
+
}
|
814
|
+
// 保存原始方法
|
815
|
+
const originalSendBeacon = navigatorWithBeacon.sendBeacon.bind(navigatorWithBeacon);
|
816
|
+
// 覆盖方法
|
817
|
+
navigatorWithBeacon.sendBeacon = function (url, data) {
|
818
|
+
const urlString = url instanceof URL ? url.href : url.toString();
|
819
|
+
const success = originalSendBeacon(url, data);
|
820
|
+
function parseBeaconData(data) {
|
821
|
+
return __awaiter(this, void 0, void 0, function* () {
|
822
|
+
if (typeof data === 'string')
|
823
|
+
return JSON.parse(data);
|
824
|
+
if (data instanceof Blob)
|
825
|
+
return JSON.parse(yield data.text());
|
826
|
+
if (data instanceof ArrayBuffer)
|
827
|
+
return JSON.parse(new TextDecoder().decode(data));
|
828
|
+
return null;
|
829
|
+
});
|
830
|
+
}
|
831
|
+
if (success) {
|
832
|
+
// 异步处理监控逻辑(不阻塞原始行为)
|
833
|
+
Promise.resolve().then(() => __awaiter(this, void 0, void 0, function* () {
|
834
|
+
var _a, _b;
|
835
|
+
try {
|
836
|
+
const parsedData = yield parseBeaconData(data);
|
837
|
+
if (success) {
|
838
|
+
// 使用你的自定义上报方法
|
839
|
+
if (urlString.includes('https://tr.snapchat.com/p')) {
|
840
|
+
(_b = (_a = parsedData === null || parsedData === void 0 ? void 0 : parsedData.req) === null || _a === void 0 ? void 0 : _a.forEach) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => {
|
841
|
+
var _a, _b;
|
842
|
+
if ((_a = item === null || item === void 0 ? void 0 : item.t) === null || _a === void 0 ? void 0 : _a.ev) {
|
843
|
+
bffCollectEvent({
|
844
|
+
eventName: (_b = item === null || item === void 0 ? void 0 : item.t) === null || _b === void 0 ? void 0 : _b.ev,
|
845
|
+
eventSource: 'Snapchat Pixel'
|
846
|
+
});
|
847
|
+
}
|
848
|
+
});
|
849
|
+
}
|
850
|
+
else if (urlString.includes('https://analytics.tiktok.com/api/v2/pixel') && (parsedData === null || parsedData === void 0 ? void 0 : parsedData.event)) {
|
851
|
+
bffCollectEvent({
|
852
|
+
eventName: parsedData.event,
|
853
|
+
eventSource: 'TikTok Pixel'
|
854
|
+
});
|
855
|
+
}
|
856
|
+
}
|
857
|
+
}
|
858
|
+
catch (error) {
|
859
|
+
console.error('监控失败:', error);
|
860
|
+
}
|
861
|
+
}));
|
862
|
+
}
|
863
|
+
// 非TikTok请求直接放行
|
864
|
+
return success;
|
865
|
+
};
|
866
|
+
// 清理函数:恢复原始方法
|
867
|
+
return () => {
|
868
|
+
navigatorWithBeacon.sendBeacon = originalSendBeacon;
|
869
|
+
};
|
870
|
+
}, [bffCollectEvent]);
|
871
|
+
React.useEffect(() => {
|
872
|
+
const _originalFetch = window.fetch;
|
873
|
+
// 覆盖 fetch 方法
|
874
|
+
window.fetch = function (input, init) {
|
875
|
+
var arguments_1 = arguments;
|
876
|
+
return __awaiter(this, void 0, void 0, function* () {
|
877
|
+
// 安全获取 URL 字符串
|
878
|
+
let url;
|
879
|
+
try {
|
880
|
+
url = typeof input === 'string'
|
881
|
+
? input
|
882
|
+
: input instanceof URL
|
883
|
+
? input.href
|
884
|
+
: input.url;
|
885
|
+
}
|
886
|
+
catch (error) {
|
887
|
+
console.error('解析请求URL失败:', error);
|
888
|
+
return _originalFetch.apply(this, arguments_1);
|
889
|
+
}
|
890
|
+
// 非GA4请求直接放行
|
891
|
+
if (!url.includes('https://www.google-analytics.com/g/collect')) {
|
892
|
+
return _originalFetch.apply(this, arguments_1);
|
893
|
+
}
|
894
|
+
// 检查是否是 GA4 收集端点
|
895
|
+
try {
|
896
|
+
// 1. 先执行原始请求
|
897
|
+
const response = yield _originalFetch.apply(this, arguments_1);
|
898
|
+
// 2. 检查请求是否成功 (HTTP 200-299)
|
899
|
+
// 安全解析 URL
|
900
|
+
const urlObj = new URL(url);
|
901
|
+
const params = Object.fromEntries(urlObj.searchParams.entries());
|
902
|
+
if (params === null || params === void 0 ? void 0 : params.en) {
|
903
|
+
bffCollectEvent({
|
904
|
+
eventName: params === null || params === void 0 ? void 0 : params.en,
|
905
|
+
eventSource: 'Google Analytics'
|
906
|
+
});
|
907
|
+
}
|
908
|
+
return response;
|
909
|
+
}
|
910
|
+
catch (error) {
|
911
|
+
console.error('处理 GA4 请求时出错:', error);
|
912
|
+
throw error;
|
913
|
+
}
|
914
|
+
});
|
915
|
+
};
|
916
|
+
}, [bffCollectEvent]);
|
917
|
+
React.useEffect(() => {
|
918
|
+
if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
919
|
+
window === null || window === void 0 ? void 0 : window.fbq('track', 'PageView');
|
920
|
+
}
|
921
|
+
}, []);
|
763
922
|
// bff API admin 请求方法
|
764
923
|
const bffFetchAdmin = React.useCallback((path, options) => {
|
765
924
|
if (!bffDataSource)
|
@@ -815,9 +974,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
815
974
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
816
975
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
817
976
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
818
|
-
if (isDiyH5) {
|
819
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
820
|
-
}
|
821
977
|
}
|
822
978
|
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));
|
823
979
|
if (isNotNullList) {
|
@@ -857,17 +1013,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
857
1013
|
if (rtcList.length <= 0) {
|
858
1014
|
return;
|
859
1015
|
}
|
860
|
-
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
861
|
-
setRtcList(rtcList.concat(firstRtcList));
|
862
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
863
|
-
return;
|
864
|
-
}
|
865
1016
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
866
1017
|
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 })));
|
867
1018
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
868
1019
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
869
1020
|
return data;
|
870
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
1021
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
871
1022
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
872
1023
|
var _a, _b, _c, _d, _e;
|
873
1024
|
let expire = false;
|
@@ -1094,7 +1245,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1094
1245
|
}
|
1095
1246
|
}), [bffFetch, utmVal]);
|
1096
1247
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1097
|
-
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
|
1248
|
+
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;
|
1098
1249
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1099
1250
|
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);
|
1100
1251
|
let fromKName = '';
|
@@ -1112,7 +1263,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1112
1263
|
}
|
1113
1264
|
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;
|
1114
1265
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1115
|
-
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 : '',
|
1266
|
+
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 })
|
1116
1267
|
});
|
1117
1268
|
}, [bffEventReport, isFromHashtag]);
|
1118
1269
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1214,9 +1365,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1214
1365
|
}
|
1215
1366
|
setRtcList(list);
|
1216
1367
|
setCacheRtcList(list);
|
1217
|
-
if (isDiyH5) {
|
1218
|
-
setFirstRtcList(list);
|
1219
|
-
}
|
1220
1368
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1221
1369
|
if (channel) {
|
1222
1370
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1252,9 +1400,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1252
1400
|
}
|
1253
1401
|
setRtcList(list);
|
1254
1402
|
setCacheRtcList(list);
|
1255
|
-
if (isDiyH5) {
|
1256
|
-
setFirstRtcList(list);
|
1257
|
-
}
|
1258
1403
|
}
|
1259
1404
|
})
|
1260
1405
|
.finally(() => {
|
@@ -1318,8 +1463,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1318
1463
|
refreshFeSession,
|
1319
1464
|
getAccount,
|
1320
1465
|
accountSonsent,
|
1321
|
-
isDiyH5
|
1322
|
-
firstRtcList
|
1466
|
+
isDiyH5
|
1323
1467
|
} }, 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({
|
1324
1468
|
rtcList,
|
1325
1469
|
mutateLike: bffMutateLike,
|
@@ -1780,14 +1924,14 @@ var settingRender$f = [
|
|
1780
1924
|
* @Author: binruan@chatlabs.com
|
1781
1925
|
* @Date: 2024-03-12 10:59:06
|
1782
1926
|
* @LastEditors: binruan@chatlabs.com
|
1783
|
-
* @LastEditTime:
|
1927
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1784
1928
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1785
1929
|
*
|
1786
1930
|
*/
|
1787
1931
|
function useEventReport() {
|
1788
1932
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1789
1933
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1790
|
-
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
|
1934
|
+
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;
|
1791
1935
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1792
1936
|
if (i !== -1) {
|
1793
1937
|
return;
|
@@ -1820,11 +1964,11 @@ function useEventReport() {
|
|
1820
1964
|
contentFormat = 'image';
|
1821
1965
|
}
|
1822
1966
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1823
|
-
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 : '',
|
1967
|
+
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 }))
|
1824
1968
|
});
|
1825
1969
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1826
1970
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1827
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
1971
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1828
1972
|
let fromKName = '';
|
1829
1973
|
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))) {
|
1830
1974
|
fromKName = 'pdpPage';
|
@@ -1843,9 +1987,8 @@ function useEventReport() {
|
|
1843
1987
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1844
1988
|
position: position + '',
|
1845
1989
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1846
|
-
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 : '',
|
1847
1990
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1848
|
-
traceInfo: (
|
1991
|
+
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 : '',
|
1849
1992
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1850
1993
|
eventSubject: 'productView',
|
1851
1994
|
eventDescription: 'User browsed the product'
|
@@ -15660,7 +15803,7 @@ function WaterfallList(_a) {
|
|
15660
15803
|
* @Author: binruan@chatlabs.com
|
15661
15804
|
* @Date: 2024-01-10 10:58:24
|
15662
15805
|
* @LastEditors: binruan@chatlabs.com
|
15663
|
-
* @LastEditTime: 2025-
|
15806
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15664
15807
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15665
15808
|
*
|
15666
15809
|
*/
|
@@ -15698,7 +15841,7 @@ const WaterFall = (props) => {
|
|
15698
15841
|
}
|
15699
15842
|
}, [waterFallData]);
|
15700
15843
|
const reportTagsView = React.useCallback(() => {
|
15701
|
-
var _a, _b, _c, _d, _e, _f
|
15844
|
+
var _a, _b, _c, _d, _e, _f;
|
15702
15845
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15703
15846
|
if (!rec)
|
15704
15847
|
return;
|
@@ -15718,10 +15861,9 @@ const WaterFall = (props) => {
|
|
15718
15861
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15719
15862
|
eventInfo: {
|
15720
15863
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15721
|
-
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 : '',
|
15722
15864
|
position: cacheActiveIndex + '',
|
15723
|
-
contentTags: JSON.stringify((
|
15724
|
-
traceInfo: (
|
15865
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
15866
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
15725
15867
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15726
15868
|
fromKName,
|
15727
15869
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17803,7 +17945,7 @@ const LikeButton = (_a) => {
|
|
17803
17945
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17804
17946
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17805
17947
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17806
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
17948
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17807
17949
|
if (state) {
|
17808
17950
|
// 先设置状态
|
17809
17951
|
setState(false);
|
@@ -17813,12 +17955,11 @@ const LikeButton = (_a) => {
|
|
17813
17955
|
eventSubject: 'favoriteContentCanceled',
|
17814
17956
|
eventDescription: 'This content was unfavorite by the user',
|
17815
17957
|
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 : '',
|
17816
|
-
|
17817
|
-
|
17818
|
-
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 : []),
|
17958
|
+
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 : '',
|
17959
|
+
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 : []),
|
17819
17960
|
position: position + '',
|
17820
|
-
contentFormat: ((
|
17821
|
-
traceInfo: (
|
17961
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
17962
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
17822
17963
|
}
|
17823
17964
|
});
|
17824
17965
|
// 如果接口调用失败,则回滚状态
|
@@ -17826,41 +17967,40 @@ const LikeButton = (_a) => {
|
|
17826
17967
|
setState(true);
|
17827
17968
|
}
|
17828
17969
|
else {
|
17829
|
-
const nRtcList = (
|
17970
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17830
17971
|
if (index === position) {
|
17831
17972
|
item.isCollected = false;
|
17832
17973
|
}
|
17833
17974
|
return item;
|
17834
|
-
})) !== null &&
|
17975
|
+
})) !== null && _p !== void 0 ? _p : [];
|
17835
17976
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17836
17977
|
}
|
17837
17978
|
}
|
17838
17979
|
else {
|
17839
17980
|
setState(true);
|
17840
|
-
const result = (
|
17981
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
17841
17982
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17842
17983
|
eventInfo: {
|
17843
17984
|
eventSubject: 'favoriteContent',
|
17844
17985
|
eventDescription: 'This content was favorite by the user',
|
17845
|
-
contentId: (
|
17846
|
-
|
17847
|
-
|
17848
|
-
contentTags: JSON.stringify((_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.tags) !== null && _2 !== void 0 ? _2 : []),
|
17986
|
+
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 : '',
|
17987
|
+
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 : '',
|
17988
|
+
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 : []),
|
17849
17989
|
position: position + '',
|
17850
|
-
contentFormat: ((
|
17851
|
-
traceInfo: (
|
17990
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
17991
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
17852
17992
|
}
|
17853
17993
|
});
|
17854
17994
|
if (!result) {
|
17855
17995
|
setState(false);
|
17856
17996
|
}
|
17857
17997
|
else {
|
17858
|
-
const nRtcList = (
|
17998
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17859
17999
|
if (index === position) {
|
17860
18000
|
item.isCollected = true;
|
17861
18001
|
}
|
17862
18002
|
return item;
|
17863
|
-
})) !== null &&
|
18003
|
+
})) !== null && _z !== void 0 ? _z : [];
|
17864
18004
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17865
18005
|
}
|
17866
18006
|
}
|
@@ -17897,7 +18037,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
17897
18037
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
17898
18038
|
var _a, _b;
|
17899
18039
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
17900
|
-
const { bffEventReport, sxpParameter,
|
18040
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
17901
18041
|
const videoStartTime = React.useRef(0);
|
17902
18042
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
17903
18043
|
const { isActive } = useSwiperSlide();
|
@@ -17963,23 +18103,6 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
17963
18103
|
return;
|
17964
18104
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
17965
18105
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17966
|
-
const handleEnd = () => {
|
17967
|
-
var _a, _b, _c, _d, _e, _f;
|
17968
|
-
if (!videoRef.current)
|
17969
|
-
return;
|
17970
|
-
if (isDiyH5) {
|
17971
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
17972
|
-
if (!loopPlayRef.current)
|
17973
|
-
return;
|
17974
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
17975
|
-
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;
|
17976
|
-
(_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);
|
17977
|
-
}
|
17978
|
-
}
|
17979
|
-
else {
|
17980
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
17981
|
-
}
|
17982
|
-
};
|
17983
18106
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
17984
18107
|
const handlePlaying = React.useCallback(() => {
|
17985
18108
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -17988,7 +18111,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
17988
18111
|
setIsLoadFinish(true);
|
17989
18112
|
}, []);
|
17990
18113
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
17991
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
18114
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
17992
18115
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17993
18116
|
return;
|
17994
18117
|
setIsPauseVideo(false);
|
@@ -17999,11 +18122,16 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
17999
18122
|
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);
|
18000
18123
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18001
18124
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18002
|
-
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 : '',
|
18125
|
+
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) + '' }))
|
18003
18126
|
});
|
18004
18127
|
isFirstPlayRef.current = false;
|
18005
18128
|
}
|
18006
18129
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18130
|
+
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18131
|
+
if (isDiyH5) {
|
18132
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18133
|
+
}
|
18134
|
+
}, []);
|
18007
18135
|
const handLoadeddata = React.useCallback(() => {
|
18008
18136
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18009
18137
|
return;
|
@@ -18028,12 +18156,13 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18028
18156
|
const handleLoadedmetadata = React.useCallback(() => {
|
18029
18157
|
if (!videoRef.current)
|
18030
18158
|
return;
|
18159
|
+
setCurrentTimeByStartTime();
|
18031
18160
|
loadedTimeRef.current = new Date();
|
18032
18161
|
handleStartPlay();
|
18033
18162
|
handLoadeddata();
|
18034
18163
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18035
18164
|
const handleClickVideo = React.useCallback((type) => () => {
|
18036
|
-
var _a, _b, _c, _d, _e;
|
18165
|
+
var _a, _b, _c, _d, _e, _f;
|
18037
18166
|
if (!videoRef.current)
|
18038
18167
|
return;
|
18039
18168
|
if (!isLoadFinish)
|
@@ -18054,17 +18183,20 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18054
18183
|
break;
|
18055
18184
|
default:
|
18056
18185
|
if (isPause) {
|
18057
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
18186
|
+
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)) {
|
18187
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18188
|
+
}
|
18189
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18058
18190
|
}
|
18059
18191
|
else {
|
18060
|
-
(
|
18192
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
18061
18193
|
}
|
18062
18194
|
setIsPauseVideo(!isPause);
|
18063
18195
|
break;
|
18064
18196
|
}
|
18065
18197
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18066
18198
|
const handlePause = React.useCallback(() => {
|
18067
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
18199
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18068
18200
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18069
18201
|
return;
|
18070
18202
|
if (activeIndex !== index)
|
@@ -18080,15 +18212,14 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18080
18212
|
eventSubject: 'playOverVideo',
|
18081
18213
|
eventDescription: 'User finished playing the video',
|
18082
18214
|
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 : '',
|
18083
|
-
|
18084
|
-
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 : '',
|
18215
|
+
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 : '',
|
18085
18216
|
endTime: videoCurrentTime,
|
18086
18217
|
videoDuration,
|
18087
18218
|
playDuration,
|
18088
|
-
contentTags: JSON.stringify((
|
18219
|
+
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 : []),
|
18089
18220
|
position: index + '',
|
18090
18221
|
contentFormat: 'video',
|
18091
|
-
traceInfo: (
|
18222
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18092
18223
|
}
|
18093
18224
|
});
|
18094
18225
|
}
|
@@ -18096,8 +18227,27 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18096
18227
|
const handleWaiting = React.useCallback(() => {
|
18097
18228
|
setWaiting(true);
|
18098
18229
|
}, []);
|
18230
|
+
const handleTimeUpload = () => {
|
18231
|
+
if (!videoRef.current || !isDiyH5)
|
18232
|
+
return;
|
18233
|
+
setTimeout(() => {
|
18234
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18235
|
+
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)) {
|
18236
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18237
|
+
if (!loopPlayRef.current)
|
18238
|
+
return;
|
18239
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18240
|
+
(_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);
|
18241
|
+
}
|
18242
|
+
else {
|
18243
|
+
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;
|
18244
|
+
(_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);
|
18245
|
+
}
|
18246
|
+
}
|
18247
|
+
});
|
18248
|
+
};
|
18099
18249
|
React.useEffect(() => {
|
18100
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18250
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18101
18251
|
if (!isActive)
|
18102
18252
|
return;
|
18103
18253
|
const videoSrc = videoUrl;
|
@@ -18118,6 +18268,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18118
18268
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18119
18269
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18120
18270
|
var _a;
|
18271
|
+
setCurrentTimeByStartTime();
|
18121
18272
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18122
18273
|
});
|
18123
18274
|
}
|
@@ -18131,11 +18282,12 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18131
18282
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18132
18283
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18133
18284
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18134
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18285
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
18135
18286
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18136
18287
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18288
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18137
18289
|
return () => {
|
18138
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18290
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18139
18291
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18140
18292
|
if (!isPause)
|
18141
18293
|
handlePause();
|
@@ -18147,9 +18299,10 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18147
18299
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18148
18300
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18149
18301
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18150
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18302
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
18151
18303
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18152
18304
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18305
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18153
18306
|
};
|
18154
18307
|
}, [isActive]);
|
18155
18308
|
React.useEffect(() => {
|
@@ -18360,45 +18513,19 @@ const Picture = (props) => {
|
|
18360
18513
|
}, onLoad: onShowFirstImage }))));
|
18361
18514
|
};
|
18362
18515
|
|
18363
|
-
const PictureGroup$4 =
|
18516
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18364
18517
|
var _a, _b;
|
18365
18518
|
const { isActive } = useSwiperSlide();
|
18366
|
-
const {
|
18519
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
18367
18520
|
const [isLoad, setIsLoad] = React.useState(false);
|
18368
18521
|
const [imgInfo, setImgInfo] = React.useState();
|
18369
18522
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18370
|
-
const
|
18523
|
+
const swiperRef = React.useRef();
|
18371
18524
|
const isFirstPlayRef = React.useRef(true);
|
18372
|
-
const loopPlayRef = React.useRef(true);
|
18373
18525
|
const initTime = new Date();
|
18374
|
-
React.useImperativeHandle(ref, () => {
|
18375
|
-
return {
|
18376
|
-
setLoopPlay(v) {
|
18377
|
-
loopPlayRef.current = v;
|
18378
|
-
}
|
18379
|
-
};
|
18380
|
-
});
|
18381
|
-
React.useEffect(() => {
|
18382
|
-
let timerId;
|
18383
|
-
if (isLoad && isActive && isDiyH5) {
|
18384
|
-
timerId = setTimeout(() => {
|
18385
|
-
var _a, _b, _c, _d;
|
18386
|
-
if (!loopPlayRef.current)
|
18387
|
-
return;
|
18388
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18389
|
-
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;
|
18390
|
-
(_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);
|
18391
|
-
}
|
18392
|
-
}, 3000);
|
18393
|
-
}
|
18394
|
-
return () => {
|
18395
|
-
if (timerId)
|
18396
|
-
clearTimeout(timerId);
|
18397
|
-
};
|
18398
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18399
18526
|
React.useEffect(() => {
|
18400
18527
|
if (isLoad && isActive) {
|
18401
|
-
(
|
18528
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
18402
18529
|
if (openHashtag) {
|
18403
18530
|
onViewImageEndEvent(rec);
|
18404
18531
|
}
|
@@ -18408,7 +18535,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18408
18535
|
}
|
18409
18536
|
}
|
18410
18537
|
else {
|
18411
|
-
(
|
18538
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
18412
18539
|
}
|
18413
18540
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18414
18541
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18435,13 +18562,13 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18435
18562
|
};
|
18436
18563
|
}, [isActive, imgInfo]);
|
18437
18564
|
const handleMouseEnter = React.useCallback(() => {
|
18438
|
-
if (
|
18439
|
-
|
18565
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18566
|
+
swiperRef.current.swiper.autoplay.stop();
|
18440
18567
|
}
|
18441
18568
|
}, []);
|
18442
18569
|
const handleMouseLeave = React.useCallback(() => {
|
18443
|
-
if (
|
18444
|
-
|
18570
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18571
|
+
swiperRef.current.swiper.autoplay.start();
|
18445
18572
|
}
|
18446
18573
|
}, []);
|
18447
18574
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18462,7 +18589,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18462
18589
|
enabled: true
|
18463
18590
|
}
|
18464
18591
|
}
|
18465
|
-
: {}), { loop: true, ref:
|
18592
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18466
18593
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18467
18594
|
fontSize: '14px'
|
18468
18595
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18479,7 +18606,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
18479
18606
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18480
18607
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18481
18608
|
}))));
|
18482
|
-
}
|
18609
|
+
};
|
18483
18610
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18484
18611
|
|
18485
18612
|
/*
|
@@ -18759,7 +18886,7 @@ var NavBack$1 = React.memo(NavBack);
|
|
18759
18886
|
* @Author: binruan@chatlabs.com
|
18760
18887
|
* @Date: 2024-03-20 10:27:31
|
18761
18888
|
* @LastEditors: binruan@chatlabs.com
|
18762
|
-
* @LastEditTime: 2025-05-
|
18889
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18763
18890
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18764
18891
|
*
|
18765
18892
|
*/
|
@@ -18779,7 +18906,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18779
18906
|
const skipLinkRef = React.useRef(false);
|
18780
18907
|
const [pageNum, setPageNum] = React.useState(2);
|
18781
18908
|
const videoWidgetRef = React.useRef(null);
|
18782
|
-
const pictureGroupRef = React.useRef(null);
|
18783
18909
|
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();
|
18784
18910
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18785
18911
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -18827,7 +18953,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18827
18953
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18828
18954
|
}, [data, ctaType, swiperRef]);
|
18829
18955
|
const handleSessionCompleted = React.useCallback((fk) => {
|
18830
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
18956
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
18831
18957
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18832
18958
|
let fromKName = '';
|
18833
18959
|
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))) {
|
@@ -18854,13 +18980,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18854
18980
|
eventSubject: 'sessionCompleted',
|
18855
18981
|
eventDescription: 'Session completed',
|
18856
18982
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18857
|
-
|
18858
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
18983
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
18859
18984
|
position: activeIndex + '',
|
18860
18985
|
fromKName: fk || fromKName,
|
18861
18986
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
18862
|
-
ctatId: (
|
18863
|
-
traceInfo: (
|
18987
|
+
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 : '',
|
18988
|
+
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 : ''
|
18864
18989
|
}
|
18865
18990
|
});
|
18866
18991
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -18919,9 +19044,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18919
19044
|
refreshFeSession
|
18920
19045
|
]);
|
18921
19046
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
18922
|
-
var _a
|
19047
|
+
var _a;
|
18923
19048
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
18924
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
18925
19049
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
18926
19050
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
18927
19051
|
React.useEffect(() => {
|
@@ -18991,18 +19115,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18991
19115
|
return null;
|
18992
19116
|
}, [globalConfig, activeIndex, visList]);
|
18993
19117
|
const renderContent = React.useCallback((rec, index) => {
|
18994
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
19118
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18995
19119
|
if (rec === 'organic menu') {
|
18996
19120
|
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)));
|
18997
19121
|
}
|
18998
|
-
if ((
|
19122
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
18999
19123
|
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 })));
|
19000
19124
|
}
|
19001
|
-
if ((
|
19002
|
-
return (React.createElement(PictureGroup$5,
|
19125
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
19126
|
+
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 }));
|
19003
19127
|
}
|
19004
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19005
|
-
return (
|
19128
|
+
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) {
|
19129
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
19006
19130
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19007
19131
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19008
19132
|
const Component = withBindDataSource(t);
|
@@ -19040,7 +19164,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19040
19164
|
};
|
19041
19165
|
}, [isShowMore]);
|
19042
19166
|
const renderBottom = React.useCallback((rec, index) => {
|
19043
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
19167
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19044
19168
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19045
19169
|
let cta = null;
|
19046
19170
|
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) {
|
@@ -19049,27 +19173,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19049
19173
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19050
19174
|
cta = '商品CTA';
|
19051
19175
|
}
|
19052
|
-
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)) {
|
19053
|
-
cta = '服务CTA';
|
19054
|
-
}
|
19055
19176
|
else {
|
19056
|
-
cta = (
|
19177
|
+
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;
|
19057
19178
|
}
|
19058
19179
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19059
19180
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19060
19181
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19061
|
-
((
|
19182
|
+
((_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));
|
19062
19183
|
return (React.createElement(React.Fragment, null,
|
19063
19184
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19064
|
-
((
|
19065
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19185
|
+
((_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' }),
|
19186
|
+
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` } },
|
19066
19187
|
React.createElement(Nudge, { nudge: nudge }),
|
19067
19188
|
((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' },
|
19068
19189
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19069
19190
|
React.createElement("div", null,
|
19070
|
-
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: (
|
19191
|
+
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 }),
|
19071
19192
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19072
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19193
|
+
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) }))),
|
19073
19194
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19074
19195
|
}
|
19075
19196
|
return null;
|
@@ -19108,7 +19229,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19108
19229
|
return null;
|
19109
19230
|
}, [globalConfig, waterFallData]);
|
19110
19231
|
const handleViewImageStartEnd = (item) => {
|
19111
|
-
var _a, _b, _c, _d, _e, _f
|
19232
|
+
var _a, _b, _c, _d, _e, _f;
|
19112
19233
|
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)) {
|
19113
19234
|
const endTime = Date.now();
|
19114
19235
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19117,11 +19238,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19117
19238
|
eventSubject: 'viewImageCarouselEnd',
|
19118
19239
|
eventDescription: 'User end view the image carousel',
|
19119
19240
|
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 : '',
|
19120
|
-
|
19121
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19241
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19122
19242
|
imageEndTime: `${endTime}`,
|
19123
19243
|
playDuration: `${duration}`,
|
19124
|
-
contentTags: JSON.stringify((
|
19244
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19125
19245
|
position: activeIndex + '',
|
19126
19246
|
contentFormat: 'image',
|
19127
19247
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19130,7 +19250,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19130
19250
|
}
|
19131
19251
|
};
|
19132
19252
|
const handleSlideSkip = (item, position) => {
|
19133
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
19253
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19134
19254
|
if (isPreview || waterFallData)
|
19135
19255
|
return;
|
19136
19256
|
const t = new Date() - curTime.current;
|
@@ -19156,8 +19276,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19156
19276
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19157
19277
|
position: position + '',
|
19158
19278
|
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 : '',
|
19159
|
-
|
19160
|
-
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 : '',
|
19279
|
+
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 : '',
|
19161
19280
|
contentFormat
|
19162
19281
|
}
|
19163
19282
|
});
|
@@ -19167,7 +19286,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19167
19286
|
}
|
19168
19287
|
};
|
19169
19288
|
const handleScrollEvent = (swiper) => {
|
19170
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
19289
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19171
19290
|
const item = data[swiper.previousIndex];
|
19172
19291
|
if (!item)
|
19173
19292
|
return;
|
@@ -19184,12 +19303,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19184
19303
|
eventSubject: 'scrollDown',
|
19185
19304
|
eventDescription: 'User scroll down',
|
19186
19305
|
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 : '',
|
19187
|
-
|
19188
|
-
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 : '',
|
19306
|
+
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 : '',
|
19189
19307
|
requestId: null,
|
19190
|
-
traceInfo: (
|
19308
|
+
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 : '',
|
19191
19309
|
contentFormat,
|
19192
|
-
position: ((
|
19310
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
19193
19311
|
}
|
19194
19312
|
});
|
19195
19313
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19201,13 +19319,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19201
19319
|
eventInfo: {
|
19202
19320
|
eventSubject: 'scrollUp',
|
19203
19321
|
eventDescription: 'User scroll up',
|
19204
|
-
contentId: (
|
19205
|
-
|
19206
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19322
|
+
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 : '',
|
19323
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19207
19324
|
requestId: null,
|
19208
|
-
traceInfo: (
|
19325
|
+
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 : '',
|
19209
19326
|
contentFormat,
|
19210
|
-
position: ((
|
19327
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19211
19328
|
}
|
19212
19329
|
});
|
19213
19330
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19233,7 +19350,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19233
19350
|
}
|
19234
19351
|
}, [openHashtag, data, activeIndex]);
|
19235
19352
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19236
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19353
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19237
19354
|
const item = data[activeIndex];
|
19238
19355
|
// 如果是图片集则上报事件
|
19239
19356
|
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)) {
|
@@ -19244,10 +19361,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19244
19361
|
eventSubject: 'viewImageCarouselStart',
|
19245
19362
|
eventDescription: 'User start view the image carousel',
|
19246
19363
|
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 : '',
|
19247
|
-
|
19248
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19364
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19249
19365
|
imageStartTime: `${startTime}`,
|
19250
|
-
contentTags: JSON.stringify((
|
19366
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19251
19367
|
position: activeIndex + '',
|
19252
19368
|
contentFormat: 'image',
|
19253
19369
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19257,11 +19373,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19257
19373
|
if (enableCapi) {
|
19258
19374
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19259
19375
|
eventName: 'ViewContent',
|
19260
|
-
product: (
|
19376
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19261
19377
|
});
|
19262
19378
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19263
19379
|
eventName: 'PageView',
|
19264
|
-
product: (
|
19380
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19265
19381
|
});
|
19266
19382
|
}
|
19267
19383
|
}
|
@@ -19353,20 +19469,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19353
19469
|
swiperRef.current.swiper.allowTouchMove = true;
|
19354
19470
|
}, 500);
|
19355
19471
|
}, onActiveIndexChange: (swiper) => {
|
19356
|
-
var _a, _b;
|
19357
19472
|
setActiveIndex(swiper.activeIndex);
|
19358
19473
|
if (openHashtag)
|
19359
19474
|
return;
|
19360
19475
|
// 处理上滑下滑事件
|
19361
19476
|
handleScrollEvent(swiper);
|
19362
|
-
if (waterFallData || isEditor)
|
19477
|
+
if (waterFallData || isEditor || isDiyH5)
|
19363
19478
|
return;
|
19364
19479
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19365
19480
|
if (!isLoadMore) {
|
19366
|
-
if (isDiyH5) {
|
19367
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19368
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19369
|
-
}
|
19370
19481
|
setIsLoadMore(true);
|
19371
19482
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19372
19483
|
var _a;
|
@@ -19419,7 +19530,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19419
19530
|
}, []);
|
19420
19531
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19421
19532
|
const handlePlaying = React.useCallback(() => {
|
19422
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19533
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19423
19534
|
setIsPauseVideo(false);
|
19424
19535
|
const item = data[index];
|
19425
19536
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19432,15 +19543,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19432
19543
|
eventSubject: 'playVideo',
|
19433
19544
|
eventDescription: 'User played the video',
|
19434
19545
|
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 : '',
|
19435
|
-
|
19436
|
-
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 : '',
|
19546
|
+
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 : '',
|
19437
19547
|
playType,
|
19438
19548
|
startTime: videoCurrentTime,
|
19439
19549
|
videoDuration,
|
19440
|
-
contentTags: JSON.stringify((
|
19550
|
+
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 : []),
|
19441
19551
|
position: index + '',
|
19442
19552
|
contentFormat: 'video',
|
19443
|
-
traceInfo: (
|
19553
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19444
19554
|
}
|
19445
19555
|
});
|
19446
19556
|
setIsFirstPlay(false);
|
@@ -19479,7 +19589,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19479
19589
|
}
|
19480
19590
|
}, [isLoadFinish]);
|
19481
19591
|
const onPause = React.useCallback(() => {
|
19482
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19592
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19483
19593
|
const item = data[index];
|
19484
19594
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19485
19595
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19490,15 +19600,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19490
19600
|
eventSubject: 'playOverVideo',
|
19491
19601
|
eventDescription: 'User finished playing the video',
|
19492
19602
|
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 : '',
|
19493
|
-
|
19494
|
-
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 : '',
|
19603
|
+
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 : '',
|
19495
19604
|
endTime: videoCurrentTime,
|
19496
19605
|
videoDuration,
|
19497
19606
|
playDuration,
|
19498
|
-
contentTags: JSON.stringify((
|
19607
|
+
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 : []),
|
19499
19608
|
position: index + '',
|
19500
19609
|
contentFormat: 'video',
|
19501
|
-
traceInfo: (
|
19610
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19502
19611
|
}
|
19503
19612
|
});
|
19504
19613
|
}
|