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