pb-sxp-ui 1.20.11 → 1.20.12
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 +175 -251
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +175 -251
- 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 +175 -251
- 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 +8 -10
- package/es/core/components/SxpPageRender/LikeButton/index.js +18 -20
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
- package/es/core/components/SxpPageRender/VideoWidget/index.js +46 -33
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +40 -56
- package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/es/core/context/SxpDataSourceProvider.js +41 -84
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/LikeButton/index.js +18 -20
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +46 -33
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +40 -56
- package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/lib/core/context/SxpDataSourceProvider.js +41 -84
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -645,7 +645,6 @@ 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([]);
|
|
649
648
|
const [tagList, setTagList] = useState([]);
|
|
650
649
|
const [loading, setLoading] = useState(true);
|
|
651
650
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
|
@@ -677,10 +676,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
677
676
|
const [chatlabsId, setChatlabsId] = useState();
|
|
678
677
|
const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
|
679
678
|
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]);
|
|
684
679
|
useEffect(() => {
|
|
685
680
|
var _a, _b;
|
|
686
681
|
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);
|
|
@@ -786,7 +781,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
786
781
|
};
|
|
787
782
|
// bff API 请求方法
|
|
788
783
|
const bffFetch = useCallback((path, options, isBota = true) => {
|
|
789
|
-
var _a
|
|
784
|
+
var _a;
|
|
790
785
|
if (!bffDataSource)
|
|
791
786
|
return;
|
|
792
787
|
const url = bffDataSource.url;
|
|
@@ -799,9 +794,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
799
794
|
val.split('=')[0];
|
|
800
795
|
val.split('=')[1];
|
|
801
796
|
});
|
|
802
|
-
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
|
803
797
|
return window
|
|
804
|
-
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId
|
|
798
|
+
.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
|
|
805
799
|
? JSON.stringify({
|
|
806
800
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
|
807
801
|
})
|
|
@@ -1086,8 +1080,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1086
1080
|
}, [bffDataSource]);
|
|
1087
1081
|
// 获取推荐视频数据
|
|
1088
1082
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1089
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
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 })), (
|
|
1083
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1084
|
+
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 })), (isDiyH5 && { type: 'story' }));
|
|
1091
1085
|
if (channel) {
|
|
1092
1086
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
|
1093
1087
|
}
|
|
@@ -1100,10 +1094,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1100
1094
|
if (val)
|
|
1101
1095
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
|
1102
1096
|
}
|
|
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);
|
|
1104
1097
|
if (isEditor) {
|
|
1105
1098
|
let pageNum = 1;
|
|
1106
|
-
query = Object.assign(Object.assign(Object.assign(
|
|
1099
|
+
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] }));
|
|
1107
1100
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
|
1108
1101
|
return undefined;
|
|
1109
1102
|
}
|
|
@@ -1111,24 +1104,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1111
1104
|
let list = [];
|
|
1112
1105
|
let result = null;
|
|
1113
1106
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1114
|
-
var
|
|
1107
|
+
var _v, _w, _x, _y, _z, _0;
|
|
1115
1108
|
query.pageNum = pageNum;
|
|
1116
|
-
result =
|
|
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 }));
|
|
1109
|
+
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
|
1119
1110
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1120
1111
|
return undefined;
|
|
1121
1112
|
}
|
|
1122
1113
|
setLoading(false);
|
|
1123
|
-
list = list.concat((
|
|
1114
|
+
list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
|
|
1124
1115
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
|
1125
1116
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1126
1117
|
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
|
-
}
|
|
1130
1118
|
}
|
|
1131
|
-
const isNotNullList = (
|
|
1119
|
+
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
|
1132
1120
|
if (isNotNullList) {
|
|
1133
1121
|
pageNum = pageNum + 1;
|
|
1134
1122
|
yield recurveRecList(query);
|
|
@@ -1136,61 +1124,42 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1136
1124
|
});
|
|
1137
1125
|
yield recurveRecList(query);
|
|
1138
1126
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
|
1139
|
-
setCurReqInfo({ rtc: (
|
|
1127
|
+
setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
|
|
1140
1128
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
|
1141
1129
|
}
|
|
1142
1130
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
|
1143
|
-
query = Object.assign(Object.assign(
|
|
1131
|
+
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
|
|
1144
1132
|
}
|
|
1145
|
-
const result =
|
|
1146
|
-
|
|
1147
|
-
:
|
|
1148
|
-
|
|
1149
|
-
body: query
|
|
1150
|
-
}));
|
|
1133
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
|
1134
|
+
method: 'POST',
|
|
1135
|
+
body: query
|
|
1136
|
+
}));
|
|
1151
1137
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1152
1138
|
return undefined;
|
|
1153
1139
|
}
|
|
1154
1140
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
|
1155
1141
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
|
1156
1142
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
|
1157
|
-
const isNotNullList = (
|
|
1143
|
+
const isNotNullList = (_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.recList) === null || _q === void 0 ? void 0 : _q.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
|
1158
1144
|
if (!isNotNullList) {
|
|
1159
1145
|
setIsNoMoreData(true);
|
|
1160
1146
|
}
|
|
1161
1147
|
}
|
|
1162
1148
|
let list = [];
|
|
1163
|
-
list = list.concat((
|
|
1149
|
+
list = list.concat((_u = (_t = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.filter) === null || _t === void 0 ? void 0 : _t.call(_s, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _u !== void 0 ? _u : []);
|
|
1164
1150
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
|
1165
|
-
}), [
|
|
1166
|
-
bffFetch,
|
|
1167
|
-
utmVal,
|
|
1168
|
-
maxSize,
|
|
1169
|
-
defaultSize,
|
|
1170
|
-
channelQueryList,
|
|
1171
|
-
channel,
|
|
1172
|
-
chatlabsId,
|
|
1173
|
-
bffFetchAdmin,
|
|
1174
|
-
isDiyPage,
|
|
1175
|
-
finalPageData,
|
|
1176
|
-
isDiyH5
|
|
1177
|
-
]);
|
|
1151
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
|
1178
1152
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1179
|
-
var
|
|
1153
|
+
var _1, _2, _3, _4;
|
|
1180
1154
|
if (rtcList.length <= 0) {
|
|
1181
1155
|
return;
|
|
1182
1156
|
}
|
|
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
|
-
}
|
|
1188
1157
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
|
1189
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
|
1158
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
|
1190
1159
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
|
1191
1160
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
|
1192
1161
|
return data;
|
|
1193
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
|
1162
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
|
1194
1163
|
const refreshFeSession = useCallback((enableReSid, event) => {
|
|
1195
1164
|
var _a, _b, _c, _d, _e;
|
|
1196
1165
|
let expire = false;
|
|
@@ -1221,8 +1190,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1221
1190
|
// 用户信息都是公共的
|
|
1222
1191
|
if (!userInfo) {
|
|
1223
1192
|
userInfo = {
|
|
1224
|
-
|
|
1225
|
-
|
|
1193
|
+
// productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
|
|
1194
|
+
// tpChannelId: 'H5' // 后端处理
|
|
1226
1195
|
};
|
|
1227
1196
|
}
|
|
1228
1197
|
const sessionID = storeAndLoadFeSessionId();
|
|
@@ -1256,8 +1225,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1256
1225
|
layoutVariantId,
|
|
1257
1226
|
globalConfig,
|
|
1258
1227
|
playbookType,
|
|
1259
|
-
bffDataSource
|
|
1260
|
-
fakeUserId
|
|
1228
|
+
bffDataSource
|
|
1261
1229
|
]);
|
|
1262
1230
|
const getEventParamsByJson = useCallback((_a) => {
|
|
1263
1231
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -1277,9 +1245,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1277
1245
|
// funnel_type
|
|
1278
1246
|
content_ids: [(_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.itemId, ...((_f = product === null || product === void 0 ? void 0 : product.map((item) => item === null || item === void 0 ? void 0 : item.itemId)) !== null && _f !== void 0 ? _f : [])], content_type: contentType, content_name: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.title, total_posts: rtcList === null || rtcList === void 0 ? void 0 : rtcList.length, position,
|
|
1279
1247
|
// content_category
|
|
1280
|
-
currency: (_k = (_j = (_h = product === null || product === void 0 ? void 0 : product[0]) === null || _h === void 0 ? void 0 : _h.currency) === null || _j === void 0 ? void 0 : _j.split('-')) === null || _k === void 0 ? void 0 : _k[0], contents: (_l = product === null || product === void 0 ? void 0 : product.map((item) => ({
|
|
1248
|
+
currency: (_k = (_j = (_h = product === null || product === void 0 ? void 0 : product[0]) === null || _h === void 0 ? void 0 : _h.currency) === null || _j === void 0 ? void 0 : _j.split('-')) === null || _k === void 0 ? void 0 : _k[0], value: product === null || product === void 0 ? void 0 : product.reduce((acc, item) => acc + (item === null || item === void 0 ? void 0 : item.price), 0), contents: (_l = product === null || product === void 0 ? void 0 : product.map((item) => ({
|
|
1281
1249
|
id: item === null || item === void 0 ? void 0 : item.itemId,
|
|
1282
|
-
|
|
1250
|
+
item_price: item === null || item === void 0 ? void 0 : item.price
|
|
1283
1251
|
}))) !== null && _l !== void 0 ? _l : [], image_urls: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.imgUrls) !== null && _o !== void 0 ? _o : [], video_urls: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.url,
|
|
1284
1252
|
// prompt
|
|
1285
1253
|
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);
|
|
@@ -1296,7 +1264,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1296
1264
|
contents: [
|
|
1297
1265
|
{
|
|
1298
1266
|
id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
1299
|
-
|
|
1267
|
+
item_price: product === null || product === void 0 ? void 0 : product.price
|
|
1300
1268
|
}
|
|
1301
1269
|
],
|
|
1302
1270
|
image_urls: (_u = product.homePage) !== null && _u !== void 0 ? _u : []
|
|
@@ -1443,40 +1411,38 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1443
1411
|
}
|
|
1444
1412
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
|
1445
1413
|
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1446
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1447
1414
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
|
1448
1415
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1449
|
-
}), [bffFetch
|
|
1416
|
+
}), [bffFetch]);
|
|
1450
1417
|
const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1451
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1452
1418
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
|
1453
1419
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1454
|
-
}), [bffFetch
|
|
1420
|
+
}), [bffFetch]);
|
|
1455
1421
|
const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1456
1422
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
|
1457
1423
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1458
1424
|
}), [bffFetch]);
|
|
1459
1425
|
// 获取 Tag
|
|
1460
1426
|
const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1461
|
-
var
|
|
1462
|
-
const isShowTag = !!((
|
|
1427
|
+
var _5, _6, _7, _8, _9, _10, _11, _12;
|
|
1428
|
+
const isShowTag = !!((_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.data) === null || _5 === void 0 ? void 0 : _5.sxpPageConf) === null || _6 === void 0 ? void 0 : _6.globalConfig) === null || _7 === void 0 ? void 0 : _7.isShowTag);
|
|
1463
1429
|
if (!utmVal || !isShowTag)
|
|
1464
1430
|
return;
|
|
1465
1431
|
try {
|
|
1466
|
-
const val = (
|
|
1432
|
+
const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
|
|
1467
1433
|
var _a, _b;
|
|
1468
1434
|
const key = val.split('=')[0];
|
|
1469
1435
|
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);
|
|
1470
|
-
})) === null ||
|
|
1436
|
+
})) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
|
|
1471
1437
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
|
1472
|
-
setTagList((
|
|
1438
|
+
setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
|
|
1473
1439
|
}
|
|
1474
1440
|
catch (e) {
|
|
1475
1441
|
console.log('e', e);
|
|
1476
1442
|
}
|
|
1477
1443
|
}), [bffFetch, utmVal]);
|
|
1478
1444
|
const ctaEvent = useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
|
|
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
|
|
1445
|
+
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;
|
|
1480
1446
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
|
1481
1447
|
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);
|
|
1482
1448
|
let fromKName = '';
|
|
@@ -1494,7 +1460,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1494
1460
|
}
|
|
1495
1461
|
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;
|
|
1496
1462
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
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 : '',
|
|
1463
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
|
1498
1464
|
});
|
|
1499
1465
|
}, [bffEventReport, isFromHashtag]);
|
|
1500
1466
|
const h5EnterLink = useCallback(() => {
|
|
@@ -1518,10 +1484,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1518
1484
|
});
|
|
1519
1485
|
}, [bffEventReport]);
|
|
1520
1486
|
const getAccount = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
1521
|
-
var
|
|
1487
|
+
var _13, _14;
|
|
1522
1488
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
|
1523
|
-
setChatlabsId((
|
|
1524
|
-
return ((
|
|
1489
|
+
setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
|
|
1490
|
+
return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
|
|
1525
1491
|
}), [bffFetch]);
|
|
1526
1492
|
const accountSonsent = useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1527
1493
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
|
@@ -1585,9 +1551,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1585
1551
|
}
|
|
1586
1552
|
setRtcList(list);
|
|
1587
1553
|
setCacheRtcList(list);
|
|
1588
|
-
if (isDiyPage) {
|
|
1589
|
-
setFirstRtcList(list);
|
|
1590
|
-
}
|
|
1591
1554
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
|
1592
1555
|
if (channel) {
|
|
1593
1556
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
|
@@ -1607,7 +1570,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1607
1570
|
});
|
|
1608
1571
|
setLoading(false);
|
|
1609
1572
|
});
|
|
1610
|
-
}, [isShowConsent, channel
|
|
1573
|
+
}, [isShowConsent, channel]);
|
|
1611
1574
|
// cms预览
|
|
1612
1575
|
useEffect(() => {
|
|
1613
1576
|
if (!isPreview)
|
|
@@ -1623,15 +1586,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1623
1586
|
}
|
|
1624
1587
|
setRtcList(list);
|
|
1625
1588
|
setCacheRtcList(list);
|
|
1626
|
-
if (isDiyPage) {
|
|
1627
|
-
setFirstRtcList(list);
|
|
1628
|
-
}
|
|
1629
1589
|
}
|
|
1630
1590
|
})
|
|
1631
1591
|
.finally(() => {
|
|
1632
1592
|
setLoading(false);
|
|
1633
1593
|
});
|
|
1634
|
-
}, [getRecommendVideos, bffGetTagList, channel
|
|
1594
|
+
}, [getRecommendVideos, bffGetTagList, channel]);
|
|
1635
1595
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
|
1636
1596
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
|
1637
1597
|
rtcList,
|
|
@@ -1689,8 +1649,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1689
1649
|
refreshFeSession,
|
|
1690
1650
|
getAccount,
|
|
1691
1651
|
accountSonsent,
|
|
1692
|
-
isDiyH5
|
|
1693
|
-
firstRtcList,
|
|
1652
|
+
isDiyH5,
|
|
1694
1653
|
pixelPvStatusRef
|
|
1695
1654
|
} }, 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({
|
|
1696
1655
|
rtcList,
|
|
@@ -2152,14 +2111,14 @@ var settingRender$f = [
|
|
|
2152
2111
|
* @Author: binruan@chatlabs.com
|
|
2153
2112
|
* @Date: 2024-03-12 10:59:06
|
|
2154
2113
|
* @LastEditors: binruan@chatlabs.com
|
|
2155
|
-
* @LastEditTime:
|
|
2114
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
|
2156
2115
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
|
2157
2116
|
*
|
|
2158
2117
|
*/
|
|
2159
2118
|
function useEventReport() {
|
|
2160
2119
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
|
2161
2120
|
const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
|
|
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
|
|
2121
|
+
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;
|
|
2163
2122
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
|
2164
2123
|
if (i !== -1) {
|
|
2165
2124
|
return;
|
|
@@ -2192,11 +2151,11 @@ function useEventReport() {
|
|
|
2192
2151
|
contentFormat = 'image';
|
|
2193
2152
|
}
|
|
2194
2153
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
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 : '',
|
|
2154
|
+
eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
|
|
2196
2155
|
});
|
|
2197
2156
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
|
2198
2157
|
const productView = useCallback((data, product, cta, viewTime, position) => {
|
|
2199
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
|
2158
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2200
2159
|
let fromKName = '';
|
|
2201
2160
|
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))) {
|
|
2202
2161
|
fromKName = 'pdpPage';
|
|
@@ -2215,9 +2174,8 @@ function useEventReport() {
|
|
|
2215
2174
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
|
2216
2175
|
position: position + '',
|
|
2217
2176
|
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 : '',
|
|
2219
2177
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
|
2220
|
-
traceInfo: (
|
|
2178
|
+
traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
|
2221
2179
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
|
2222
2180
|
eventSubject: 'productView',
|
|
2223
2181
|
eventDescription: 'User browsed the product'
|
|
@@ -16261,7 +16219,7 @@ function WaterfallList(_a) {
|
|
|
16261
16219
|
* @Author: binruan@chatlabs.com
|
|
16262
16220
|
* @Date: 2024-01-10 10:58:24
|
|
16263
16221
|
* @LastEditors: binruan@chatlabs.com
|
|
16264
|
-
* @LastEditTime: 2025-
|
|
16222
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
|
16265
16223
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
|
16266
16224
|
*
|
|
16267
16225
|
*/
|
|
@@ -16299,7 +16257,7 @@ const WaterFall = (props) => {
|
|
|
16299
16257
|
}
|
|
16300
16258
|
}, [waterFallData]);
|
|
16301
16259
|
const reportTagsView = useCallback(() => {
|
|
16302
|
-
var _a, _b, _c, _d, _e, _f
|
|
16260
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16303
16261
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
|
16304
16262
|
if (!rec)
|
|
16305
16263
|
return;
|
|
@@ -16319,10 +16277,9 @@ const WaterFall = (props) => {
|
|
|
16319
16277
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
16320
16278
|
eventInfo: {
|
|
16321
16279
|
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 : '',
|
|
16323
16280
|
position: cacheActiveIndex + '',
|
|
16324
|
-
contentTags: JSON.stringify((
|
|
16325
|
-
traceInfo: (
|
|
16281
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
|
16282
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
|
16326
16283
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
|
16327
16284
|
fromKName,
|
|
16328
16285
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
@@ -18429,22 +18386,21 @@ const LikeButton = (_a) => {
|
|
|
18429
18386
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
|
18430
18387
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
|
18431
18388
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
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
|
|
18389
|
+
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;
|
|
18433
18390
|
if (state) {
|
|
18434
18391
|
// 先设置状态
|
|
18435
18392
|
setState(false);
|
|
18436
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
|
18393
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
|
18437
18394
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18438
18395
|
eventInfo: {
|
|
18439
18396
|
eventSubject: 'favoriteContentCanceled',
|
|
18440
18397
|
eventDescription: 'This content was unfavorite by the user',
|
|
18441
18398
|
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 : '',
|
|
18442
|
-
|
|
18443
|
-
|
|
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 : []),
|
|
18399
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
|
18400
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
|
18445
18401
|
position: position + '',
|
|
18446
|
-
contentFormat: ((
|
|
18447
|
-
traceInfo: (
|
|
18402
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
|
18403
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
18448
18404
|
}
|
|
18449
18405
|
});
|
|
18450
18406
|
// 如果接口调用失败,则回滚状态
|
|
@@ -18452,49 +18408,48 @@ const LikeButton = (_a) => {
|
|
|
18452
18408
|
setState(true);
|
|
18453
18409
|
}
|
|
18454
18410
|
else {
|
|
18455
|
-
const nRtcList = (
|
|
18411
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18456
18412
|
if (index === position) {
|
|
18457
18413
|
item.isCollected = false;
|
|
18458
18414
|
}
|
|
18459
18415
|
return item;
|
|
18460
|
-
})) !== null &&
|
|
18416
|
+
})) !== null && _p !== void 0 ? _p : [];
|
|
18461
18417
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18462
18418
|
}
|
|
18463
18419
|
}
|
|
18464
18420
|
else {
|
|
18465
18421
|
setState(true);
|
|
18466
|
-
const result = (
|
|
18422
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
|
18467
18423
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18468
18424
|
eventInfo: {
|
|
18469
18425
|
eventSubject: 'favoriteContent',
|
|
18470
18426
|
eventDescription: 'This content was favorite by the user',
|
|
18471
|
-
contentId: (
|
|
18472
|
-
|
|
18473
|
-
|
|
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 : []),
|
|
18427
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
|
18428
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
|
18429
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
|
18475
18430
|
position: position + '',
|
|
18476
|
-
contentFormat: ((
|
|
18477
|
-
traceInfo: (
|
|
18431
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
|
18432
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
|
18478
18433
|
}
|
|
18479
18434
|
});
|
|
18480
18435
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
18481
18436
|
eventName: 'Engagement',
|
|
18482
|
-
product: (
|
|
18437
|
+
product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
|
|
18483
18438
|
rec: recData,
|
|
18484
18439
|
position,
|
|
18485
|
-
content_id: (
|
|
18440
|
+
content_id: (_1 = (_0 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '',
|
|
18486
18441
|
engagement_type: 'like'
|
|
18487
18442
|
});
|
|
18488
18443
|
if (!result) {
|
|
18489
18444
|
setState(false);
|
|
18490
18445
|
}
|
|
18491
18446
|
else {
|
|
18492
|
-
const nRtcList = (
|
|
18447
|
+
const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18493
18448
|
if (index === position) {
|
|
18494
18449
|
item.isCollected = true;
|
|
18495
18450
|
}
|
|
18496
18451
|
return item;
|
|
18497
|
-
})) !== null &&
|
|
18452
|
+
})) !== null && _2 !== void 0 ? _2 : [];
|
|
18498
18453
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18499
18454
|
}
|
|
18500
18455
|
}
|
|
@@ -18531,7 +18486,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
|
18531
18486
|
const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
|
|
18532
18487
|
var _a, _b;
|
|
18533
18488
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
|
18534
|
-
const { bffEventReport, sxpParameter,
|
|
18489
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
|
18535
18490
|
const videoStartTime = useRef(0);
|
|
18536
18491
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
|
18537
18492
|
const { isActive } = useSwiperSlide();
|
|
@@ -18548,7 +18503,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18548
18503
|
const loopPlayRef = useRef(loopPlay);
|
|
18549
18504
|
const scene = rec.video.scene;
|
|
18550
18505
|
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);
|
|
18551
|
-
const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
|
18506
|
+
const videoCover = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) ? scene === null || scene === void 0 ? void 0 : scene.cover : (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
|
18552
18507
|
const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
|
|
18553
18508
|
useImperativeHandle(ref, () => {
|
|
18554
18509
|
return {
|
|
@@ -18597,23 +18552,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18597
18552
|
return;
|
|
18598
18553
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18599
18554
|
}, [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
|
-
};
|
|
18617
18555
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
18618
18556
|
const handlePlaying = useCallback(() => {
|
|
18619
18557
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
@@ -18622,7 +18560,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18622
18560
|
setIsLoadFinish(true);
|
|
18623
18561
|
}, []);
|
|
18624
18562
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18625
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
18563
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18626
18564
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18627
18565
|
return;
|
|
18628
18566
|
setIsPauseVideo(false);
|
|
@@ -18633,11 +18571,16 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18633
18571
|
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);
|
|
18634
18572
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
|
18635
18573
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
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 : '',
|
|
18574
|
+
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', contentName: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []), position: index + '', contentFormat: 'video', traceInfo: (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
|
|
18637
18575
|
});
|
|
18638
18576
|
isFirstPlayRef.current = false;
|
|
18639
18577
|
}
|
|
18640
18578
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18579
|
+
const setCurrentTimeByStartTime = useCallback(() => {
|
|
18580
|
+
if (isDiyH5) {
|
|
18581
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18582
|
+
}
|
|
18583
|
+
}, []);
|
|
18641
18584
|
const handLoadeddata = useCallback(() => {
|
|
18642
18585
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
|
18643
18586
|
return;
|
|
@@ -18662,12 +18605,13 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18662
18605
|
const handleLoadedmetadata = useCallback(() => {
|
|
18663
18606
|
if (!videoRef.current)
|
|
18664
18607
|
return;
|
|
18608
|
+
setCurrentTimeByStartTime();
|
|
18665
18609
|
loadedTimeRef.current = new Date();
|
|
18666
18610
|
handleStartPlay();
|
|
18667
18611
|
handLoadeddata();
|
|
18668
18612
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
|
18669
18613
|
const handleClickVideo = useCallback((type) => () => {
|
|
18670
|
-
var _a, _b, _c, _d, _e;
|
|
18614
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18671
18615
|
if (!videoRef.current)
|
|
18672
18616
|
return;
|
|
18673
18617
|
if (!isLoadFinish)
|
|
@@ -18688,17 +18632,20 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18688
18632
|
break;
|
|
18689
18633
|
default:
|
|
18690
18634
|
if (isPause) {
|
|
18691
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
|
18635
|
+
if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
|
|
18636
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18637
|
+
}
|
|
18638
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
|
18692
18639
|
}
|
|
18693
18640
|
else {
|
|
18694
|
-
(
|
|
18641
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
|
18695
18642
|
}
|
|
18696
18643
|
setIsPauseVideo(!isPause);
|
|
18697
18644
|
break;
|
|
18698
18645
|
}
|
|
18699
18646
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18700
18647
|
const handlePause = useCallback(() => {
|
|
18701
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
18648
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
18702
18649
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18703
18650
|
return;
|
|
18704
18651
|
if (activeIndex !== index)
|
|
@@ -18714,15 +18661,14 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18714
18661
|
eventSubject: 'playOverVideo',
|
|
18715
18662
|
eventDescription: 'User finished playing the video',
|
|
18716
18663
|
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 : '',
|
|
18717
|
-
|
|
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 : '',
|
|
18664
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
|
18719
18665
|
endTime: videoCurrentTime,
|
|
18720
18666
|
videoDuration,
|
|
18721
18667
|
playDuration,
|
|
18722
|
-
contentTags: JSON.stringify((
|
|
18668
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
|
18723
18669
|
position: index + '',
|
|
18724
18670
|
contentFormat: 'video',
|
|
18725
|
-
traceInfo: (
|
|
18671
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
18726
18672
|
}
|
|
18727
18673
|
});
|
|
18728
18674
|
}
|
|
@@ -18730,8 +18676,27 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18730
18676
|
const handleWaiting = useCallback(() => {
|
|
18731
18677
|
setWaiting(true);
|
|
18732
18678
|
}, []);
|
|
18679
|
+
const handleTimeUpload = () => {
|
|
18680
|
+
if (!videoRef.current || !isDiyH5)
|
|
18681
|
+
return;
|
|
18682
|
+
setTimeout(() => {
|
|
18683
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18684
|
+
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)) {
|
|
18685
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
|
18686
|
+
if (!loopPlayRef.current)
|
|
18687
|
+
return;
|
|
18688
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
|
18689
|
+
(_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);
|
|
18690
|
+
}
|
|
18691
|
+
else {
|
|
18692
|
+
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;
|
|
18693
|
+
(_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);
|
|
18694
|
+
}
|
|
18695
|
+
}
|
|
18696
|
+
});
|
|
18697
|
+
};
|
|
18733
18698
|
useEffect(() => {
|
|
18734
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18699
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
18735
18700
|
if (!isActive)
|
|
18736
18701
|
return;
|
|
18737
18702
|
const videoSrc = videoUrl;
|
|
@@ -18752,6 +18717,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18752
18717
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
|
18753
18718
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
18754
18719
|
var _a;
|
|
18720
|
+
setCurrentTimeByStartTime();
|
|
18755
18721
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18756
18722
|
});
|
|
18757
18723
|
}
|
|
@@ -18765,11 +18731,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18765
18731
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
|
18766
18732
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
|
18767
18733
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
|
18768
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
|
18734
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
|
18769
18735
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
|
18770
18736
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
|
18737
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
|
18771
18738
|
return () => {
|
|
18772
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18739
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
18773
18740
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
|
18774
18741
|
if (!isPause)
|
|
18775
18742
|
handlePause();
|
|
@@ -18781,9 +18748,10 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
|
|
|
18781
18748
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
|
18782
18749
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
|
18783
18750
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
|
18784
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
|
18751
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
|
18785
18752
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
|
18786
18753
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
|
18754
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
|
18787
18755
|
};
|
|
18788
18756
|
}, [isActive]);
|
|
18789
18757
|
useEffect(() => {
|
|
@@ -18998,45 +18966,19 @@ const Picture = (props) => {
|
|
|
18998
18966
|
}, onLoad: onShowFirstImage }))));
|
|
18999
18967
|
};
|
|
19000
18968
|
|
|
19001
|
-
const PictureGroup$4 =
|
|
18969
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
|
19002
18970
|
var _a, _b;
|
|
19003
18971
|
const { isActive } = useSwiperSlide();
|
|
19004
|
-
const {
|
|
18972
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
|
19005
18973
|
const [isLoad, setIsLoad] = useState(false);
|
|
19006
18974
|
const [imgInfo, setImgInfo] = useState();
|
|
19007
18975
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
|
19008
|
-
const
|
|
18976
|
+
const swiperRef = useRef();
|
|
19009
18977
|
const isFirstPlayRef = useRef(true);
|
|
19010
|
-
const loopPlayRef = useRef(true);
|
|
19011
18978
|
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]);
|
|
19037
18979
|
useEffect(() => {
|
|
19038
18980
|
if (isLoad && isActive) {
|
|
19039
|
-
(
|
|
18981
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
|
19040
18982
|
if (openHashtag) {
|
|
19041
18983
|
onViewImageEndEvent(rec);
|
|
19042
18984
|
}
|
|
@@ -19046,7 +18988,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
|
19046
18988
|
}
|
|
19047
18989
|
}
|
|
19048
18990
|
else {
|
|
19049
|
-
(
|
|
18991
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
|
19050
18992
|
}
|
|
19051
18993
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
|
19052
18994
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19073,13 +19015,13 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
|
19073
19015
|
};
|
|
19074
19016
|
}, [isActive, imgInfo]);
|
|
19075
19017
|
const handleMouseEnter = useCallback(() => {
|
|
19076
|
-
if (
|
|
19077
|
-
|
|
19018
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
|
19019
|
+
swiperRef.current.swiper.autoplay.stop();
|
|
19078
19020
|
}
|
|
19079
19021
|
}, []);
|
|
19080
19022
|
const handleMouseLeave = useCallback(() => {
|
|
19081
|
-
if (
|
|
19082
|
-
|
|
19023
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
|
19024
|
+
swiperRef.current.swiper.autoplay.start();
|
|
19083
19025
|
}
|
|
19084
19026
|
}, []);
|
|
19085
19027
|
const handleSlideChange = useCallback((swiper) => {
|
|
@@ -19100,7 +19042,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
|
19100
19042
|
enabled: true
|
|
19101
19043
|
}
|
|
19102
19044
|
}
|
|
19103
|
-
: {}), { loop: true, ref:
|
|
19045
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
|
19104
19046
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
|
19105
19047
|
fontSize: '14px'
|
|
19106
19048
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
|
@@ -19117,7 +19059,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
|
|
|
19117
19059
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
|
19118
19060
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
|
19119
19061
|
}))));
|
|
19120
|
-
}
|
|
19062
|
+
};
|
|
19121
19063
|
var PictureGroup$5 = memo(PictureGroup$4);
|
|
19122
19064
|
|
|
19123
19065
|
/*
|
|
@@ -19409,7 +19351,7 @@ var NavBack$1 = memo(NavBack);
|
|
|
19409
19351
|
* @Author: binruan@chatlabs.com
|
|
19410
19352
|
* @Date: 2024-03-20 10:27:31
|
|
19411
19353
|
* @LastEditors: binruan@chatlabs.com
|
|
19412
|
-
* @LastEditTime: 2025-05-
|
|
19354
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
|
19413
19355
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
|
19414
19356
|
*
|
|
19415
19357
|
*/
|
|
@@ -19430,7 +19372,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19430
19372
|
const [pageNum, setPageNum] = useState(2);
|
|
19431
19373
|
useState(false);
|
|
19432
19374
|
const videoWidgetRef = useRef(null);
|
|
19433
|
-
const pictureGroupRef = useRef(null);
|
|
19434
19375
|
const fbcRef = useRef('');
|
|
19435
19376
|
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();
|
|
19436
19377
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
@@ -19480,7 +19421,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19480
19421
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
|
19481
19422
|
}, [data, ctaType, swiperRef]);
|
|
19482
19423
|
const handleSessionCompleted = useCallback((fk) => {
|
|
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
|
|
19424
|
+
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;
|
|
19484
19425
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
19485
19426
|
let fromKName = '';
|
|
19486
19427
|
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))) {
|
|
@@ -19507,23 +19448,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19507
19448
|
eventSubject: 'sessionCompleted',
|
|
19508
19449
|
eventDescription: 'Session completed',
|
|
19509
19450
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
|
19510
|
-
|
|
19511
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
|
19451
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
|
19512
19452
|
position: activeIndex + '',
|
|
19513
19453
|
fromKName: fk || fromKName,
|
|
19514
19454
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
19515
|
-
ctatId: (
|
|
19516
|
-
traceInfo: (
|
|
19455
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
|
19456
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
|
19517
19457
|
}
|
|
19518
19458
|
});
|
|
19519
|
-
const isPostType = ((
|
|
19459
|
+
const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
|
|
19520
19460
|
if (!popupDetailData) {
|
|
19521
19461
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19522
19462
|
eventName: 'ExitFeed',
|
|
19523
|
-
product: isPostType ? (
|
|
19463
|
+
product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
|
|
19524
19464
|
rec: item,
|
|
19525
19465
|
position: activeIndex,
|
|
19526
|
-
content_id: isPostType ? (
|
|
19466
|
+
content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
|
|
19527
19467
|
view_time: new Date() - viewTime.current
|
|
19528
19468
|
});
|
|
19529
19469
|
}
|
|
@@ -19583,9 +19523,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19583
19523
|
refreshFeSession
|
|
19584
19524
|
]);
|
|
19585
19525
|
const handleSessionExpire = useCallback(debounce(() => {
|
|
19586
|
-
var _a
|
|
19526
|
+
var _a;
|
|
19587
19527
|
(_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);
|
|
19589
19528
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
|
19590
19529
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
|
19591
19530
|
useEffect(() => {
|
|
@@ -19656,18 +19595,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19656
19595
|
return null;
|
|
19657
19596
|
}, [globalConfig, activeIndex, visList]);
|
|
19658
19597
|
const renderContent = useCallback((rec, index) => {
|
|
19659
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
19598
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19660
19599
|
if (rec === 'organic menu') {
|
|
19661
19600
|
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)));
|
|
19662
19601
|
}
|
|
19663
|
-
if ((
|
|
19602
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
|
19664
19603
|
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 })));
|
|
19665
19604
|
}
|
|
19666
|
-
if ((
|
|
19667
|
-
return (React.createElement(PictureGroup$5,
|
|
19605
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
|
19606
|
+
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 }));
|
|
19668
19607
|
}
|
|
19669
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
|
19670
|
-
return (
|
|
19608
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
|
19609
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
|
19671
19610
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19672
19611
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
|
19673
19612
|
const Component = withBindDataSource(t);
|
|
@@ -19706,7 +19645,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19706
19645
|
};
|
|
19707
19646
|
}, [isShowMore]);
|
|
19708
19647
|
const renderBottom = useCallback((rec, index) => {
|
|
19709
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
19648
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
19710
19649
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
|
19711
19650
|
let cta = null;
|
|
19712
19651
|
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) {
|
|
@@ -19715,27 +19654,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19715
19654
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
|
19716
19655
|
cta = '商品CTA';
|
|
19717
19656
|
}
|
|
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
|
-
}
|
|
19721
19657
|
else {
|
|
19722
|
-
cta = (
|
|
19658
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
|
19723
19659
|
}
|
|
19724
19660
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
|
19725
19661
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
|
19726
19662
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
|
|
19727
|
-
((
|
|
19663
|
+
((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
|
|
19728
19664
|
return (React.createElement(React.Fragment, null,
|
|
19729
19665
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
|
19730
|
-
((
|
|
19731
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
|
19666
|
+
((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
|
19667
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
|
19732
19668
|
React.createElement(Nudge, { nudge: nudge }),
|
|
19733
19669
|
((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' },
|
|
19734
19670
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
19735
19671
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
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: (
|
|
19672
|
+
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
|
19737
19673
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
19738
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
|
19674
|
+
React.createElement(Hashtag$1, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
|
19739
19675
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
|
19740
19676
|
}
|
|
19741
19677
|
return null;
|
|
@@ -19777,7 +19713,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19777
19713
|
return null;
|
|
19778
19714
|
}, [globalConfig, waterFallData, bottomHeight]);
|
|
19779
19715
|
const handleViewImageStartEnd = (item) => {
|
|
19780
|
-
var _a, _b, _c, _d, _e, _f
|
|
19716
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19781
19717
|
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)) {
|
|
19782
19718
|
const endTime = Date.now();
|
|
19783
19719
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
|
@@ -19786,11 +19722,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19786
19722
|
eventSubject: 'viewImageCarouselEnd',
|
|
19787
19723
|
eventDescription: 'User end view the image carousel',
|
|
19788
19724
|
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 : '',
|
|
19789
|
-
|
|
19790
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19725
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
|
19791
19726
|
imageEndTime: `${endTime}`,
|
|
19792
19727
|
playDuration: `${duration}`,
|
|
19793
|
-
contentTags: JSON.stringify((
|
|
19728
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
|
19794
19729
|
position: activeIndex + '',
|
|
19795
19730
|
contentFormat: 'image',
|
|
19796
19731
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
|
@@ -19799,7 +19734,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19799
19734
|
}
|
|
19800
19735
|
};
|
|
19801
19736
|
const handleSlideSkip = (item, position) => {
|
|
19802
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
19737
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
19803
19738
|
if (isPreview || waterFallData)
|
|
19804
19739
|
return;
|
|
19805
19740
|
const t = new Date() - curTime.current;
|
|
@@ -19825,8 +19760,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19825
19760
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
|
19826
19761
|
position: position + '',
|
|
19827
19762
|
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 : '',
|
|
19828
|
-
|
|
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 : '',
|
|
19763
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
|
19830
19764
|
contentFormat
|
|
19831
19765
|
}
|
|
19832
19766
|
});
|
|
@@ -19836,7 +19770,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19836
19770
|
}
|
|
19837
19771
|
};
|
|
19838
19772
|
const handleScrollEvent = (swiper) => {
|
|
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
|
|
19773
|
+
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;
|
|
19840
19774
|
const item = data[swiper.previousIndex];
|
|
19841
19775
|
const activeItem = data[swiper.activeIndex];
|
|
19842
19776
|
if (!item)
|
|
@@ -19869,12 +19803,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19869
19803
|
eventSubject: 'scrollDown',
|
|
19870
19804
|
eventDescription: 'User scroll down',
|
|
19871
19805
|
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 : '',
|
|
19872
|
-
|
|
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 : '',
|
|
19806
|
+
productId: (_w = (_v = item === null || item === void 0 ? void 0 : item.product) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
|
|
19874
19807
|
requestId: null,
|
|
19875
|
-
traceInfo: (
|
|
19808
|
+
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 : '',
|
|
19876
19809
|
contentFormat,
|
|
19877
|
-
position: ((
|
|
19810
|
+
position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
|
|
19878
19811
|
}
|
|
19879
19812
|
});
|
|
19880
19813
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19887,13 +19820,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19887
19820
|
eventInfo: {
|
|
19888
19821
|
eventSubject: 'scrollUp',
|
|
19889
19822
|
eventDescription: 'User scroll up',
|
|
19890
|
-
contentId: (
|
|
19891
|
-
|
|
19892
|
-
productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
|
|
19823
|
+
contentId: (_3 = (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
|
|
19824
|
+
productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
|
|
19893
19825
|
requestId: null,
|
|
19894
|
-
traceInfo: (
|
|
19826
|
+
traceInfo: (_9 = (_7 = (_6 = item === null || item === void 0 ? void 0 : item.video) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_8 = item === null || item === void 0 ? void 0 : item.product) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : '',
|
|
19895
19827
|
contentFormat,
|
|
19896
|
-
position: ((
|
|
19828
|
+
position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
|
|
19897
19829
|
}
|
|
19898
19830
|
});
|
|
19899
19831
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19993,7 +19925,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19993
19925
|
};
|
|
19994
19926
|
}, [globalConfig, bffEventReport, data, activeIndex]);
|
|
19995
19927
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
|
19996
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
19928
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19997
19929
|
const item = data[activeIndex];
|
|
19998
19930
|
// 如果是图片集则上报事件
|
|
19999
19931
|
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)) {
|
|
@@ -20004,10 +19936,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20004
19936
|
eventSubject: 'viewImageCarouselStart',
|
|
20005
19937
|
eventDescription: 'User start view the image carousel',
|
|
20006
19938
|
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 : '',
|
|
20007
|
-
|
|
20008
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19939
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
|
20009
19940
|
imageStartTime: `${startTime}`,
|
|
20010
|
-
contentTags: JSON.stringify((
|
|
19941
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
|
20011
19942
|
position: activeIndex + '',
|
|
20012
19943
|
contentFormat: 'image',
|
|
20013
19944
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
|
@@ -20017,13 +19948,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20017
19948
|
if (enableCapi) {
|
|
20018
19949
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
20019
19950
|
eventName: 'ViewContent',
|
|
20020
|
-
product: (
|
|
19951
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
|
|
20021
19952
|
rec: item,
|
|
20022
19953
|
position: activeIndex
|
|
20023
19954
|
});
|
|
20024
19955
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
20025
19956
|
eventName: 'PageView',
|
|
20026
|
-
product: (
|
|
19957
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
|
|
20027
19958
|
rec: item,
|
|
20028
19959
|
position: activeIndex
|
|
20029
19960
|
});
|
|
@@ -20121,20 +20052,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20121
20052
|
swiperRef.current.swiper.allowTouchMove = true;
|
|
20122
20053
|
}, 500);
|
|
20123
20054
|
}, onActiveIndexChange: (swiper) => {
|
|
20124
|
-
var _a, _b;
|
|
20125
20055
|
setActiveIndex(swiper.activeIndex);
|
|
20126
20056
|
if (openHashtag)
|
|
20127
20057
|
return;
|
|
20128
20058
|
// 处理上滑下滑事件
|
|
20129
20059
|
handleScrollEvent(swiper);
|
|
20130
|
-
if (waterFallData || isEditor)
|
|
20060
|
+
if (waterFallData || isEditor || isDiyH5)
|
|
20131
20061
|
return;
|
|
20132
20062
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
|
20133
20063
|
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
|
-
}
|
|
20138
20064
|
setIsLoadMore(true);
|
|
20139
20065
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
|
20140
20066
|
var _a;
|
|
@@ -20207,7 +20133,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20207
20133
|
}, []);
|
|
20208
20134
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
20209
20135
|
const handlePlaying = useCallback(() => {
|
|
20210
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
20136
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20211
20137
|
setIsPauseVideo(false);
|
|
20212
20138
|
const item = data[index];
|
|
20213
20139
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
|
@@ -20220,15 +20146,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20220
20146
|
eventSubject: 'playVideo',
|
|
20221
20147
|
eventDescription: 'User played the video',
|
|
20222
20148
|
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 : '',
|
|
20223
|
-
|
|
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 : '',
|
|
20149
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
|
20225
20150
|
playType,
|
|
20226
20151
|
startTime: videoCurrentTime,
|
|
20227
20152
|
videoDuration,
|
|
20228
|
-
contentTags: JSON.stringify((
|
|
20153
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
|
20229
20154
|
position: index + '',
|
|
20230
20155
|
contentFormat: 'video',
|
|
20231
|
-
traceInfo: (
|
|
20156
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
20232
20157
|
}
|
|
20233
20158
|
});
|
|
20234
20159
|
setIsFirstPlay(false);
|
|
@@ -20267,7 +20192,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20267
20192
|
}
|
|
20268
20193
|
}, [isLoadFinish]);
|
|
20269
20194
|
const onPause = useCallback(() => {
|
|
20270
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
20195
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20271
20196
|
const item = data[index];
|
|
20272
20197
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
|
20273
20198
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
|
@@ -20278,15 +20203,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20278
20203
|
eventSubject: 'playOverVideo',
|
|
20279
20204
|
eventDescription: 'User finished playing the video',
|
|
20280
20205
|
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 : '',
|
|
20281
|
-
|
|
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 : '',
|
|
20206
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
|
20283
20207
|
endTime: videoCurrentTime,
|
|
20284
20208
|
videoDuration,
|
|
20285
20209
|
playDuration,
|
|
20286
|
-
contentTags: JSON.stringify((
|
|
20210
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
|
20287
20211
|
position: index + '',
|
|
20288
20212
|
contentFormat: 'video',
|
|
20289
|
-
traceInfo: (
|
|
20213
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
20290
20214
|
}
|
|
20291
20215
|
});
|
|
20292
20216
|
}
|