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/pb-ui.js
CHANGED
@@ -637,7 +637,6 @@
|
|
637
637
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, isDiyH5, onUpdateSchema, onUpdateChannel }) => {
|
638
638
|
var _a, _b, _c, _d, _e;
|
639
639
|
const [rtcList, setRtcList] = React.useState([]);
|
640
|
-
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
641
640
|
const [tagList, setTagList] = React.useState([]);
|
642
641
|
const [loading, setLoading] = React.useState(true);
|
643
642
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
@@ -730,7 +729,7 @@
|
|
730
729
|
return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
|
731
730
|
}, [bffDataSource]);
|
732
731
|
// bff API 请求方法
|
733
|
-
const bffFetch = React.useCallback((path, options) => {
|
732
|
+
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
734
733
|
var _a;
|
735
734
|
if (!bffDataSource)
|
736
735
|
return;
|
@@ -745,7 +744,7 @@
|
|
745
744
|
val.split('=')[1];
|
746
745
|
});
|
747
746
|
return window
|
748
|
-
.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'
|
747
|
+
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
|
749
748
|
? JSON.stringify({
|
750
749
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
751
750
|
})
|
@@ -753,6 +752,166 @@
|
|
753
752
|
.then((res) => res.json())
|
754
753
|
.catch((err) => Promise.reject(err));
|
755
754
|
}, [bffDataSource, fakeUserId]);
|
755
|
+
const bffCollectEvent = React.useCallback((params) => {
|
756
|
+
var _a;
|
757
|
+
const body = {
|
758
|
+
eventName: params === null || params === void 0 ? void 0 : params.eventName,
|
759
|
+
eventSource: params === null || params === void 0 ? void 0 : params.eventSource
|
760
|
+
// eventInfo: params?.eventInfo ? JSON.stringify(params?.eventInfo) : ''
|
761
|
+
};
|
762
|
+
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}`, {
|
763
|
+
method: 'POST',
|
764
|
+
body,
|
765
|
+
type: 'beacon'
|
766
|
+
}, false);
|
767
|
+
}, [bffFetch, bffDataSource]);
|
768
|
+
React.useEffect(() => {
|
769
|
+
if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
770
|
+
const OriginalImage = window.Image;
|
771
|
+
window.Image = function () {
|
772
|
+
const img = new OriginalImage();
|
773
|
+
// 劫持 src 的 setter
|
774
|
+
const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
|
775
|
+
Object.defineProperty(img, 'src', {
|
776
|
+
set(value) {
|
777
|
+
// 继续正常设置 src
|
778
|
+
originalSrcDescriptor.set.call(this, value);
|
779
|
+
img.onload = function () {
|
780
|
+
// 检查是否是目标 URL
|
781
|
+
if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
|
782
|
+
// 解析 URL 参数
|
783
|
+
const url = new URL(value);
|
784
|
+
const params = Object.fromEntries(url.searchParams.entries());
|
785
|
+
bffCollectEvent({
|
786
|
+
eventName: params === null || params === void 0 ? void 0 : params.ev,
|
787
|
+
eventSource: 'Meta Pixel'
|
788
|
+
});
|
789
|
+
}
|
790
|
+
};
|
791
|
+
},
|
792
|
+
get() {
|
793
|
+
return originalSrcDescriptor.get.call(this);
|
794
|
+
}
|
795
|
+
});
|
796
|
+
return img;
|
797
|
+
};
|
798
|
+
}
|
799
|
+
}, [bffCollectEvent]);
|
800
|
+
React.useEffect(() => {
|
801
|
+
// 类型安全声明
|
802
|
+
const navigatorWithBeacon = navigator;
|
803
|
+
if (!navigatorWithBeacon.sendBeacon) {
|
804
|
+
console.warn('navigator.sendBeacon is not supported');
|
805
|
+
return;
|
806
|
+
}
|
807
|
+
// 保存原始方法
|
808
|
+
const originalSendBeacon = navigatorWithBeacon.sendBeacon.bind(navigatorWithBeacon);
|
809
|
+
// 覆盖方法
|
810
|
+
navigatorWithBeacon.sendBeacon = function (url, data) {
|
811
|
+
const urlString = url instanceof URL ? url.href : url.toString();
|
812
|
+
const success = originalSendBeacon(url, data);
|
813
|
+
function parseBeaconData(data) {
|
814
|
+
return __awaiter(this, void 0, void 0, function* () {
|
815
|
+
if (typeof data === 'string')
|
816
|
+
return JSON.parse(data);
|
817
|
+
if (data instanceof Blob)
|
818
|
+
return JSON.parse(yield data.text());
|
819
|
+
if (data instanceof ArrayBuffer)
|
820
|
+
return JSON.parse(new TextDecoder().decode(data));
|
821
|
+
return null;
|
822
|
+
});
|
823
|
+
}
|
824
|
+
if (success) {
|
825
|
+
// 异步处理监控逻辑(不阻塞原始行为)
|
826
|
+
Promise.resolve().then(() => __awaiter(this, void 0, void 0, function* () {
|
827
|
+
var _a, _b;
|
828
|
+
try {
|
829
|
+
const parsedData = yield parseBeaconData(data);
|
830
|
+
if (success) {
|
831
|
+
// 使用你的自定义上报方法
|
832
|
+
if (urlString.includes('https://tr.snapchat.com/p')) {
|
833
|
+
(_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) => {
|
834
|
+
var _a, _b;
|
835
|
+
if ((_a = item === null || item === void 0 ? void 0 : item.t) === null || _a === void 0 ? void 0 : _a.ev) {
|
836
|
+
bffCollectEvent({
|
837
|
+
eventName: (_b = item === null || item === void 0 ? void 0 : item.t) === null || _b === void 0 ? void 0 : _b.ev,
|
838
|
+
eventSource: 'Snapchat Pixel'
|
839
|
+
});
|
840
|
+
}
|
841
|
+
});
|
842
|
+
}
|
843
|
+
else if (urlString.includes('https://analytics.tiktok.com/api/v2/pixel') && (parsedData === null || parsedData === void 0 ? void 0 : parsedData.event)) {
|
844
|
+
bffCollectEvent({
|
845
|
+
eventName: parsedData.event,
|
846
|
+
eventSource: 'TikTok Pixel'
|
847
|
+
});
|
848
|
+
}
|
849
|
+
}
|
850
|
+
}
|
851
|
+
catch (error) {
|
852
|
+
console.error('监控失败:', error);
|
853
|
+
}
|
854
|
+
}));
|
855
|
+
}
|
856
|
+
// 非TikTok请求直接放行
|
857
|
+
return success;
|
858
|
+
};
|
859
|
+
// 清理函数:恢复原始方法
|
860
|
+
return () => {
|
861
|
+
navigatorWithBeacon.sendBeacon = originalSendBeacon;
|
862
|
+
};
|
863
|
+
}, [bffCollectEvent]);
|
864
|
+
React.useEffect(() => {
|
865
|
+
const _originalFetch = window.fetch;
|
866
|
+
// 覆盖 fetch 方法
|
867
|
+
window.fetch = function (input, init) {
|
868
|
+
var arguments_1 = arguments;
|
869
|
+
return __awaiter(this, void 0, void 0, function* () {
|
870
|
+
// 安全获取 URL 字符串
|
871
|
+
let url;
|
872
|
+
try {
|
873
|
+
url = typeof input === 'string'
|
874
|
+
? input
|
875
|
+
: input instanceof URL
|
876
|
+
? input.href
|
877
|
+
: input.url;
|
878
|
+
}
|
879
|
+
catch (error) {
|
880
|
+
console.error('解析请求URL失败:', error);
|
881
|
+
return _originalFetch.apply(this, arguments_1);
|
882
|
+
}
|
883
|
+
// 非GA4请求直接放行
|
884
|
+
if (!url.includes('https://www.google-analytics.com/g/collect')) {
|
885
|
+
return _originalFetch.apply(this, arguments_1);
|
886
|
+
}
|
887
|
+
// 检查是否是 GA4 收集端点
|
888
|
+
try {
|
889
|
+
// 1. 先执行原始请求
|
890
|
+
const response = yield _originalFetch.apply(this, arguments_1);
|
891
|
+
// 2. 检查请求是否成功 (HTTP 200-299)
|
892
|
+
// 安全解析 URL
|
893
|
+
const urlObj = new URL(url);
|
894
|
+
const params = Object.fromEntries(urlObj.searchParams.entries());
|
895
|
+
if (params === null || params === void 0 ? void 0 : params.en) {
|
896
|
+
bffCollectEvent({
|
897
|
+
eventName: params === null || params === void 0 ? void 0 : params.en,
|
898
|
+
eventSource: 'Google Analytics'
|
899
|
+
});
|
900
|
+
}
|
901
|
+
return response;
|
902
|
+
}
|
903
|
+
catch (error) {
|
904
|
+
console.error('处理 GA4 请求时出错:', error);
|
905
|
+
throw error;
|
906
|
+
}
|
907
|
+
});
|
908
|
+
};
|
909
|
+
}, [bffCollectEvent]);
|
910
|
+
React.useEffect(() => {
|
911
|
+
if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
912
|
+
window === null || window === void 0 ? void 0 : window.fbq('track', 'PageView');
|
913
|
+
}
|
914
|
+
}, []);
|
756
915
|
// bff API admin 请求方法
|
757
916
|
const bffFetchAdmin = React.useCallback((path, options) => {
|
758
917
|
if (!bffDataSource)
|
@@ -808,9 +967,6 @@
|
|
808
967
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
809
968
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
810
969
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
811
|
-
if (isDiyH5) {
|
812
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
813
|
-
}
|
814
970
|
}
|
815
971
|
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));
|
816
972
|
if (isNotNullList) {
|
@@ -850,17 +1006,12 @@
|
|
850
1006
|
if (rtcList.length <= 0) {
|
851
1007
|
return;
|
852
1008
|
}
|
853
|
-
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
854
|
-
setRtcList(rtcList.concat(firstRtcList));
|
855
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
856
|
-
return;
|
857
|
-
}
|
858
1009
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
859
1010
|
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 })));
|
860
1011
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
861
1012
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
862
1013
|
return data;
|
863
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
1014
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
864
1015
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
865
1016
|
var _a, _b, _c, _d, _e;
|
866
1017
|
let expire = false;
|
@@ -1087,7 +1238,7 @@
|
|
1087
1238
|
}
|
1088
1239
|
}), [bffFetch, utmVal]);
|
1089
1240
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1090
|
-
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
|
1241
|
+
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;
|
1091
1242
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1092
1243
|
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);
|
1093
1244
|
let fromKName = '';
|
@@ -1105,7 +1256,7 @@
|
|
1105
1256
|
}
|
1106
1257
|
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;
|
1107
1258
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1108
|
-
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 : '',
|
1259
|
+
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 })
|
1109
1260
|
});
|
1110
1261
|
}, [bffEventReport, isFromHashtag]);
|
1111
1262
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1207,9 +1358,6 @@
|
|
1207
1358
|
}
|
1208
1359
|
setRtcList(list);
|
1209
1360
|
setCacheRtcList(list);
|
1210
|
-
if (isDiyH5) {
|
1211
|
-
setFirstRtcList(list);
|
1212
|
-
}
|
1213
1361
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1214
1362
|
if (channel) {
|
1215
1363
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1245,9 +1393,6 @@
|
|
1245
1393
|
}
|
1246
1394
|
setRtcList(list);
|
1247
1395
|
setCacheRtcList(list);
|
1248
|
-
if (isDiyH5) {
|
1249
|
-
setFirstRtcList(list);
|
1250
|
-
}
|
1251
1396
|
}
|
1252
1397
|
})
|
1253
1398
|
.finally(() => {
|
@@ -1311,8 +1456,7 @@
|
|
1311
1456
|
refreshFeSession,
|
1312
1457
|
getAccount,
|
1313
1458
|
accountSonsent,
|
1314
|
-
isDiyH5
|
1315
|
-
firstRtcList
|
1459
|
+
isDiyH5
|
1316
1460
|
} }, 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({
|
1317
1461
|
rtcList,
|
1318
1462
|
mutateLike: bffMutateLike,
|
@@ -1773,14 +1917,14 @@
|
|
1773
1917
|
* @Author: binruan@chatlabs.com
|
1774
1918
|
* @Date: 2024-03-12 10:59:06
|
1775
1919
|
* @LastEditors: binruan@chatlabs.com
|
1776
|
-
* @LastEditTime:
|
1920
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
1777
1921
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1778
1922
|
*
|
1779
1923
|
*/
|
1780
1924
|
function useEventReport() {
|
1781
1925
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1782
1926
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1783
|
-
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
|
1927
|
+
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;
|
1784
1928
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1785
1929
|
if (i !== -1) {
|
1786
1930
|
return;
|
@@ -1813,11 +1957,11 @@
|
|
1813
1957
|
contentFormat = 'image';
|
1814
1958
|
}
|
1815
1959
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1816
|
-
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 : '',
|
1960
|
+
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 }))
|
1817
1961
|
});
|
1818
1962
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
1819
1963
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
1820
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
1964
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1821
1965
|
let fromKName = '';
|
1822
1966
|
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))) {
|
1823
1967
|
fromKName = 'pdpPage';
|
@@ -1836,9 +1980,8 @@
|
|
1836
1980
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
1837
1981
|
position: position + '',
|
1838
1982
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
1839
|
-
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 : '',
|
1840
1983
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
1841
|
-
traceInfo: (
|
1984
|
+
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 : '',
|
1842
1985
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
1843
1986
|
eventSubject: 'productView',
|
1844
1987
|
eventDescription: 'User browsed the product'
|
@@ -15653,7 +15796,7 @@ Made in Italy` })));
|
|
15653
15796
|
* @Author: binruan@chatlabs.com
|
15654
15797
|
* @Date: 2024-01-10 10:58:24
|
15655
15798
|
* @LastEditors: binruan@chatlabs.com
|
15656
|
-
* @LastEditTime: 2025-
|
15799
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
15657
15800
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15658
15801
|
*
|
15659
15802
|
*/
|
@@ -15691,7 +15834,7 @@ Made in Italy` })));
|
|
15691
15834
|
}
|
15692
15835
|
}, [waterFallData]);
|
15693
15836
|
const reportTagsView = React.useCallback(() => {
|
15694
|
-
var _a, _b, _c, _d, _e, _f
|
15837
|
+
var _a, _b, _c, _d, _e, _f;
|
15695
15838
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15696
15839
|
if (!rec)
|
15697
15840
|
return;
|
@@ -15711,10 +15854,9 @@ Made in Italy` })));
|
|
15711
15854
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15712
15855
|
eventInfo: {
|
15713
15856
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15714
|
-
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 : '',
|
15715
15857
|
position: cacheActiveIndex + '',
|
15716
|
-
contentTags: JSON.stringify((
|
15717
|
-
traceInfo: (
|
15858
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
15859
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
15718
15860
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15719
15861
|
fromKName,
|
15720
15862
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -17796,7 +17938,7 @@ Made in Italy` })));
|
|
17796
17938
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
17797
17939
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
17798
17940
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
17799
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
17941
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17800
17942
|
if (state) {
|
17801
17943
|
// 先设置状态
|
17802
17944
|
setState(false);
|
@@ -17806,12 +17948,11 @@ Made in Italy` })));
|
|
17806
17948
|
eventSubject: 'favoriteContentCanceled',
|
17807
17949
|
eventDescription: 'This content was unfavorite by the user',
|
17808
17950
|
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 : '',
|
17809
|
-
|
17810
|
-
|
17811
|
-
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 : []),
|
17951
|
+
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 : '',
|
17952
|
+
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 : []),
|
17812
17953
|
position: position + '',
|
17813
|
-
contentFormat: ((
|
17814
|
-
traceInfo: (
|
17954
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
17955
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
17815
17956
|
}
|
17816
17957
|
});
|
17817
17958
|
// 如果接口调用失败,则回滚状态
|
@@ -17819,41 +17960,40 @@ Made in Italy` })));
|
|
17819
17960
|
setState(true);
|
17820
17961
|
}
|
17821
17962
|
else {
|
17822
|
-
const nRtcList = (
|
17963
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17823
17964
|
if (index === position) {
|
17824
17965
|
item.isCollected = false;
|
17825
17966
|
}
|
17826
17967
|
return item;
|
17827
|
-
})) !== null &&
|
17968
|
+
})) !== null && _p !== void 0 ? _p : [];
|
17828
17969
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17829
17970
|
}
|
17830
17971
|
}
|
17831
17972
|
else {
|
17832
17973
|
setState(true);
|
17833
|
-
const result = (
|
17974
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
17834
17975
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17835
17976
|
eventInfo: {
|
17836
17977
|
eventSubject: 'favoriteContent',
|
17837
17978
|
eventDescription: 'This content was favorite by the user',
|
17838
|
-
contentId: (
|
17839
|
-
|
17840
|
-
|
17841
|
-
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 : []),
|
17979
|
+
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 : '',
|
17980
|
+
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 : '',
|
17981
|
+
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 : []),
|
17842
17982
|
position: position + '',
|
17843
|
-
contentFormat: ((
|
17844
|
-
traceInfo: (
|
17983
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
17984
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
17845
17985
|
}
|
17846
17986
|
});
|
17847
17987
|
if (!result) {
|
17848
17988
|
setState(false);
|
17849
17989
|
}
|
17850
17990
|
else {
|
17851
|
-
const nRtcList = (
|
17991
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
17852
17992
|
if (index === position) {
|
17853
17993
|
item.isCollected = true;
|
17854
17994
|
}
|
17855
17995
|
return item;
|
17856
|
-
})) !== null &&
|
17996
|
+
})) !== null && _z !== void 0 ? _z : [];
|
17857
17997
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
17858
17998
|
}
|
17859
17999
|
}
|
@@ -17890,7 +18030,7 @@ Made in Italy` })));
|
|
17890
18030
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
17891
18031
|
var _a, _b;
|
17892
18032
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
17893
|
-
const { bffEventReport, sxpParameter,
|
18033
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
17894
18034
|
const videoStartTime = React.useRef(0);
|
17895
18035
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
17896
18036
|
const { isActive } = useSwiperSlide();
|
@@ -17956,23 +18096,6 @@ Made in Italy` })));
|
|
17956
18096
|
return;
|
17957
18097
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
17958
18098
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17959
|
-
const handleEnd = () => {
|
17960
|
-
var _a, _b, _c, _d, _e, _f;
|
17961
|
-
if (!videoRef.current)
|
17962
|
-
return;
|
17963
|
-
if (isDiyH5) {
|
17964
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
17965
|
-
if (!loopPlayRef.current)
|
17966
|
-
return;
|
17967
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
17968
|
-
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;
|
17969
|
-
(_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);
|
17970
|
-
}
|
17971
|
-
}
|
17972
|
-
else {
|
17973
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
17974
|
-
}
|
17975
|
-
};
|
17976
18099
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
17977
18100
|
const handlePlaying = React.useCallback(() => {
|
17978
18101
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -17981,7 +18104,7 @@ Made in Italy` })));
|
|
17981
18104
|
setIsLoadFinish(true);
|
17982
18105
|
}, []);
|
17983
18106
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
17984
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
18107
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
17985
18108
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
17986
18109
|
return;
|
17987
18110
|
setIsPauseVideo(false);
|
@@ -17992,11 +18115,16 @@ Made in Italy` })));
|
|
17992
18115
|
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);
|
17993
18116
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
17994
18117
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
17995
|
-
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 : '',
|
18118
|
+
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) + '' }))
|
17996
18119
|
});
|
17997
18120
|
isFirstPlayRef.current = false;
|
17998
18121
|
}
|
17999
18122
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18123
|
+
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18124
|
+
if (isDiyH5) {
|
18125
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18126
|
+
}
|
18127
|
+
}, []);
|
18000
18128
|
const handLoadeddata = React.useCallback(() => {
|
18001
18129
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18002
18130
|
return;
|
@@ -18021,12 +18149,13 @@ Made in Italy` })));
|
|
18021
18149
|
const handleLoadedmetadata = React.useCallback(() => {
|
18022
18150
|
if (!videoRef.current)
|
18023
18151
|
return;
|
18152
|
+
setCurrentTimeByStartTime();
|
18024
18153
|
loadedTimeRef.current = new Date();
|
18025
18154
|
handleStartPlay();
|
18026
18155
|
handLoadeddata();
|
18027
18156
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18028
18157
|
const handleClickVideo = React.useCallback((type) => () => {
|
18029
|
-
var _a, _b, _c, _d, _e;
|
18158
|
+
var _a, _b, _c, _d, _e, _f;
|
18030
18159
|
if (!videoRef.current)
|
18031
18160
|
return;
|
18032
18161
|
if (!isLoadFinish)
|
@@ -18047,17 +18176,20 @@ Made in Italy` })));
|
|
18047
18176
|
break;
|
18048
18177
|
default:
|
18049
18178
|
if (isPause) {
|
18050
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
18179
|
+
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)) {
|
18180
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18181
|
+
}
|
18182
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18051
18183
|
}
|
18052
18184
|
else {
|
18053
|
-
(
|
18185
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
18054
18186
|
}
|
18055
18187
|
setIsPauseVideo(!isPause);
|
18056
18188
|
break;
|
18057
18189
|
}
|
18058
18190
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18059
18191
|
const handlePause = React.useCallback(() => {
|
18060
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
18192
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18061
18193
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18062
18194
|
return;
|
18063
18195
|
if (activeIndex !== index)
|
@@ -18073,15 +18205,14 @@ Made in Italy` })));
|
|
18073
18205
|
eventSubject: 'playOverVideo',
|
18074
18206
|
eventDescription: 'User finished playing the video',
|
18075
18207
|
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 : '',
|
18076
|
-
|
18077
|
-
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 : '',
|
18208
|
+
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 : '',
|
18078
18209
|
endTime: videoCurrentTime,
|
18079
18210
|
videoDuration,
|
18080
18211
|
playDuration,
|
18081
|
-
contentTags: JSON.stringify((
|
18212
|
+
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 : []),
|
18082
18213
|
position: index + '',
|
18083
18214
|
contentFormat: 'video',
|
18084
|
-
traceInfo: (
|
18215
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
18085
18216
|
}
|
18086
18217
|
});
|
18087
18218
|
}
|
@@ -18089,8 +18220,27 @@ Made in Italy` })));
|
|
18089
18220
|
const handleWaiting = React.useCallback(() => {
|
18090
18221
|
setWaiting(true);
|
18091
18222
|
}, []);
|
18223
|
+
const handleTimeUpload = () => {
|
18224
|
+
if (!videoRef.current || !isDiyH5)
|
18225
|
+
return;
|
18226
|
+
setTimeout(() => {
|
18227
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18228
|
+
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)) {
|
18229
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18230
|
+
if (!loopPlayRef.current)
|
18231
|
+
return;
|
18232
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18233
|
+
(_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);
|
18234
|
+
}
|
18235
|
+
else {
|
18236
|
+
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;
|
18237
|
+
(_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);
|
18238
|
+
}
|
18239
|
+
}
|
18240
|
+
});
|
18241
|
+
};
|
18092
18242
|
React.useEffect(() => {
|
18093
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18243
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18094
18244
|
if (!isActive)
|
18095
18245
|
return;
|
18096
18246
|
const videoSrc = videoUrl;
|
@@ -18111,6 +18261,7 @@ Made in Italy` })));
|
|
18111
18261
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18112
18262
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18113
18263
|
var _a;
|
18264
|
+
setCurrentTimeByStartTime();
|
18114
18265
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18115
18266
|
});
|
18116
18267
|
}
|
@@ -18124,11 +18275,12 @@ Made in Italy` })));
|
|
18124
18275
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18125
18276
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18126
18277
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18127
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18278
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
18128
18279
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18129
18280
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18281
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18130
18282
|
return () => {
|
18131
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18283
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
18132
18284
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18133
18285
|
if (!isPause)
|
18134
18286
|
handlePause();
|
@@ -18140,9 +18292,10 @@ Made in Italy` })));
|
|
18140
18292
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18141
18293
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18142
18294
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18143
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18295
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
18144
18296
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18145
18297
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18298
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18146
18299
|
};
|
18147
18300
|
}, [isActive]);
|
18148
18301
|
React.useEffect(() => {
|
@@ -18353,45 +18506,19 @@ Made in Italy` })));
|
|
18353
18506
|
}, onLoad: onShowFirstImage }))));
|
18354
18507
|
};
|
18355
18508
|
|
18356
|
-
const PictureGroup$4 =
|
18509
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
18357
18510
|
var _a, _b;
|
18358
18511
|
const { isActive } = useSwiperSlide();
|
18359
|
-
const {
|
18512
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
18360
18513
|
const [isLoad, setIsLoad] = React.useState(false);
|
18361
18514
|
const [imgInfo, setImgInfo] = React.useState();
|
18362
18515
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18363
|
-
const
|
18516
|
+
const swiperRef = React.useRef();
|
18364
18517
|
const isFirstPlayRef = React.useRef(true);
|
18365
|
-
const loopPlayRef = React.useRef(true);
|
18366
18518
|
const initTime = new Date();
|
18367
|
-
React.useImperativeHandle(ref, () => {
|
18368
|
-
return {
|
18369
|
-
setLoopPlay(v) {
|
18370
|
-
loopPlayRef.current = v;
|
18371
|
-
}
|
18372
|
-
};
|
18373
|
-
});
|
18374
|
-
React.useEffect(() => {
|
18375
|
-
let timerId;
|
18376
|
-
if (isLoad && isActive && isDiyH5) {
|
18377
|
-
timerId = setTimeout(() => {
|
18378
|
-
var _a, _b, _c, _d;
|
18379
|
-
if (!loopPlayRef.current)
|
18380
|
-
return;
|
18381
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18382
|
-
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;
|
18383
|
-
(_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);
|
18384
|
-
}
|
18385
|
-
}, 3000);
|
18386
|
-
}
|
18387
|
-
return () => {
|
18388
|
-
if (timerId)
|
18389
|
-
clearTimeout(timerId);
|
18390
|
-
};
|
18391
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18392
18519
|
React.useEffect(() => {
|
18393
18520
|
if (isLoad && isActive) {
|
18394
|
-
(
|
18521
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
18395
18522
|
if (openHashtag) {
|
18396
18523
|
onViewImageEndEvent(rec);
|
18397
18524
|
}
|
@@ -18401,7 +18528,7 @@ Made in Italy` })));
|
|
18401
18528
|
}
|
18402
18529
|
}
|
18403
18530
|
else {
|
18404
|
-
(
|
18531
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
18405
18532
|
}
|
18406
18533
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18407
18534
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18428,13 +18555,13 @@ Made in Italy` })));
|
|
18428
18555
|
};
|
18429
18556
|
}, [isActive, imgInfo]);
|
18430
18557
|
const handleMouseEnter = React.useCallback(() => {
|
18431
|
-
if (
|
18432
|
-
|
18558
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18559
|
+
swiperRef.current.swiper.autoplay.stop();
|
18433
18560
|
}
|
18434
18561
|
}, []);
|
18435
18562
|
const handleMouseLeave = React.useCallback(() => {
|
18436
|
-
if (
|
18437
|
-
|
18563
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
18564
|
+
swiperRef.current.swiper.autoplay.start();
|
18438
18565
|
}
|
18439
18566
|
}, []);
|
18440
18567
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18455,7 +18582,7 @@ Made in Italy` })));
|
|
18455
18582
|
enabled: true
|
18456
18583
|
}
|
18457
18584
|
}
|
18458
|
-
: {}), { loop: true, ref:
|
18585
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18459
18586
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18460
18587
|
fontSize: '14px'
|
18461
18588
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18472,7 +18599,7 @@ Made in Italy` })));
|
|
18472
18599
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18473
18600
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18474
18601
|
}))));
|
18475
|
-
}
|
18602
|
+
};
|
18476
18603
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18477
18604
|
|
18478
18605
|
/*
|
@@ -18752,7 +18879,7 @@ Made in Italy` })));
|
|
18752
18879
|
* @Author: binruan@chatlabs.com
|
18753
18880
|
* @Date: 2024-03-20 10:27:31
|
18754
18881
|
* @LastEditors: binruan@chatlabs.com
|
18755
|
-
* @LastEditTime: 2025-05-
|
18882
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
18756
18883
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18757
18884
|
*
|
18758
18885
|
*/
|
@@ -18772,7 +18899,6 @@ Made in Italy` })));
|
|
18772
18899
|
const skipLinkRef = React.useRef(false);
|
18773
18900
|
const [pageNum, setPageNum] = React.useState(2);
|
18774
18901
|
const videoWidgetRef = React.useRef(null);
|
18775
|
-
const pictureGroupRef = React.useRef(null);
|
18776
18902
|
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();
|
18777
18903
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18778
18904
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -18820,7 +18946,7 @@ Made in Italy` })));
|
|
18820
18946
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
18821
18947
|
}, [data, ctaType, swiperRef]);
|
18822
18948
|
const handleSessionCompleted = React.useCallback((fk) => {
|
18823
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
18949
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
18824
18950
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
18825
18951
|
let fromKName = '';
|
18826
18952
|
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))) {
|
@@ -18847,13 +18973,12 @@ Made in Italy` })));
|
|
18847
18973
|
eventSubject: 'sessionCompleted',
|
18848
18974
|
eventDescription: 'Session completed',
|
18849
18975
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
18850
|
-
|
18851
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
18976
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
18852
18977
|
position: activeIndex + '',
|
18853
18978
|
fromKName: fk || fromKName,
|
18854
18979
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
18855
|
-
ctatId: (
|
18856
|
-
traceInfo: (
|
18980
|
+
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 : '',
|
18981
|
+
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 : ''
|
18857
18982
|
}
|
18858
18983
|
});
|
18859
18984
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -18912,9 +19037,8 @@ Made in Italy` })));
|
|
18912
19037
|
refreshFeSession
|
18913
19038
|
]);
|
18914
19039
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
18915
|
-
var _a
|
19040
|
+
var _a;
|
18916
19041
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
18917
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
18918
19042
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
18919
19043
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
18920
19044
|
React.useEffect(() => {
|
@@ -18984,18 +19108,18 @@ Made in Italy` })));
|
|
18984
19108
|
return null;
|
18985
19109
|
}, [globalConfig, activeIndex, visList]);
|
18986
19110
|
const renderContent = React.useCallback((rec, index) => {
|
18987
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
19111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18988
19112
|
if (rec === 'organic menu') {
|
18989
19113
|
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)));
|
18990
19114
|
}
|
18991
|
-
if ((
|
19115
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
18992
19116
|
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 })));
|
18993
19117
|
}
|
18994
|
-
if ((
|
18995
|
-
return (React.createElement(PictureGroup$5,
|
19118
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
19119
|
+
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 }));
|
18996
19120
|
}
|
18997
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
18998
|
-
return (
|
19121
|
+
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) {
|
19122
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
18999
19123
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19000
19124
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19001
19125
|
const Component = withBindDataSource(t);
|
@@ -19033,7 +19157,7 @@ Made in Italy` })));
|
|
19033
19157
|
};
|
19034
19158
|
}, [isShowMore]);
|
19035
19159
|
const renderBottom = React.useCallback((rec, index) => {
|
19036
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
19160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19037
19161
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19038
19162
|
let cta = null;
|
19039
19163
|
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) {
|
@@ -19042,27 +19166,24 @@ Made in Italy` })));
|
|
19042
19166
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19043
19167
|
cta = '商品CTA';
|
19044
19168
|
}
|
19045
|
-
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)) {
|
19046
|
-
cta = '服务CTA';
|
19047
|
-
}
|
19048
19169
|
else {
|
19049
|
-
cta = (
|
19170
|
+
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;
|
19050
19171
|
}
|
19051
19172
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19052
19173
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19053
19174
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19054
|
-
((
|
19175
|
+
((_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));
|
19055
19176
|
return (React.createElement(React.Fragment, null,
|
19056
19177
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19057
|
-
((
|
19058
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19178
|
+
((_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' }),
|
19179
|
+
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` } },
|
19059
19180
|
React.createElement(Nudge, { nudge: nudge }),
|
19060
19181
|
((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' },
|
19061
19182
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19062
19183
|
React.createElement("div", null,
|
19063
|
-
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: (
|
19184
|
+
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 }),
|
19064
19185
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19065
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19186
|
+
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) }))),
|
19066
19187
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19067
19188
|
}
|
19068
19189
|
return null;
|
@@ -19101,7 +19222,7 @@ Made in Italy` })));
|
|
19101
19222
|
return null;
|
19102
19223
|
}, [globalConfig, waterFallData]);
|
19103
19224
|
const handleViewImageStartEnd = (item) => {
|
19104
|
-
var _a, _b, _c, _d, _e, _f
|
19225
|
+
var _a, _b, _c, _d, _e, _f;
|
19105
19226
|
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)) {
|
19106
19227
|
const endTime = Date.now();
|
19107
19228
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19110,11 +19231,10 @@ Made in Italy` })));
|
|
19110
19231
|
eventSubject: 'viewImageCarouselEnd',
|
19111
19232
|
eventDescription: 'User end view the image carousel',
|
19112
19233
|
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 : '',
|
19113
|
-
|
19114
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19234
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19115
19235
|
imageEndTime: `${endTime}`,
|
19116
19236
|
playDuration: `${duration}`,
|
19117
|
-
contentTags: JSON.stringify((
|
19237
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19118
19238
|
position: activeIndex + '',
|
19119
19239
|
contentFormat: 'image',
|
19120
19240
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19123,7 +19243,7 @@ Made in Italy` })));
|
|
19123
19243
|
}
|
19124
19244
|
};
|
19125
19245
|
const handleSlideSkip = (item, position) => {
|
19126
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
19246
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19127
19247
|
if (isPreview || waterFallData)
|
19128
19248
|
return;
|
19129
19249
|
const t = new Date() - curTime.current;
|
@@ -19149,8 +19269,7 @@ Made in Italy` })));
|
|
19149
19269
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19150
19270
|
position: position + '',
|
19151
19271
|
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 : '',
|
19152
|
-
|
19153
|
-
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 : '',
|
19272
|
+
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 : '',
|
19154
19273
|
contentFormat
|
19155
19274
|
}
|
19156
19275
|
});
|
@@ -19160,7 +19279,7 @@ Made in Italy` })));
|
|
19160
19279
|
}
|
19161
19280
|
};
|
19162
19281
|
const handleScrollEvent = (swiper) => {
|
19163
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
19282
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19164
19283
|
const item = data[swiper.previousIndex];
|
19165
19284
|
if (!item)
|
19166
19285
|
return;
|
@@ -19177,12 +19296,11 @@ Made in Italy` })));
|
|
19177
19296
|
eventSubject: 'scrollDown',
|
19178
19297
|
eventDescription: 'User scroll down',
|
19179
19298
|
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 : '',
|
19180
|
-
|
19181
|
-
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 : '',
|
19299
|
+
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 : '',
|
19182
19300
|
requestId: null,
|
19183
|
-
traceInfo: (
|
19301
|
+
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 : '',
|
19184
19302
|
contentFormat,
|
19185
|
-
position: ((
|
19303
|
+
position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
|
19186
19304
|
}
|
19187
19305
|
});
|
19188
19306
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19194,13 +19312,12 @@ Made in Italy` })));
|
|
19194
19312
|
eventInfo: {
|
19195
19313
|
eventSubject: 'scrollUp',
|
19196
19314
|
eventDescription: 'User scroll up',
|
19197
|
-
contentId: (
|
19198
|
-
|
19199
|
-
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19315
|
+
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 : '',
|
19316
|
+
productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
19200
19317
|
requestId: null,
|
19201
|
-
traceInfo: (
|
19318
|
+
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 : '',
|
19202
19319
|
contentFormat,
|
19203
|
-
position: ((
|
19320
|
+
position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
|
19204
19321
|
}
|
19205
19322
|
});
|
19206
19323
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19226,7 +19343,7 @@ Made in Italy` })));
|
|
19226
19343
|
}
|
19227
19344
|
}, [openHashtag, data, activeIndex]);
|
19228
19345
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19229
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
19346
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19230
19347
|
const item = data[activeIndex];
|
19231
19348
|
// 如果是图片集则上报事件
|
19232
19349
|
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)) {
|
@@ -19237,10 +19354,9 @@ Made in Italy` })));
|
|
19237
19354
|
eventSubject: 'viewImageCarouselStart',
|
19238
19355
|
eventDescription: 'User start view the image carousel',
|
19239
19356
|
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 : '',
|
19240
|
-
|
19241
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19357
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
19242
19358
|
imageStartTime: `${startTime}`,
|
19243
|
-
contentTags: JSON.stringify((
|
19359
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
19244
19360
|
position: activeIndex + '',
|
19245
19361
|
contentFormat: 'image',
|
19246
19362
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19250,11 +19366,11 @@ Made in Italy` })));
|
|
19250
19366
|
if (enableCapi) {
|
19251
19367
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19252
19368
|
eventName: 'ViewContent',
|
19253
|
-
product: (
|
19369
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
19254
19370
|
});
|
19255
19371
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19256
19372
|
eventName: 'PageView',
|
19257
|
-
product: (
|
19373
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
19258
19374
|
});
|
19259
19375
|
}
|
19260
19376
|
}
|
@@ -19346,20 +19462,15 @@ Made in Italy` })));
|
|
19346
19462
|
swiperRef.current.swiper.allowTouchMove = true;
|
19347
19463
|
}, 500);
|
19348
19464
|
}, onActiveIndexChange: (swiper) => {
|
19349
|
-
var _a, _b;
|
19350
19465
|
setActiveIndex(swiper.activeIndex);
|
19351
19466
|
if (openHashtag)
|
19352
19467
|
return;
|
19353
19468
|
// 处理上滑下滑事件
|
19354
19469
|
handleScrollEvent(swiper);
|
19355
|
-
if (waterFallData || isEditor)
|
19470
|
+
if (waterFallData || isEditor || isDiyH5)
|
19356
19471
|
return;
|
19357
19472
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19358
19473
|
if (!isLoadMore) {
|
19359
|
-
if (isDiyH5) {
|
19360
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19361
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19362
|
-
}
|
19363
19474
|
setIsLoadMore(true);
|
19364
19475
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19365
19476
|
var _a;
|
@@ -19412,7 +19523,7 @@ Made in Italy` })));
|
|
19412
19523
|
}, []);
|
19413
19524
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19414
19525
|
const handlePlaying = React.useCallback(() => {
|
19415
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19526
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19416
19527
|
setIsPauseVideo(false);
|
19417
19528
|
const item = data[index];
|
19418
19529
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19425,15 +19536,14 @@ Made in Italy` })));
|
|
19425
19536
|
eventSubject: 'playVideo',
|
19426
19537
|
eventDescription: 'User played the video',
|
19427
19538
|
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 : '',
|
19428
|
-
|
19429
|
-
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 : '',
|
19539
|
+
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 : '',
|
19430
19540
|
playType,
|
19431
19541
|
startTime: videoCurrentTime,
|
19432
19542
|
videoDuration,
|
19433
|
-
contentTags: JSON.stringify((
|
19543
|
+
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 : []),
|
19434
19544
|
position: index + '',
|
19435
19545
|
contentFormat: 'video',
|
19436
|
-
traceInfo: (
|
19546
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19437
19547
|
}
|
19438
19548
|
});
|
19439
19549
|
setIsFirstPlay(false);
|
@@ -19472,7 +19582,7 @@ Made in Italy` })));
|
|
19472
19582
|
}
|
19473
19583
|
}, [isLoadFinish]);
|
19474
19584
|
const onPause = React.useCallback(() => {
|
19475
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
19585
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19476
19586
|
const item = data[index];
|
19477
19587
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19478
19588
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19483,15 +19593,14 @@ Made in Italy` })));
|
|
19483
19593
|
eventSubject: 'playOverVideo',
|
19484
19594
|
eventDescription: 'User finished playing the video',
|
19485
19595
|
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 : '',
|
19486
|
-
|
19487
|
-
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 : '',
|
19596
|
+
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 : '',
|
19488
19597
|
endTime: videoCurrentTime,
|
19489
19598
|
videoDuration,
|
19490
19599
|
playDuration,
|
19491
|
-
contentTags: JSON.stringify((
|
19600
|
+
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 : []),
|
19492
19601
|
position: index + '',
|
19493
19602
|
contentFormat: 'video',
|
19494
|
-
traceInfo: (
|
19603
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
19495
19604
|
}
|
19496
19605
|
});
|
19497
19606
|
}
|