pb-sxp-ui 1.20.7 → 1.20.9
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 +290 -188
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +290 -188
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +7 -7
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +7 -7
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +290 -188
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +7 -7
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/es/core/components/SxpPageRender/LikeButton/index.js +20 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
- package/es/core/components/SxpPageRender/VideoWidget/index.js +33 -46
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +56 -40
- package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/es/core/context/SxpDataSourceProvider.js +123 -55
- package/es/core/hooks/useEventReport.js +6 -5
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/lib/core/components/SxpPageRender/LikeButton/index.js +20 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +33 -46
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +56 -40
- package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/lib/core/context/SxpDataSourceProvider.js +123 -55
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -645,6 +645,7 @@ const DEFAULT_TAG = 'FOR U';
|
|
|
645
645
|
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 }) => {
|
|
646
646
|
var _a, _b, _c, _d, _e;
|
|
647
647
|
const [rtcList, setRtcList] = useState([]);
|
|
648
|
+
const [firstRtcList, setFirstRtcList] = useState([]);
|
|
648
649
|
const [tagList, setTagList] = useState([]);
|
|
649
650
|
const [loading, setLoading] = useState(true);
|
|
650
651
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
|
@@ -676,6 +677,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
676
677
|
const [chatlabsId, setChatlabsId] = useState();
|
|
677
678
|
const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
|
678
679
|
const pixelPvStatusRef = useRef(false);
|
|
680
|
+
const isDiyPage = useMemo(() => {
|
|
681
|
+
var _a, _b, _c;
|
|
682
|
+
return isDiyH5 && !((_c = (_b = (_a = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.enablePreview);
|
|
683
|
+
}, [isDiyH5, finalPageData]);
|
|
679
684
|
useEffect(() => {
|
|
680
685
|
var _a, _b;
|
|
681
686
|
setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
|
|
@@ -771,14 +776,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
771
776
|
return '';
|
|
772
777
|
}
|
|
773
778
|
const OptanonConsent = decodeURIComponent((_a = getCookie('OptanonConsent')) !== null && _a !== void 0 ? _a : '');
|
|
774
|
-
if ((
|
|
779
|
+
if ((window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) &&
|
|
780
|
+
((_b = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) === null || _b === void 0 ? void 0 : _b.length) > 2 &&
|
|
781
|
+
!(window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups.includes('4')) &&
|
|
782
|
+
isTargetingRejected(OptanonConsent)) {
|
|
775
783
|
return true;
|
|
776
784
|
}
|
|
777
785
|
return false;
|
|
778
786
|
};
|
|
779
787
|
// bff API 请求方法
|
|
780
788
|
const bffFetch = useCallback((path, options, isBota = true) => {
|
|
781
|
-
var _a;
|
|
789
|
+
var _a, _b;
|
|
782
790
|
if (!bffDataSource)
|
|
783
791
|
return;
|
|
784
792
|
const url = bffDataSource.url;
|
|
@@ -791,8 +799,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
791
799
|
val.split('=')[0];
|
|
792
800
|
val.split('=')[1];
|
|
793
801
|
});
|
|
802
|
+
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
|
794
803
|
return window
|
|
795
|
-
.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
|
|
804
|
+
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId, 'tenant-id': (_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id'] }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
|
|
796
805
|
? JSON.stringify({
|
|
797
806
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
|
798
807
|
})
|
|
@@ -824,7 +833,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
824
833
|
const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
|
|
825
834
|
Object.defineProperty(img, 'src', {
|
|
826
835
|
set(value) {
|
|
827
|
-
if (getTargetingCookie() &&
|
|
836
|
+
if (getTargetingCookie() &&
|
|
837
|
+
(value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/') ||
|
|
838
|
+
value.includes('https://www.facebook.com/tr'))) {
|
|
828
839
|
return;
|
|
829
840
|
}
|
|
830
841
|
// 继续正常设置 src
|
|
@@ -862,7 +873,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
862
873
|
// 覆盖方法
|
|
863
874
|
navigatorWithBeacon.sendBeacon = function (url, data) {
|
|
864
875
|
const urlString = url instanceof URL ? url.href : url.toString();
|
|
865
|
-
if (getTargetingCookie() &&
|
|
876
|
+
if (getTargetingCookie() &&
|
|
877
|
+
(urlString.includes('https://tr.snapchat.com/p') ||
|
|
878
|
+
urlString.includes('https://analytics.tiktok.com/api/v2/pixel'))) {
|
|
866
879
|
return true;
|
|
867
880
|
}
|
|
868
881
|
const success = originalSendBeacon(url, data);
|
|
@@ -949,18 +962,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
949
962
|
// 安全获取 URL 字符串
|
|
950
963
|
let url;
|
|
951
964
|
try {
|
|
952
|
-
url = typeof input === 'string'
|
|
953
|
-
? input
|
|
954
|
-
: input instanceof URL
|
|
955
|
-
? input.href
|
|
956
|
-
: input.url;
|
|
965
|
+
url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
|
|
957
966
|
}
|
|
958
967
|
catch (error) {
|
|
959
968
|
console.error('解析请求URL失败:', error);
|
|
960
969
|
return _originalFetch.apply(this, arguments_1);
|
|
961
970
|
}
|
|
962
971
|
try {
|
|
963
|
-
if (getTargetingCookie() &&
|
|
972
|
+
if (getTargetingCookie() &&
|
|
973
|
+
(url.includes('https://www.google-analytics.com/g/collect') ||
|
|
974
|
+
url.includes('https://arms-retcode.aliyuncs.com/r.png'))) {
|
|
964
975
|
return Promise.resolve(new Response(''));
|
|
965
976
|
}
|
|
966
977
|
// 1. 先执行原始请求
|
|
@@ -1016,7 +1027,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1016
1027
|
};
|
|
1017
1028
|
XMLHttpRequest.prototype.send = function (body) {
|
|
1018
1029
|
var _a;
|
|
1019
|
-
if (getTargetingCookie() &&
|
|
1030
|
+
if (getTargetingCookie() &&
|
|
1031
|
+
this._url &&
|
|
1032
|
+
typeof this._url === 'string' &&
|
|
1033
|
+
(this._url.includes('https://rumcollector.uptime.com') ||
|
|
1034
|
+
this._url.includes('https://arms-retcode.aliyuncs.com/r.png') ||
|
|
1035
|
+
this._url.includes('https://i.giesswein.com/nb-collector'))) {
|
|
1020
1036
|
return;
|
|
1021
1037
|
}
|
|
1022
1038
|
if (this._url && typeof this._url === 'string' && this._url.includes('https://i.giesswein.com/nb-collector')) {
|
|
@@ -1070,8 +1086,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1070
1086
|
}, [bffDataSource]);
|
|
1071
1087
|
// 获取推荐视频数据
|
|
1072
1088
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1073
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1074
|
-
query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (
|
|
1089
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1090
|
+
query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (isDiyPage && { type: 'story' }));
|
|
1075
1091
|
if (channel) {
|
|
1076
1092
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
|
1077
1093
|
}
|
|
@@ -1084,9 +1100,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1084
1100
|
if (val)
|
|
1085
1101
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
|
1086
1102
|
}
|
|
1103
|
+
const isDiy = isDiyH5 && ((_o = (_m = (_l = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _l === void 0 ? void 0 : _l.sxpPageConf) === null || _m === void 0 ? void 0 : _m.globalConfig) === null || _o === void 0 ? void 0 : _o.enablePreview);
|
|
1087
1104
|
if (isEditor) {
|
|
1088
1105
|
let pageNum = 1;
|
|
1089
|
-
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
|
|
1106
|
+
query = Object.assign(Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] })), (isDiy && { maxRecs: query === null || query === void 0 ? void 0 : query.maxSize }));
|
|
1090
1107
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
|
1091
1108
|
return undefined;
|
|
1092
1109
|
}
|
|
@@ -1094,19 +1111,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1094
1111
|
let list = [];
|
|
1095
1112
|
let result = null;
|
|
1096
1113
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1097
|
-
var
|
|
1114
|
+
var _y, _z, _0, _1, _2, _3;
|
|
1098
1115
|
query.pageNum = pageNum;
|
|
1099
|
-
result =
|
|
1116
|
+
result = isDiyH5
|
|
1117
|
+
? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
|
|
1118
|
+
: yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('recommend/direct_page', { method: 'POST', body: query }));
|
|
1100
1119
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1101
1120
|
return undefined;
|
|
1102
1121
|
}
|
|
1103
1122
|
setLoading(false);
|
|
1104
|
-
list = list.concat((
|
|
1123
|
+
list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
|
|
1105
1124
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
|
1106
1125
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1107
1126
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1127
|
+
if (isDiyPage) {
|
|
1128
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1129
|
+
}
|
|
1108
1130
|
}
|
|
1109
|
-
const isNotNullList = (
|
|
1131
|
+
const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
|
1110
1132
|
if (isNotNullList) {
|
|
1111
1133
|
pageNum = pageNum + 1;
|
|
1112
1134
|
yield recurveRecList(query);
|
|
@@ -1114,42 +1136,61 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1114
1136
|
});
|
|
1115
1137
|
yield recurveRecList(query);
|
|
1116
1138
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
|
1117
|
-
setCurReqInfo({ rtc: (
|
|
1139
|
+
setCurReqInfo({ rtc: (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.rtc, requestId: (_q = result === null || result === void 0 ? void 0 : result.data) === null || _q === void 0 ? void 0 : _q.requestId });
|
|
1118
1140
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
|
1119
1141
|
}
|
|
1120
1142
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
|
1121
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
|
1143
|
+
query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_r = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _r !== void 0 ? _r : 1 }), (isDiy && { maxRecs: query === null || query === void 0 ? void 0 : query.maxSize }));
|
|
1122
1144
|
}
|
|
1123
|
-
const result =
|
|
1124
|
-
method: 'POST',
|
|
1125
|
-
|
|
1126
|
-
|
|
1145
|
+
const result = isDiy
|
|
1146
|
+
? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
|
|
1147
|
+
: yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
|
1148
|
+
method: 'POST',
|
|
1149
|
+
body: query
|
|
1150
|
+
}));
|
|
1127
1151
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1128
1152
|
return undefined;
|
|
1129
1153
|
}
|
|
1130
1154
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
|
1131
1155
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
|
1132
1156
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
|
1133
|
-
const isNotNullList = (
|
|
1157
|
+
const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
|
1134
1158
|
if (!isNotNullList) {
|
|
1135
1159
|
setIsNoMoreData(true);
|
|
1136
1160
|
}
|
|
1137
1161
|
}
|
|
1138
1162
|
let list = [];
|
|
1139
|
-
list = list.concat((
|
|
1163
|
+
list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
|
|
1140
1164
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
|
1141
|
-
}), [
|
|
1165
|
+
}), [
|
|
1166
|
+
bffFetch,
|
|
1167
|
+
utmVal,
|
|
1168
|
+
maxSize,
|
|
1169
|
+
defaultSize,
|
|
1170
|
+
channelQueryList,
|
|
1171
|
+
channel,
|
|
1172
|
+
chatlabsId,
|
|
1173
|
+
bffFetchAdmin,
|
|
1174
|
+
isDiyPage,
|
|
1175
|
+
finalPageData,
|
|
1176
|
+
isDiyH5
|
|
1177
|
+
]);
|
|
1142
1178
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1143
|
-
var
|
|
1179
|
+
var _4, _5, _6, _7;
|
|
1144
1180
|
if (rtcList.length <= 0) {
|
|
1145
1181
|
return;
|
|
1146
1182
|
}
|
|
1183
|
+
if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
|
1184
|
+
setRtcList(rtcList.concat(firstRtcList));
|
|
1185
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
|
1186
|
+
return;
|
|
1187
|
+
}
|
|
1147
1188
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
|
1148
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
|
1189
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _4 === void 0 ? void 0 : _4.itemId) && { productFilter: [(_5 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _5 === void 0 ? void 0 : _5.itemId] })), (((_6 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _6 === void 0 ? void 0 : _6.itemId) && { contentFilter: [(_7 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _7 === void 0 ? void 0 : _7.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
|
1149
1190
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
|
1150
1191
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
|
1151
1192
|
return data;
|
|
1152
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
|
1193
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
|
|
1153
1194
|
const refreshFeSession = useCallback((enableReSid, event) => {
|
|
1154
1195
|
var _a, _b, _c, _d, _e;
|
|
1155
1196
|
let expire = false;
|
|
@@ -1180,8 +1221,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1180
1221
|
// 用户信息都是公共的
|
|
1181
1222
|
if (!userInfo) {
|
|
1182
1223
|
userInfo = {
|
|
1183
|
-
|
|
1184
|
-
|
|
1224
|
+
productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
|
|
1225
|
+
// tpChannelId: 'H5' // 后端处理
|
|
1185
1226
|
};
|
|
1186
1227
|
}
|
|
1187
1228
|
const sessionID = storeAndLoadFeSessionId();
|
|
@@ -1215,7 +1256,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1215
1256
|
layoutVariantId,
|
|
1216
1257
|
globalConfig,
|
|
1217
1258
|
playbookType,
|
|
1218
|
-
bffDataSource
|
|
1259
|
+
bffDataSource,
|
|
1260
|
+
fakeUserId
|
|
1219
1261
|
]);
|
|
1220
1262
|
const getEventParamsByJson = useCallback((_a) => {
|
|
1221
1263
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -1241,23 +1283,37 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1241
1283
|
}))) !== null && _j !== void 0 ? _j : [], image_urls: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) !== null && _l !== void 0 ? _l : [], video_urls: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.url,
|
|
1242
1284
|
// prompt
|
|
1243
1285
|
headline: getUrlParamByKey('headline'), scene: getUrlParamByKey('scene'), campaign_id: getUrlParamByKey('campaign_id'), ad_id: getUrlParamByKey('ad_id'), utm_source: getUrlParamByKey('utm_source'), utm_medium: getUrlParamByKey('utm_medium'), utm_campaign: getUrlParamByKey('utm_campaign'), utm_content: getUrlParamByKey('utm_content') }, props);
|
|
1244
|
-
if (!((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.url) &&
|
|
1286
|
+
if (!((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.url) &&
|
|
1287
|
+
!((_q = (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length) &&
|
|
1288
|
+
(rec === null || rec === void 0 ? void 0 : rec.product) &&
|
|
1289
|
+
Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) &&
|
|
1290
|
+
((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _r === void 0 ? void 0 : _r.length) > 0) {
|
|
1245
1291
|
const product = rec === null || rec === void 0 ? void 0 : rec.product;
|
|
1246
1292
|
const productCustomData = {
|
|
1247
1293
|
content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
|
|
1248
1294
|
content_type: 'product',
|
|
1249
1295
|
content_name: '',
|
|
1250
|
-
contents: [
|
|
1296
|
+
contents: [
|
|
1297
|
+
{
|
|
1251
1298
|
id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
1252
1299
|
item_price: product === null || product === void 0 ? void 0 : product.price
|
|
1253
|
-
}
|
|
1300
|
+
}
|
|
1301
|
+
],
|
|
1254
1302
|
image_urls: (_s = product.homePage) !== null && _s !== void 0 ? _s : []
|
|
1255
1303
|
};
|
|
1256
1304
|
customData = Object.assign(Object.assign({}, customData), productCustomData);
|
|
1257
1305
|
}
|
|
1258
1306
|
if (eventName === 'ContentSwipe' || eventName === 'Engagement' || eventName === 'ExitFeed') {
|
|
1259
|
-
const deleteKeys = [
|
|
1260
|
-
|
|
1307
|
+
const deleteKeys = [
|
|
1308
|
+
'content_ids',
|
|
1309
|
+
'content_category',
|
|
1310
|
+
'currency',
|
|
1311
|
+
'contents',
|
|
1312
|
+
'image_urls',
|
|
1313
|
+
'video_urls',
|
|
1314
|
+
'prompt'
|
|
1315
|
+
];
|
|
1316
|
+
deleteKeys.forEach((key) => {
|
|
1261
1317
|
if (customData === null || customData === void 0 ? void 0 : customData[key])
|
|
1262
1318
|
delete customData[key];
|
|
1263
1319
|
});
|
|
@@ -1363,7 +1419,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1363
1419
|
if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
|
|
1364
1420
|
window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: snapchatPixelEventParamsJson, eventName }, props)));
|
|
1365
1421
|
}
|
|
1366
|
-
if (eventName === 'PageView' &&
|
|
1422
|
+
if (eventName === 'PageView' &&
|
|
1423
|
+
typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' &&
|
|
1424
|
+
typeof ((_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView) === 'function') {
|
|
1367
1425
|
(_h = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _h === void 0 ? void 0 : _h.trackPageView();
|
|
1368
1426
|
}
|
|
1369
1427
|
const converApiEventParamsJson = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _j === void 0 ? void 0 : _j[eventName];
|
|
@@ -1385,38 +1443,40 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1385
1443
|
}
|
|
1386
1444
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
|
1387
1445
|
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1446
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1388
1447
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
|
1389
1448
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1390
|
-
}), [bffFetch]);
|
|
1449
|
+
}), [bffFetch, fakeUserId]);
|
|
1391
1450
|
const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1451
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1392
1452
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
|
1393
1453
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1394
|
-
}), [bffFetch]);
|
|
1454
|
+
}), [bffFetch, fakeUserId]);
|
|
1395
1455
|
const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1396
1456
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
|
1397
1457
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1398
1458
|
}), [bffFetch]);
|
|
1399
1459
|
// 获取 Tag
|
|
1400
1460
|
const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1401
|
-
var
|
|
1402
|
-
const isShowTag = !!((
|
|
1461
|
+
var _8, _9, _10, _11, _12, _13, _14, _15;
|
|
1462
|
+
const isShowTag = !!((_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.data) === null || _8 === void 0 ? void 0 : _8.sxpPageConf) === null || _9 === void 0 ? void 0 : _9.globalConfig) === null || _10 === void 0 ? void 0 : _10.isShowTag);
|
|
1403
1463
|
if (!utmVal || !isShowTag)
|
|
1404
1464
|
return;
|
|
1405
1465
|
try {
|
|
1406
|
-
const val = (
|
|
1466
|
+
const val = (_13 = (_12 = (_11 = splitUrlParams(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
|
|
1407
1467
|
var _a, _b;
|
|
1408
1468
|
const key = val.split('=')[0];
|
|
1409
1469
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
|
1410
|
-
})) === null ||
|
|
1470
|
+
})) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
|
|
1411
1471
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
|
1412
|
-
setTagList((
|
|
1472
|
+
setTagList((_15 = (_14 = result === null || result === void 0 ? void 0 : result.data) === null || _14 === void 0 ? void 0 : _14.tags) !== null && _15 !== void 0 ? _15 : []);
|
|
1413
1473
|
}
|
|
1414
1474
|
catch (e) {
|
|
1415
1475
|
console.log('e', e);
|
|
1416
1476
|
}
|
|
1417
1477
|
}), [bffFetch, utmVal]);
|
|
1418
1478
|
const ctaEvent = useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
|
|
1419
|
-
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;
|
|
1479
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
|
|
1420
1480
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
|
1421
1481
|
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);
|
|
1422
1482
|
let fromKName = '';
|
|
@@ -1434,7 +1494,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1434
1494
|
}
|
|
1435
1495
|
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;
|
|
1436
1496
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
1437
|
-
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: (
|
|
1497
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', sceneId: (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_13 = (_10 = (_5 = (_1 = (_y = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_4 = (_3 = (_2 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.bindCta) === null || _4 === void 0 ? void 0 : _4.traceInfo) !== null && _5 !== void 0 ? _5 : (_9 = (_8 = (_7 = (_6 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _6 === void 0 ? void 0 : _6.bindProducts) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '', fromKName, fromKPage: (_14 = location === null || location === void 0 ? void 0 : location.href) !== null && _14 !== void 0 ? _14 : '', contentFormat })
|
|
1438
1498
|
});
|
|
1439
1499
|
}, [bffEventReport, isFromHashtag]);
|
|
1440
1500
|
const h5EnterLink = useCallback(() => {
|
|
@@ -1458,10 +1518,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1458
1518
|
});
|
|
1459
1519
|
}, [bffEventReport]);
|
|
1460
1520
|
const getAccount = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
1461
|
-
var
|
|
1521
|
+
var _16, _17;
|
|
1462
1522
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
|
1463
|
-
setChatlabsId((
|
|
1464
|
-
return ((
|
|
1523
|
+
setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
|
|
1524
|
+
return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
|
|
1465
1525
|
}), [bffFetch]);
|
|
1466
1526
|
const accountSonsent = useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1467
1527
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
|
@@ -1525,6 +1585,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1525
1585
|
}
|
|
1526
1586
|
setRtcList(list);
|
|
1527
1587
|
setCacheRtcList(list);
|
|
1588
|
+
if (isDiyPage) {
|
|
1589
|
+
setFirstRtcList(list);
|
|
1590
|
+
}
|
|
1528
1591
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
|
1529
1592
|
if (channel) {
|
|
1530
1593
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
|
@@ -1544,7 +1607,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1544
1607
|
});
|
|
1545
1608
|
setLoading(false);
|
|
1546
1609
|
});
|
|
1547
|
-
}, [isShowConsent, channel]);
|
|
1610
|
+
}, [isShowConsent, channel, isDiyPage]);
|
|
1548
1611
|
// cms预览
|
|
1549
1612
|
useEffect(() => {
|
|
1550
1613
|
if (!isPreview)
|
|
@@ -1560,12 +1623,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1560
1623
|
}
|
|
1561
1624
|
setRtcList(list);
|
|
1562
1625
|
setCacheRtcList(list);
|
|
1626
|
+
if (isDiyPage) {
|
|
1627
|
+
setFirstRtcList(list);
|
|
1628
|
+
}
|
|
1563
1629
|
}
|
|
1564
1630
|
})
|
|
1565
1631
|
.finally(() => {
|
|
1566
1632
|
setLoading(false);
|
|
1567
1633
|
});
|
|
1568
|
-
}, [getRecommendVideos, bffGetTagList, channel]);
|
|
1634
|
+
}, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
|
|
1569
1635
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
|
1570
1636
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
|
1571
1637
|
rtcList,
|
|
@@ -1623,7 +1689,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1623
1689
|
refreshFeSession,
|
|
1624
1690
|
getAccount,
|
|
1625
1691
|
accountSonsent,
|
|
1626
|
-
isDiyH5,
|
|
1692
|
+
isDiyH5: isDiyPage,
|
|
1693
|
+
firstRtcList,
|
|
1627
1694
|
pixelPvStatusRef
|
|
1628
1695
|
} }, 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({
|
|
1629
1696
|
rtcList,
|
|
@@ -2085,14 +2152,14 @@ var settingRender$f = [
|
|
|
2085
2152
|
* @Author: binruan@chatlabs.com
|
|
2086
2153
|
* @Date: 2024-03-12 10:59:06
|
|
2087
2154
|
* @LastEditors: binruan@chatlabs.com
|
|
2088
|
-
* @LastEditTime:
|
|
2155
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
|
2089
2156
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
|
2090
2157
|
*
|
|
2091
2158
|
*/
|
|
2092
2159
|
function useEventReport() {
|
|
2093
2160
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
|
2094
2161
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
|
2095
|
-
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;
|
|
2162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
2096
2163
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
|
2097
2164
|
if (i !== -1) {
|
|
2098
2165
|
return;
|
|
@@ -2125,11 +2192,11 @@ function useEventReport() {
|
|
|
2125
2192
|
contentFormat = 'image';
|
|
2126
2193
|
}
|
|
2127
2194
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
2128
|
-
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 : '',
|
|
2195
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', sceneId: (_2 = (_1 = (_0 = data === null || data === void 0 ? void 0 : data.video) === null || _0 === void 0 ? void 0 : _0.scene) === null || _1 === void 0 ? void 0 : _1.sceneId) !== null && _2 !== void 0 ? _2 : '', ctatId: (_3 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _3 !== void 0 ? _3 : '', traceInfo: (_16 = (_13 = (_11 = (_7 = (_4 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _4 !== void 0 ? _4 : (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProduct) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.video) === null || _8 === void 0 ? void 0 : _8.bindProducts) === null || _9 === void 0 ? void 0 : _9[0]) === null || _10 === void 0 ? void 0 : _10.traceInfo) !== null && _11 !== void 0 ? _11 : (_12 = data === null || data === void 0 ? void 0 : data.product) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_15 = (_14 = data === null || data === void 0 ? void 0 : data.video) === null || _14 === void 0 ? void 0 : _14.bindCta) === null || _15 === void 0 ? void 0 : _15.traceInfo) !== null && _16 !== void 0 ? _16 : '' }, (contentFormat && { contentFormat }))
|
|
2129
2196
|
});
|
|
2130
2197
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
|
2131
2198
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
|
2132
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2199
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
2133
2200
|
let fromKName = '';
|
|
2134
2201
|
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))) {
|
|
2135
2202
|
fromKName = 'pdpPage';
|
|
@@ -2148,8 +2215,9 @@ function useEventReport() {
|
|
|
2148
2215
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
|
2149
2216
|
position: position + '',
|
|
2150
2217
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
2218
|
+
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 : '',
|
|
2151
2219
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
|
2152
|
-
traceInfo: (
|
|
2220
|
+
traceInfo: (_s = (_q = (_l = (_h = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProducts) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_r = data === null || data === void 0 ? void 0 : data.product) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : '',
|
|
2153
2221
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
|
2154
2222
|
eventSubject: 'productView',
|
|
2155
2223
|
eventDescription: 'User browsed the product'
|
|
@@ -16193,7 +16261,7 @@ function WaterfallList(_a) {
|
|
|
16193
16261
|
* @Author: binruan@chatlabs.com
|
|
16194
16262
|
* @Date: 2024-01-10 10:58:24
|
|
16195
16263
|
* @LastEditors: binruan@chatlabs.com
|
|
16196
|
-
* @LastEditTime: 2025-
|
|
16264
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
|
16197
16265
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
|
16198
16266
|
*
|
|
16199
16267
|
*/
|
|
@@ -16231,7 +16299,7 @@ const WaterFall = (props) => {
|
|
|
16231
16299
|
}
|
|
16232
16300
|
}, [waterFallData]);
|
|
16233
16301
|
const reportTagsView = useCallback(() => {
|
|
16234
|
-
var _a, _b, _c, _d, _e, _f;
|
|
16302
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16235
16303
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
|
16236
16304
|
if (!rec)
|
|
16237
16305
|
return;
|
|
@@ -16251,9 +16319,10 @@ const WaterFall = (props) => {
|
|
|
16251
16319
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
16252
16320
|
eventInfo: {
|
|
16253
16321
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
16322
|
+
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 : '',
|
|
16254
16323
|
position: cacheActiveIndex + '',
|
|
16255
|
-
contentTags: JSON.stringify((
|
|
16256
|
-
traceInfo: (
|
|
16324
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
|
16325
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
|
16257
16326
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
|
16258
16327
|
fromKName,
|
|
16259
16328
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
@@ -18360,21 +18429,22 @@ const LikeButton = (_a) => {
|
|
|
18360
18429
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
|
18361
18430
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
|
18362
18431
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18363
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
18432
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
18364
18433
|
if (state) {
|
|
18365
18434
|
// 先设置状态
|
|
18366
18435
|
setState(false);
|
|
18367
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
|
18436
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ itemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
|
18368
18437
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18369
18438
|
eventInfo: {
|
|
18370
18439
|
eventSubject: 'favoriteContentCanceled',
|
|
18371
18440
|
eventDescription: 'This content was unfavorite by the user',
|
|
18372
18441
|
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 : '',
|
|
18373
|
-
|
|
18374
|
-
|
|
18442
|
+
sceneId: (_k = (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '',
|
|
18443
|
+
contentName: (_m = (_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '',
|
|
18444
|
+
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 : []),
|
|
18375
18445
|
position: position + '',
|
|
18376
|
-
contentFormat: ((
|
|
18377
|
-
traceInfo: (
|
|
18446
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
|
18447
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
18378
18448
|
}
|
|
18379
18449
|
});
|
|
18380
18450
|
// 如果接口调用失败,则回滚状态
|
|
@@ -18382,48 +18452,49 @@ const LikeButton = (_a) => {
|
|
|
18382
18452
|
setState(true);
|
|
18383
18453
|
}
|
|
18384
18454
|
else {
|
|
18385
|
-
const nRtcList = (
|
|
18455
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18386
18456
|
if (index === position) {
|
|
18387
18457
|
item.isCollected = false;
|
|
18388
18458
|
}
|
|
18389
18459
|
return item;
|
|
18390
|
-
})) !== null &&
|
|
18460
|
+
})) !== null && _s !== void 0 ? _s : [];
|
|
18391
18461
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18392
18462
|
}
|
|
18393
18463
|
}
|
|
18394
18464
|
else {
|
|
18395
18465
|
setState(true);
|
|
18396
|
-
const result = (
|
|
18466
|
+
const result = (_v = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData), itemId: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '' })))) !== null && _v !== void 0 ? _v : false;
|
|
18397
18467
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18398
18468
|
eventInfo: {
|
|
18399
18469
|
eventSubject: 'favoriteContent',
|
|
18400
18470
|
eventDescription: 'This content was favorite by the user',
|
|
18401
|
-
contentId: (
|
|
18402
|
-
|
|
18403
|
-
|
|
18471
|
+
contentId: (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
|
18472
|
+
sceneId: (_0 = (_z = (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.scene) === null || _z === void 0 ? void 0 : _z.sceneId) !== null && _0 !== void 0 ? _0 : '',
|
|
18473
|
+
contentName: (_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.title) !== null && _2 !== void 0 ? _2 : '',
|
|
18474
|
+
contentTags: JSON.stringify((_4 = (_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.tags) !== null && _4 !== void 0 ? _4 : []),
|
|
18404
18475
|
position: position + '',
|
|
18405
|
-
contentFormat: ((
|
|
18406
|
-
traceInfo: (
|
|
18476
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
|
18477
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
|
18407
18478
|
}
|
|
18408
18479
|
});
|
|
18409
18480
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
18410
18481
|
eventName: 'Engagement',
|
|
18411
|
-
product: (
|
|
18482
|
+
product: (_7 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _7 === void 0 ? void 0 : _7.bindProducts,
|
|
18412
18483
|
rec: recData,
|
|
18413
18484
|
position,
|
|
18414
|
-
content_id: (
|
|
18485
|
+
content_id: (_9 = (_8 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _8 === void 0 ? void 0 : _8.itemId) !== null && _9 !== void 0 ? _9 : '',
|
|
18415
18486
|
engagement_type: 'like'
|
|
18416
18487
|
});
|
|
18417
18488
|
if (!result) {
|
|
18418
18489
|
setState(false);
|
|
18419
18490
|
}
|
|
18420
18491
|
else {
|
|
18421
|
-
const nRtcList = (
|
|
18492
|
+
const nRtcList = (_10 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18422
18493
|
if (index === position) {
|
|
18423
18494
|
item.isCollected = true;
|
|
18424
18495
|
}
|
|
18425
18496
|
return item;
|
|
18426
|
-
})) !== null &&
|
|
18497
|
+
})) !== null && _10 !== void 0 ? _10 : [];
|
|
18427
18498
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18428
18499
|
}
|
|
18429
18500
|
}
|
|
@@ -18460,7 +18531,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
|
18460
18531
|
const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
|
|
18461
18532
|
var _a, _b;
|
|
18462
18533
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
|
18463
|
-
const { bffEventReport, sxpParameter,
|
|
18534
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
|
18464
18535
|
const videoStartTime = useRef(0);
|
|
18465
18536
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
|
18466
18537
|
const { isActive } = useSwiperSlide();
|
|
@@ -18477,7 +18548,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18477
18548
|
const loopPlayRef = useRef(loopPlay);
|
|
18478
18549
|
const scene = rec.video.scene;
|
|
18479
18550
|
const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
|
|
18480
|
-
const videoCover = (
|
|
18551
|
+
const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
|
18481
18552
|
const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
|
|
18482
18553
|
useImperativeHandle(ref, () => {
|
|
18483
18554
|
return {
|
|
@@ -18526,6 +18597,23 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18526
18597
|
return;
|
|
18527
18598
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18528
18599
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18600
|
+
const handleEnd = () => {
|
|
18601
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18602
|
+
if (!videoRef.current)
|
|
18603
|
+
return;
|
|
18604
|
+
if (isDiyH5) {
|
|
18605
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
18606
|
+
if (!loopPlayRef.current)
|
|
18607
|
+
return;
|
|
18608
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
18609
|
+
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;
|
|
18610
|
+
(_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);
|
|
18611
|
+
}
|
|
18612
|
+
}
|
|
18613
|
+
else {
|
|
18614
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
|
18615
|
+
}
|
|
18616
|
+
};
|
|
18529
18617
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
18530
18618
|
const handlePlaying = useCallback(() => {
|
|
18531
18619
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
@@ -18534,7 +18622,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18534
18622
|
setIsLoadFinish(true);
|
|
18535
18623
|
}, []);
|
|
18536
18624
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18537
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18625
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
18538
18626
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18539
18627
|
return;
|
|
18540
18628
|
setIsPauseVideo(false);
|
|
@@ -18545,16 +18633,11 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18545
18633
|
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);
|
|
18546
18634
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
|
18547
18635
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18548
|
-
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 : '',
|
|
18636
|
+
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', sceneId: (_o = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.scene) === null || _m === void 0 ? void 0 : _m.sceneId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
|
|
18549
18637
|
});
|
|
18550
18638
|
isFirstPlayRef.current = false;
|
|
18551
18639
|
}
|
|
18552
18640
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18553
|
-
const setCurrentTimeByStartTime = useCallback(() => {
|
|
18554
|
-
if (isDiyH5) {
|
|
18555
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18556
|
-
}
|
|
18557
|
-
}, []);
|
|
18558
18641
|
const handLoadeddata = useCallback(() => {
|
|
18559
18642
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
|
18560
18643
|
return;
|
|
@@ -18579,13 +18662,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18579
18662
|
const handleLoadedmetadata = useCallback(() => {
|
|
18580
18663
|
if (!videoRef.current)
|
|
18581
18664
|
return;
|
|
18582
|
-
setCurrentTimeByStartTime();
|
|
18583
18665
|
loadedTimeRef.current = new Date();
|
|
18584
18666
|
handleStartPlay();
|
|
18585
18667
|
handLoadeddata();
|
|
18586
18668
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
|
18587
18669
|
const handleClickVideo = useCallback((type) => () => {
|
|
18588
|
-
var _a, _b, _c, _d, _e
|
|
18670
|
+
var _a, _b, _c, _d, _e;
|
|
18589
18671
|
if (!videoRef.current)
|
|
18590
18672
|
return;
|
|
18591
18673
|
if (!isLoadFinish)
|
|
@@ -18606,20 +18688,17 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18606
18688
|
break;
|
|
18607
18689
|
default:
|
|
18608
18690
|
if (isPause) {
|
|
18609
|
-
|
|
18610
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18611
|
-
}
|
|
18612
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
|
18691
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
|
18613
18692
|
}
|
|
18614
18693
|
else {
|
|
18615
|
-
(
|
|
18694
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
|
18616
18695
|
}
|
|
18617
18696
|
setIsPauseVideo(!isPause);
|
|
18618
18697
|
break;
|
|
18619
18698
|
}
|
|
18620
18699
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18621
18700
|
const handlePause = useCallback(() => {
|
|
18622
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
18701
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
18623
18702
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18624
18703
|
return;
|
|
18625
18704
|
if (activeIndex !== index)
|
|
@@ -18635,14 +18714,15 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18635
18714
|
eventSubject: 'playOverVideo',
|
|
18636
18715
|
eventDescription: 'User finished playing the video',
|
|
18637
18716
|
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 : '',
|
|
18638
|
-
|
|
18717
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
|
18718
|
+
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 : '',
|
|
18639
18719
|
endTime: videoCurrentTime,
|
|
18640
18720
|
videoDuration,
|
|
18641
18721
|
playDuration,
|
|
18642
|
-
contentTags: JSON.stringify((
|
|
18722
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
|
18643
18723
|
position: index + '',
|
|
18644
18724
|
contentFormat: 'video',
|
|
18645
|
-
traceInfo: (
|
|
18725
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
18646
18726
|
}
|
|
18647
18727
|
});
|
|
18648
18728
|
}
|
|
@@ -18650,27 +18730,8 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18650
18730
|
const handleWaiting = useCallback(() => {
|
|
18651
18731
|
setWaiting(true);
|
|
18652
18732
|
}, []);
|
|
18653
|
-
const handleTimeUpload = () => {
|
|
18654
|
-
if (!videoRef.current || !isDiyH5)
|
|
18655
|
-
return;
|
|
18656
|
-
setTimeout(() => {
|
|
18657
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18658
|
-
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)) {
|
|
18659
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
|
18660
|
-
if (!loopPlayRef.current)
|
|
18661
|
-
return;
|
|
18662
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
|
18663
|
-
(_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);
|
|
18664
|
-
}
|
|
18665
|
-
else {
|
|
18666
|
-
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;
|
|
18667
|
-
(_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);
|
|
18668
|
-
}
|
|
18669
|
-
}
|
|
18670
|
-
});
|
|
18671
|
-
};
|
|
18672
18733
|
useEffect(() => {
|
|
18673
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
18734
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18674
18735
|
if (!isActive)
|
|
18675
18736
|
return;
|
|
18676
18737
|
const videoSrc = videoUrl;
|
|
@@ -18691,7 +18752,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18691
18752
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
|
18692
18753
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
18693
18754
|
var _a;
|
|
18694
|
-
setCurrentTimeByStartTime();
|
|
18695
18755
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18696
18756
|
});
|
|
18697
18757
|
}
|
|
@@ -18705,12 +18765,11 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18705
18765
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
|
18706
18766
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
|
18707
18767
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
|
18708
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
|
18768
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
|
18709
18769
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
|
18710
18770
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
|
18711
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
|
18712
18771
|
return () => {
|
|
18713
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
18772
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18714
18773
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
|
18715
18774
|
if (!isPause)
|
|
18716
18775
|
handlePause();
|
|
@@ -18722,10 +18781,9 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18722
18781
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
|
18723
18782
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
|
18724
18783
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
|
18725
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
|
18784
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
|
18726
18785
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
|
18727
18786
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
|
18728
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
|
18729
18787
|
};
|
|
18730
18788
|
}, [isActive]);
|
|
18731
18789
|
useEffect(() => {
|
|
@@ -18940,19 +18998,45 @@ const Picture = (props) => {
|
|
|
18940
18998
|
}, onLoad: onShowFirstImage }))));
|
|
18941
18999
|
};
|
|
18942
19000
|
|
|
18943
|
-
const PictureGroup$4 = ({ imgUrls,
|
|
19001
|
+
const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
|
18944
19002
|
var _a, _b;
|
|
18945
19003
|
const { isActive } = useSwiperSlide();
|
|
18946
|
-
const {
|
|
19004
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
|
18947
19005
|
const [isLoad, setIsLoad] = useState(false);
|
|
18948
19006
|
const [imgInfo, setImgInfo] = useState();
|
|
18949
19007
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
|
18950
|
-
const
|
|
19008
|
+
const imgsSwiperRef = useRef();
|
|
18951
19009
|
const isFirstPlayRef = useRef(true);
|
|
19010
|
+
const loopPlayRef = useRef(true);
|
|
18952
19011
|
const initTime = new Date();
|
|
19012
|
+
useImperativeHandle(ref, () => {
|
|
19013
|
+
return {
|
|
19014
|
+
setLoopPlay(v) {
|
|
19015
|
+
loopPlayRef.current = v;
|
|
19016
|
+
}
|
|
19017
|
+
};
|
|
19018
|
+
});
|
|
19019
|
+
useEffect(() => {
|
|
19020
|
+
let timerId;
|
|
19021
|
+
if (isLoad && isActive && isDiyH5) {
|
|
19022
|
+
timerId = setTimeout(() => {
|
|
19023
|
+
var _a, _b, _c, _d;
|
|
19024
|
+
if (!loopPlayRef.current)
|
|
19025
|
+
return;
|
|
19026
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
19027
|
+
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;
|
|
19028
|
+
(_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);
|
|
19029
|
+
}
|
|
19030
|
+
}, 3000);
|
|
19031
|
+
}
|
|
19032
|
+
return () => {
|
|
19033
|
+
if (timerId)
|
|
19034
|
+
clearTimeout(timerId);
|
|
19035
|
+
};
|
|
19036
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
|
18953
19037
|
useEffect(() => {
|
|
18954
19038
|
if (isLoad && isActive) {
|
|
18955
|
-
(
|
|
19039
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
|
18956
19040
|
if (openHashtag) {
|
|
18957
19041
|
onViewImageEndEvent(rec);
|
|
18958
19042
|
}
|
|
@@ -18962,7 +19046,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
|
18962
19046
|
}
|
|
18963
19047
|
}
|
|
18964
19048
|
else {
|
|
18965
|
-
(
|
|
19049
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
|
18966
19050
|
}
|
|
18967
19051
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
|
18968
19052
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18989,13 +19073,13 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
|
18989
19073
|
};
|
|
18990
19074
|
}, [isActive, imgInfo]);
|
|
18991
19075
|
const handleMouseEnter = useCallback(() => {
|
|
18992
|
-
if (
|
|
18993
|
-
|
|
19076
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
|
19077
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
|
18994
19078
|
}
|
|
18995
19079
|
}, []);
|
|
18996
19080
|
const handleMouseLeave = useCallback(() => {
|
|
18997
|
-
if (
|
|
18998
|
-
|
|
19081
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
|
19082
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
|
18999
19083
|
}
|
|
19000
19084
|
}, []);
|
|
19001
19085
|
const handleSlideChange = useCallback((swiper) => {
|
|
@@ -19016,7 +19100,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
|
19016
19100
|
enabled: true
|
|
19017
19101
|
}
|
|
19018
19102
|
}
|
|
19019
|
-
: {}), { loop: true, ref:
|
|
19103
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
|
19020
19104
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
|
19021
19105
|
fontSize: '14px'
|
|
19022
19106
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
|
@@ -19033,7 +19117,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
|
19033
19117
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
|
19034
19118
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
|
19035
19119
|
}))));
|
|
19036
|
-
};
|
|
19120
|
+
});
|
|
19037
19121
|
var PictureGroup$5 = memo(PictureGroup$4);
|
|
19038
19122
|
|
|
19039
19123
|
/*
|
|
@@ -19325,7 +19409,7 @@ var NavBack$1 = memo(NavBack);
|
|
|
19325
19409
|
* @Author: binruan@chatlabs.com
|
|
19326
19410
|
* @Date: 2024-03-20 10:27:31
|
|
19327
19411
|
* @LastEditors: binruan@chatlabs.com
|
|
19328
|
-
* @LastEditTime: 2025-05-
|
|
19412
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
|
19329
19413
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
|
19330
19414
|
*
|
|
19331
19415
|
*/
|
|
@@ -19346,6 +19430,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19346
19430
|
const [pageNum, setPageNum] = useState(2);
|
|
19347
19431
|
useState(false);
|
|
19348
19432
|
const videoWidgetRef = useRef(null);
|
|
19433
|
+
const pictureGroupRef = useRef(null);
|
|
19349
19434
|
const fbcRef = useRef('');
|
|
19350
19435
|
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, pixelPvStatusRef } = useSxpDataSource();
|
|
19351
19436
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
@@ -19395,7 +19480,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19395
19480
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
|
19396
19481
|
}, [data, ctaType, swiperRef]);
|
|
19397
19482
|
const handleSessionCompleted = useCallback((fk) => {
|
|
19398
|
-
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;
|
|
19483
|
+
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;
|
|
19399
19484
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
19400
19485
|
let fromKName = '';
|
|
19401
19486
|
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))) {
|
|
@@ -19422,22 +19507,23 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19422
19507
|
eventSubject: 'sessionCompleted',
|
|
19423
19508
|
eventDescription: 'Session completed',
|
|
19424
19509
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
|
19425
|
-
|
|
19510
|
+
sceneId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.scene) === null || _p === void 0 ? void 0 : _p.sceneId) !== null && _q !== void 0 ? _q : '',
|
|
19511
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
|
19426
19512
|
position: activeIndex + '',
|
|
19427
19513
|
fromKName: fk || fromKName,
|
|
19428
19514
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
19429
|
-
ctatId: (
|
|
19430
|
-
traceInfo: (
|
|
19515
|
+
ctatId: (_u = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
19516
|
+
traceInfo: (_y = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = item === null || item === void 0 ? void 0 : item.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : ''
|
|
19431
19517
|
}
|
|
19432
19518
|
});
|
|
19433
|
-
const isPostType = ((
|
|
19519
|
+
const isPostType = ((_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.url) || ((_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.imgUrls) === null || _1 === void 0 ? void 0 : _1.length);
|
|
19434
19520
|
if (!popupDetailData) {
|
|
19435
19521
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19436
19522
|
eventName: 'ExitFeed',
|
|
19437
|
-
product: isPostType ? (
|
|
19523
|
+
product: isPostType ? (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
|
|
19438
19524
|
rec: item,
|
|
19439
19525
|
position: activeIndex,
|
|
19440
|
-
content_id: isPostType ? (
|
|
19526
|
+
content_id: isPostType ? (_4 = (_3 = item === null || item === void 0 ? void 0 : item.video) === null || _3 === void 0 ? void 0 : _3.itemId) !== null && _4 !== void 0 ? _4 : '' : (_6 = (_5 = item === null || item === void 0 ? void 0 : item.product) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
|
|
19441
19527
|
view_time: new Date() - viewTime.current
|
|
19442
19528
|
});
|
|
19443
19529
|
}
|
|
@@ -19497,8 +19583,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19497
19583
|
refreshFeSession
|
|
19498
19584
|
]);
|
|
19499
19585
|
const handleSessionExpire = useCallback(debounce(() => {
|
|
19500
|
-
var _a;
|
|
19586
|
+
var _a, _b;
|
|
19501
19587
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
19588
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
19502
19589
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
|
19503
19590
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
|
19504
19591
|
useEffect(() => {
|
|
@@ -19569,18 +19656,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19569
19656
|
return null;
|
|
19570
19657
|
}, [globalConfig, activeIndex, visList]);
|
|
19571
19658
|
const renderContent = useCallback((rec, index) => {
|
|
19572
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19659
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
19573
19660
|
if (rec === 'organic menu') {
|
|
19574
19661
|
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)));
|
|
19575
19662
|
}
|
|
19576
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
|
19663
|
+
if (((_h = (_g = rec.video) === null || _g === void 0 ? void 0 : _g.scene) === null || _h === void 0 ? void 0 : _h.mediaUrl) || ((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.url)) {
|
|
19577
19664
|
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, visibleHeight: visibleHeight })));
|
|
19578
19665
|
}
|
|
19579
|
-
if ((
|
|
19580
|
-
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 }));
|
|
19666
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
|
19667
|
+
return (React.createElement(PictureGroup$5, Object.assign({ data: data }, (activeIndex === index && { ref: pictureGroupRef }), { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, swiperRef: swiperRef })));
|
|
19581
19668
|
}
|
|
19582
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
|
19583
|
-
return (
|
|
19669
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _l === void 0 ? void 0 : _l.length) > 0) {
|
|
19670
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
|
19584
19671
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19585
19672
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
|
19586
19673
|
const Component = withBindDataSource(t);
|
|
@@ -19619,7 +19706,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19619
19706
|
};
|
|
19620
19707
|
}, [isShowMore]);
|
|
19621
19708
|
const renderBottom = useCallback((rec, index) => {
|
|
19622
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
19709
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
19623
19710
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
|
19624
19711
|
let cta = null;
|
|
19625
19712
|
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) {
|
|
@@ -19628,24 +19715,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19628
19715
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
|
19629
19716
|
cta = '商品CTA';
|
|
19630
19717
|
}
|
|
19718
|
+
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)) {
|
|
19719
|
+
cta = '服务CTA';
|
|
19720
|
+
}
|
|
19631
19721
|
else {
|
|
19632
|
-
cta = (
|
|
19722
|
+
cta = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.itemId;
|
|
19633
19723
|
}
|
|
19634
19724
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
|
19635
19725
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
|
19636
19726
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
|
|
19637
|
-
((
|
|
19727
|
+
((_j = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _j === void 0 ? void 0 : _j.includes((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type));
|
|
19638
19728
|
return (React.createElement(React.Fragment, null,
|
|
19639
19729
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
|
19640
|
-
((
|
|
19641
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
|
19730
|
+
((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
|
19731
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _m !== void 0 ? _m : 40}px` } },
|
|
19642
19732
|
React.createElement(Nudge, { nudge: nudge }),
|
|
19643
19733
|
((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' },
|
|
19644
19734
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
19645
19735
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
19646
|
-
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: (
|
|
19736
|
+
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
|
19647
19737
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
19648
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
|
19738
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.hashTags) !== null && _r !== void 0 ? _r : [], itemId: (_s = rec === null || rec === void 0 ? void 0 : rec.video) === null || _s === void 0 ? void 0 : _s.itemId, itemType: ((_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
|
19649
19739
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
|
19650
19740
|
}
|
|
19651
19741
|
return null;
|
|
@@ -19687,7 +19777,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19687
19777
|
return null;
|
|
19688
19778
|
}, [globalConfig, waterFallData, bottomHeight]);
|
|
19689
19779
|
const handleViewImageStartEnd = (item) => {
|
|
19690
|
-
var _a, _b, _c, _d, _e, _f;
|
|
19780
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19691
19781
|
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)) {
|
|
19692
19782
|
const endTime = Date.now();
|
|
19693
19783
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
|
@@ -19696,10 +19786,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19696
19786
|
eventSubject: 'viewImageCarouselEnd',
|
|
19697
19787
|
eventDescription: 'User end view the image carousel',
|
|
19698
19788
|
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 : '',
|
|
19699
|
-
|
|
19789
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
|
19790
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19700
19791
|
imageEndTime: `${endTime}`,
|
|
19701
19792
|
playDuration: `${duration}`,
|
|
19702
|
-
contentTags: JSON.stringify((
|
|
19793
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
|
19703
19794
|
position: activeIndex + '',
|
|
19704
19795
|
contentFormat: 'image',
|
|
19705
19796
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
|
@@ -19708,7 +19799,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19708
19799
|
}
|
|
19709
19800
|
};
|
|
19710
19801
|
const handleSlideSkip = (item, position) => {
|
|
19711
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
19802
|
+
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;
|
|
19712
19803
|
if (isPreview || waterFallData)
|
|
19713
19804
|
return;
|
|
19714
19805
|
const t = new Date() - curTime.current;
|
|
@@ -19734,7 +19825,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19734
19825
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
|
19735
19826
|
position: position + '',
|
|
19736
19827
|
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 : '',
|
|
19737
|
-
|
|
19828
|
+
sceneId: (_w = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.scene) === null || _v === void 0 ? void 0 : _v.sceneId) !== null && _w !== void 0 ? _w : '',
|
|
19829
|
+
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 : '',
|
|
19738
19830
|
contentFormat
|
|
19739
19831
|
}
|
|
19740
19832
|
});
|
|
@@ -19744,7 +19836,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19744
19836
|
}
|
|
19745
19837
|
};
|
|
19746
19838
|
const handleScrollEvent = (swiper) => {
|
|
19747
|
-
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;
|
|
19839
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
19748
19840
|
const item = data[swiper.previousIndex];
|
|
19749
19841
|
const activeItem = data[swiper.activeIndex];
|
|
19750
19842
|
if (!item)
|
|
@@ -19777,11 +19869,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19777
19869
|
eventSubject: 'scrollDown',
|
|
19778
19870
|
eventDescription: 'User scroll down',
|
|
19779
19871
|
contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
19780
|
-
|
|
19872
|
+
sceneId: (_x = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '',
|
|
19873
|
+
productId: (_z = (_y = item === null || item === void 0 ? void 0 : item.product) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
|
19781
19874
|
requestId: null,
|
|
19782
|
-
traceInfo: (
|
|
19875
|
+
traceInfo: (_3 = (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.traceInfo) !== null && _3 !== void 0 ? _3 : '',
|
|
19783
19876
|
contentFormat,
|
|
19784
|
-
position: ((
|
|
19877
|
+
position: ((_4 = swiper.previousIndex) !== null && _4 !== void 0 ? _4 : 0) + ''
|
|
19785
19878
|
}
|
|
19786
19879
|
});
|
|
19787
19880
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19794,12 +19887,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19794
19887
|
eventInfo: {
|
|
19795
19888
|
eventSubject: 'scrollUp',
|
|
19796
19889
|
eventDescription: 'User scroll up',
|
|
19797
|
-
contentId: (
|
|
19798
|
-
|
|
19890
|
+
contentId: (_6 = (_5 = item === null || item === void 0 ? void 0 : item.video) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
|
|
19891
|
+
sceneId: (_9 = (_8 = (_7 = item === null || item === void 0 ? void 0 : item.video) === null || _7 === void 0 ? void 0 : _7.scene) === null || _8 === void 0 ? void 0 : _8.sceneId) !== null && _9 !== void 0 ? _9 : '',
|
|
19892
|
+
productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
|
|
19799
19893
|
requestId: null,
|
|
19800
|
-
traceInfo: (
|
|
19894
|
+
traceInfo: (_15 = (_13 = (_12 = item === null || item === void 0 ? void 0 : item.video) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_14 = item === null || item === void 0 ? void 0 : item.product) === null || _14 === void 0 ? void 0 : _14.traceInfo) !== null && _15 !== void 0 ? _15 : '',
|
|
19801
19895
|
contentFormat,
|
|
19802
|
-
position: ((
|
|
19896
|
+
position: ((_16 = swiper.previousIndex) !== null && _16 !== void 0 ? _16 : 0) + ''
|
|
19803
19897
|
}
|
|
19804
19898
|
});
|
|
19805
19899
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19899,7 +19993,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19899
19993
|
};
|
|
19900
19994
|
}, [globalConfig, bffEventReport, data, activeIndex]);
|
|
19901
19995
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
|
19902
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19996
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
19903
19997
|
const item = data[activeIndex];
|
|
19904
19998
|
// 如果是图片集则上报事件
|
|
19905
19999
|
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)) {
|
|
@@ -19910,9 +20004,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19910
20004
|
eventSubject: 'viewImageCarouselStart',
|
|
19911
20005
|
eventDescription: 'User start view the image carousel',
|
|
19912
20006
|
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 : '',
|
|
19913
|
-
|
|
20007
|
+
sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
|
20008
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19914
20009
|
imageStartTime: `${startTime}`,
|
|
19915
|
-
contentTags: JSON.stringify((
|
|
20010
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
|
19916
20011
|
position: activeIndex + '',
|
|
19917
20012
|
contentFormat: 'image',
|
|
19918
20013
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
|
@@ -19922,13 +20017,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19922
20017
|
if (enableCapi) {
|
|
19923
20018
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19924
20019
|
eventName: 'ViewContent',
|
|
19925
|
-
product: (
|
|
20020
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProducts,
|
|
19926
20021
|
rec: item,
|
|
19927
20022
|
position: activeIndex
|
|
19928
20023
|
});
|
|
19929
20024
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19930
20025
|
eventName: 'PageView',
|
|
19931
|
-
product: (
|
|
20026
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProducts,
|
|
19932
20027
|
rec: item,
|
|
19933
20028
|
position: activeIndex
|
|
19934
20029
|
});
|
|
@@ -20026,15 +20121,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20026
20121
|
swiperRef.current.swiper.allowTouchMove = true;
|
|
20027
20122
|
}, 500);
|
|
20028
20123
|
}, onActiveIndexChange: (swiper) => {
|
|
20124
|
+
var _a, _b;
|
|
20029
20125
|
setActiveIndex(swiper.activeIndex);
|
|
20030
20126
|
if (openHashtag)
|
|
20031
20127
|
return;
|
|
20032
20128
|
// 处理上滑下滑事件
|
|
20033
20129
|
handleScrollEvent(swiper);
|
|
20034
|
-
if (waterFallData || isEditor
|
|
20130
|
+
if (waterFallData || isEditor)
|
|
20035
20131
|
return;
|
|
20036
20132
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
|
20037
20133
|
if (!isLoadMore) {
|
|
20134
|
+
if (isDiyH5) {
|
|
20135
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
20136
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
20137
|
+
}
|
|
20038
20138
|
setIsLoadMore(true);
|
|
20039
20139
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
|
20040
20140
|
var _a;
|
|
@@ -20107,7 +20207,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20107
20207
|
}, []);
|
|
20108
20208
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
20109
20209
|
const handlePlaying = useCallback(() => {
|
|
20110
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20210
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
20111
20211
|
setIsPauseVideo(false);
|
|
20112
20212
|
const item = data[index];
|
|
20113
20213
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
|
@@ -20120,14 +20220,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20120
20220
|
eventSubject: 'playVideo',
|
|
20121
20221
|
eventDescription: 'User played the video',
|
|
20122
20222
|
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 : '',
|
|
20123
|
-
|
|
20223
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
|
20224
|
+
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 : '',
|
|
20124
20225
|
playType,
|
|
20125
20226
|
startTime: videoCurrentTime,
|
|
20126
20227
|
videoDuration,
|
|
20127
|
-
contentTags: JSON.stringify((
|
|
20228
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
|
20128
20229
|
position: index + '',
|
|
20129
20230
|
contentFormat: 'video',
|
|
20130
|
-
traceInfo: (
|
|
20231
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
20131
20232
|
}
|
|
20132
20233
|
});
|
|
20133
20234
|
setIsFirstPlay(false);
|
|
@@ -20166,7 +20267,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20166
20267
|
}
|
|
20167
20268
|
}, [isLoadFinish]);
|
|
20168
20269
|
const onPause = useCallback(() => {
|
|
20169
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20270
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
20170
20271
|
const item = data[index];
|
|
20171
20272
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
|
20172
20273
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
|
@@ -20177,14 +20278,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20177
20278
|
eventSubject: 'playOverVideo',
|
|
20178
20279
|
eventDescription: 'User finished playing the video',
|
|
20179
20280
|
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 : '',
|
|
20180
|
-
|
|
20281
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
|
20282
|
+
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 : '',
|
|
20181
20283
|
endTime: videoCurrentTime,
|
|
20182
20284
|
videoDuration,
|
|
20183
20285
|
playDuration,
|
|
20184
|
-
contentTags: JSON.stringify((
|
|
20286
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
|
20185
20287
|
position: index + '',
|
|
20186
20288
|
contentFormat: 'video',
|
|
20187
|
-
traceInfo: (
|
|
20289
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
20188
20290
|
}
|
|
20189
20291
|
});
|
|
20190
20292
|
}
|