pb-sxp-ui 1.20.11 → 1.20.13
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 +177 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +177 -252
- 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 +177 -252
- 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 +43 -85
- 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 +43 -85
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -667,7 +667,6 @@ const DEFAULT_TAG = 'FOR U';
|
|
|
667
667
|
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 }) => {
|
|
668
668
|
var _a, _b, _c, _d, _e;
|
|
669
669
|
const [rtcList, setRtcList] = React.useState([]);
|
|
670
|
-
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
|
671
670
|
const [tagList, setTagList] = React.useState([]);
|
|
672
671
|
const [loading, setLoading] = React.useState(true);
|
|
673
672
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
|
@@ -699,10 +698,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
699
698
|
const [chatlabsId, setChatlabsId] = React.useState();
|
|
700
699
|
const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
|
701
700
|
const pixelPvStatusRef = React.useRef(false);
|
|
702
|
-
const isDiyPage = React.useMemo(() => {
|
|
703
|
-
var _a, _b, _c;
|
|
704
|
-
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);
|
|
705
|
-
}, [isDiyH5, finalPageData]);
|
|
706
701
|
React.useEffect(() => {
|
|
707
702
|
var _a, _b;
|
|
708
703
|
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);
|
|
@@ -808,7 +803,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
808
803
|
};
|
|
809
804
|
// bff API 请求方法
|
|
810
805
|
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
|
811
|
-
var _a
|
|
806
|
+
var _a;
|
|
812
807
|
if (!bffDataSource)
|
|
813
808
|
return;
|
|
814
809
|
const url = bffDataSource.url;
|
|
@@ -821,9 +816,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
821
816
|
val.split('=')[0];
|
|
822
817
|
val.split('=')[1];
|
|
823
818
|
});
|
|
824
|
-
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
|
825
819
|
return window
|
|
826
|
-
.fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId
|
|
820
|
+
.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
|
|
827
821
|
? JSON.stringify({
|
|
828
822
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
|
829
823
|
})
|
|
@@ -1108,8 +1102,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1108
1102
|
}, [bffDataSource]);
|
|
1109
1103
|
// 获取推荐视频数据
|
|
1110
1104
|
const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1111
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
1112
|
-
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 })), (
|
|
1105
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1106
|
+
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' }));
|
|
1113
1107
|
if (channel) {
|
|
1114
1108
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
|
1115
1109
|
}
|
|
@@ -1122,10 +1116,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1122
1116
|
if (val)
|
|
1123
1117
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
|
1124
1118
|
}
|
|
1125
|
-
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);
|
|
1126
1119
|
if (isEditor) {
|
|
1127
1120
|
let pageNum = 1;
|
|
1128
|
-
query = Object.assign(Object.assign(Object.assign(
|
|
1121
|
+
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] }));
|
|
1129
1122
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
|
1130
1123
|
return undefined;
|
|
1131
1124
|
}
|
|
@@ -1133,24 +1126,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1133
1126
|
let list = [];
|
|
1134
1127
|
let result = null;
|
|
1135
1128
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1136
|
-
var
|
|
1129
|
+
var _v, _w, _x, _y, _z, _0;
|
|
1137
1130
|
query.pageNum = pageNum;
|
|
1138
|
-
result =
|
|
1139
|
-
? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
|
|
1140
|
-
: yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('recommend/direct_page', { method: 'POST', body: query }));
|
|
1131
|
+
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
|
1141
1132
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1142
1133
|
return undefined;
|
|
1143
1134
|
}
|
|
1144
1135
|
setLoading(false);
|
|
1145
|
-
list = list.concat((
|
|
1136
|
+
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 : []);
|
|
1146
1137
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
|
1147
1138
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1148
1139
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1149
|
-
if (isDiyPage) {
|
|
1150
|
-
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1151
|
-
}
|
|
1152
1140
|
}
|
|
1153
|
-
const isNotNullList = (
|
|
1141
|
+
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));
|
|
1154
1142
|
if (isNotNullList) {
|
|
1155
1143
|
pageNum = pageNum + 1;
|
|
1156
1144
|
yield recurveRecList(query);
|
|
@@ -1158,61 +1146,42 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1158
1146
|
});
|
|
1159
1147
|
yield recurveRecList(query);
|
|
1160
1148
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
|
1161
|
-
setCurReqInfo({ rtc: (
|
|
1149
|
+
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 });
|
|
1162
1150
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
|
1163
1151
|
}
|
|
1164
1152
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
|
1165
|
-
query = Object.assign(Object.assign(
|
|
1153
|
+
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 });
|
|
1166
1154
|
}
|
|
1167
|
-
const result =
|
|
1168
|
-
|
|
1169
|
-
:
|
|
1170
|
-
|
|
1171
|
-
body: query
|
|
1172
|
-
}));
|
|
1155
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
|
1156
|
+
method: 'POST',
|
|
1157
|
+
body: query
|
|
1158
|
+
}));
|
|
1173
1159
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1174
1160
|
return undefined;
|
|
1175
1161
|
}
|
|
1176
1162
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
|
1177
1163
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
|
1178
1164
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
|
1179
|
-
const isNotNullList = (
|
|
1165
|
+
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));
|
|
1180
1166
|
if (!isNotNullList) {
|
|
1181
1167
|
setIsNoMoreData(true);
|
|
1182
1168
|
}
|
|
1183
1169
|
}
|
|
1184
1170
|
let list = [];
|
|
1185
|
-
list = list.concat((
|
|
1171
|
+
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 : []);
|
|
1186
1172
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
|
1187
|
-
}), [
|
|
1188
|
-
bffFetch,
|
|
1189
|
-
utmVal,
|
|
1190
|
-
maxSize,
|
|
1191
|
-
defaultSize,
|
|
1192
|
-
channelQueryList,
|
|
1193
|
-
channel,
|
|
1194
|
-
chatlabsId,
|
|
1195
|
-
bffFetchAdmin,
|
|
1196
|
-
isDiyPage,
|
|
1197
|
-
finalPageData,
|
|
1198
|
-
isDiyH5
|
|
1199
|
-
]);
|
|
1173
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
|
1200
1174
|
const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1201
|
-
var
|
|
1175
|
+
var _1, _2, _3, _4;
|
|
1202
1176
|
if (rtcList.length <= 0) {
|
|
1203
1177
|
return;
|
|
1204
1178
|
}
|
|
1205
|
-
if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
|
1206
|
-
setRtcList(rtcList.concat(firstRtcList));
|
|
1207
|
-
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
|
1208
|
-
return;
|
|
1209
|
-
}
|
|
1210
1179
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
|
1211
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
|
1180
|
+
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 })));
|
|
1212
1181
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
|
1213
1182
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
|
1214
1183
|
return data;
|
|
1215
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList
|
|
1184
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
|
1216
1185
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
|
1217
1186
|
var _a, _b, _c, _d, _e;
|
|
1218
1187
|
let expire = false;
|
|
@@ -1243,8 +1212,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1243
1212
|
// 用户信息都是公共的
|
|
1244
1213
|
if (!userInfo) {
|
|
1245
1214
|
userInfo = {
|
|
1246
|
-
|
|
1247
|
-
|
|
1215
|
+
// productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
|
|
1216
|
+
// tpChannelId: 'H5' // 后端处理
|
|
1248
1217
|
};
|
|
1249
1218
|
}
|
|
1250
1219
|
const sessionID = storeAndLoadFeSessionId();
|
|
@@ -1278,8 +1247,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1278
1247
|
layoutVariantId,
|
|
1279
1248
|
globalConfig,
|
|
1280
1249
|
playbookType,
|
|
1281
|
-
bffDataSource
|
|
1282
|
-
fakeUserId
|
|
1250
|
+
bffDataSource
|
|
1283
1251
|
]);
|
|
1284
1252
|
const getEventParamsByJson = React.useCallback((_a) => {
|
|
1285
1253
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -1299,9 +1267,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1299
1267
|
// funnel_type
|
|
1300
1268
|
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,
|
|
1301
1269
|
// content_category
|
|
1302
|
-
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) => ({
|
|
1270
|
+
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) => ({
|
|
1303
1271
|
id: item === null || item === void 0 ? void 0 : item.itemId,
|
|
1304
|
-
|
|
1272
|
+
item_price: item === null || item === void 0 ? void 0 : item.price
|
|
1305
1273
|
}))) !== 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,
|
|
1306
1274
|
// prompt
|
|
1307
1275
|
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);
|
|
@@ -1318,7 +1286,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1318
1286
|
contents: [
|
|
1319
1287
|
{
|
|
1320
1288
|
id: product === null || product === void 0 ? void 0 : product.itemId,
|
|
1321
|
-
|
|
1289
|
+
item_price: product === null || product === void 0 ? void 0 : product.price
|
|
1322
1290
|
}
|
|
1323
1291
|
],
|
|
1324
1292
|
image_urls: (_u = product.homePage) !== null && _u !== void 0 ? _u : []
|
|
@@ -1333,7 +1301,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1333
1301
|
'contents',
|
|
1334
1302
|
'image_urls',
|
|
1335
1303
|
'video_urls',
|
|
1336
|
-
'prompt'
|
|
1304
|
+
'prompt',
|
|
1305
|
+
'value'
|
|
1337
1306
|
];
|
|
1338
1307
|
deleteKeys.forEach((key) => {
|
|
1339
1308
|
if (customData === null || customData === void 0 ? void 0 : customData[key])
|
|
@@ -1465,40 +1434,38 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1465
1434
|
}
|
|
1466
1435
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
|
1467
1436
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1468
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1469
1437
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
|
1470
1438
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1471
|
-
}), [bffFetch
|
|
1439
|
+
}), [bffFetch]);
|
|
1472
1440
|
const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1473
|
-
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1474
1441
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
|
1475
1442
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1476
|
-
}), [bffFetch
|
|
1443
|
+
}), [bffFetch]);
|
|
1477
1444
|
const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1478
1445
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
|
1479
1446
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1480
1447
|
}), [bffFetch]);
|
|
1481
1448
|
// 获取 Tag
|
|
1482
1449
|
const bffGetTagList = React.useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1483
|
-
var
|
|
1484
|
-
const isShowTag = !!((
|
|
1450
|
+
var _5, _6, _7, _8, _9, _10, _11, _12;
|
|
1451
|
+
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);
|
|
1485
1452
|
if (!utmVal || !isShowTag)
|
|
1486
1453
|
return;
|
|
1487
1454
|
try {
|
|
1488
|
-
const val = (
|
|
1455
|
+
const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
|
|
1489
1456
|
var _a, _b;
|
|
1490
1457
|
const key = val.split('=')[0];
|
|
1491
1458
|
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);
|
|
1492
|
-
})) === null ||
|
|
1459
|
+
})) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
|
|
1493
1460
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
|
1494
|
-
setTagList((
|
|
1461
|
+
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 : []);
|
|
1495
1462
|
}
|
|
1496
1463
|
catch (e) {
|
|
1497
1464
|
console.log('e', e);
|
|
1498
1465
|
}
|
|
1499
1466
|
}), [bffFetch, utmVal]);
|
|
1500
1467
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
|
|
1501
|
-
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
|
|
1468
|
+
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;
|
|
1502
1469
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
|
1503
1470
|
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);
|
|
1504
1471
|
let fromKName = '';
|
|
@@ -1516,7 +1483,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1516
1483
|
}
|
|
1517
1484
|
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;
|
|
1518
1485
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
1519
|
-
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 : '',
|
|
1486
|
+
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 })
|
|
1520
1487
|
});
|
|
1521
1488
|
}, [bffEventReport, isFromHashtag]);
|
|
1522
1489
|
const h5EnterLink = React.useCallback(() => {
|
|
@@ -1540,10 +1507,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1540
1507
|
});
|
|
1541
1508
|
}, [bffEventReport]);
|
|
1542
1509
|
const getAccount = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
1543
|
-
var
|
|
1510
|
+
var _13, _14;
|
|
1544
1511
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
|
1545
|
-
setChatlabsId((
|
|
1546
|
-
return ((
|
|
1512
|
+
setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
|
|
1513
|
+
return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
|
|
1547
1514
|
}), [bffFetch]);
|
|
1548
1515
|
const accountSonsent = React.useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1549
1516
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
|
@@ -1607,9 +1574,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1607
1574
|
}
|
|
1608
1575
|
setRtcList(list);
|
|
1609
1576
|
setCacheRtcList(list);
|
|
1610
|
-
if (isDiyPage) {
|
|
1611
|
-
setFirstRtcList(list);
|
|
1612
|
-
}
|
|
1613
1577
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
|
1614
1578
|
if (channel) {
|
|
1615
1579
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
|
@@ -1629,7 +1593,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1629
1593
|
});
|
|
1630
1594
|
setLoading(false);
|
|
1631
1595
|
});
|
|
1632
|
-
}, [isShowConsent, channel
|
|
1596
|
+
}, [isShowConsent, channel]);
|
|
1633
1597
|
// cms预览
|
|
1634
1598
|
React.useEffect(() => {
|
|
1635
1599
|
if (!isPreview)
|
|
@@ -1645,15 +1609,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1645
1609
|
}
|
|
1646
1610
|
setRtcList(list);
|
|
1647
1611
|
setCacheRtcList(list);
|
|
1648
|
-
if (isDiyPage) {
|
|
1649
|
-
setFirstRtcList(list);
|
|
1650
|
-
}
|
|
1651
1612
|
}
|
|
1652
1613
|
})
|
|
1653
1614
|
.finally(() => {
|
|
1654
1615
|
setLoading(false);
|
|
1655
1616
|
});
|
|
1656
|
-
}, [getRecommendVideos, bffGetTagList, channel
|
|
1617
|
+
}, [getRecommendVideos, bffGetTagList, channel]);
|
|
1657
1618
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
|
1658
1619
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
|
1659
1620
|
rtcList,
|
|
@@ -1711,8 +1672,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1711
1672
|
refreshFeSession,
|
|
1712
1673
|
getAccount,
|
|
1713
1674
|
accountSonsent,
|
|
1714
|
-
isDiyH5
|
|
1715
|
-
firstRtcList,
|
|
1675
|
+
isDiyH5,
|
|
1716
1676
|
pixelPvStatusRef
|
|
1717
1677
|
} }, 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({
|
|
1718
1678
|
rtcList,
|
|
@@ -2174,14 +2134,14 @@ var settingRender$f = [
|
|
|
2174
2134
|
* @Author: binruan@chatlabs.com
|
|
2175
2135
|
* @Date: 2024-03-12 10:59:06
|
|
2176
2136
|
* @LastEditors: binruan@chatlabs.com
|
|
2177
|
-
* @LastEditTime:
|
|
2137
|
+
* @LastEditTime: 2024-11-28 11:17:16
|
|
2178
2138
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
|
2179
2139
|
*
|
|
2180
2140
|
*/
|
|
2181
2141
|
function useEventReport() {
|
|
2182
2142
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
|
2183
2143
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
|
2184
|
-
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
|
|
2144
|
+
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;
|
|
2185
2145
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
|
2186
2146
|
if (i !== -1) {
|
|
2187
2147
|
return;
|
|
@@ -2214,11 +2174,11 @@ function useEventReport() {
|
|
|
2214
2174
|
contentFormat = 'image';
|
|
2215
2175
|
}
|
|
2216
2176
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
2217
|
-
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 : '',
|
|
2177
|
+
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 }))
|
|
2218
2178
|
});
|
|
2219
2179
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
|
2220
2180
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
|
2221
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
|
2181
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2222
2182
|
let fromKName = '';
|
|
2223
2183
|
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))) {
|
|
2224
2184
|
fromKName = 'pdpPage';
|
|
@@ -2237,9 +2197,8 @@ function useEventReport() {
|
|
|
2237
2197
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
|
2238
2198
|
position: position + '',
|
|
2239
2199
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
2240
|
-
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 : '',
|
|
2241
2200
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
|
2242
|
-
traceInfo: (
|
|
2201
|
+
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 : '',
|
|
2243
2202
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
|
2244
2203
|
eventSubject: 'productView',
|
|
2245
2204
|
eventDescription: 'User browsed the product'
|
|
@@ -16283,7 +16242,7 @@ function WaterfallList(_a) {
|
|
|
16283
16242
|
* @Author: binruan@chatlabs.com
|
|
16284
16243
|
* @Date: 2024-01-10 10:58:24
|
|
16285
16244
|
* @LastEditors: binruan@chatlabs.com
|
|
16286
|
-
* @LastEditTime: 2025-
|
|
16245
|
+
* @LastEditTime: 2025-02-28 10:00:31
|
|
16287
16246
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
|
16288
16247
|
*
|
|
16289
16248
|
*/
|
|
@@ -16321,7 +16280,7 @@ const WaterFall = (props) => {
|
|
|
16321
16280
|
}
|
|
16322
16281
|
}, [waterFallData]);
|
|
16323
16282
|
const reportTagsView = React.useCallback(() => {
|
|
16324
|
-
var _a, _b, _c, _d, _e, _f
|
|
16283
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16325
16284
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
|
16326
16285
|
if (!rec)
|
|
16327
16286
|
return;
|
|
@@ -16341,10 +16300,9 @@ const WaterFall = (props) => {
|
|
|
16341
16300
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
16342
16301
|
eventInfo: {
|
|
16343
16302
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
16344
|
-
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 : '',
|
|
16345
16303
|
position: cacheActiveIndex + '',
|
|
16346
|
-
contentTags: JSON.stringify((
|
|
16347
|
-
traceInfo: (
|
|
16304
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
|
16305
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
|
16348
16306
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
|
16349
16307
|
fromKName,
|
|
16350
16308
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
@@ -18451,22 +18409,21 @@ const LikeButton = (_a) => {
|
|
|
18451
18409
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
|
18452
18410
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
|
18453
18411
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18454
|
-
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
|
|
18412
|
+
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;
|
|
18455
18413
|
if (state) {
|
|
18456
18414
|
// 先设置状态
|
|
18457
18415
|
setState(false);
|
|
18458
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
|
18416
|
+
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;
|
|
18459
18417
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18460
18418
|
eventInfo: {
|
|
18461
18419
|
eventSubject: 'favoriteContentCanceled',
|
|
18462
18420
|
eventDescription: 'This content was unfavorite by the user',
|
|
18463
18421
|
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 : '',
|
|
18464
|
-
|
|
18465
|
-
|
|
18466
|
-
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 : []),
|
|
18422
|
+
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 : '',
|
|
18423
|
+
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 : []),
|
|
18467
18424
|
position: position + '',
|
|
18468
|
-
contentFormat: ((
|
|
18469
|
-
traceInfo: (
|
|
18425
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
|
18426
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
18470
18427
|
}
|
|
18471
18428
|
});
|
|
18472
18429
|
// 如果接口调用失败,则回滚状态
|
|
@@ -18474,49 +18431,48 @@ const LikeButton = (_a) => {
|
|
|
18474
18431
|
setState(true);
|
|
18475
18432
|
}
|
|
18476
18433
|
else {
|
|
18477
|
-
const nRtcList = (
|
|
18434
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18478
18435
|
if (index === position) {
|
|
18479
18436
|
item.isCollected = false;
|
|
18480
18437
|
}
|
|
18481
18438
|
return item;
|
|
18482
|
-
})) !== null &&
|
|
18439
|
+
})) !== null && _p !== void 0 ? _p : [];
|
|
18483
18440
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18484
18441
|
}
|
|
18485
18442
|
}
|
|
18486
18443
|
else {
|
|
18487
18444
|
setState(true);
|
|
18488
|
-
const result = (
|
|
18445
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
|
18489
18446
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18490
18447
|
eventInfo: {
|
|
18491
18448
|
eventSubject: 'favoriteContent',
|
|
18492
18449
|
eventDescription: 'This content was favorite by the user',
|
|
18493
|
-
contentId: (
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
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 : []),
|
|
18450
|
+
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 : '',
|
|
18451
|
+
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 : '',
|
|
18452
|
+
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 : []),
|
|
18497
18453
|
position: position + '',
|
|
18498
|
-
contentFormat: ((
|
|
18499
|
-
traceInfo: (
|
|
18454
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
|
18455
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
|
18500
18456
|
}
|
|
18501
18457
|
});
|
|
18502
18458
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
18503
18459
|
eventName: 'Engagement',
|
|
18504
|
-
product: (
|
|
18460
|
+
product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
|
|
18505
18461
|
rec: recData,
|
|
18506
18462
|
position,
|
|
18507
|
-
content_id: (
|
|
18463
|
+
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 : '',
|
|
18508
18464
|
engagement_type: 'like'
|
|
18509
18465
|
});
|
|
18510
18466
|
if (!result) {
|
|
18511
18467
|
setState(false);
|
|
18512
18468
|
}
|
|
18513
18469
|
else {
|
|
18514
|
-
const nRtcList = (
|
|
18470
|
+
const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18515
18471
|
if (index === position) {
|
|
18516
18472
|
item.isCollected = true;
|
|
18517
18473
|
}
|
|
18518
18474
|
return item;
|
|
18519
|
-
})) !== null &&
|
|
18475
|
+
})) !== null && _2 !== void 0 ? _2 : [];
|
|
18520
18476
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18521
18477
|
}
|
|
18522
18478
|
}
|
|
@@ -18553,7 +18509,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
|
18553
18509
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
|
|
18554
18510
|
var _a, _b;
|
|
18555
18511
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
|
18556
|
-
const { bffEventReport, sxpParameter,
|
|
18512
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
|
18557
18513
|
const videoStartTime = React.useRef(0);
|
|
18558
18514
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
|
18559
18515
|
const { isActive } = useSwiperSlide();
|
|
@@ -18570,7 +18526,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18570
18526
|
const loopPlayRef = React.useRef(loopPlay);
|
|
18571
18527
|
const scene = rec.video.scene;
|
|
18572
18528
|
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);
|
|
18573
|
-
const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
|
18529
|
+
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;
|
|
18574
18530
|
const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
|
|
18575
18531
|
React.useImperativeHandle(ref, () => {
|
|
18576
18532
|
return {
|
|
@@ -18619,23 +18575,6 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18619
18575
|
return;
|
|
18620
18576
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18621
18577
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18622
|
-
const handleEnd = () => {
|
|
18623
|
-
var _a, _b, _c, _d, _e, _f;
|
|
18624
|
-
if (!videoRef.current)
|
|
18625
|
-
return;
|
|
18626
|
-
if (isDiyH5) {
|
|
18627
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
18628
|
-
if (!loopPlayRef.current)
|
|
18629
|
-
return;
|
|
18630
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
18631
|
-
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;
|
|
18632
|
-
(_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);
|
|
18633
|
-
}
|
|
18634
|
-
}
|
|
18635
|
-
else {
|
|
18636
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
|
18637
|
-
}
|
|
18638
|
-
};
|
|
18639
18578
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
18640
18579
|
const handlePlaying = React.useCallback(() => {
|
|
18641
18580
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
@@ -18644,7 +18583,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18644
18583
|
setIsLoadFinish(true);
|
|
18645
18584
|
}, []);
|
|
18646
18585
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18647
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
18586
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18648
18587
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18649
18588
|
return;
|
|
18650
18589
|
setIsPauseVideo(false);
|
|
@@ -18655,11 +18594,16 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18655
18594
|
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);
|
|
18656
18595
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
|
18657
18596
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18658
|
-
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 : '',
|
|
18597
|
+
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) + '' }))
|
|
18659
18598
|
});
|
|
18660
18599
|
isFirstPlayRef.current = false;
|
|
18661
18600
|
}
|
|
18662
18601
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18602
|
+
const setCurrentTimeByStartTime = React.useCallback(() => {
|
|
18603
|
+
if (isDiyH5) {
|
|
18604
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18605
|
+
}
|
|
18606
|
+
}, []);
|
|
18663
18607
|
const handLoadeddata = React.useCallback(() => {
|
|
18664
18608
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
|
18665
18609
|
return;
|
|
@@ -18684,12 +18628,13 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18684
18628
|
const handleLoadedmetadata = React.useCallback(() => {
|
|
18685
18629
|
if (!videoRef.current)
|
|
18686
18630
|
return;
|
|
18631
|
+
setCurrentTimeByStartTime();
|
|
18687
18632
|
loadedTimeRef.current = new Date();
|
|
18688
18633
|
handleStartPlay();
|
|
18689
18634
|
handLoadeddata();
|
|
18690
18635
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
|
18691
18636
|
const handleClickVideo = React.useCallback((type) => () => {
|
|
18692
|
-
var _a, _b, _c, _d, _e;
|
|
18637
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18693
18638
|
if (!videoRef.current)
|
|
18694
18639
|
return;
|
|
18695
18640
|
if (!isLoadFinish)
|
|
@@ -18710,17 +18655,20 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18710
18655
|
break;
|
|
18711
18656
|
default:
|
|
18712
18657
|
if (isPause) {
|
|
18713
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
|
18658
|
+
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)) {
|
|
18659
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18660
|
+
}
|
|
18661
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
|
18714
18662
|
}
|
|
18715
18663
|
else {
|
|
18716
|
-
(
|
|
18664
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
|
18717
18665
|
}
|
|
18718
18666
|
setIsPauseVideo(!isPause);
|
|
18719
18667
|
break;
|
|
18720
18668
|
}
|
|
18721
18669
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18722
18670
|
const handlePause = React.useCallback(() => {
|
|
18723
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
18671
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
18724
18672
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18725
18673
|
return;
|
|
18726
18674
|
if (activeIndex !== index)
|
|
@@ -18736,15 +18684,14 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18736
18684
|
eventSubject: 'playOverVideo',
|
|
18737
18685
|
eventDescription: 'User finished playing the video',
|
|
18738
18686
|
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 : '',
|
|
18739
|
-
|
|
18740
|
-
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 : '',
|
|
18687
|
+
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 : '',
|
|
18741
18688
|
endTime: videoCurrentTime,
|
|
18742
18689
|
videoDuration,
|
|
18743
18690
|
playDuration,
|
|
18744
|
-
contentTags: JSON.stringify((
|
|
18691
|
+
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 : []),
|
|
18745
18692
|
position: index + '',
|
|
18746
18693
|
contentFormat: 'video',
|
|
18747
|
-
traceInfo: (
|
|
18694
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
18748
18695
|
}
|
|
18749
18696
|
});
|
|
18750
18697
|
}
|
|
@@ -18752,8 +18699,27 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18752
18699
|
const handleWaiting = React.useCallback(() => {
|
|
18753
18700
|
setWaiting(true);
|
|
18754
18701
|
}, []);
|
|
18702
|
+
const handleTimeUpload = () => {
|
|
18703
|
+
if (!videoRef.current || !isDiyH5)
|
|
18704
|
+
return;
|
|
18705
|
+
setTimeout(() => {
|
|
18706
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18707
|
+
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)) {
|
|
18708
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
|
18709
|
+
if (!loopPlayRef.current)
|
|
18710
|
+
return;
|
|
18711
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
|
18712
|
+
(_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);
|
|
18713
|
+
}
|
|
18714
|
+
else {
|
|
18715
|
+
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;
|
|
18716
|
+
(_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);
|
|
18717
|
+
}
|
|
18718
|
+
}
|
|
18719
|
+
});
|
|
18720
|
+
};
|
|
18755
18721
|
React.useEffect(() => {
|
|
18756
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18722
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
18757
18723
|
if (!isActive)
|
|
18758
18724
|
return;
|
|
18759
18725
|
const videoSrc = videoUrl;
|
|
@@ -18774,6 +18740,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18774
18740
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
|
18775
18741
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
18776
18742
|
var _a;
|
|
18743
|
+
setCurrentTimeByStartTime();
|
|
18777
18744
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18778
18745
|
});
|
|
18779
18746
|
}
|
|
@@ -18787,11 +18754,12 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18787
18754
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
|
18788
18755
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
|
18789
18756
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
|
18790
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
|
18757
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
|
18791
18758
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
|
18792
18759
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
|
18760
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
|
18793
18761
|
return () => {
|
|
18794
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18762
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
18795
18763
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
|
18796
18764
|
if (!isPause)
|
|
18797
18765
|
handlePause();
|
|
@@ -18803,9 +18771,10 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
|
18803
18771
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
|
18804
18772
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
|
18805
18773
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
|
18806
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
|
18774
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
|
18807
18775
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
|
18808
18776
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
|
18777
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
|
18809
18778
|
};
|
|
18810
18779
|
}, [isActive]);
|
|
18811
18780
|
React.useEffect(() => {
|
|
@@ -19020,45 +18989,19 @@ const Picture = (props) => {
|
|
|
19020
18989
|
}, onLoad: onShowFirstImage }))));
|
|
19021
18990
|
};
|
|
19022
18991
|
|
|
19023
|
-
const PictureGroup$4 =
|
|
18992
|
+
const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
|
19024
18993
|
var _a, _b;
|
|
19025
18994
|
const { isActive } = useSwiperSlide();
|
|
19026
|
-
const {
|
|
18995
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
|
19027
18996
|
const [isLoad, setIsLoad] = React.useState(false);
|
|
19028
18997
|
const [imgInfo, setImgInfo] = React.useState();
|
|
19029
18998
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
|
19030
|
-
const
|
|
18999
|
+
const swiperRef = React.useRef();
|
|
19031
19000
|
const isFirstPlayRef = React.useRef(true);
|
|
19032
|
-
const loopPlayRef = React.useRef(true);
|
|
19033
19001
|
const initTime = new Date();
|
|
19034
|
-
React.useImperativeHandle(ref, () => {
|
|
19035
|
-
return {
|
|
19036
|
-
setLoopPlay(v) {
|
|
19037
|
-
loopPlayRef.current = v;
|
|
19038
|
-
}
|
|
19039
|
-
};
|
|
19040
|
-
});
|
|
19041
|
-
React.useEffect(() => {
|
|
19042
|
-
let timerId;
|
|
19043
|
-
if (isLoad && isActive && isDiyH5) {
|
|
19044
|
-
timerId = setTimeout(() => {
|
|
19045
|
-
var _a, _b, _c, _d;
|
|
19046
|
-
if (!loopPlayRef.current)
|
|
19047
|
-
return;
|
|
19048
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
19049
|
-
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;
|
|
19050
|
-
(_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);
|
|
19051
|
-
}
|
|
19052
|
-
}, 3000);
|
|
19053
|
-
}
|
|
19054
|
-
return () => {
|
|
19055
|
-
if (timerId)
|
|
19056
|
-
clearTimeout(timerId);
|
|
19057
|
-
};
|
|
19058
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
|
19059
19002
|
React.useEffect(() => {
|
|
19060
19003
|
if (isLoad && isActive) {
|
|
19061
|
-
(
|
|
19004
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
|
19062
19005
|
if (openHashtag) {
|
|
19063
19006
|
onViewImageEndEvent(rec);
|
|
19064
19007
|
}
|
|
@@ -19068,7 +19011,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
|
19068
19011
|
}
|
|
19069
19012
|
}
|
|
19070
19013
|
else {
|
|
19071
|
-
(
|
|
19014
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
|
19072
19015
|
}
|
|
19073
19016
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
|
19074
19017
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19095,13 +19038,13 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
|
19095
19038
|
};
|
|
19096
19039
|
}, [isActive, imgInfo]);
|
|
19097
19040
|
const handleMouseEnter = React.useCallback(() => {
|
|
19098
|
-
if (
|
|
19099
|
-
|
|
19041
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
|
19042
|
+
swiperRef.current.swiper.autoplay.stop();
|
|
19100
19043
|
}
|
|
19101
19044
|
}, []);
|
|
19102
19045
|
const handleMouseLeave = React.useCallback(() => {
|
|
19103
|
-
if (
|
|
19104
|
-
|
|
19046
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
|
19047
|
+
swiperRef.current.swiper.autoplay.start();
|
|
19105
19048
|
}
|
|
19106
19049
|
}, []);
|
|
19107
19050
|
const handleSlideChange = React.useCallback((swiper) => {
|
|
@@ -19122,7 +19065,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
|
19122
19065
|
enabled: true
|
|
19123
19066
|
}
|
|
19124
19067
|
}
|
|
19125
|
-
: {}), { loop: true, ref:
|
|
19068
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
|
19126
19069
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
|
19127
19070
|
fontSize: '14px'
|
|
19128
19071
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
|
@@ -19139,7 +19082,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
|
|
|
19139
19082
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
|
19140
19083
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
|
19141
19084
|
}))));
|
|
19142
|
-
}
|
|
19085
|
+
};
|
|
19143
19086
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
|
19144
19087
|
|
|
19145
19088
|
/*
|
|
@@ -19431,7 +19374,7 @@ var NavBack$1 = React.memo(NavBack);
|
|
|
19431
19374
|
* @Author: binruan@chatlabs.com
|
|
19432
19375
|
* @Date: 2024-03-20 10:27:31
|
|
19433
19376
|
* @LastEditors: binruan@chatlabs.com
|
|
19434
|
-
* @LastEditTime: 2025-05-
|
|
19377
|
+
* @LastEditTime: 2025-05-09 15:51:40
|
|
19435
19378
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
|
19436
19379
|
*
|
|
19437
19380
|
*/
|
|
@@ -19452,7 +19395,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19452
19395
|
const [pageNum, setPageNum] = React.useState(2);
|
|
19453
19396
|
React.useState(false);
|
|
19454
19397
|
const videoWidgetRef = React.useRef(null);
|
|
19455
|
-
const pictureGroupRef = React.useRef(null);
|
|
19456
19398
|
const fbcRef = React.useRef('');
|
|
19457
19399
|
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();
|
|
19458
19400
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
@@ -19502,7 +19444,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19502
19444
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
|
19503
19445
|
}, [data, ctaType, swiperRef]);
|
|
19504
19446
|
const handleSessionCompleted = React.useCallback((fk) => {
|
|
19505
|
-
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
|
|
19447
|
+
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;
|
|
19506
19448
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
19507
19449
|
let fromKName = '';
|
|
19508
19450
|
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))) {
|
|
@@ -19529,23 +19471,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19529
19471
|
eventSubject: 'sessionCompleted',
|
|
19530
19472
|
eventDescription: 'Session completed',
|
|
19531
19473
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
|
19532
|
-
|
|
19533
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
|
19474
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
|
19534
19475
|
position: activeIndex + '',
|
|
19535
19476
|
fromKName: fk || fromKName,
|
|
19536
19477
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
19537
|
-
ctatId: (
|
|
19538
|
-
traceInfo: (
|
|
19478
|
+
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 : '',
|
|
19479
|
+
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 : ''
|
|
19539
19480
|
}
|
|
19540
19481
|
});
|
|
19541
|
-
const isPostType = ((
|
|
19482
|
+
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);
|
|
19542
19483
|
if (!popupDetailData) {
|
|
19543
19484
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19544
19485
|
eventName: 'ExitFeed',
|
|
19545
|
-
product: isPostType ? (
|
|
19486
|
+
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] : [],
|
|
19546
19487
|
rec: item,
|
|
19547
19488
|
position: activeIndex,
|
|
19548
|
-
content_id: isPostType ? (
|
|
19489
|
+
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 : '',
|
|
19549
19490
|
view_time: new Date() - viewTime.current
|
|
19550
19491
|
});
|
|
19551
19492
|
}
|
|
@@ -19605,9 +19546,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19605
19546
|
refreshFeSession
|
|
19606
19547
|
]);
|
|
19607
19548
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
|
19608
|
-
var _a
|
|
19549
|
+
var _a;
|
|
19609
19550
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
19610
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
19611
19551
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
|
19612
19552
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
|
19613
19553
|
React.useEffect(() => {
|
|
@@ -19678,18 +19618,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19678
19618
|
return null;
|
|
19679
19619
|
}, [globalConfig, activeIndex, visList]);
|
|
19680
19620
|
const renderContent = React.useCallback((rec, index) => {
|
|
19681
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
19621
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19682
19622
|
if (rec === 'organic menu') {
|
|
19683
19623
|
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)));
|
|
19684
19624
|
}
|
|
19685
|
-
if ((
|
|
19625
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
|
19686
19626
|
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 })));
|
|
19687
19627
|
}
|
|
19688
|
-
if ((
|
|
19689
|
-
return (React.createElement(PictureGroup$5,
|
|
19628
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
|
19629
|
+
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 }));
|
|
19690
19630
|
}
|
|
19691
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
|
19692
|
-
return (
|
|
19631
|
+
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) {
|
|
19632
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
|
19693
19633
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19694
19634
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
|
19695
19635
|
const Component = withBindDataSource(t);
|
|
@@ -19728,7 +19668,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19728
19668
|
};
|
|
19729
19669
|
}, [isShowMore]);
|
|
19730
19670
|
const renderBottom = React.useCallback((rec, index) => {
|
|
19731
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
19671
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
19732
19672
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
|
19733
19673
|
let cta = null;
|
|
19734
19674
|
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) {
|
|
@@ -19737,27 +19677,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19737
19677
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
|
19738
19678
|
cta = '商品CTA';
|
|
19739
19679
|
}
|
|
19740
|
-
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)) {
|
|
19741
|
-
cta = '服务CTA';
|
|
19742
|
-
}
|
|
19743
19680
|
else {
|
|
19744
|
-
cta = (
|
|
19681
|
+
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;
|
|
19745
19682
|
}
|
|
19746
19683
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
|
19747
19684
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
|
19748
19685
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
|
|
19749
|
-
((
|
|
19686
|
+
((_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));
|
|
19750
19687
|
return (React.createElement(React.Fragment, null,
|
|
19751
19688
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
|
19752
|
-
((
|
|
19753
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
|
19689
|
+
((_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' }),
|
|
19690
|
+
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` } },
|
|
19754
19691
|
React.createElement(Nudge, { nudge: nudge }),
|
|
19755
19692
|
((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' },
|
|
19756
19693
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
19757
19694
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
19758
|
-
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: (
|
|
19695
|
+
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 }),
|
|
19759
19696
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
19760
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
|
19697
|
+
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) }))),
|
|
19761
19698
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
|
19762
19699
|
}
|
|
19763
19700
|
return null;
|
|
@@ -19799,7 +19736,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19799
19736
|
return null;
|
|
19800
19737
|
}, [globalConfig, waterFallData, bottomHeight]);
|
|
19801
19738
|
const handleViewImageStartEnd = (item) => {
|
|
19802
|
-
var _a, _b, _c, _d, _e, _f
|
|
19739
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19803
19740
|
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)) {
|
|
19804
19741
|
const endTime = Date.now();
|
|
19805
19742
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
|
@@ -19808,11 +19745,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19808
19745
|
eventSubject: 'viewImageCarouselEnd',
|
|
19809
19746
|
eventDescription: 'User end view the image carousel',
|
|
19810
19747
|
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 : '',
|
|
19811
|
-
|
|
19812
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19748
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
|
19813
19749
|
imageEndTime: `${endTime}`,
|
|
19814
19750
|
playDuration: `${duration}`,
|
|
19815
|
-
contentTags: JSON.stringify((
|
|
19751
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
|
19816
19752
|
position: activeIndex + '',
|
|
19817
19753
|
contentFormat: 'image',
|
|
19818
19754
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
|
@@ -19821,7 +19757,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19821
19757
|
}
|
|
19822
19758
|
};
|
|
19823
19759
|
const handleSlideSkip = (item, position) => {
|
|
19824
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
19760
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
19825
19761
|
if (isPreview || waterFallData)
|
|
19826
19762
|
return;
|
|
19827
19763
|
const t = new Date() - curTime.current;
|
|
@@ -19847,8 +19783,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19847
19783
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
|
19848
19784
|
position: position + '',
|
|
19849
19785
|
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 : '',
|
|
19850
|
-
|
|
19851
|
-
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 : '',
|
|
19786
|
+
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 : '',
|
|
19852
19787
|
contentFormat
|
|
19853
19788
|
}
|
|
19854
19789
|
});
|
|
@@ -19858,7 +19793,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19858
19793
|
}
|
|
19859
19794
|
};
|
|
19860
19795
|
const handleScrollEvent = (swiper) => {
|
|
19861
|
-
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
|
|
19796
|
+
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;
|
|
19862
19797
|
const item = data[swiper.previousIndex];
|
|
19863
19798
|
const activeItem = data[swiper.activeIndex];
|
|
19864
19799
|
if (!item)
|
|
@@ -19891,12 +19826,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19891
19826
|
eventSubject: 'scrollDown',
|
|
19892
19827
|
eventDescription: 'User scroll down',
|
|
19893
19828
|
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 : '',
|
|
19894
|
-
|
|
19895
|
-
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 : '',
|
|
19829
|
+
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 : '',
|
|
19896
19830
|
requestId: null,
|
|
19897
|
-
traceInfo: (
|
|
19831
|
+
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 : '',
|
|
19898
19832
|
contentFormat,
|
|
19899
|
-
position: ((
|
|
19833
|
+
position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
|
|
19900
19834
|
}
|
|
19901
19835
|
});
|
|
19902
19836
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19909,13 +19843,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
19909
19843
|
eventInfo: {
|
|
19910
19844
|
eventSubject: 'scrollUp',
|
|
19911
19845
|
eventDescription: 'User scroll up',
|
|
19912
|
-
contentId: (
|
|
19913
|
-
|
|
19914
|
-
productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
|
|
19846
|
+
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 : '',
|
|
19847
|
+
productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
|
|
19915
19848
|
requestId: null,
|
|
19916
|
-
traceInfo: (
|
|
19849
|
+
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 : '',
|
|
19917
19850
|
contentFormat,
|
|
19918
|
-
position: ((
|
|
19851
|
+
position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
|
|
19919
19852
|
}
|
|
19920
19853
|
});
|
|
19921
19854
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -20015,7 +19948,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20015
19948
|
};
|
|
20016
19949
|
}, [globalConfig, bffEventReport, data, activeIndex]);
|
|
20017
19950
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
|
20018
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
19951
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
20019
19952
|
const item = data[activeIndex];
|
|
20020
19953
|
// 如果是图片集则上报事件
|
|
20021
19954
|
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)) {
|
|
@@ -20026,10 +19959,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20026
19959
|
eventSubject: 'viewImageCarouselStart',
|
|
20027
19960
|
eventDescription: 'User start view the image carousel',
|
|
20028
19961
|
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 : '',
|
|
20029
|
-
|
|
20030
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19962
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
|
20031
19963
|
imageStartTime: `${startTime}`,
|
|
20032
|
-
contentTags: JSON.stringify((
|
|
19964
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
|
20033
19965
|
position: activeIndex + '',
|
|
20034
19966
|
contentFormat: 'image',
|
|
20035
19967
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
|
@@ -20039,13 +19971,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20039
19971
|
if (enableCapi) {
|
|
20040
19972
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
20041
19973
|
eventName: 'ViewContent',
|
|
20042
|
-
product: (
|
|
19974
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
|
|
20043
19975
|
rec: item,
|
|
20044
19976
|
position: activeIndex
|
|
20045
19977
|
});
|
|
20046
19978
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
20047
19979
|
eventName: 'PageView',
|
|
20048
|
-
product: (
|
|
19980
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
|
|
20049
19981
|
rec: item,
|
|
20050
19982
|
position: activeIndex
|
|
20051
19983
|
});
|
|
@@ -20143,20 +20075,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
20143
20075
|
swiperRef.current.swiper.allowTouchMove = true;
|
|
20144
20076
|
}, 500);
|
|
20145
20077
|
}, onActiveIndexChange: (swiper) => {
|
|
20146
|
-
var _a, _b;
|
|
20147
20078
|
setActiveIndex(swiper.activeIndex);
|
|
20148
20079
|
if (openHashtag)
|
|
20149
20080
|
return;
|
|
20150
20081
|
// 处理上滑下滑事件
|
|
20151
20082
|
handleScrollEvent(swiper);
|
|
20152
|
-
if (waterFallData || isEditor)
|
|
20083
|
+
if (waterFallData || isEditor || isDiyH5)
|
|
20153
20084
|
return;
|
|
20154
20085
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
|
20155
20086
|
if (!isLoadMore) {
|
|
20156
|
-
if (isDiyH5) {
|
|
20157
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
20158
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
20159
|
-
}
|
|
20160
20087
|
setIsLoadMore(true);
|
|
20161
20088
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
|
20162
20089
|
var _a;
|
|
@@ -20229,7 +20156,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20229
20156
|
}, []);
|
|
20230
20157
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
20231
20158
|
const handlePlaying = React.useCallback(() => {
|
|
20232
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
20159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20233
20160
|
setIsPauseVideo(false);
|
|
20234
20161
|
const item = data[index];
|
|
20235
20162
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
|
@@ -20242,15 +20169,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20242
20169
|
eventSubject: 'playVideo',
|
|
20243
20170
|
eventDescription: 'User played the video',
|
|
20244
20171
|
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 : '',
|
|
20245
|
-
|
|
20246
|
-
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 : '',
|
|
20172
|
+
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 : '',
|
|
20247
20173
|
playType,
|
|
20248
20174
|
startTime: videoCurrentTime,
|
|
20249
20175
|
videoDuration,
|
|
20250
|
-
contentTags: JSON.stringify((
|
|
20176
|
+
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 : []),
|
|
20251
20177
|
position: index + '',
|
|
20252
20178
|
contentFormat: 'video',
|
|
20253
|
-
traceInfo: (
|
|
20179
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
20254
20180
|
}
|
|
20255
20181
|
});
|
|
20256
20182
|
setIsFirstPlay(false);
|
|
@@ -20289,7 +20215,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20289
20215
|
}
|
|
20290
20216
|
}, [isLoadFinish]);
|
|
20291
20217
|
const onPause = React.useCallback(() => {
|
|
20292
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
20218
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20293
20219
|
const item = data[index];
|
|
20294
20220
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
|
20295
20221
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
|
@@ -20300,15 +20226,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
|
20300
20226
|
eventSubject: 'playOverVideo',
|
|
20301
20227
|
eventDescription: 'User finished playing the video',
|
|
20302
20228
|
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 : '',
|
|
20303
|
-
|
|
20304
|
-
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 : '',
|
|
20229
|
+
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 : '',
|
|
20305
20230
|
endTime: videoCurrentTime,
|
|
20306
20231
|
videoDuration,
|
|
20307
20232
|
playDuration,
|
|
20308
|
-
contentTags: JSON.stringify((
|
|
20233
|
+
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 : []),
|
|
20309
20234
|
position: index + '',
|
|
20310
20235
|
contentFormat: 'video',
|
|
20311
|
-
traceInfo: (
|
|
20236
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
|
20312
20237
|
}
|
|
20313
20238
|
});
|
|
20314
20239
|
}
|