pb-sxp-ui 1.17.1 → 1.18.0
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 +223 -163
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +223 -163
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +223 -163
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/es/core/components/SxpPageRender/LikeButton/index.js +18 -16
- 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 +32 -45
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +53 -37
- package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/es/core/context/SxpDataSourceProvider.js +62 -35
- 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 +18 -16
- 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 +32 -45
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +53 -37
- package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/lib/core/context/SxpDataSourceProvider.js +62 -35
- package/lib/core/hooks/useEventReport.js +6 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -644,6 +644,7 @@ const DEFAULT_TAG = 'FOR U';
|
|
644
644
|
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 }) => {
|
645
645
|
var _a, _b, _c, _d, _e;
|
646
646
|
const [rtcList, setRtcList] = React.useState([]);
|
647
|
+
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
647
648
|
const [tagList, setTagList] = React.useState([]);
|
648
649
|
const [loading, setLoading] = React.useState(true);
|
649
650
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
@@ -675,6 +676,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
675
676
|
const [chatlabsId, setChatlabsId] = React.useState();
|
676
677
|
const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
677
678
|
const pixelPvStatusRef = React.useRef(false);
|
679
|
+
const isDiyPage = React.useMemo(() => {
|
680
|
+
var _a, _b, _c;
|
681
|
+
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);
|
682
|
+
}, [isDiyH5, finalPageData]);
|
678
683
|
const isShowConsent = React.useMemo(() => {
|
679
684
|
var _a, _b, _c, _d;
|
680
685
|
return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
|
@@ -737,7 +742,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
737
742
|
}, [bffDataSource]);
|
738
743
|
// bff API 请求方法
|
739
744
|
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
740
|
-
var _a;
|
745
|
+
var _a, _b;
|
741
746
|
if (!bffDataSource)
|
742
747
|
return;
|
743
748
|
const url = bffDataSource.url;
|
@@ -750,8 +755,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
750
755
|
val.split('=')[0];
|
751
756
|
val.split('=')[1];
|
752
757
|
});
|
758
|
+
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
753
759
|
return window
|
754
|
-
.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
|
760
|
+
.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
|
755
761
|
? JSON.stringify({
|
756
762
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
757
763
|
})
|
@@ -991,8 +997,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
991
997
|
}, [bffDataSource]);
|
992
998
|
// 获取推荐视频数据
|
993
999
|
const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
994
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
995
|
-
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 })), (
|
1000
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
1001
|
+
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' }));
|
996
1002
|
if (channel) {
|
997
1003
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
998
1004
|
}
|
@@ -1005,9 +1011,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1005
1011
|
if (val)
|
1006
1012
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
1007
1013
|
}
|
1014
|
+
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);
|
1008
1015
|
if (isEditor) {
|
1009
1016
|
let pageNum = 1;
|
1010
|
-
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] }));
|
1017
|
+
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 }));
|
1011
1018
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
1012
1019
|
return undefined;
|
1013
1020
|
}
|
@@ -1015,19 +1022,22 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1015
1022
|
let list = [];
|
1016
1023
|
let result = null;
|
1017
1024
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
1018
|
-
var
|
1025
|
+
var _y, _z, _0, _1, _2, _3;
|
1019
1026
|
query.pageNum = pageNum;
|
1020
|
-
result = yield (
|
1027
|
+
result = isDiy ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query })) : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('recommend/direct_page', { method: 'POST', body: query }));
|
1021
1028
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
1022
1029
|
return undefined;
|
1023
1030
|
}
|
1024
1031
|
setLoading(false);
|
1025
|
-
list = list.concat((
|
1032
|
+
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 : []);
|
1026
1033
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
1027
1034
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1028
1035
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1036
|
+
if (isDiyPage) {
|
1037
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
1038
|
+
}
|
1029
1039
|
}
|
1030
|
-
const isNotNullList = (
|
1040
|
+
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));
|
1031
1041
|
if (isNotNullList) {
|
1032
1042
|
pageNum = pageNum + 1;
|
1033
1043
|
yield recurveRecList(query);
|
@@ -1035,13 +1045,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1035
1045
|
});
|
1036
1046
|
yield recurveRecList(query);
|
1037
1047
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
1038
|
-
setCurReqInfo({ rtc: (
|
1048
|
+
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 });
|
1039
1049
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
1040
1050
|
}
|
1041
1051
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
1042
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
1052
|
+
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 }));
|
1043
1053
|
}
|
1044
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
1054
|
+
const result = isDiy ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query })) : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
1045
1055
|
method: 'POST',
|
1046
1056
|
body: query
|
1047
1057
|
}));
|
@@ -1051,26 +1061,31 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1051
1061
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
1052
1062
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
1053
1063
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
1054
|
-
const isNotNullList = (
|
1064
|
+
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));
|
1055
1065
|
if (!isNotNullList) {
|
1056
1066
|
setIsNoMoreData(true);
|
1057
1067
|
}
|
1058
1068
|
}
|
1059
1069
|
let list = [];
|
1060
|
-
list = list.concat((
|
1070
|
+
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 : []);
|
1061
1071
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
1062
|
-
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
1072
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin, isDiyPage, finalPageData, isDiyH5]);
|
1063
1073
|
const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
1064
|
-
var
|
1074
|
+
var _4, _5, _6, _7;
|
1065
1075
|
if (rtcList.length <= 0) {
|
1066
1076
|
return;
|
1067
1077
|
}
|
1078
|
+
if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
1079
|
+
setRtcList(rtcList.concat(firstRtcList));
|
1080
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
1081
|
+
return;
|
1082
|
+
}
|
1068
1083
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
1069
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
1084
|
+
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 })));
|
1070
1085
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
1071
1086
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
1072
1087
|
return data;
|
1073
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
1088
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
|
1074
1089
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
1075
1090
|
var _a, _b, _c, _d, _e;
|
1076
1091
|
let expire = false;
|
@@ -1101,8 +1116,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1101
1116
|
// 用户信息都是公共的
|
1102
1117
|
if (!userInfo) {
|
1103
1118
|
userInfo = {
|
1104
|
-
|
1105
|
-
|
1119
|
+
productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
|
1120
|
+
// tpChannelId: 'H5' // 后端处理
|
1106
1121
|
};
|
1107
1122
|
}
|
1108
1123
|
const sessionID = storeAndLoadFeSessionId();
|
@@ -1136,7 +1151,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1136
1151
|
layoutVariantId,
|
1137
1152
|
globalConfig,
|
1138
1153
|
playbookType,
|
1139
|
-
bffDataSource
|
1154
|
+
bffDataSource,
|
1155
|
+
fakeUserId
|
1140
1156
|
]);
|
1141
1157
|
const getEventParamsByJson = React.useCallback((json, product) => {
|
1142
1158
|
var _a, _b, _c;
|
@@ -1269,38 +1285,40 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1269
1285
|
}
|
1270
1286
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
1271
1287
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1288
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1272
1289
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
1273
1290
|
return res === null || res === void 0 ? void 0 : res.success;
|
1274
|
-
}), [bffFetch]);
|
1291
|
+
}), [bffFetch, fakeUserId]);
|
1275
1292
|
const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1293
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
1276
1294
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
1277
1295
|
return res === null || res === void 0 ? void 0 : res.success;
|
1278
|
-
}), [bffFetch]);
|
1296
|
+
}), [bffFetch, fakeUserId]);
|
1279
1297
|
const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
1280
1298
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
1281
1299
|
return res === null || res === void 0 ? void 0 : res.success;
|
1282
1300
|
}), [bffFetch]);
|
1283
1301
|
// 获取 Tag
|
1284
1302
|
const bffGetTagList = React.useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
1285
|
-
var
|
1286
|
-
const isShowTag = !!((
|
1303
|
+
var _8, _9, _10, _11, _12, _13, _14, _15;
|
1304
|
+
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);
|
1287
1305
|
if (!utmVal || !isShowTag)
|
1288
1306
|
return;
|
1289
1307
|
try {
|
1290
|
-
const val = (
|
1308
|
+
const val = (_13 = (_12 = (_11 = splitUrlParams(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
|
1291
1309
|
var _a, _b;
|
1292
1310
|
const key = val.split('=')[0];
|
1293
1311
|
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);
|
1294
|
-
})) === null ||
|
1312
|
+
})) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
|
1295
1313
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
1296
|
-
setTagList((
|
1314
|
+
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 : []);
|
1297
1315
|
}
|
1298
1316
|
catch (e) {
|
1299
1317
|
console.log('e', e);
|
1300
1318
|
}
|
1301
1319
|
}), [bffFetch, utmVal]);
|
1302
1320
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
1303
|
-
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;
|
1321
|
+
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;
|
1304
1322
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
1305
1323
|
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);
|
1306
1324
|
let fromKName = '';
|
@@ -1318,7 +1336,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1318
1336
|
}
|
1319
1337
|
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;
|
1320
1338
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1321
|
-
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: (
|
1339
|
+
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 })
|
1322
1340
|
});
|
1323
1341
|
}, [bffEventReport, isFromHashtag]);
|
1324
1342
|
const h5EnterLink = React.useCallback(() => {
|
@@ -1353,10 +1371,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1353
1371
|
});
|
1354
1372
|
}, [bffEventReport]);
|
1355
1373
|
const getAccount = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
1356
|
-
var
|
1374
|
+
var _16, _17;
|
1357
1375
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
1358
|
-
setChatlabsId((
|
1359
|
-
return ((
|
1376
|
+
setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
|
1377
|
+
return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
|
1360
1378
|
}), [bffFetch]);
|
1361
1379
|
const accountSonsent = React.useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
1362
1380
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
@@ -1420,6 +1438,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1420
1438
|
}
|
1421
1439
|
setRtcList(list);
|
1422
1440
|
setCacheRtcList(list);
|
1441
|
+
if (isDiyPage) {
|
1442
|
+
setFirstRtcList(list);
|
1443
|
+
}
|
1423
1444
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1424
1445
|
if (channel) {
|
1425
1446
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1439,7 +1460,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1439
1460
|
});
|
1440
1461
|
setLoading(false);
|
1441
1462
|
});
|
1442
|
-
}, [isShowConsent, channel]);
|
1463
|
+
}, [isShowConsent, channel, isDiyPage]);
|
1443
1464
|
// cms预览
|
1444
1465
|
React.useEffect(() => {
|
1445
1466
|
if (!isPreview)
|
@@ -1455,12 +1476,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1455
1476
|
}
|
1456
1477
|
setRtcList(list);
|
1457
1478
|
setCacheRtcList(list);
|
1479
|
+
if (isDiyPage) {
|
1480
|
+
setFirstRtcList(list);
|
1481
|
+
}
|
1458
1482
|
}
|
1459
1483
|
})
|
1460
1484
|
.finally(() => {
|
1461
1485
|
setLoading(false);
|
1462
1486
|
});
|
1463
|
-
}, [getRecommendVideos, bffGetTagList, channel]);
|
1487
|
+
}, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
|
1464
1488
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
1465
1489
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
1466
1490
|
rtcList,
|
@@ -1518,7 +1542,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1518
1542
|
refreshFeSession,
|
1519
1543
|
getAccount,
|
1520
1544
|
accountSonsent,
|
1521
|
-
isDiyH5
|
1545
|
+
isDiyH5: isDiyPage,
|
1546
|
+
firstRtcList
|
1522
1547
|
} }, 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({
|
1523
1548
|
rtcList,
|
1524
1549
|
mutateLike: bffMutateLike,
|
@@ -1979,14 +2004,14 @@ var settingRender$f = [
|
|
1979
2004
|
* @Author: binruan@chatlabs.com
|
1980
2005
|
* @Date: 2024-03-12 10:59:06
|
1981
2006
|
* @LastEditors: binruan@chatlabs.com
|
1982
|
-
* @LastEditTime:
|
2007
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
1983
2008
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1984
2009
|
*
|
1985
2010
|
*/
|
1986
2011
|
function useEventReport() {
|
1987
2012
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
1988
2013
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
1989
|
-
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;
|
2014
|
+
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;
|
1990
2015
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
1991
2016
|
if (i !== -1) {
|
1992
2017
|
return;
|
@@ -2019,11 +2044,11 @@ function useEventReport() {
|
|
2019
2044
|
contentFormat = 'image';
|
2020
2045
|
}
|
2021
2046
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
2022
|
-
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 : '',
|
2047
|
+
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 }))
|
2023
2048
|
});
|
2024
2049
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
2025
2050
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
2026
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
2051
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
2027
2052
|
let fromKName = '';
|
2028
2053
|
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))) {
|
2029
2054
|
fromKName = 'pdpPage';
|
@@ -2042,8 +2067,9 @@ function useEventReport() {
|
|
2042
2067
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
2043
2068
|
position: position + '',
|
2044
2069
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
2070
|
+
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 : '',
|
2045
2071
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
2046
|
-
traceInfo: (
|
2072
|
+
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 : '',
|
2047
2073
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
2048
2074
|
eventSubject: 'productView',
|
2049
2075
|
eventDescription: 'User browsed the product'
|
@@ -15858,7 +15884,7 @@ function WaterfallList(_a) {
|
|
15858
15884
|
* @Author: binruan@chatlabs.com
|
15859
15885
|
* @Date: 2024-01-10 10:58:24
|
15860
15886
|
* @LastEditors: binruan@chatlabs.com
|
15861
|
-
* @LastEditTime: 2025-
|
15887
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
15862
15888
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
15863
15889
|
*
|
15864
15890
|
*/
|
@@ -15896,7 +15922,7 @@ const WaterFall = (props) => {
|
|
15896
15922
|
}
|
15897
15923
|
}, [waterFallData]);
|
15898
15924
|
const reportTagsView = React.useCallback(() => {
|
15899
|
-
var _a, _b, _c, _d, _e, _f;
|
15925
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
15900
15926
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
15901
15927
|
if (!rec)
|
15902
15928
|
return;
|
@@ -15916,9 +15942,10 @@ const WaterFall = (props) => {
|
|
15916
15942
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
15917
15943
|
eventInfo: {
|
15918
15944
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
15945
|
+
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 : '',
|
15919
15946
|
position: cacheActiveIndex + '',
|
15920
|
-
contentTags: JSON.stringify((
|
15921
|
-
traceInfo: (
|
15947
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
15948
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
15922
15949
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
15923
15950
|
fromKName,
|
15924
15951
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
@@ -18000,21 +18027,22 @@ const LikeButton = (_a) => {
|
|
18000
18027
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
18001
18028
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
18002
18029
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
18003
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
18030
|
+
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;
|
18004
18031
|
if (state) {
|
18005
18032
|
// 先设置状态
|
18006
18033
|
setState(false);
|
18007
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
18034
|
+
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;
|
18008
18035
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18009
18036
|
eventInfo: {
|
18010
18037
|
eventSubject: 'favoriteContentCanceled',
|
18011
18038
|
eventDescription: 'This content was unfavorite by the user',
|
18012
18039
|
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 : '',
|
18013
|
-
|
18014
|
-
|
18040
|
+
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 : '',
|
18041
|
+
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 : '',
|
18042
|
+
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 : []),
|
18015
18043
|
position: position + '',
|
18016
|
-
contentFormat: ((
|
18017
|
-
traceInfo: (
|
18044
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
18045
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18018
18046
|
}
|
18019
18047
|
});
|
18020
18048
|
// 如果接口调用失败,则回滚状态
|
@@ -18022,40 +18050,41 @@ const LikeButton = (_a) => {
|
|
18022
18050
|
setState(true);
|
18023
18051
|
}
|
18024
18052
|
else {
|
18025
|
-
const nRtcList = (
|
18053
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18026
18054
|
if (index === position) {
|
18027
18055
|
item.isCollected = false;
|
18028
18056
|
}
|
18029
18057
|
return item;
|
18030
|
-
})) !== null &&
|
18058
|
+
})) !== null && _s !== void 0 ? _s : [];
|
18031
18059
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18032
18060
|
}
|
18033
18061
|
}
|
18034
18062
|
else {
|
18035
18063
|
setState(true);
|
18036
|
-
const result = (
|
18064
|
+
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;
|
18037
18065
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18038
18066
|
eventInfo: {
|
18039
18067
|
eventSubject: 'favoriteContent',
|
18040
18068
|
eventDescription: 'This content was favorite by the user',
|
18041
|
-
contentId: (
|
18042
|
-
|
18043
|
-
|
18069
|
+
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 : '',
|
18070
|
+
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 : '',
|
18071
|
+
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 : '',
|
18072
|
+
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 : []),
|
18044
18073
|
position: position + '',
|
18045
|
-
contentFormat: ((
|
18046
|
-
traceInfo: (
|
18074
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
18075
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
18047
18076
|
}
|
18048
18077
|
});
|
18049
18078
|
if (!result) {
|
18050
18079
|
setState(false);
|
18051
18080
|
}
|
18052
18081
|
else {
|
18053
|
-
const nRtcList = (
|
18082
|
+
const nRtcList = (_7 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
18054
18083
|
if (index === position) {
|
18055
18084
|
item.isCollected = true;
|
18056
18085
|
}
|
18057
18086
|
return item;
|
18058
|
-
})) !== null &&
|
18087
|
+
})) !== null && _7 !== void 0 ? _7 : [];
|
18059
18088
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
18060
18089
|
}
|
18061
18090
|
}
|
@@ -18092,7 +18121,7 @@ const mountVideoPlayerAtNode = (() => {
|
|
18092
18121
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
18093
18122
|
var _a, _b;
|
18094
18123
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
18095
|
-
const { bffEventReport, sxpParameter,
|
18124
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
18096
18125
|
const videoStartTime = React.useRef(0);
|
18097
18126
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
18098
18127
|
const { isActive } = useSwiperSlide();
|
@@ -18158,6 +18187,23 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18158
18187
|
return;
|
18159
18188
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18160
18189
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18190
|
+
const handleEnd = () => {
|
18191
|
+
var _a, _b, _c, _d, _e, _f;
|
18192
|
+
if (!videoRef.current)
|
18193
|
+
return;
|
18194
|
+
if (isDiyH5) {
|
18195
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
18196
|
+
if (!loopPlayRef.current)
|
18197
|
+
return;
|
18198
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18199
|
+
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;
|
18200
|
+
(_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);
|
18201
|
+
}
|
18202
|
+
}
|
18203
|
+
else {
|
18204
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
18205
|
+
}
|
18206
|
+
};
|
18161
18207
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
18162
18208
|
const handlePlaying = React.useCallback(() => {
|
18163
18209
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -18166,7 +18212,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18166
18212
|
setIsLoadFinish(true);
|
18167
18213
|
}, []);
|
18168
18214
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
18169
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
18215
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
18170
18216
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18171
18217
|
return;
|
18172
18218
|
setIsPauseVideo(false);
|
@@ -18177,16 +18223,11 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18177
18223
|
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);
|
18178
18224
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
18179
18225
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18180
|
-
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 : '',
|
18226
|
+
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) + '' }))
|
18181
18227
|
});
|
18182
18228
|
isFirstPlayRef.current = false;
|
18183
18229
|
}
|
18184
18230
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18185
|
-
const setCurrentTimeByStartTime = React.useCallback(() => {
|
18186
|
-
if (isDiyH5) {
|
18187
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18188
|
-
}
|
18189
|
-
}, []);
|
18190
18231
|
const handLoadeddata = React.useCallback(() => {
|
18191
18232
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
18192
18233
|
return;
|
@@ -18211,13 +18252,12 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18211
18252
|
const handleLoadedmetadata = React.useCallback(() => {
|
18212
18253
|
if (!videoRef.current)
|
18213
18254
|
return;
|
18214
|
-
setCurrentTimeByStartTime();
|
18215
18255
|
loadedTimeRef.current = new Date();
|
18216
18256
|
handleStartPlay();
|
18217
18257
|
handLoadeddata();
|
18218
18258
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
18219
18259
|
const handleClickVideo = React.useCallback((type) => () => {
|
18220
|
-
var _a, _b, _c, _d, _e
|
18260
|
+
var _a, _b, _c, _d, _e;
|
18221
18261
|
if (!videoRef.current)
|
18222
18262
|
return;
|
18223
18263
|
if (!isLoadFinish)
|
@@ -18238,20 +18278,17 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18238
18278
|
break;
|
18239
18279
|
default:
|
18240
18280
|
if (isPause) {
|
18241
|
-
|
18242
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
18243
|
-
}
|
18244
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
18281
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
18245
18282
|
}
|
18246
18283
|
else {
|
18247
|
-
(
|
18284
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
18248
18285
|
}
|
18249
18286
|
setIsPauseVideo(!isPause);
|
18250
18287
|
break;
|
18251
18288
|
}
|
18252
18289
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
18253
18290
|
const handlePause = React.useCallback(() => {
|
18254
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
18291
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
18255
18292
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
18256
18293
|
return;
|
18257
18294
|
if (activeIndex !== index)
|
@@ -18267,14 +18304,15 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18267
18304
|
eventSubject: 'playOverVideo',
|
18268
18305
|
eventDescription: 'User finished playing the video',
|
18269
18306
|
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 : '',
|
18270
|
-
|
18307
|
+
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 : '',
|
18308
|
+
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 : '',
|
18271
18309
|
endTime: videoCurrentTime,
|
18272
18310
|
videoDuration,
|
18273
18311
|
playDuration,
|
18274
|
-
contentTags: JSON.stringify((
|
18312
|
+
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 : []),
|
18275
18313
|
position: index + '',
|
18276
18314
|
contentFormat: 'video',
|
18277
|
-
traceInfo: (
|
18315
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
18278
18316
|
}
|
18279
18317
|
});
|
18280
18318
|
}
|
@@ -18282,27 +18320,8 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18282
18320
|
const handleWaiting = React.useCallback(() => {
|
18283
18321
|
setWaiting(true);
|
18284
18322
|
}, []);
|
18285
|
-
const handleTimeUpload = () => {
|
18286
|
-
if (!videoRef.current || !isDiyH5)
|
18287
|
-
return;
|
18288
|
-
setTimeout(() => {
|
18289
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18290
|
-
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)) {
|
18291
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
18292
|
-
if (!loopPlayRef.current)
|
18293
|
-
return;
|
18294
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
18295
|
-
(_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);
|
18296
|
-
}
|
18297
|
-
else {
|
18298
|
-
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;
|
18299
|
-
(_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);
|
18300
|
-
}
|
18301
|
-
}
|
18302
|
-
});
|
18303
|
-
};
|
18304
18323
|
React.useEffect(() => {
|
18305
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18324
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18306
18325
|
if (!isActive)
|
18307
18326
|
return;
|
18308
18327
|
const videoSrc = videoUrl;
|
@@ -18323,7 +18342,6 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18323
18342
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
18324
18343
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
18325
18344
|
var _a;
|
18326
|
-
setCurrentTimeByStartTime();
|
18327
18345
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
18328
18346
|
});
|
18329
18347
|
}
|
@@ -18337,12 +18355,11 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18337
18355
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
18338
18356
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
18339
18357
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
18340
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
18358
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
18341
18359
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
18342
18360
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
18343
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
18344
18361
|
return () => {
|
18345
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
18362
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
18346
18363
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
18347
18364
|
if (!isPause)
|
18348
18365
|
handlePause();
|
@@ -18354,10 +18371,9 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
|
|
18354
18371
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
18355
18372
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
18356
18373
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
18357
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
18374
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
18358
18375
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
18359
18376
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
18360
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
18361
18377
|
};
|
18362
18378
|
}, [isActive]);
|
18363
18379
|
React.useEffect(() => {
|
@@ -18568,19 +18584,45 @@ const Picture = (props) => {
|
|
18568
18584
|
}, onLoad: onShowFirstImage }))));
|
18569
18585
|
};
|
18570
18586
|
|
18571
|
-
const PictureGroup$4 = ({ imgUrls,
|
18587
|
+
const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
18572
18588
|
var _a, _b;
|
18573
18589
|
const { isActive } = useSwiperSlide();
|
18574
|
-
const {
|
18590
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
18575
18591
|
const [isLoad, setIsLoad] = React.useState(false);
|
18576
18592
|
const [imgInfo, setImgInfo] = React.useState();
|
18577
18593
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
18578
|
-
const
|
18594
|
+
const imgsSwiperRef = React.useRef();
|
18579
18595
|
const isFirstPlayRef = React.useRef(true);
|
18596
|
+
const loopPlayRef = React.useRef(true);
|
18580
18597
|
const initTime = new Date();
|
18598
|
+
React.useImperativeHandle(ref, () => {
|
18599
|
+
return {
|
18600
|
+
setLoopPlay(v) {
|
18601
|
+
loopPlayRef.current = v;
|
18602
|
+
}
|
18603
|
+
};
|
18604
|
+
});
|
18605
|
+
React.useEffect(() => {
|
18606
|
+
let timerId;
|
18607
|
+
if (isLoad && isActive && isDiyH5) {
|
18608
|
+
timerId = setTimeout(() => {
|
18609
|
+
var _a, _b, _c, _d;
|
18610
|
+
if (!loopPlayRef.current)
|
18611
|
+
return;
|
18612
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
18613
|
+
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;
|
18614
|
+
(_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);
|
18615
|
+
}
|
18616
|
+
}, 3000);
|
18617
|
+
}
|
18618
|
+
return () => {
|
18619
|
+
if (timerId)
|
18620
|
+
clearTimeout(timerId);
|
18621
|
+
};
|
18622
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
18581
18623
|
React.useEffect(() => {
|
18582
18624
|
if (isLoad && isActive) {
|
18583
|
-
(
|
18625
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
18584
18626
|
if (openHashtag) {
|
18585
18627
|
onViewImageEndEvent(rec);
|
18586
18628
|
}
|
@@ -18590,7 +18632,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18590
18632
|
}
|
18591
18633
|
}
|
18592
18634
|
else {
|
18593
|
-
(
|
18635
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
18594
18636
|
}
|
18595
18637
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
18596
18638
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -18617,13 +18659,13 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18617
18659
|
};
|
18618
18660
|
}, [isActive, imgInfo]);
|
18619
18661
|
const handleMouseEnter = React.useCallback(() => {
|
18620
|
-
if (
|
18621
|
-
|
18662
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18663
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
18622
18664
|
}
|
18623
18665
|
}, []);
|
18624
18666
|
const handleMouseLeave = React.useCallback(() => {
|
18625
|
-
if (
|
18626
|
-
|
18667
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
18668
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
18627
18669
|
}
|
18628
18670
|
}, []);
|
18629
18671
|
const handleSlideChange = React.useCallback((swiper) => {
|
@@ -18644,7 +18686,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18644
18686
|
enabled: true
|
18645
18687
|
}
|
18646
18688
|
}
|
18647
|
-
: {}), { loop: true, ref:
|
18689
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
18648
18690
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
18649
18691
|
fontSize: '14px'
|
18650
18692
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -18661,7 +18703,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
|
|
18661
18703
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
18662
18704
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
18663
18705
|
}))));
|
18664
|
-
};
|
18706
|
+
});
|
18665
18707
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
18666
18708
|
|
18667
18709
|
/*
|
@@ -18941,7 +18983,7 @@ var NavBack$1 = React.memo(NavBack);
|
|
18941
18983
|
* @Author: binruan@chatlabs.com
|
18942
18984
|
* @Date: 2024-03-20 10:27:31
|
18943
18985
|
* @LastEditors: binruan@chatlabs.com
|
18944
|
-
* @LastEditTime: 2025-05-
|
18986
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
18945
18987
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18946
18988
|
*
|
18947
18989
|
*/
|
@@ -18961,6 +19003,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18961
19003
|
const skipLinkRef = React.useRef(false);
|
18962
19004
|
const [pageNum, setPageNum] = React.useState(2);
|
18963
19005
|
const videoWidgetRef = React.useRef(null);
|
19006
|
+
const pictureGroupRef = React.useRef(null);
|
18964
19007
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
|
18965
19008
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
18966
19009
|
const isShowFingerTip = React.useMemo(() => {
|
@@ -19008,7 +19051,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19008
19051
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
19009
19052
|
}, [data, ctaType, swiperRef]);
|
19010
19053
|
const handleSessionCompleted = React.useCallback((fk) => {
|
19011
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
19054
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
19012
19055
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
19013
19056
|
let fromKName = '';
|
19014
19057
|
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))) {
|
@@ -19035,12 +19078,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19035
19078
|
eventSubject: 'sessionCompleted',
|
19036
19079
|
eventDescription: 'Session completed',
|
19037
19080
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
19038
|
-
|
19081
|
+
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 : '',
|
19082
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
19039
19083
|
position: activeIndex + '',
|
19040
19084
|
fromKName: fk || fromKName,
|
19041
19085
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
19042
|
-
ctatId: (
|
19043
|
-
traceInfo: (
|
19086
|
+
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 : '',
|
19087
|
+
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 : ''
|
19044
19088
|
}
|
19045
19089
|
});
|
19046
19090
|
}, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
|
@@ -19099,8 +19143,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19099
19143
|
refreshFeSession
|
19100
19144
|
]);
|
19101
19145
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
19102
|
-
var _a;
|
19146
|
+
var _a, _b;
|
19103
19147
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19148
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19104
19149
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
19105
19150
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
19106
19151
|
React.useEffect(() => {
|
@@ -19170,18 +19215,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19170
19215
|
return null;
|
19171
19216
|
}, [globalConfig, activeIndex, visList]);
|
19172
19217
|
const renderContent = React.useCallback((rec, index) => {
|
19173
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
19218
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
19174
19219
|
if (rec === 'organic menu') {
|
19175
19220
|
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)));
|
19176
19221
|
}
|
19177
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
19222
|
+
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)) {
|
19178
19223
|
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 })));
|
19179
19224
|
}
|
19180
|
-
if ((
|
19181
|
-
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 }));
|
19225
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
19226
|
+
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 })));
|
19182
19227
|
}
|
19183
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
19184
|
-
return (
|
19228
|
+
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) {
|
19229
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
19185
19230
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19186
19231
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
19187
19232
|
const Component = withBindDataSource(t);
|
@@ -19219,7 +19264,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19219
19264
|
};
|
19220
19265
|
}, [isShowMore]);
|
19221
19266
|
const renderBottom = React.useCallback((rec, index) => {
|
19222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
19267
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
19223
19268
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
19224
19269
|
let cta = null;
|
19225
19270
|
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) {
|
@@ -19228,24 +19273,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19228
19273
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19229
19274
|
cta = '商品CTA';
|
19230
19275
|
}
|
19276
|
+
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)) {
|
19277
|
+
cta = '服务CTA';
|
19278
|
+
}
|
19231
19279
|
else {
|
19232
|
-
cta = (
|
19280
|
+
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;
|
19233
19281
|
}
|
19234
19282
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
19235
19283
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
19236
19284
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
|
19237
|
-
((
|
19285
|
+
((_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));
|
19238
19286
|
return (React.createElement(React.Fragment, null,
|
19239
19287
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
|
19240
|
-
((
|
19241
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
19288
|
+
((_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' }),
|
19289
|
+
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` } },
|
19242
19290
|
React.createElement(Nudge, { nudge: nudge }),
|
19243
19291
|
((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' },
|
19244
19292
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
|
19245
19293
|
React.createElement("div", null,
|
19246
|
-
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: (
|
19294
|
+
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 }),
|
19247
19295
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
|
19248
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
19296
|
+
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) }))),
|
19249
19297
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
19250
19298
|
}
|
19251
19299
|
return null;
|
@@ -19284,7 +19332,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19284
19332
|
return null;
|
19285
19333
|
}, [globalConfig, waterFallData]);
|
19286
19334
|
const handleViewImageStartEnd = (item) => {
|
19287
|
-
var _a, _b, _c, _d, _e, _f;
|
19335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19288
19336
|
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)) {
|
19289
19337
|
const endTime = Date.now();
|
19290
19338
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
@@ -19293,10 +19341,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19293
19341
|
eventSubject: 'viewImageCarouselEnd',
|
19294
19342
|
eventDescription: 'User end view the image carousel',
|
19295
19343
|
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 : '',
|
19296
|
-
|
19344
|
+
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 : '',
|
19345
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19297
19346
|
imageEndTime: `${endTime}`,
|
19298
19347
|
playDuration: `${duration}`,
|
19299
|
-
contentTags: JSON.stringify((
|
19348
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19300
19349
|
position: activeIndex + '',
|
19301
19350
|
contentFormat: 'image',
|
19302
19351
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
@@ -19305,7 +19354,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19305
19354
|
}
|
19306
19355
|
};
|
19307
19356
|
const handleSlideSkip = (item, position) => {
|
19308
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
19357
|
+
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;
|
19309
19358
|
if (isPreview || waterFallData)
|
19310
19359
|
return;
|
19311
19360
|
const t = new Date() - curTime.current;
|
@@ -19331,7 +19380,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19331
19380
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
19332
19381
|
position: position + '',
|
19333
19382
|
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 : '',
|
19334
|
-
|
19383
|
+
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 : '',
|
19384
|
+
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 : '',
|
19335
19385
|
contentFormat
|
19336
19386
|
}
|
19337
19387
|
});
|
@@ -19341,7 +19391,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19341
19391
|
}
|
19342
19392
|
};
|
19343
19393
|
const handleScrollEvent = (swiper) => {
|
19344
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
19394
|
+
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;
|
19345
19395
|
const item = data[swiper.previousIndex];
|
19346
19396
|
if (!item)
|
19347
19397
|
return;
|
@@ -19358,11 +19408,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19358
19408
|
eventSubject: 'scrollDown',
|
19359
19409
|
eventDescription: 'User scroll down',
|
19360
19410
|
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
19361
|
-
|
19411
|
+
sceneId: (_h = (_g = (_f = item === null || item === void 0 ? void 0 : item.video) === null || _f === void 0 ? void 0 : _f.scene) === null || _g === void 0 ? void 0 : _g.sceneId) !== null && _h !== void 0 ? _h : '',
|
19412
|
+
productId: (_k = (_j = item === null || item === void 0 ? void 0 : item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
19362
19413
|
requestId: null,
|
19363
|
-
traceInfo: (
|
19414
|
+
traceInfo: (_p = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
|
19364
19415
|
contentFormat,
|
19365
|
-
position: ((
|
19416
|
+
position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
|
19366
19417
|
}
|
19367
19418
|
});
|
19368
19419
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19374,12 +19425,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19374
19425
|
eventInfo: {
|
19375
19426
|
eventSubject: 'scrollUp',
|
19376
19427
|
eventDescription: 'User scroll up',
|
19377
|
-
contentId: (
|
19378
|
-
|
19428
|
+
contentId: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
19429
|
+
sceneId: (_v = (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.scene) === null || _u === void 0 ? void 0 : _u.sceneId) !== null && _v !== void 0 ? _v : '',
|
19430
|
+
productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
19379
19431
|
requestId: null,
|
19380
|
-
traceInfo: (
|
19432
|
+
traceInfo: (_1 = (_z = (_y = item === null || item === void 0 ? void 0 : item.video) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_0 = item === null || item === void 0 ? void 0 : item.product) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '',
|
19381
19433
|
contentFormat,
|
19382
|
-
position: ((
|
19434
|
+
position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
|
19383
19435
|
}
|
19384
19436
|
});
|
19385
19437
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -19405,7 +19457,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19405
19457
|
}
|
19406
19458
|
}, [openHashtag, data, activeIndex]);
|
19407
19459
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
19408
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
19460
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
19409
19461
|
const item = data[activeIndex];
|
19410
19462
|
// 如果是图片集则上报事件
|
19411
19463
|
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)) {
|
@@ -19416,9 +19468,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19416
19468
|
eventSubject: 'viewImageCarouselStart',
|
19417
19469
|
eventDescription: 'User start view the image carousel',
|
19418
19470
|
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 : '',
|
19419
|
-
|
19471
|
+
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 : '',
|
19472
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
19420
19473
|
imageStartTime: `${startTime}`,
|
19421
|
-
contentTags: JSON.stringify((
|
19474
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
19422
19475
|
position: activeIndex + '',
|
19423
19476
|
contentFormat: 'image',
|
19424
19477
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
@@ -19428,11 +19481,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19428
19481
|
if (enableCapi) {
|
19429
19482
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19430
19483
|
eventName: 'ViewContent',
|
19431
|
-
product: (
|
19484
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
|
19432
19485
|
});
|
19433
19486
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
19434
19487
|
eventName: 'PageView',
|
19435
|
-
product: (
|
19488
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
|
19436
19489
|
});
|
19437
19490
|
}
|
19438
19491
|
}
|
@@ -19524,15 +19577,20 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
19524
19577
|
swiperRef.current.swiper.allowTouchMove = true;
|
19525
19578
|
}, 500);
|
19526
19579
|
}, onActiveIndexChange: (swiper) => {
|
19580
|
+
var _a, _b;
|
19527
19581
|
setActiveIndex(swiper.activeIndex);
|
19528
19582
|
if (openHashtag)
|
19529
19583
|
return;
|
19530
19584
|
// 处理上滑下滑事件
|
19531
19585
|
handleScrollEvent(swiper);
|
19532
|
-
if (waterFallData || isEditor
|
19586
|
+
if (waterFallData || isEditor)
|
19533
19587
|
return;
|
19534
19588
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19535
19589
|
if (!isLoadMore) {
|
19590
|
+
if (isDiyH5) {
|
19591
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19592
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19593
|
+
}
|
19536
19594
|
setIsLoadMore(true);
|
19537
19595
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19538
19596
|
var _a;
|
@@ -19585,7 +19643,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19585
19643
|
}, []);
|
19586
19644
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19587
19645
|
const handlePlaying = React.useCallback(() => {
|
19588
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19646
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19589
19647
|
setIsPauseVideo(false);
|
19590
19648
|
const item = data[index];
|
19591
19649
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -19598,14 +19656,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19598
19656
|
eventSubject: 'playVideo',
|
19599
19657
|
eventDescription: 'User played the video',
|
19600
19658
|
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 : '',
|
19601
|
-
|
19659
|
+
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 : '',
|
19660
|
+
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 : '',
|
19602
19661
|
playType,
|
19603
19662
|
startTime: videoCurrentTime,
|
19604
19663
|
videoDuration,
|
19605
|
-
contentTags: JSON.stringify((
|
19664
|
+
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 : []),
|
19606
19665
|
position: index + '',
|
19607
19666
|
contentFormat: 'video',
|
19608
|
-
traceInfo: (
|
19667
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19609
19668
|
}
|
19610
19669
|
});
|
19611
19670
|
setIsFirstPlay(false);
|
@@ -19644,7 +19703,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19644
19703
|
}
|
19645
19704
|
}, [isLoadFinish]);
|
19646
19705
|
const onPause = React.useCallback(() => {
|
19647
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
19706
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
19648
19707
|
const item = data[index];
|
19649
19708
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19650
19709
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -19655,14 +19714,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
19655
19714
|
eventSubject: 'playOverVideo',
|
19656
19715
|
eventDescription: 'User finished playing the video',
|
19657
19716
|
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 : '',
|
19658
|
-
|
19717
|
+
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 : '',
|
19718
|
+
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 : '',
|
19659
19719
|
endTime: videoCurrentTime,
|
19660
19720
|
videoDuration,
|
19661
19721
|
playDuration,
|
19662
|
-
contentTags: JSON.stringify((
|
19722
|
+
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 : []),
|
19663
19723
|
position: index + '',
|
19664
19724
|
contentFormat: 'video',
|
19665
|
-
traceInfo: (
|
19725
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
19666
19726
|
}
|
19667
19727
|
});
|
19668
19728
|
}
|