pb-sxp-ui 1.20.13 → 1.20.15
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +1187 -383
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +73 -72
- package/dist/index.js +1187 -384
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +7 -7
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +7 -7
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +1187 -383
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +7 -7
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/es/core/components/DiyStoryPreview/index.js +10 -4
- package/es/core/components/StructurePage/index.d.ts +89 -0
- package/es/core/components/StructurePage/index.js +700 -0
- package/es/core/components/SxpPageRender/LikeButton/index.js +20 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
- package/es/core/components/SxpPageRender/VideoWidget/index.js +33 -46
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/fakeData.js +1 -1
- package/es/core/components/SxpPageRender/index.js +66 -44
- package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/es/core/context/SxpDataSourceProvider.js +84 -38
- package/es/core/hooks/useEventReport.js +6 -5
- package/es/core/hooks/useVisibleHeight.js +7 -7
- package/es/core/index.d.ts +2 -0
- package/es/core/index.js +1 -0
- package/es/core/utils/materials.d.ts +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/materials/sxp/MultiPosts/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetail/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/lib/core/components/DiyStoryPreview/index.js +10 -4
- package/lib/core/components/StructurePage/index.d.ts +89 -0
- package/lib/core/components/StructurePage/index.js +702 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.js +20 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +33 -46
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/fakeData.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +66 -44
- package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/lib/core/context/SxpDataSourceProvider.js +84 -38
- package/lib/core/hooks/useEventReport.js +6 -5
- package/lib/core/hooks/useVisibleHeight.js +7 -7
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +6 -1
- package/lib/core/utils/materials.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/materials/sxp/MultiPosts/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/package.json +111 -111
package/dist/pb-ui.js
CHANGED
|
@@ -660,6 +660,7 @@
|
|
|
660
660
|
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 }) => {
|
|
661
661
|
var _a, _b, _c, _d, _e;
|
|
662
662
|
const [rtcList, setRtcList] = React.useState([]);
|
|
663
|
+
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
|
663
664
|
const [tagList, setTagList] = React.useState([]);
|
|
664
665
|
const [loading, setLoading] = React.useState(true);
|
|
665
666
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
|
@@ -670,6 +671,10 @@
|
|
|
670
671
|
const [popupDetailData, setPopupDetailData] = React.useState();
|
|
671
672
|
const [waterFallData, setWaterFallData] = React.useState();
|
|
672
673
|
const [openHashtag, setOpenHashtag] = React.useState(isOpenHashTag);
|
|
674
|
+
// 将 setPopupDetailData 挂载到 window 对象,供 StructurePage 使用
|
|
675
|
+
if (typeof window !== 'undefined') {
|
|
676
|
+
window.setPopupDetailData = setPopupDetailData;
|
|
677
|
+
}
|
|
673
678
|
const [cacheRtcList, setCacheRtcList] = React.useState([]);
|
|
674
679
|
const [cacheActiveIndex, setCacheActiveIndex] = React.useState(0);
|
|
675
680
|
const [isFromHashtag, setIsFromHashtag] = React.useState(false);
|
|
@@ -691,6 +696,10 @@
|
|
|
691
696
|
const [chatlabsId, setChatlabsId] = React.useState();
|
|
692
697
|
const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
|
693
698
|
const pixelPvStatusRef = React.useRef(false);
|
|
699
|
+
const isDiyPage = React.useMemo(() => {
|
|
700
|
+
var _a, _b, _c;
|
|
701
|
+
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);
|
|
702
|
+
}, [isDiyH5, finalPageData]);
|
|
694
703
|
React.useEffect(() => {
|
|
695
704
|
var _a, _b;
|
|
696
705
|
setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
|
|
@@ -796,7 +805,7 @@
|
|
|
796
805
|
};
|
|
797
806
|
// bff API 请求方法
|
|
798
807
|
const bffFetch = React.useCallback((path, options, isBota = true) => {
|
|
799
|
-
var _a;
|
|
808
|
+
var _a, _b;
|
|
800
809
|
if (!bffDataSource)
|
|
801
810
|
return;
|
|
802
811
|
const url = bffDataSource.url;
|
|
@@ -809,8 +818,9 @@
|
|
|
809
818
|
val.split('=')[0];
|
|
810
819
|
val.split('=')[1];
|
|
811
820
|
});
|
|
821
|
+
options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
|
|
812
822
|
return window
|
|
813
|
-
.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
|
|
823
|
+
.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
|
|
814
824
|
? JSON.stringify({
|
|
815
825
|
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
|
816
826
|
})
|
|
@@ -1095,8 +1105,8 @@
|
|
|
1095
1105
|
}, [bffDataSource]);
|
|
1096
1106
|
// 获取推荐视频数据
|
|
1097
1107
|
const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1098
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1099
|
-
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 })), (
|
|
1108
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1109
|
+
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' }));
|
|
1100
1110
|
if (channel) {
|
|
1101
1111
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
|
1102
1112
|
}
|
|
@@ -1109,9 +1119,10 @@
|
|
|
1109
1119
|
if (val)
|
|
1110
1120
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
|
1111
1121
|
}
|
|
1122
|
+
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);
|
|
1112
1123
|
if (isEditor) {
|
|
1113
1124
|
let pageNum = 1;
|
|
1114
|
-
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] }));
|
|
1125
|
+
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 }));
|
|
1115
1126
|
if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
|
|
1116
1127
|
return undefined;
|
|
1117
1128
|
}
|
|
@@ -1119,19 +1130,24 @@
|
|
|
1119
1130
|
let list = [];
|
|
1120
1131
|
let result = null;
|
|
1121
1132
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1122
|
-
var
|
|
1133
|
+
var _y, _z, _0, _1, _2, _3;
|
|
1123
1134
|
query.pageNum = pageNum;
|
|
1124
|
-
result =
|
|
1135
|
+
result = isDiyH5
|
|
1136
|
+
? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
|
|
1137
|
+
: yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/direct_page', { method: 'POST', body: query }));
|
|
1125
1138
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1126
1139
|
return undefined;
|
|
1127
1140
|
}
|
|
1128
1141
|
setLoading(false);
|
|
1129
|
-
list = list.concat((
|
|
1142
|
+
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 : []);
|
|
1130
1143
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
|
1131
1144
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1132
1145
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1146
|
+
if (isDiyPage) {
|
|
1147
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
1148
|
+
}
|
|
1133
1149
|
}
|
|
1134
|
-
const isNotNullList = (
|
|
1150
|
+
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));
|
|
1135
1151
|
if (isNotNullList) {
|
|
1136
1152
|
pageNum = pageNum + 1;
|
|
1137
1153
|
yield recurveRecList(query);
|
|
@@ -1139,42 +1155,61 @@
|
|
|
1139
1155
|
});
|
|
1140
1156
|
yield recurveRecList(query);
|
|
1141
1157
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
|
1142
|
-
setCurReqInfo({ rtc: (
|
|
1158
|
+
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 });
|
|
1143
1159
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
|
1144
1160
|
}
|
|
1145
1161
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
|
1146
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
|
1162
|
+
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 }));
|
|
1147
1163
|
}
|
|
1148
|
-
const result =
|
|
1149
|
-
method: 'POST',
|
|
1150
|
-
|
|
1151
|
-
|
|
1164
|
+
const result = isDiy
|
|
1165
|
+
? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
|
|
1166
|
+
: yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
|
|
1167
|
+
method: 'POST',
|
|
1168
|
+
body: query
|
|
1169
|
+
}));
|
|
1152
1170
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
|
1153
1171
|
return undefined;
|
|
1154
1172
|
}
|
|
1155
1173
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
|
1156
1174
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
|
1157
1175
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
|
1158
|
-
const isNotNullList = (
|
|
1176
|
+
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));
|
|
1159
1177
|
if (!isNotNullList) {
|
|
1160
1178
|
setIsNoMoreData(true);
|
|
1161
1179
|
}
|
|
1162
1180
|
}
|
|
1163
1181
|
let list = [];
|
|
1164
|
-
list = list.concat((
|
|
1182
|
+
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 : []);
|
|
1165
1183
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
|
1166
|
-
}), [
|
|
1184
|
+
}), [
|
|
1185
|
+
bffFetch,
|
|
1186
|
+
utmVal,
|
|
1187
|
+
maxSize,
|
|
1188
|
+
defaultSize,
|
|
1189
|
+
channelQueryList,
|
|
1190
|
+
channel,
|
|
1191
|
+
chatlabsId,
|
|
1192
|
+
bffFetchAdmin,
|
|
1193
|
+
isDiyPage,
|
|
1194
|
+
finalPageData,
|
|
1195
|
+
isDiyH5
|
|
1196
|
+
]);
|
|
1167
1197
|
const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1168
|
-
var
|
|
1198
|
+
var _4, _5, _6, _7;
|
|
1169
1199
|
if (rtcList.length <= 0) {
|
|
1170
1200
|
return;
|
|
1171
1201
|
}
|
|
1202
|
+
if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
|
1203
|
+
setRtcList(rtcList.concat(firstRtcList));
|
|
1204
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1172
1207
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
|
1173
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
|
1208
|
+
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 })));
|
|
1174
1209
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
|
1175
1210
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
|
1176
1211
|
return data;
|
|
1177
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
|
1212
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
|
|
1178
1213
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
|
1179
1214
|
var _a, _b, _c, _d, _e;
|
|
1180
1215
|
let expire = false;
|
|
@@ -1205,8 +1240,8 @@
|
|
|
1205
1240
|
// 用户信息都是公共的
|
|
1206
1241
|
if (!userInfo) {
|
|
1207
1242
|
userInfo = {
|
|
1208
|
-
|
|
1209
|
-
|
|
1243
|
+
productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
|
|
1244
|
+
// tpChannelId: 'H5' // 后端处理
|
|
1210
1245
|
};
|
|
1211
1246
|
}
|
|
1212
1247
|
const sessionID = storeAndLoadFeSessionId();
|
|
@@ -1240,7 +1275,8 @@
|
|
|
1240
1275
|
layoutVariantId,
|
|
1241
1276
|
globalConfig,
|
|
1242
1277
|
playbookType,
|
|
1243
|
-
bffDataSource
|
|
1278
|
+
bffDataSource,
|
|
1279
|
+
fakeUserId
|
|
1244
1280
|
]);
|
|
1245
1281
|
const getEventParamsByJson = React.useCallback((_a) => {
|
|
1246
1282
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -1326,6 +1362,7 @@
|
|
|
1326
1362
|
var _a;
|
|
1327
1363
|
const prop = match.substring(2, match.length - 2);
|
|
1328
1364
|
try {
|
|
1365
|
+
// eslint-disable-next-line no-new-func
|
|
1329
1366
|
let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
|
|
1330
1367
|
if (replaceValue) {
|
|
1331
1368
|
if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
|
|
@@ -1427,38 +1464,40 @@
|
|
|
1427
1464
|
}
|
|
1428
1465
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
|
|
1429
1466
|
const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1467
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1430
1468
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
|
|
1431
1469
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1432
|
-
}), [bffFetch]);
|
|
1470
|
+
}), [bffFetch, fakeUserId]);
|
|
1433
1471
|
const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1472
|
+
body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
|
|
1434
1473
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
|
|
1435
1474
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1436
|
-
}), [bffFetch]);
|
|
1475
|
+
}), [bffFetch, fakeUserId]);
|
|
1437
1476
|
const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1438
1477
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
|
|
1439
1478
|
return res === null || res === void 0 ? void 0 : res.success;
|
|
1440
1479
|
}), [bffFetch]);
|
|
1441
1480
|
// 获取 Tag
|
|
1442
1481
|
const bffGetTagList = React.useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1443
|
-
var
|
|
1444
|
-
const isShowTag = !!((
|
|
1482
|
+
var _8, _9, _10, _11, _12, _13, _14, _15;
|
|
1483
|
+
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);
|
|
1445
1484
|
if (!utmVal || !isShowTag)
|
|
1446
1485
|
return;
|
|
1447
1486
|
try {
|
|
1448
|
-
const val = (
|
|
1487
|
+
const val = (_13 = (_12 = (_11 = splitUrlParams(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
|
|
1449
1488
|
var _a, _b;
|
|
1450
1489
|
const key = val.split('=')[0];
|
|
1451
1490
|
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);
|
|
1452
|
-
})) === null ||
|
|
1491
|
+
})) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
|
|
1453
1492
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
|
1454
|
-
setTagList((
|
|
1493
|
+
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 : []);
|
|
1455
1494
|
}
|
|
1456
1495
|
catch (e) {
|
|
1457
1496
|
console.log('e', e);
|
|
1458
1497
|
}
|
|
1459
1498
|
}), [bffFetch, utmVal]);
|
|
1460
1499
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
|
|
1461
|
-
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;
|
|
1500
|
+
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;
|
|
1462
1501
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
|
1463
1502
|
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);
|
|
1464
1503
|
let fromKName = '';
|
|
@@ -1476,7 +1515,7 @@
|
|
|
1476
1515
|
}
|
|
1477
1516
|
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;
|
|
1478
1517
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
1479
|
-
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: (
|
|
1518
|
+
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 })
|
|
1480
1519
|
});
|
|
1481
1520
|
}, [bffEventReport, isFromHashtag]);
|
|
1482
1521
|
const h5EnterLink = React.useCallback(() => {
|
|
@@ -1500,10 +1539,10 @@
|
|
|
1500
1539
|
});
|
|
1501
1540
|
}, [bffEventReport]);
|
|
1502
1541
|
const getAccount = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
1503
|
-
var
|
|
1542
|
+
var _16, _17;
|
|
1504
1543
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
|
1505
|
-
setChatlabsId((
|
|
1506
|
-
return ((
|
|
1544
|
+
setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
|
|
1545
|
+
return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
|
|
1507
1546
|
}), [bffFetch]);
|
|
1508
1547
|
const accountSonsent = React.useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1509
1548
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
|
@@ -1567,6 +1606,9 @@
|
|
|
1567
1606
|
}
|
|
1568
1607
|
setRtcList(list);
|
|
1569
1608
|
setCacheRtcList(list);
|
|
1609
|
+
if (isDiyPage) {
|
|
1610
|
+
setFirstRtcList(list);
|
|
1611
|
+
}
|
|
1570
1612
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
|
1571
1613
|
if (channel) {
|
|
1572
1614
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
|
@@ -1586,7 +1628,7 @@
|
|
|
1586
1628
|
});
|
|
1587
1629
|
setLoading(false);
|
|
1588
1630
|
});
|
|
1589
|
-
}, [isShowConsent, channel]);
|
|
1631
|
+
}, [isShowConsent, channel, isDiyPage]);
|
|
1590
1632
|
// cms预览
|
|
1591
1633
|
React.useEffect(() => {
|
|
1592
1634
|
if (!isPreview)
|
|
@@ -1602,12 +1644,15 @@
|
|
|
1602
1644
|
}
|
|
1603
1645
|
setRtcList(list);
|
|
1604
1646
|
setCacheRtcList(list);
|
|
1647
|
+
if (isDiyPage) {
|
|
1648
|
+
setFirstRtcList(list);
|
|
1649
|
+
}
|
|
1605
1650
|
}
|
|
1606
1651
|
})
|
|
1607
1652
|
.finally(() => {
|
|
1608
1653
|
setLoading(false);
|
|
1609
1654
|
});
|
|
1610
|
-
}, [getRecommendVideos, bffGetTagList, channel]);
|
|
1655
|
+
}, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
|
|
1611
1656
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
|
1612
1657
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
|
1613
1658
|
rtcList,
|
|
@@ -1665,7 +1710,8 @@
|
|
|
1665
1710
|
refreshFeSession,
|
|
1666
1711
|
getAccount,
|
|
1667
1712
|
accountSonsent,
|
|
1668
|
-
isDiyH5,
|
|
1713
|
+
isDiyH5: isDiyPage,
|
|
1714
|
+
firstRtcList,
|
|
1669
1715
|
pixelPvStatusRef
|
|
1670
1716
|
} }, 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({
|
|
1671
1717
|
rtcList,
|
|
@@ -1900,9 +1946,820 @@
|
|
|
1900
1946
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
|
1901
1947
|
});
|
|
1902
1948
|
|
|
1949
|
+
const FormatImage = React.forwardRef((props, ref) => {
|
|
1950
|
+
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
|
1951
|
+
const [imgSrc, setImgSrc] = React.useState(src);
|
|
1952
|
+
const imgRef = React.useRef(null);
|
|
1953
|
+
const [visible, setVisible] = React.useState(false);
|
|
1954
|
+
React.useImperativeHandle(ref, () => ({
|
|
1955
|
+
setSrc: (v) => {
|
|
1956
|
+
if (v)
|
|
1957
|
+
setImgSrc(v);
|
|
1958
|
+
}
|
|
1959
|
+
}));
|
|
1960
|
+
React.useEffect(() => {
|
|
1961
|
+
if (src)
|
|
1962
|
+
setImgSrc(src);
|
|
1963
|
+
}, [src]);
|
|
1964
|
+
React.useEffect(() => {
|
|
1965
|
+
const onShow = () => {
|
|
1966
|
+
if (src && !visible && imgRef.current) {
|
|
1967
|
+
imgRef.current.src = '';
|
|
1968
|
+
imgRef.current.src = src;
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1971
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
|
1972
|
+
return () => {
|
|
1973
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
|
1974
|
+
};
|
|
1975
|
+
}, [src, visible]);
|
|
1976
|
+
return (React.createElement(React.Fragment, null,
|
|
1977
|
+
!visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
|
1978
|
+
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
|
1979
|
+
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
|
1980
|
+
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
|
1981
|
+
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
|
1982
|
+
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
|
1983
|
+
setVisible(true);
|
|
1984
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
|
1985
|
+
}, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
|
1986
|
+
setVisible(true);
|
|
1987
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
|
1988
|
+
}, alt: alt }))));
|
|
1989
|
+
});
|
|
1990
|
+
var FormatImage$1 = React.memo(FormatImage);
|
|
1991
|
+
|
|
1992
|
+
// 动态导入材料库(避免循环依赖)
|
|
1993
|
+
const RESOLVER$3 = {};
|
|
1994
|
+
try {
|
|
1995
|
+
// 尝试动态导入材料库
|
|
1996
|
+
const materialsModule = require('../../materials/sxp');
|
|
1997
|
+
Object.values(materialsModule).forEach((v) => {
|
|
1998
|
+
var _a;
|
|
1999
|
+
if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
|
|
2000
|
+
RESOLVER$3[v.extend.type] = v;
|
|
2001
|
+
}
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
catch (error) {
|
|
2005
|
+
console.warn('Failed to load materials for StructurePage:', error);
|
|
2006
|
+
}
|
|
2007
|
+
// 基础样式定义
|
|
2008
|
+
const baseStyles = {
|
|
2009
|
+
container: {
|
|
2010
|
+
backgroundColor: '#000',
|
|
2011
|
+
overflowY: 'auto',
|
|
2012
|
+
overflowX: 'hidden',
|
|
2013
|
+
padding: 0,
|
|
2014
|
+
boxSizing: 'border-box'
|
|
2015
|
+
},
|
|
2016
|
+
section: {
|
|
2017
|
+
width: '100%',
|
|
2018
|
+
position: 'relative',
|
|
2019
|
+
boxSizing: 'border-box'
|
|
2020
|
+
},
|
|
2021
|
+
// Hero Section
|
|
2022
|
+
heroSection: {
|
|
2023
|
+
width: '100%',
|
|
2024
|
+
height: 'auto',
|
|
2025
|
+
position: 'relative',
|
|
2026
|
+
overflow: 'hidden',
|
|
2027
|
+
backgroundColor: '#000'
|
|
2028
|
+
},
|
|
2029
|
+
heroTopText: {
|
|
2030
|
+
width: '100%',
|
|
2031
|
+
padding: '20px',
|
|
2032
|
+
backgroundColor: '#fff',
|
|
2033
|
+
color: '#000',
|
|
2034
|
+
fontSize: '16px',
|
|
2035
|
+
fontWeight: 'bold',
|
|
2036
|
+
textAlign: 'center',
|
|
2037
|
+
boxSizing: 'border-box'
|
|
2038
|
+
},
|
|
2039
|
+
heroImageContainer: {
|
|
2040
|
+
width: '100%',
|
|
2041
|
+
position: 'relative',
|
|
2042
|
+
overflow: 'hidden'
|
|
2043
|
+
},
|
|
2044
|
+
heroImage: {
|
|
2045
|
+
width: '100%',
|
|
2046
|
+
height: 'auto',
|
|
2047
|
+
display: 'block',
|
|
2048
|
+
objectFit: 'cover'
|
|
2049
|
+
},
|
|
2050
|
+
heroVideo: {
|
|
2051
|
+
width: '100%',
|
|
2052
|
+
height: 'auto',
|
|
2053
|
+
display: 'block',
|
|
2054
|
+
objectFit: 'cover'
|
|
2055
|
+
},
|
|
2056
|
+
heroOverlay: {
|
|
2057
|
+
position: 'absolute',
|
|
2058
|
+
bottom: 0,
|
|
2059
|
+
left: 0,
|
|
2060
|
+
right: 0,
|
|
2061
|
+
padding: '40px 20px',
|
|
2062
|
+
background: 'linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%)',
|
|
2063
|
+
color: '#fff',
|
|
2064
|
+
display: 'flex',
|
|
2065
|
+
justifyContent: 'center',
|
|
2066
|
+
alignItems: 'center'
|
|
2067
|
+
},
|
|
2068
|
+
heroButton: {
|
|
2069
|
+
padding: '12px 30px',
|
|
2070
|
+
backgroundColor: '#fff',
|
|
2071
|
+
color: '#000',
|
|
2072
|
+
border: 'none',
|
|
2073
|
+
fontSize: '14px',
|
|
2074
|
+
fontWeight: 500,
|
|
2075
|
+
cursor: 'pointer',
|
|
2076
|
+
textTransform: 'uppercase'
|
|
2077
|
+
},
|
|
2078
|
+
// Carousel Section
|
|
2079
|
+
carouselSection: {
|
|
2080
|
+
width: '100%',
|
|
2081
|
+
position: 'relative'
|
|
2082
|
+
},
|
|
2083
|
+
carouselImageContainer: {
|
|
2084
|
+
width: '100%',
|
|
2085
|
+
height: 'auto',
|
|
2086
|
+
position: 'relative',
|
|
2087
|
+
overflow: 'hidden'
|
|
2088
|
+
},
|
|
2089
|
+
carouselContainer: {
|
|
2090
|
+
display: 'flex',
|
|
2091
|
+
transition: 'transform 0.5s ease-in-out',
|
|
2092
|
+
width: '100%'
|
|
2093
|
+
},
|
|
2094
|
+
carouselSlide: {
|
|
2095
|
+
minWidth: '100%',
|
|
2096
|
+
position: 'relative'
|
|
2097
|
+
},
|
|
2098
|
+
carouselImage: {
|
|
2099
|
+
width: '100%',
|
|
2100
|
+
height: 'auto',
|
|
2101
|
+
display: 'block',
|
|
2102
|
+
objectFit: 'cover'
|
|
2103
|
+
},
|
|
2104
|
+
carouselVideo: {
|
|
2105
|
+
width: '100%',
|
|
2106
|
+
height: 'auto',
|
|
2107
|
+
display: 'block',
|
|
2108
|
+
objectFit: 'cover'
|
|
2109
|
+
},
|
|
2110
|
+
carouselInfoSection: {
|
|
2111
|
+
width: '100%',
|
|
2112
|
+
padding: '20px',
|
|
2113
|
+
backgroundColor: '#000',
|
|
2114
|
+
color: '#fff',
|
|
2115
|
+
textAlign: 'center'
|
|
2116
|
+
},
|
|
2117
|
+
carouselText: {
|
|
2118
|
+
fontSize: '16px',
|
|
2119
|
+
fontWeight: 'normal',
|
|
2120
|
+
marginBottom: '15px',
|
|
2121
|
+
color: '#fff'
|
|
2122
|
+
},
|
|
2123
|
+
carouselButton: {
|
|
2124
|
+
padding: '10px 25px',
|
|
2125
|
+
backgroundColor: '#fff',
|
|
2126
|
+
color: '#000',
|
|
2127
|
+
border: '1px solid #fff',
|
|
2128
|
+
fontSize: '13px',
|
|
2129
|
+
fontWeight: 500,
|
|
2130
|
+
cursor: 'pointer',
|
|
2131
|
+
textTransform: 'uppercase'
|
|
2132
|
+
},
|
|
2133
|
+
arrowButton: {
|
|
2134
|
+
position: 'absolute',
|
|
2135
|
+
top: '50%',
|
|
2136
|
+
transform: 'translateY(-50%)',
|
|
2137
|
+
width: '40px',
|
|
2138
|
+
height: '40px',
|
|
2139
|
+
backgroundColor: 'rgba(255,255,255,0.8)',
|
|
2140
|
+
border: 'none',
|
|
2141
|
+
borderRadius: '50%',
|
|
2142
|
+
fontSize: '18px',
|
|
2143
|
+
cursor: 'pointer',
|
|
2144
|
+
zIndex: 10,
|
|
2145
|
+
display: 'flex',
|
|
2146
|
+
alignItems: 'center',
|
|
2147
|
+
justifyContent: 'center'
|
|
2148
|
+
},
|
|
2149
|
+
// Highlight Reveal Section
|
|
2150
|
+
highlightSection: {
|
|
2151
|
+
width: '100%',
|
|
2152
|
+
position: 'relative',
|
|
2153
|
+
backgroundColor: '#000'
|
|
2154
|
+
},
|
|
2155
|
+
highlightImageContainer: {
|
|
2156
|
+
width: '100%',
|
|
2157
|
+
aspectRatio: '1/1',
|
|
2158
|
+
position: 'relative',
|
|
2159
|
+
overflow: 'hidden'
|
|
2160
|
+
},
|
|
2161
|
+
highlightImage: {
|
|
2162
|
+
width: '100%',
|
|
2163
|
+
height: '100%',
|
|
2164
|
+
objectFit: 'cover',
|
|
2165
|
+
display: 'block'
|
|
2166
|
+
},
|
|
2167
|
+
highlightInfoSection: {
|
|
2168
|
+
width: '100%',
|
|
2169
|
+
padding: '20px',
|
|
2170
|
+
backgroundColor: '#000',
|
|
2171
|
+
color: '#fff',
|
|
2172
|
+
textAlign: 'center'
|
|
2173
|
+
},
|
|
2174
|
+
highlightTitle: {
|
|
2175
|
+
fontSize: '18px',
|
|
2176
|
+
fontWeight: 'bold',
|
|
2177
|
+
marginBottom: '10px',
|
|
2178
|
+
textAlign: 'center',
|
|
2179
|
+
color: '#fff'
|
|
2180
|
+
},
|
|
2181
|
+
highlightDesc: {
|
|
2182
|
+
fontSize: '14px',
|
|
2183
|
+
marginBottom: '15px',
|
|
2184
|
+
textAlign: 'center',
|
|
2185
|
+
lineHeight: '1.5',
|
|
2186
|
+
color: '#ccc'
|
|
2187
|
+
},
|
|
2188
|
+
highlightButton: {
|
|
2189
|
+
padding: '10px 25px',
|
|
2190
|
+
backgroundColor: 'transparent',
|
|
2191
|
+
color: '#fff',
|
|
2192
|
+
border: '1px solid #fff',
|
|
2193
|
+
fontSize: '13px',
|
|
2194
|
+
fontWeight: 500,
|
|
2195
|
+
cursor: 'pointer',
|
|
2196
|
+
textTransform: 'uppercase'
|
|
2197
|
+
},
|
|
2198
|
+
// Product Grid Section
|
|
2199
|
+
productGrid: {
|
|
2200
|
+
display: 'grid',
|
|
2201
|
+
gridTemplateColumns: '50% 50%',
|
|
2202
|
+
gridAutoRows: 'auto',
|
|
2203
|
+
gap: '0',
|
|
2204
|
+
width: '100%',
|
|
2205
|
+
backgroundColor: '#000',
|
|
2206
|
+
boxSizing: 'border-box',
|
|
2207
|
+
margin: 0,
|
|
2208
|
+
padding: 0,
|
|
2209
|
+
overflow: 'hidden'
|
|
2210
|
+
},
|
|
2211
|
+
productItem: {
|
|
2212
|
+
position: 'relative',
|
|
2213
|
+
backgroundColor: '#000',
|
|
2214
|
+
display: 'block',
|
|
2215
|
+
boxSizing: 'border-box',
|
|
2216
|
+
width: '100%',
|
|
2217
|
+
minWidth: 0,
|
|
2218
|
+
overflow: 'hidden'
|
|
2219
|
+
},
|
|
2220
|
+
productImageContainer: {
|
|
2221
|
+
width: '100%',
|
|
2222
|
+
paddingBottom: '100%',
|
|
2223
|
+
position: 'relative',
|
|
2224
|
+
overflow: 'hidden'
|
|
2225
|
+
},
|
|
2226
|
+
productImage: {
|
|
2227
|
+
position: 'absolute',
|
|
2228
|
+
top: 0,
|
|
2229
|
+
left: 0,
|
|
2230
|
+
width: '100%',
|
|
2231
|
+
height: '100%',
|
|
2232
|
+
objectFit: 'cover',
|
|
2233
|
+
display: 'block'
|
|
2234
|
+
},
|
|
2235
|
+
productCtaContainer: {
|
|
2236
|
+
width: '100%',
|
|
2237
|
+
padding: '15px',
|
|
2238
|
+
backgroundColor: '#000',
|
|
2239
|
+
textAlign: 'center',
|
|
2240
|
+
boxSizing: 'border-box'
|
|
2241
|
+
},
|
|
2242
|
+
productText: {
|
|
2243
|
+
width: '100%',
|
|
2244
|
+
padding: '15px',
|
|
2245
|
+
backgroundColor: '#000',
|
|
2246
|
+
color: '#fff',
|
|
2247
|
+
textAlign: 'center',
|
|
2248
|
+
fontSize: '14px',
|
|
2249
|
+
fontWeight: 'normal',
|
|
2250
|
+
boxSizing: 'border-box'
|
|
2251
|
+
},
|
|
2252
|
+
productButton: {
|
|
2253
|
+
padding: '8px 20px',
|
|
2254
|
+
backgroundColor: 'transparent',
|
|
2255
|
+
color: '#fff',
|
|
2256
|
+
border: '1px solid #fff',
|
|
2257
|
+
fontSize: '12px',
|
|
2258
|
+
fontWeight: 500,
|
|
2259
|
+
cursor: 'pointer',
|
|
2260
|
+
textTransform: 'uppercase',
|
|
2261
|
+
whiteSpace: 'nowrap'
|
|
2262
|
+
},
|
|
2263
|
+
// Footer Section
|
|
2264
|
+
footerSection: {
|
|
2265
|
+
width: '100%',
|
|
2266
|
+
position: 'relative',
|
|
2267
|
+
backgroundColor: '#000'
|
|
2268
|
+
},
|
|
2269
|
+
footerInfoSection: {
|
|
2270
|
+
width: '100%',
|
|
2271
|
+
padding: '20px',
|
|
2272
|
+
backgroundColor: '#000',
|
|
2273
|
+
color: '#fff',
|
|
2274
|
+
textAlign: 'center'
|
|
2275
|
+
},
|
|
2276
|
+
footerText: {
|
|
2277
|
+
fontSize: '18px',
|
|
2278
|
+
fontWeight: 'normal',
|
|
2279
|
+
marginBottom: '15px',
|
|
2280
|
+
lineHeight: '1.4',
|
|
2281
|
+
color: '#fff'
|
|
2282
|
+
},
|
|
2283
|
+
footerButton: {
|
|
2284
|
+
padding: '10px 25px',
|
|
2285
|
+
backgroundColor: 'transparent',
|
|
2286
|
+
color: '#fff',
|
|
2287
|
+
border: '1px solid #fff',
|
|
2288
|
+
fontSize: '13px',
|
|
2289
|
+
fontWeight: 500,
|
|
2290
|
+
cursor: 'pointer',
|
|
2291
|
+
textTransform: 'uppercase',
|
|
2292
|
+
marginBottom: '20px',
|
|
2293
|
+
display: 'inline-block'
|
|
2294
|
+
},
|
|
2295
|
+
footerImageContainer: {
|
|
2296
|
+
width: '100%',
|
|
2297
|
+
aspectRatio: '1/1',
|
|
2298
|
+
overflow: 'hidden'
|
|
2299
|
+
},
|
|
2300
|
+
footerImage: {
|
|
2301
|
+
width: '100%',
|
|
2302
|
+
height: '100%',
|
|
2303
|
+
objectFit: 'cover',
|
|
2304
|
+
display: 'block'
|
|
2305
|
+
}
|
|
2306
|
+
};
|
|
2307
|
+
const StructurePage = (_a) => {
|
|
2308
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2309
|
+
var { containerStyle, containerHeight = 664, containerWidth = 375, className = '', apiUrl = 'https://bff-be-dev.chatlabs.net/api/v1/recommend/list', requestBody, editorMode = false, multiCTAConfig: propMultiCTAConfig, videoPlayIcon: propVideoPlayIcon, isCmsMode = false, storyId, customHeaders } = _a, rest = __rest(_a, ["containerStyle", "containerHeight", "containerWidth", "className", "apiUrl", "requestBody", "editorMode", "multiCTAConfig", "videoPlayIcon", "isCmsMode", "storyId", "customHeaders"]);
|
|
2310
|
+
const [data, setData] = React.useState(null);
|
|
2311
|
+
const [loading, setLoading] = React.useState(true);
|
|
2312
|
+
const [error, setError] = React.useState(null);
|
|
2313
|
+
const [carouselIndex, setCarouselIndex] = React.useState(0);
|
|
2314
|
+
const heroVideoRef = React.useRef(null);
|
|
2315
|
+
const carouselVideoRefs = React.useRef([]);
|
|
2316
|
+
// 视频暂停状态管理
|
|
2317
|
+
const [isHeroVideoPaused, setIsHeroVideoPaused] = React.useState(false);
|
|
2318
|
+
const [carouselVideoPausedStates, setCarouselVideoPausedStates] = React.useState([]);
|
|
2319
|
+
// 从 schema 中获取 multiCTAConfig(优先使用 props 传入的)
|
|
2320
|
+
const { schema } = useEditor();
|
|
2321
|
+
const multiCTAConfig = React.useMemo(() => {
|
|
2322
|
+
var _a;
|
|
2323
|
+
return propMultiCTAConfig || ((_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.multiCTAConfig) || {};
|
|
2324
|
+
}, [propMultiCTAConfig, (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.multiCTAConfig]);
|
|
2325
|
+
// 默认播放图标 URL(直接使用 CDN 地址作为后备)
|
|
2326
|
+
const DEFAULT_PAUSE_ICON = 'https://sxph5-uat.chatlabs.net/pb_static/06f28a2025c74c1cb49be6767316d827.png';
|
|
2327
|
+
// 获取视频播放图标
|
|
2328
|
+
const videoPlayIcon = React.useMemo(() => {
|
|
2329
|
+
var _a, _b;
|
|
2330
|
+
// 优先使用 props 传入的
|
|
2331
|
+
if (propVideoPlayIcon)
|
|
2332
|
+
return propVideoPlayIcon;
|
|
2333
|
+
// 然后使用 schema 配置的
|
|
2334
|
+
const configIcon = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.videoPlayIcon;
|
|
2335
|
+
if (configIcon) {
|
|
2336
|
+
// 如果是完整 URL,直接使用
|
|
2337
|
+
if (configIcon.startsWith('http://') || configIcon.startsWith('https://')) {
|
|
2338
|
+
return configIcon;
|
|
2339
|
+
}
|
|
2340
|
+
// 如果是相对路径,拼接当前域名
|
|
2341
|
+
if (configIcon.startsWith('/')) {
|
|
2342
|
+
return `${window.location.origin}${configIcon}`;
|
|
2343
|
+
}
|
|
2344
|
+
return configIcon;
|
|
2345
|
+
}
|
|
2346
|
+
// 最后使用默认图标
|
|
2347
|
+
return DEFAULT_PAUSE_ICON;
|
|
2348
|
+
}, [propVideoPlayIcon, (_d = (_c = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _c === void 0 ? void 0 : _c.globalConfig) === null || _d === void 0 ? void 0 : _d.videoPlayIcon]);
|
|
2349
|
+
// 处理 CTA 点击
|
|
2350
|
+
const handleCtaClick = React.useCallback((link, interaction, productData, ctaData) => {
|
|
2351
|
+
// 如果配置了交互设置,优先使用交互设置
|
|
2352
|
+
if (interaction) {
|
|
2353
|
+
const { linkType, popupType, popupAni } = interaction;
|
|
2354
|
+
if (linkType === 'popup' && popupType) {
|
|
2355
|
+
// 设置弹窗要显示的产品数据
|
|
2356
|
+
if (productData && typeof window !== 'undefined' && window.setPopupDetailData) {
|
|
2357
|
+
// 构造与原有系统一致的数据结构
|
|
2358
|
+
const popupData = {
|
|
2359
|
+
video: {
|
|
2360
|
+
bindProduct: productData,
|
|
2361
|
+
bindProducts: [productData],
|
|
2362
|
+
bindCta: ctaData
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
window.setPopupDetailData(popupData);
|
|
2366
|
+
}
|
|
2367
|
+
// 打开弹窗 - 使用与现有系统一致的方式
|
|
2368
|
+
if (typeof window !== 'undefined' && window.sxpPopup) {
|
|
2369
|
+
// 如果有动画配置,传递动画参数;否则只传弹窗 ID
|
|
2370
|
+
if (popupAni && popupAni.name) {
|
|
2371
|
+
window.sxpPopup(popupType, popupAni);
|
|
2372
|
+
}
|
|
2373
|
+
else {
|
|
2374
|
+
window.sxpPopup(popupType);
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
return;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
// 默认行为:打开外部链接
|
|
2381
|
+
if (link) {
|
|
2382
|
+
window.open(link, '_blank');
|
|
2383
|
+
}
|
|
2384
|
+
}, []);
|
|
2385
|
+
// 合并基础样式和编辑器配置的样式
|
|
2386
|
+
const mergeStyles = React.useCallback((baseStyle, configKey) => {
|
|
2387
|
+
if (!editorMode || !multiCTAConfig[configKey]) {
|
|
2388
|
+
return baseStyle;
|
|
2389
|
+
}
|
|
2390
|
+
const config = multiCTAConfig[configKey];
|
|
2391
|
+
// 定义允许的样式属性列表
|
|
2392
|
+
const styleKeys = [
|
|
2393
|
+
'fontSize', 'color', 'textAlign', 'fontWeight',
|
|
2394
|
+
'backgroundColor', 'padding', 'margin', 'borderRadius',
|
|
2395
|
+
'showBorder', 'borderWidth', 'borderColor',
|
|
2396
|
+
'buttonBackgroundColor', 'buttonTextColor', 'buttonWidth', 'buttonHeight'
|
|
2397
|
+
];
|
|
2398
|
+
// 只处理样式相关的属性,忽略 interaction 等非样式属性
|
|
2399
|
+
const styleConfig = Object.keys(config)
|
|
2400
|
+
.filter(key => styleKeys.includes(key))
|
|
2401
|
+
.reduce((obj, key) => {
|
|
2402
|
+
obj[key] = config[key];
|
|
2403
|
+
return obj;
|
|
2404
|
+
}, {});
|
|
2405
|
+
// 如果配置中没有任何样式字段(只有 interaction),直接返回基础样式
|
|
2406
|
+
if (Object.keys(styleConfig).length === 0) {
|
|
2407
|
+
return baseStyle;
|
|
2408
|
+
}
|
|
2409
|
+
const customStyle = {};
|
|
2410
|
+
// 应用配置中的样式
|
|
2411
|
+
if (styleConfig.fontSize && typeof styleConfig.fontSize === 'number') {
|
|
2412
|
+
customStyle.fontSize = `${styleConfig.fontSize}px`;
|
|
2413
|
+
}
|
|
2414
|
+
if (styleConfig.color && typeof styleConfig.color === 'string') {
|
|
2415
|
+
customStyle.color = styleConfig.color;
|
|
2416
|
+
}
|
|
2417
|
+
if (styleConfig.textAlign && typeof styleConfig.textAlign === 'string') {
|
|
2418
|
+
customStyle.textAlign = styleConfig.textAlign;
|
|
2419
|
+
}
|
|
2420
|
+
if (styleConfig.fontWeight && typeof styleConfig.fontWeight === 'number') {
|
|
2421
|
+
customStyle.fontWeight = styleConfig.fontWeight;
|
|
2422
|
+
}
|
|
2423
|
+
if (styleConfig.backgroundColor && typeof styleConfig.backgroundColor === 'string') {
|
|
2424
|
+
customStyle.backgroundColor = styleConfig.backgroundColor;
|
|
2425
|
+
}
|
|
2426
|
+
if (styleConfig.padding && typeof styleConfig.padding === 'string') {
|
|
2427
|
+
customStyle.padding = styleConfig.padding;
|
|
2428
|
+
}
|
|
2429
|
+
if (styleConfig.margin && typeof styleConfig.margin === 'string') {
|
|
2430
|
+
customStyle.margin = styleConfig.margin;
|
|
2431
|
+
}
|
|
2432
|
+
if (styleConfig.borderRadius && typeof styleConfig.borderRadius === 'number') {
|
|
2433
|
+
customStyle.borderRadius = `${styleConfig.borderRadius}px`;
|
|
2434
|
+
}
|
|
2435
|
+
if (styleConfig.showBorder && styleConfig.borderWidth && typeof styleConfig.borderWidth === 'number') {
|
|
2436
|
+
customStyle.border = `${styleConfig.borderWidth}px solid ${styleConfig.borderColor || '#d9d9d9'}`;
|
|
2437
|
+
}
|
|
2438
|
+
// 按钮特殊样式
|
|
2439
|
+
if (styleConfig.buttonBackgroundColor && typeof styleConfig.buttonBackgroundColor === 'string') {
|
|
2440
|
+
customStyle.backgroundColor = styleConfig.buttonBackgroundColor;
|
|
2441
|
+
}
|
|
2442
|
+
if (styleConfig.buttonTextColor && typeof styleConfig.buttonTextColor === 'string') {
|
|
2443
|
+
customStyle.color = styleConfig.buttonTextColor;
|
|
2444
|
+
}
|
|
2445
|
+
if (styleConfig.buttonWidth && typeof styleConfig.buttonWidth === 'number') {
|
|
2446
|
+
customStyle.width = `${styleConfig.buttonWidth}px`;
|
|
2447
|
+
}
|
|
2448
|
+
if (styleConfig.buttonHeight && typeof styleConfig.buttonHeight === 'number') {
|
|
2449
|
+
customStyle.height = `${styleConfig.buttonHeight}px`;
|
|
2450
|
+
}
|
|
2451
|
+
return Object.assign(Object.assign({}, baseStyle), customStyle);
|
|
2452
|
+
}, [editorMode, multiCTAConfig]);
|
|
2453
|
+
// 渲染 CTA 按钮或模版组件
|
|
2454
|
+
const renderCTA = React.useCallback((buttonKey, ctaData, productData, fallbackStyle) => {
|
|
2455
|
+
var _a, _b, _c;
|
|
2456
|
+
if (!ctaData) {
|
|
2457
|
+
return null;
|
|
2458
|
+
}
|
|
2459
|
+
const config = multiCTAConfig[buttonKey];
|
|
2460
|
+
const templateType = config === null || config === void 0 ? void 0 : config.templateType;
|
|
2461
|
+
const interaction = config === null || config === void 0 ? void 0 : config.interaction;
|
|
2462
|
+
// 如果配置了模版类型,渲染对应的模版组件
|
|
2463
|
+
if (editorMode && templateType && RESOLVER$3[templateType]) {
|
|
2464
|
+
const TemplateComponent = RESOLVER$3[templateType];
|
|
2465
|
+
const templateExtend = TemplateComponent === null || TemplateComponent === void 0 ? void 0 : TemplateComponent.extend;
|
|
2466
|
+
if (templateExtend) {
|
|
2467
|
+
// 准备模版组件的 props
|
|
2468
|
+
const templateProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = templateExtend.defaulSetting) === null || _a === void 0 ? void 0 : _a.props), { style: Object.assign(Object.assign(Object.assign({}, (_b = templateExtend.defaulSetting) === null || _b === void 0 ? void 0 : _b.style), mergeStyles(fallbackStyle || {}, buttonKey)), { marginBottom: 0, width: '100%' }), textStyle: (_c = templateExtend.defaulSetting) === null || _c === void 0 ? void 0 : _c.textStyle }), (productData && { bindProduct: productData })), { isTel: true }), rest);
|
|
2469
|
+
// 渲染模版组件
|
|
2470
|
+
return React.createElement(TemplateComponent, templateProps);
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
// 默认渲染按钮
|
|
2474
|
+
return (React.createElement("button", { style: mergeStyles(fallbackStyle || baseStyles.heroButton, buttonKey), onClick: () => handleCtaClick(ctaData === null || ctaData === void 0 ? void 0 : ctaData.link, interaction, productData, ctaData) }, ctaData.title));
|
|
2475
|
+
}, [multiCTAConfig, editorMode, handleCtaClick, mergeStyles, rest]);
|
|
2476
|
+
// 获取数据 - 只在组件挂载时执行一次
|
|
2477
|
+
React.useEffect(() => {
|
|
2478
|
+
// 重要:在 PB 编辑器模式下,propMultiCTAConfig 只是样式配置,不是数据源
|
|
2479
|
+
// 只有在 CMS 模式 (isCmsMode=false) 且 propMultiCTAConfig 包含实际数据时才跳过 API 调用
|
|
2480
|
+
// 判断是否包含实际数据:检查是否有 heroSection, carouselSection 等数据字段
|
|
2481
|
+
const hasActualData = propMultiCTAConfig && (propMultiCTAConfig.heroSection ||
|
|
2482
|
+
propMultiCTAConfig.carouselSection ||
|
|
2483
|
+
propMultiCTAConfig.highlightRevealSection ||
|
|
2484
|
+
propMultiCTAConfig.productGridSection ||
|
|
2485
|
+
propMultiCTAConfig.footerSection);
|
|
2486
|
+
if (editorMode && hasActualData && !isCmsMode) {
|
|
2487
|
+
setLoading(false);
|
|
2488
|
+
setError(null);
|
|
2489
|
+
// 使用传入的 multiCTAConfig 作为数据源
|
|
2490
|
+
setData(propMultiCTAConfig);
|
|
2491
|
+
return;
|
|
2492
|
+
}
|
|
2493
|
+
// 如果已经有数据了,且在编辑器模式下,不要重新请求
|
|
2494
|
+
if (editorMode && data && !isCmsMode) {
|
|
2495
|
+
return;
|
|
2496
|
+
}
|
|
2497
|
+
setLoading(true);
|
|
2498
|
+
setError(null);
|
|
2499
|
+
// 根据模式决定使用哪个接口
|
|
2500
|
+
let finalApiUrl = apiUrl;
|
|
2501
|
+
let bodyToSend = {};
|
|
2502
|
+
if (isCmsMode) {
|
|
2503
|
+
// CMS 模式:使用 /api/console/ad/multiCta/rec/detail 接口
|
|
2504
|
+
if (!storyId) {
|
|
2505
|
+
console.error('[StructurePage CMS Mode] storyId is required but not provided');
|
|
2506
|
+
setError('storyId is required in CMS mode');
|
|
2507
|
+
setLoading(false);
|
|
2508
|
+
return;
|
|
2509
|
+
}
|
|
2510
|
+
// 构建 CMS 接口的 URL 和请求体
|
|
2511
|
+
// apiUrl 应该是域名(如 http://localhost:8001),然后拼接 /api/console/ad/multiCta/rec/detail
|
|
2512
|
+
finalApiUrl = `${apiUrl}/api/console/ad/multiCta/rec/detail`;
|
|
2513
|
+
bodyToSend = { storyId };
|
|
2514
|
+
}
|
|
2515
|
+
else {
|
|
2516
|
+
// 普通模式:使用原有的 /api/v1/recommend/list 接口
|
|
2517
|
+
const defaultBody = {
|
|
2518
|
+
maxSize: 20,
|
|
2519
|
+
defaultSize: 10,
|
|
2520
|
+
type: 'story'
|
|
2521
|
+
};
|
|
2522
|
+
bodyToSend = requestBody ? Object.assign(Object.assign({}, defaultBody), requestBody) : defaultBody;
|
|
2523
|
+
}
|
|
2524
|
+
// 构建请求头
|
|
2525
|
+
const headers = {
|
|
2526
|
+
'Content-Type': 'application/json'
|
|
2527
|
+
};
|
|
2528
|
+
if (isCmsMode) {
|
|
2529
|
+
// CMS 模式:使用自定义 headers(如果有传入)
|
|
2530
|
+
if (customHeaders) {
|
|
2531
|
+
Object.assign(headers, customHeaders);
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
else {
|
|
2535
|
+
// 普通模式:从 requestBody 或 bodyToSend 中提取 BFF headers
|
|
2536
|
+
if (bodyToSend['x-app-id']) {
|
|
2537
|
+
headers['x-app-id'] = bodyToSend['x-app-id'];
|
|
2538
|
+
delete bodyToSend['x-app-id'];
|
|
2539
|
+
}
|
|
2540
|
+
if (bodyToSend['x-user-id']) {
|
|
2541
|
+
headers['x-user-id'] = bodyToSend['x-user-id'];
|
|
2542
|
+
delete bodyToSend['x-user-id'];
|
|
2543
|
+
}
|
|
2544
|
+
if (bodyToSend['tenant-id']) {
|
|
2545
|
+
headers['tenant-id'] = bodyToSend['tenant-id'];
|
|
2546
|
+
delete bodyToSend['tenant-id'];
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
fetch(finalApiUrl, {
|
|
2550
|
+
method: 'POST',
|
|
2551
|
+
headers,
|
|
2552
|
+
body: JSON.stringify(bodyToSend),
|
|
2553
|
+
credentials: 'include'
|
|
2554
|
+
})
|
|
2555
|
+
.then((res) => {
|
|
2556
|
+
if (!res.ok) {
|
|
2557
|
+
throw new Error(`HTTP error! status: ${res.status}`);
|
|
2558
|
+
}
|
|
2559
|
+
return res.json();
|
|
2560
|
+
})
|
|
2561
|
+
.then((result) => {
|
|
2562
|
+
var _a, _b, _c, _d;
|
|
2563
|
+
if (result.code === '0' || result.code === '00000') {
|
|
2564
|
+
// 判断数据结构:CMS 模式和普通模式可能不同
|
|
2565
|
+
let multiCtaData = null;
|
|
2566
|
+
if (isCmsMode) {
|
|
2567
|
+
// CMS 模式:data.multiCta
|
|
2568
|
+
multiCtaData = (_a = result.data) === null || _a === void 0 ? void 0 : _a.multiCta;
|
|
2569
|
+
}
|
|
2570
|
+
else {
|
|
2571
|
+
// 普通模式:data.recList[0].multiCta
|
|
2572
|
+
multiCtaData = (_d = (_c = (_b = result.data) === null || _b === void 0 ? void 0 : _b.recList) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.multiCta;
|
|
2573
|
+
}
|
|
2574
|
+
if (multiCtaData) {
|
|
2575
|
+
setData(multiCtaData);
|
|
2576
|
+
}
|
|
2577
|
+
else {
|
|
2578
|
+
console.error('[StructurePage] No multiCta data found in response:', result);
|
|
2579
|
+
setError(result.message || 'No multiCta data found');
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
else {
|
|
2583
|
+
setError(result.message || 'Failed to load data');
|
|
2584
|
+
}
|
|
2585
|
+
setLoading(false);
|
|
2586
|
+
})
|
|
2587
|
+
.catch((err) => {
|
|
2588
|
+
console.error('[StructurePage] Failed to fetch data:', {
|
|
2589
|
+
error: err,
|
|
2590
|
+
message: err.message,
|
|
2591
|
+
url: finalApiUrl,
|
|
2592
|
+
body: bodyToSend,
|
|
2593
|
+
isCmsMode,
|
|
2594
|
+
storyId
|
|
2595
|
+
});
|
|
2596
|
+
setError(err.message || 'Network error');
|
|
2597
|
+
setLoading(false);
|
|
2598
|
+
});
|
|
2599
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2600
|
+
}, [apiUrl, isCmsMode, storyId, customHeaders]);
|
|
2601
|
+
// 注意:移除了 editorMode 和 propMultiCTAConfig 依赖,因为:
|
|
2602
|
+
// 1. editorMode 和 propMultiCTAConfig 在编辑器中频繁变化
|
|
2603
|
+
// 2. propMultiCTAConfig 只是样式配置,不是数据源
|
|
2604
|
+
// 3. 数据获取只应该在组件挂载时执行一次(除非 apiUrl/storyId 等关键参数变化)
|
|
2605
|
+
// Hero Section 视频自动播放
|
|
2606
|
+
React.useEffect(() => {
|
|
2607
|
+
var _a;
|
|
2608
|
+
if (heroVideoRef.current && ((_a = data === null || data === void 0 ? void 0 : data.heroSection) === null || _a === void 0 ? void 0 : _a.url)) {
|
|
2609
|
+
heroVideoRef.current.play().catch((err) => console.log('Video autoplay failed:', err));
|
|
2610
|
+
setIsHeroVideoPaused(false);
|
|
2611
|
+
}
|
|
2612
|
+
}, [data === null || data === void 0 ? void 0 : data.heroSection]);
|
|
2613
|
+
// 初始化 carousel 视频暂停状态
|
|
2614
|
+
React.useEffect(() => {
|
|
2615
|
+
if (data === null || data === void 0 ? void 0 : data.carouselSection) {
|
|
2616
|
+
// carousel 视频默认不自动播放,所以初始状态应该是暂停(true)
|
|
2617
|
+
setCarouselVideoPausedStates(new Array(data.carouselSection.length).fill(true));
|
|
2618
|
+
}
|
|
2619
|
+
}, [data === null || data === void 0 ? void 0 : data.carouselSection]);
|
|
2620
|
+
// Hero 视频点击处理
|
|
2621
|
+
const handleHeroVideoClick = React.useCallback(() => {
|
|
2622
|
+
if (heroVideoRef.current) {
|
|
2623
|
+
if (heroVideoRef.current.paused) {
|
|
2624
|
+
heroVideoRef.current.play();
|
|
2625
|
+
setIsHeroVideoPaused(false);
|
|
2626
|
+
}
|
|
2627
|
+
else {
|
|
2628
|
+
heroVideoRef.current.pause();
|
|
2629
|
+
setIsHeroVideoPaused(true);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
}, []);
|
|
2633
|
+
// Carousel 视频点击处理
|
|
2634
|
+
const handleCarouselVideoClick = React.useCallback((index) => {
|
|
2635
|
+
const videoRef = carouselVideoRefs.current[index];
|
|
2636
|
+
if (videoRef) {
|
|
2637
|
+
if (videoRef.paused) {
|
|
2638
|
+
videoRef.play();
|
|
2639
|
+
setCarouselVideoPausedStates(prev => {
|
|
2640
|
+
const newStates = [...prev];
|
|
2641
|
+
newStates[index] = false;
|
|
2642
|
+
return newStates;
|
|
2643
|
+
});
|
|
2644
|
+
}
|
|
2645
|
+
else {
|
|
2646
|
+
videoRef.pause();
|
|
2647
|
+
setCarouselVideoPausedStates(prev => {
|
|
2648
|
+
const newStates = [...prev];
|
|
2649
|
+
newStates[index] = true;
|
|
2650
|
+
return newStates;
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
}, []);
|
|
2655
|
+
// Carousel 导航
|
|
2656
|
+
const handleCarouselPrev = () => {
|
|
2657
|
+
if (data === null || data === void 0 ? void 0 : data.carouselSection) {
|
|
2658
|
+
setCarouselIndex((prev) => (prev === 0 ? data.carouselSection.length - 1 : prev - 1));
|
|
2659
|
+
}
|
|
2660
|
+
};
|
|
2661
|
+
const handleCarouselNext = () => {
|
|
2662
|
+
if (data === null || data === void 0 ? void 0 : data.carouselSection) {
|
|
2663
|
+
setCarouselIndex((prev) => (prev === data.carouselSection.length - 1 ? 0 : prev + 1));
|
|
2664
|
+
}
|
|
2665
|
+
};
|
|
2666
|
+
if (loading) {
|
|
2667
|
+
return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', fontSize: '16px' }) }, "Loading..."));
|
|
2668
|
+
}
|
|
2669
|
+
if (error) {
|
|
2670
|
+
return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', color: '#fff', padding: '20px', textAlign: 'center' }) },
|
|
2671
|
+
React.createElement("div", { style: { fontSize: '18px', marginBottom: '10px' } }, "\u26A0\uFE0F Error"),
|
|
2672
|
+
React.createElement("div", { style: { fontSize: '14px', opacity: 0.8 } }, error)));
|
|
2673
|
+
}
|
|
2674
|
+
if (!data) {
|
|
2675
|
+
return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', fontSize: '16px' }) }, "No data available"));
|
|
2676
|
+
}
|
|
2677
|
+
return (React.createElement("div", { className: className, style: Object.assign(Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth }), containerStyle) },
|
|
2678
|
+
data.heroSection && (React.createElement("div", { style: baseStyles.heroSection },
|
|
2679
|
+
data.heroSection.text && (React.createElement("div", { style: mergeStyles(baseStyles.heroTopText, 'heroTopText') }, data.heroSection.text)),
|
|
2680
|
+
React.createElement("div", { style: baseStyles.heroImageContainer },
|
|
2681
|
+
data.heroSection.url ? (React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: handleHeroVideoClick },
|
|
2682
|
+
React.createElement("video", { ref: heroVideoRef, src: data.heroSection.url, style: baseStyles.heroVideo, autoPlay: true, muted: true, loop: true, playsInline: true, controls: false }),
|
|
2683
|
+
isHeroVideoPaused && (React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_e = data.heroSection.imgUrls) === null || _e === void 0 ? void 0 : _e[0]) ? (React.createElement("img", { src: data.heroSection.imgUrls[0], alt: 'Hero', style: baseStyles.heroImage })) : null,
|
|
2684
|
+
React.createElement("div", { style: baseStyles.heroOverlay }, renderCTA('heroButton', (_g = (_f = data.heroSection.bindProducts) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.bindCta, (_h = data.heroSection.bindProducts) === null || _h === void 0 ? void 0 : _h[0], baseStyles.heroButton))))),
|
|
2685
|
+
data.carouselSection && data.carouselSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.carouselSection, 'carouselSection') },
|
|
2686
|
+
React.createElement("div", { style: baseStyles.carouselImageContainer },
|
|
2687
|
+
React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselContainer), { transform: `translateX(-${carouselIndex * 100}%)` }) }, data.carouselSection.map((item, index) => {
|
|
2688
|
+
var _a;
|
|
2689
|
+
return (React.createElement("div", { key: item.itemId, style: baseStyles.carouselSlide }, item.url ? (React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: () => handleCarouselVideoClick(index) },
|
|
2690
|
+
React.createElement("video", { ref: (el) => {
|
|
2691
|
+
carouselVideoRefs.current[index] = el;
|
|
2692
|
+
}, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false }),
|
|
2693
|
+
carouselVideoPausedStates[index] && (React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_a = item.imgUrls) === null || _a === void 0 ? void 0 : _a[0]) ? (React.createElement("img", { src: item.imgUrls[0], alt: item.text || 'Carousel', style: baseStyles.carouselImage })) : null));
|
|
2694
|
+
})),
|
|
2695
|
+
React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { left: '10px' }), onClick: handleCarouselPrev }, "\u2039"),
|
|
2696
|
+
React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { right: '10px' }), onClick: handleCarouselNext }, "\u203A")),
|
|
2697
|
+
React.createElement("div", { style: mergeStyles(baseStyles.carouselInfoSection, 'carouselSection') },
|
|
2698
|
+
((_j = data.carouselSection[carouselIndex]) === null || _j === void 0 ? void 0 : _j.text) && (React.createElement("div", { style: mergeStyles(baseStyles.carouselText, 'carouselSection') }, (_k = data.carouselSection[carouselIndex]) === null || _k === void 0 ? void 0 : _k.text)),
|
|
2699
|
+
renderCTA('carouselButton', (_o = (_m = (_l = data.carouselSection[carouselIndex]) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta, (_q = (_p = data.carouselSection[carouselIndex]) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0], baseStyles.carouselButton)))),
|
|
2700
|
+
data.highlightRevealSection && (React.createElement("div", { style: mergeStyles(baseStyles.highlightSection, 'highlightSection') },
|
|
2701
|
+
React.createElement("div", { style: baseStyles.highlightImageContainer },
|
|
2702
|
+
React.createElement("img", { src: data.highlightRevealSection.landingImageUrl || data.highlightRevealSection.cover, alt: data.highlightRevealSection.title, style: baseStyles.highlightImage })),
|
|
2703
|
+
React.createElement("div", { style: mergeStyles(baseStyles.highlightInfoSection, 'highlightSection') },
|
|
2704
|
+
React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.title),
|
|
2705
|
+
renderCTA('highlightButton', data.highlightRevealSection.bindCta, data.highlightRevealSection, baseStyles.highlightButton)))),
|
|
2706
|
+
data.productGridSection && data.productGridSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.productGrid, 'productGrid') }, (() => {
|
|
2707
|
+
// 创建一个6格的网格 (3行 x 2列),根据position放置产品
|
|
2708
|
+
const gridItems = [null, null, null, null, null, null];
|
|
2709
|
+
// 创建产品索引映射表:gridIndex -> 产品在数据数组中的索引(从1开始)
|
|
2710
|
+
const productIndexMap = {};
|
|
2711
|
+
data.productGridSection.forEach((product, idx) => {
|
|
2712
|
+
var _a;
|
|
2713
|
+
const pos = (_a = product.position) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
2714
|
+
let gridIndex = -1;
|
|
2715
|
+
if (pos === 'top_right') {
|
|
2716
|
+
gridIndex = 1; // 第一行右侧
|
|
2717
|
+
}
|
|
2718
|
+
else if (pos === 'top_left') {
|
|
2719
|
+
gridIndex = 0; // 第一行左侧
|
|
2720
|
+
}
|
|
2721
|
+
else if (pos === 'center_left') {
|
|
2722
|
+
gridIndex = 2; // 第二行左侧
|
|
2723
|
+
}
|
|
2724
|
+
else if (pos === 'center_right') {
|
|
2725
|
+
gridIndex = 3; // 第二行右侧
|
|
2726
|
+
}
|
|
2727
|
+
else if (pos === 'bottom_left') {
|
|
2728
|
+
gridIndex = 4; // 第三行左侧
|
|
2729
|
+
}
|
|
2730
|
+
else if (pos === 'bottom_right') {
|
|
2731
|
+
gridIndex = 5; // 第三行右侧
|
|
2732
|
+
}
|
|
2733
|
+
if (gridIndex >= 0) {
|
|
2734
|
+
gridItems[gridIndex] = product;
|
|
2735
|
+
// 映射:网格位置 -> 产品序号(基于数据数组的顺序,从1开始)
|
|
2736
|
+
productIndexMap[gridIndex] = idx + 1;
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2739
|
+
return gridItems.map((product, gridIndex) => {
|
|
2740
|
+
// 使用产品在数据数组中的实际索引来确定 buttonKey
|
|
2741
|
+
const productDataIndex = productIndexMap[gridIndex];
|
|
2742
|
+
const buttonKey = `productButton${productDataIndex || gridIndex + 1}`;
|
|
2743
|
+
return (React.createElement("div", { key: (product === null || product === void 0 ? void 0 : product.itemId) || `empty-${gridIndex}`, style: baseStyles.productItem }, product ? (React.createElement(React.Fragment, null,
|
|
2744
|
+
React.createElement("div", { style: baseStyles.productImageContainer },
|
|
2745
|
+
React.createElement("img", { src: product.landingImageUrl || product.cover,
|
|
2746
|
+
// alt={product.title}
|
|
2747
|
+
style: baseStyles.productImage })),
|
|
2748
|
+
product.bindCta && (React.createElement("div", { style: baseStyles.productCtaContainer }, renderCTA(buttonKey, product.bindCta, product, baseStyles.productButton))))) : (
|
|
2749
|
+
// 空格子
|
|
2750
|
+
React.createElement("div", { style: { width: '100%', paddingBottom: '100%' } }))));
|
|
2751
|
+
});
|
|
2752
|
+
})())),
|
|
2753
|
+
data.footerSection && (React.createElement("div", { style: mergeStyles(baseStyles.footerSection, 'footerSection') },
|
|
2754
|
+
React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') }, renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
|
|
2755
|
+
React.createElement("div", { style: baseStyles.footerImageContainer },
|
|
2756
|
+
React.createElement("img", { src: data.footerSection.landingImageUrl || data.footerSection.cover, alt: data.footerSection.title, style: baseStyles.footerImage }))))));
|
|
2757
|
+
};
|
|
2758
|
+
|
|
1903
2759
|
var index$3 = /*#__PURE__*/Object.freeze({
|
|
1904
2760
|
__proto__: null,
|
|
1905
|
-
EditorCore: EditorCore
|
|
2761
|
+
EditorCore: EditorCore,
|
|
2762
|
+
StructurePage: StructurePage
|
|
1906
2763
|
});
|
|
1907
2764
|
|
|
1908
2765
|
var interactionRender$h = [
|
|
@@ -2127,14 +2984,14 @@
|
|
|
2127
2984
|
* @Author: binruan@chatlabs.com
|
|
2128
2985
|
* @Date: 2024-03-12 10:59:06
|
|
2129
2986
|
* @LastEditors: binruan@chatlabs.com
|
|
2130
|
-
* @LastEditTime:
|
|
2987
|
+
* @LastEditTime: 2025-05-09 15:30:59
|
|
2131
2988
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
|
2132
2989
|
*
|
|
2133
2990
|
*/
|
|
2134
2991
|
function useEventReport() {
|
|
2135
2992
|
const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
|
|
2136
2993
|
const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
|
|
2137
|
-
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;
|
|
2994
|
+
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;
|
|
2138
2995
|
const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
|
|
2139
2996
|
if (i !== -1) {
|
|
2140
2997
|
return;
|
|
@@ -2167,11 +3024,11 @@
|
|
|
2167
3024
|
contentFormat = 'image';
|
|
2168
3025
|
}
|
|
2169
3026
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
2170
|
-
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 : '',
|
|
3027
|
+
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 }))
|
|
2171
3028
|
});
|
|
2172
3029
|
}, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
|
|
2173
3030
|
const productView = React.useCallback((data, product, cta, viewTime, position) => {
|
|
2174
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
3031
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
2175
3032
|
let fromKName = '';
|
|
2176
3033
|
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))) {
|
|
2177
3034
|
fromKName = 'pdpPage';
|
|
@@ -2190,8 +3047,9 @@
|
|
|
2190
3047
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
|
2191
3048
|
position: position + '',
|
|
2192
3049
|
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
3050
|
+
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 : '',
|
|
2193
3051
|
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
|
2194
|
-
traceInfo: (
|
|
3052
|
+
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 : '',
|
|
2195
3053
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
|
2196
3054
|
eventSubject: 'productView',
|
|
2197
3055
|
eventDescription: 'User browsed the product'
|
|
@@ -3850,9 +4708,8 @@
|
|
|
3850
4708
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
3851
4709
|
});
|
|
3852
4710
|
allSlidesSize -= spaceBetween;
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
4711
|
+
if (allSlidesSize < swiperSize) {
|
|
4712
|
+
const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
|
|
3856
4713
|
snapGrid.forEach((snap, snapIndex) => {
|
|
3857
4714
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
3858
4715
|
});
|
|
@@ -3956,13 +4813,6 @@
|
|
|
3956
4813
|
}
|
|
3957
4814
|
}
|
|
3958
4815
|
|
|
3959
|
-
const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
3960
|
-
if (condition && !slideEl.classList.contains(className)) {
|
|
3961
|
-
slideEl.classList.add(className);
|
|
3962
|
-
} else if (!condition && slideEl.classList.contains(className)) {
|
|
3963
|
-
slideEl.classList.remove(className);
|
|
3964
|
-
}
|
|
3965
|
-
};
|
|
3966
4816
|
function updateSlidesProgress(translate) {
|
|
3967
4817
|
if (translate === void 0) {
|
|
3968
4818
|
translate = this && this.translate || 0;
|
|
@@ -3978,6 +4828,11 @@
|
|
|
3978
4828
|
if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
|
|
3979
4829
|
let offsetCenter = -translate;
|
|
3980
4830
|
if (rtl) offsetCenter = translate;
|
|
4831
|
+
|
|
4832
|
+
// Visible Slides
|
|
4833
|
+
slides.forEach(slideEl => {
|
|
4834
|
+
slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass);
|
|
4835
|
+
});
|
|
3981
4836
|
swiper.visibleSlidesIndexes = [];
|
|
3982
4837
|
swiper.visibleSlides = [];
|
|
3983
4838
|
let spaceBetween = params.spaceBetween;
|
|
@@ -4001,9 +4856,11 @@
|
|
|
4001
4856
|
if (isVisible) {
|
|
4002
4857
|
swiper.visibleSlides.push(slide);
|
|
4003
4858
|
swiper.visibleSlidesIndexes.push(i);
|
|
4859
|
+
slides[i].classList.add(params.slideVisibleClass);
|
|
4860
|
+
}
|
|
4861
|
+
if (isFullyVisible) {
|
|
4862
|
+
slides[i].classList.add(params.slideFullyVisibleClass);
|
|
4004
4863
|
}
|
|
4005
|
-
toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
|
|
4006
|
-
toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
|
|
4007
4864
|
slide.progress = rtl ? -slideProgress : slideProgress;
|
|
4008
4865
|
slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
|
|
4009
4866
|
}
|
|
@@ -4072,13 +4929,6 @@
|
|
|
4072
4929
|
swiper.emit('progress', progress);
|
|
4073
4930
|
}
|
|
4074
4931
|
|
|
4075
|
-
const toggleSlideClasses = (slideEl, condition, className) => {
|
|
4076
|
-
if (condition && !slideEl.classList.contains(className)) {
|
|
4077
|
-
slideEl.classList.add(className);
|
|
4078
|
-
} else if (!condition && slideEl.classList.contains(className)) {
|
|
4079
|
-
slideEl.classList.remove(className);
|
|
4080
|
-
}
|
|
4081
|
-
};
|
|
4082
4932
|
function updateSlidesClasses() {
|
|
4083
4933
|
const swiper = this;
|
|
4084
4934
|
const {
|
|
@@ -4092,6 +4942,9 @@
|
|
|
4092
4942
|
const getFilteredSlide = selector => {
|
|
4093
4943
|
return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
|
|
4094
4944
|
};
|
|
4945
|
+
slides.forEach(slideEl => {
|
|
4946
|
+
slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
|
|
4947
|
+
});
|
|
4095
4948
|
let activeSlide;
|
|
4096
4949
|
let prevSlide;
|
|
4097
4950
|
let nextSlide;
|
|
@@ -4114,25 +4967,35 @@
|
|
|
4114
4967
|
}
|
|
4115
4968
|
}
|
|
4116
4969
|
if (activeSlide) {
|
|
4117
|
-
|
|
4970
|
+
// Active classes
|
|
4971
|
+
activeSlide.classList.add(params.slideActiveClass);
|
|
4972
|
+
if (gridEnabled) {
|
|
4973
|
+
if (nextSlide) {
|
|
4974
|
+
nextSlide.classList.add(params.slideNextClass);
|
|
4975
|
+
}
|
|
4976
|
+
if (prevSlide) {
|
|
4977
|
+
prevSlide.classList.add(params.slidePrevClass);
|
|
4978
|
+
}
|
|
4979
|
+
} else {
|
|
4118
4980
|
// Next Slide
|
|
4119
4981
|
nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
4120
4982
|
if (params.loop && !nextSlide) {
|
|
4121
4983
|
nextSlide = slides[0];
|
|
4122
4984
|
}
|
|
4985
|
+
if (nextSlide) {
|
|
4986
|
+
nextSlide.classList.add(params.slideNextClass);
|
|
4987
|
+
}
|
|
4123
4988
|
|
|
4124
4989
|
// Prev Slide
|
|
4125
4990
|
prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
|
|
4126
4991
|
if (params.loop && !prevSlide === 0) {
|
|
4127
4992
|
prevSlide = slides[slides.length - 1];
|
|
4128
4993
|
}
|
|
4994
|
+
if (prevSlide) {
|
|
4995
|
+
prevSlide.classList.add(params.slidePrevClass);
|
|
4996
|
+
}
|
|
4129
4997
|
}
|
|
4130
4998
|
}
|
|
4131
|
-
slides.forEach(slideEl => {
|
|
4132
|
-
toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
|
|
4133
|
-
toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
|
|
4134
|
-
toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
|
|
4135
|
-
});
|
|
4136
4999
|
swiper.emitSlidesClasses();
|
|
4137
5000
|
}
|
|
4138
5001
|
|
|
@@ -4510,7 +5373,6 @@
|
|
|
4510
5373
|
swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
|
4511
5374
|
swiper.onTranslateToWrapperTransitionEnd = null;
|
|
4512
5375
|
delete swiper.onTranslateToWrapperTransitionEnd;
|
|
4513
|
-
swiper.animating = false;
|
|
4514
5376
|
if (runCallbacks) {
|
|
4515
5377
|
swiper.emit('transitionEnd');
|
|
4516
5378
|
}
|
|
@@ -4618,6 +5480,9 @@
|
|
|
4618
5480
|
if (index === void 0) {
|
|
4619
5481
|
index = 0;
|
|
4620
5482
|
}
|
|
5483
|
+
if (speed === void 0) {
|
|
5484
|
+
speed = this.params.speed;
|
|
5485
|
+
}
|
|
4621
5486
|
if (runCallbacks === void 0) {
|
|
4622
5487
|
runCallbacks = true;
|
|
4623
5488
|
}
|
|
@@ -4637,12 +5502,9 @@
|
|
|
4637
5502
|
wrapperEl,
|
|
4638
5503
|
enabled
|
|
4639
5504
|
} = swiper;
|
|
4640
|
-
if (!enabled && !internal && !initial || swiper.destroyed
|
|
5505
|
+
if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial || swiper.destroyed) {
|
|
4641
5506
|
return false;
|
|
4642
5507
|
}
|
|
4643
|
-
if (typeof speed === 'undefined') {
|
|
4644
|
-
speed = swiper.params.speed;
|
|
4645
|
-
}
|
|
4646
5508
|
const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
|
|
4647
5509
|
let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
|
|
4648
5510
|
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
|
|
@@ -4769,6 +5631,9 @@
|
|
|
4769
5631
|
if (index === void 0) {
|
|
4770
5632
|
index = 0;
|
|
4771
5633
|
}
|
|
5634
|
+
if (speed === void 0) {
|
|
5635
|
+
speed = this.params.speed;
|
|
5636
|
+
}
|
|
4772
5637
|
if (runCallbacks === void 0) {
|
|
4773
5638
|
runCallbacks = true;
|
|
4774
5639
|
}
|
|
@@ -4778,9 +5643,6 @@
|
|
|
4778
5643
|
}
|
|
4779
5644
|
const swiper = this;
|
|
4780
5645
|
if (swiper.destroyed) return;
|
|
4781
|
-
if (typeof speed === 'undefined') {
|
|
4782
|
-
speed = swiper.params.speed;
|
|
4783
|
-
}
|
|
4784
5646
|
const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
4785
5647
|
let newIndex = index;
|
|
4786
5648
|
if (swiper.params.loop) {
|
|
@@ -4812,9 +5674,6 @@
|
|
|
4812
5674
|
if (centeredSlides) {
|
|
4813
5675
|
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
4814
5676
|
}
|
|
4815
|
-
if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
4816
|
-
needLoopFix = false;
|
|
4817
|
-
}
|
|
4818
5677
|
if (needLoopFix) {
|
|
4819
5678
|
const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
4820
5679
|
swiper.loopFix({
|
|
@@ -4840,6 +5699,9 @@
|
|
|
4840
5699
|
|
|
4841
5700
|
/* eslint no-unused-vars: "off" */
|
|
4842
5701
|
function slideNext(speed, runCallbacks, internal) {
|
|
5702
|
+
if (speed === void 0) {
|
|
5703
|
+
speed = this.params.speed;
|
|
5704
|
+
}
|
|
4843
5705
|
if (runCallbacks === void 0) {
|
|
4844
5706
|
runCallbacks = true;
|
|
4845
5707
|
}
|
|
@@ -4850,9 +5712,6 @@
|
|
|
4850
5712
|
animating
|
|
4851
5713
|
} = swiper;
|
|
4852
5714
|
if (!enabled || swiper.destroyed) return swiper;
|
|
4853
|
-
if (typeof speed === 'undefined') {
|
|
4854
|
-
speed = swiper.params.speed;
|
|
4855
|
-
}
|
|
4856
5715
|
let perGroup = params.slidesPerGroup;
|
|
4857
5716
|
if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
|
|
4858
5717
|
perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
|
|
@@ -4881,6 +5740,9 @@
|
|
|
4881
5740
|
|
|
4882
5741
|
/* eslint no-unused-vars: "off" */
|
|
4883
5742
|
function slidePrev(speed, runCallbacks, internal) {
|
|
5743
|
+
if (speed === void 0) {
|
|
5744
|
+
speed = this.params.speed;
|
|
5745
|
+
}
|
|
4884
5746
|
if (runCallbacks === void 0) {
|
|
4885
5747
|
runCallbacks = true;
|
|
4886
5748
|
}
|
|
@@ -4894,9 +5756,6 @@
|
|
|
4894
5756
|
animating
|
|
4895
5757
|
} = swiper;
|
|
4896
5758
|
if (!enabled || swiper.destroyed) return swiper;
|
|
4897
|
-
if (typeof speed === 'undefined') {
|
|
4898
|
-
speed = swiper.params.speed;
|
|
4899
|
-
}
|
|
4900
5759
|
const isVirtual = swiper.virtual && params.virtual.enabled;
|
|
4901
5760
|
if (params.loop) {
|
|
4902
5761
|
if (animating && !isVirtual && params.loopPreventsSliding) return false;
|
|
@@ -4949,19 +5808,22 @@
|
|
|
4949
5808
|
|
|
4950
5809
|
/* eslint no-unused-vars: "off" */
|
|
4951
5810
|
function slideReset(speed, runCallbacks, internal) {
|
|
5811
|
+
if (speed === void 0) {
|
|
5812
|
+
speed = this.params.speed;
|
|
5813
|
+
}
|
|
4952
5814
|
if (runCallbacks === void 0) {
|
|
4953
5815
|
runCallbacks = true;
|
|
4954
5816
|
}
|
|
4955
5817
|
const swiper = this;
|
|
4956
5818
|
if (swiper.destroyed) return;
|
|
4957
|
-
if (typeof speed === 'undefined') {
|
|
4958
|
-
speed = swiper.params.speed;
|
|
4959
|
-
}
|
|
4960
5819
|
return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
|
|
4961
5820
|
}
|
|
4962
5821
|
|
|
4963
5822
|
/* eslint no-unused-vars: "off" */
|
|
4964
5823
|
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
5824
|
+
if (speed === void 0) {
|
|
5825
|
+
speed = this.params.speed;
|
|
5826
|
+
}
|
|
4965
5827
|
if (runCallbacks === void 0) {
|
|
4966
5828
|
runCallbacks = true;
|
|
4967
5829
|
}
|
|
@@ -4970,9 +5832,6 @@
|
|
|
4970
5832
|
}
|
|
4971
5833
|
const swiper = this;
|
|
4972
5834
|
if (swiper.destroyed) return;
|
|
4973
|
-
if (typeof speed === 'undefined') {
|
|
4974
|
-
speed = swiper.params.speed;
|
|
4975
|
-
}
|
|
4976
5835
|
let index = swiper.activeIndex;
|
|
4977
5836
|
const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
|
|
4978
5837
|
const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
|
|
@@ -5607,7 +6466,7 @@
|
|
|
5607
6466
|
data.startMoving = true;
|
|
5608
6467
|
}
|
|
5609
6468
|
}
|
|
5610
|
-
if (data.isScrolling
|
|
6469
|
+
if (data.isScrolling) {
|
|
5611
6470
|
data.isTouched = false;
|
|
5612
6471
|
return;
|
|
5613
6472
|
}
|
|
@@ -5649,10 +6508,7 @@
|
|
|
5649
6508
|
if (swiper.animating) {
|
|
5650
6509
|
const evt = new window.CustomEvent('transitionend', {
|
|
5651
6510
|
bubbles: true,
|
|
5652
|
-
cancelable: true
|
|
5653
|
-
detail: {
|
|
5654
|
-
bySwiperTouchMove: true
|
|
5655
|
-
}
|
|
6511
|
+
cancelable: true
|
|
5656
6512
|
});
|
|
5657
6513
|
swiper.wrapperEl.dispatchEvent(evt);
|
|
5658
6514
|
}
|
|
@@ -6046,7 +6902,6 @@
|
|
|
6046
6902
|
const capture = !!params.nested;
|
|
6047
6903
|
const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
|
|
6048
6904
|
const swiperMethod = method;
|
|
6049
|
-
if (!el || typeof el === 'string') return;
|
|
6050
6905
|
|
|
6051
6906
|
// Touch Events
|
|
6052
6907
|
document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
|
|
@@ -6155,8 +7010,6 @@
|
|
|
6155
7010
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
6156
7011
|
const wasMultiRow = isGridEnabled(swiper, params);
|
|
6157
7012
|
const isMultiRow = isGridEnabled(swiper, breakpointParams);
|
|
6158
|
-
const wasGrabCursor = swiper.params.grabCursor;
|
|
6159
|
-
const isGrabCursor = breakpointParams.grabCursor;
|
|
6160
7013
|
const wasEnabled = params.enabled;
|
|
6161
7014
|
if (wasMultiRow && !isMultiRow) {
|
|
6162
7015
|
el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
|
|
@@ -6168,11 +7021,6 @@
|
|
|
6168
7021
|
}
|
|
6169
7022
|
swiper.emitContainerClasses();
|
|
6170
7023
|
}
|
|
6171
|
-
if (wasGrabCursor && !isGrabCursor) {
|
|
6172
|
-
swiper.unsetGrabCursor();
|
|
6173
|
-
} else if (!wasGrabCursor && isGrabCursor) {
|
|
6174
|
-
swiper.setGrabCursor();
|
|
6175
|
-
}
|
|
6176
7024
|
|
|
6177
7025
|
// Toggle navigation, pagination, scrollbar
|
|
6178
7026
|
['navigation', 'pagination', 'scrollbar'].forEach(prop => {
|
|
@@ -6323,7 +7171,6 @@
|
|
|
6323
7171
|
el,
|
|
6324
7172
|
classNames
|
|
6325
7173
|
} = swiper;
|
|
6326
|
-
if (!el || typeof el === 'string') return;
|
|
6327
7174
|
el.classList.remove(...classNames);
|
|
6328
7175
|
swiper.emitContainerClasses();
|
|
6329
7176
|
}
|
|
@@ -7088,12 +7935,8 @@
|
|
|
7088
7935
|
// Cleanup styles
|
|
7089
7936
|
if (cleanStyles) {
|
|
7090
7937
|
swiper.removeClasses();
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
}
|
|
7094
|
-
if (wrapperEl) {
|
|
7095
|
-
wrapperEl.removeAttribute('style');
|
|
7096
|
-
}
|
|
7938
|
+
el.removeAttribute('style');
|
|
7939
|
+
wrapperEl.removeAttribute('style');
|
|
7097
7940
|
if (slides && slides.length) {
|
|
7098
7941
|
slides.forEach(slideEl => {
|
|
7099
7942
|
slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
|
|
@@ -7109,9 +7952,7 @@
|
|
|
7109
7952
|
swiper.off(eventName);
|
|
7110
7953
|
});
|
|
7111
7954
|
if (deleteInstance !== false) {
|
|
7112
|
-
|
|
7113
|
-
swiper.el.swiper = null;
|
|
7114
|
-
}
|
|
7955
|
+
swiper.el.swiper = null;
|
|
7115
7956
|
deleteProps(swiper);
|
|
7116
7957
|
}
|
|
7117
7958
|
swiper.destroyed = true;
|
|
@@ -7505,7 +8346,7 @@
|
|
|
7505
8346
|
};
|
|
7506
8347
|
|
|
7507
8348
|
/**
|
|
7508
|
-
* Swiper React 11.
|
|
8349
|
+
* Swiper React 11.0.7
|
|
7509
8350
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
7510
8351
|
* https://swiperjs.com
|
|
7511
8352
|
*
|
|
@@ -7513,7 +8354,7 @@
|
|
|
7513
8354
|
*
|
|
7514
8355
|
* Released under the MIT License
|
|
7515
8356
|
*
|
|
7516
|
-
* Released on:
|
|
8357
|
+
* Released on: February 27, 2024
|
|
7517
8358
|
*/
|
|
7518
8359
|
|
|
7519
8360
|
|
|
@@ -8440,10 +9281,8 @@
|
|
|
8440
9281
|
}
|
|
8441
9282
|
if (el) {
|
|
8442
9283
|
if (typeof el === 'string') res = [...document.querySelectorAll(el)];
|
|
8443
|
-
if (swiper.params.uniqueNavElements && typeof el === 'string' && res
|
|
9284
|
+
if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
|
|
8444
9285
|
res = swiper.el.querySelector(el);
|
|
8445
|
-
} else if (res && res.length === 1) {
|
|
8446
|
-
res = res[0];
|
|
8447
9286
|
}
|
|
8448
9287
|
}
|
|
8449
9288
|
if (el && !res) return el;
|
|
@@ -8565,14 +9404,7 @@
|
|
|
8565
9404
|
nextEl = makeElementsArray(nextEl);
|
|
8566
9405
|
prevEl = makeElementsArray(prevEl);
|
|
8567
9406
|
const targetEl = e.target;
|
|
8568
|
-
|
|
8569
|
-
if (swiper.isElement && !targetIsButton) {
|
|
8570
|
-
const path = e.path || e.composedPath && e.composedPath();
|
|
8571
|
-
if (path) {
|
|
8572
|
-
targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
|
|
8573
|
-
}
|
|
8574
|
-
}
|
|
8575
|
-
if (swiper.params.navigation.hideOnClick && !targetIsButton) {
|
|
9407
|
+
if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {
|
|
8576
9408
|
if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
|
|
8577
9409
|
let isHidden;
|
|
8578
9410
|
if (nextEl.length) {
|
|
@@ -9228,7 +10060,7 @@
|
|
|
9228
10060
|
dragEl
|
|
9229
10061
|
} = scrollbar;
|
|
9230
10062
|
if (!isTouched) return;
|
|
9231
|
-
if (e.preventDefault
|
|
10063
|
+
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
|
|
9232
10064
|
setDragPosition(e);
|
|
9233
10065
|
wrapperEl.style.transitionDuration = '0ms';
|
|
9234
10066
|
el.style.transitionDuration = '0ms';
|
|
@@ -9439,9 +10271,6 @@
|
|
|
9439
10271
|
clicked: false
|
|
9440
10272
|
};
|
|
9441
10273
|
let liveRegion = null;
|
|
9442
|
-
let preventFocusHandler;
|
|
9443
|
-
let focusTargetSlideEl;
|
|
9444
|
-
let visibilityChangedTimestamp = new Date().getTime();
|
|
9445
10274
|
function notify(message) {
|
|
9446
10275
|
const notification = liveRegion;
|
|
9447
10276
|
if (notification.length === 0) return;
|
|
@@ -9522,28 +10351,24 @@
|
|
|
9522
10351
|
if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
|
|
9523
10352
|
if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
|
|
9524
10353
|
}
|
|
9525
|
-
if (swiper.navigation && swiper.navigation.
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
if (nextEls.includes(targetEl)) {
|
|
9529
|
-
if (!(swiper.isEnd && !swiper.params.loop)) {
|
|
9530
|
-
swiper.slideNext();
|
|
9531
|
-
}
|
|
9532
|
-
if (swiper.isEnd) {
|
|
9533
|
-
notify(params.lastSlideMessage);
|
|
9534
|
-
} else {
|
|
9535
|
-
notify(params.nextSlideMessage);
|
|
9536
|
-
}
|
|
10354
|
+
if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) {
|
|
10355
|
+
if (!(swiper.isEnd && !swiper.params.loop)) {
|
|
10356
|
+
swiper.slideNext();
|
|
9537
10357
|
}
|
|
9538
|
-
if (
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
10358
|
+
if (swiper.isEnd) {
|
|
10359
|
+
notify(params.lastSlideMessage);
|
|
10360
|
+
} else {
|
|
10361
|
+
notify(params.nextSlideMessage);
|
|
10362
|
+
}
|
|
10363
|
+
}
|
|
10364
|
+
if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) {
|
|
10365
|
+
if (!(swiper.isBeginning && !swiper.params.loop)) {
|
|
10366
|
+
swiper.slidePrev();
|
|
10367
|
+
}
|
|
10368
|
+
if (swiper.isBeginning) {
|
|
10369
|
+
notify(params.firstSlideMessage);
|
|
10370
|
+
} else {
|
|
10371
|
+
notify(params.prevSlideMessage);
|
|
9547
10372
|
}
|
|
9548
10373
|
}
|
|
9549
10374
|
if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
|
|
@@ -9608,14 +10433,10 @@
|
|
|
9608
10433
|
addElLabel(el, message);
|
|
9609
10434
|
addElControls(el, wrapperId);
|
|
9610
10435
|
};
|
|
9611
|
-
const handlePointerDown =
|
|
9612
|
-
if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
|
|
9613
|
-
preventFocusHandler = true;
|
|
9614
|
-
}
|
|
10436
|
+
const handlePointerDown = () => {
|
|
9615
10437
|
swiper.a11y.clicked = true;
|
|
9616
10438
|
};
|
|
9617
10439
|
const handlePointerUp = () => {
|
|
9618
|
-
preventFocusHandler = false;
|
|
9619
10440
|
requestAnimationFrame(() => {
|
|
9620
10441
|
requestAnimationFrame(() => {
|
|
9621
10442
|
if (!swiper.destroyed) {
|
|
@@ -9624,15 +10445,10 @@
|
|
|
9624
10445
|
});
|
|
9625
10446
|
});
|
|
9626
10447
|
};
|
|
9627
|
-
const onVisibilityChange = e => {
|
|
9628
|
-
visibilityChangedTimestamp = new Date().getTime();
|
|
9629
|
-
};
|
|
9630
10448
|
const handleFocus = e => {
|
|
9631
10449
|
if (swiper.a11y.clicked) return;
|
|
9632
|
-
if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
|
|
9633
10450
|
const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
|
|
9634
10451
|
if (!slideEl || !swiper.slides.includes(slideEl)) return;
|
|
9635
|
-
focusTargetSlideEl = slideEl;
|
|
9636
10452
|
const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
|
|
9637
10453
|
const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
|
|
9638
10454
|
if (isActive || isVisible) return;
|
|
@@ -9642,15 +10458,7 @@
|
|
|
9642
10458
|
} else {
|
|
9643
10459
|
swiper.el.scrollTop = 0;
|
|
9644
10460
|
}
|
|
9645
|
-
|
|
9646
|
-
if (preventFocusHandler) return;
|
|
9647
|
-
if (swiper.params.loop) {
|
|
9648
|
-
swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
|
|
9649
|
-
} else {
|
|
9650
|
-
swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
|
|
9651
|
-
}
|
|
9652
|
-
preventFocusHandler = false;
|
|
9653
|
-
});
|
|
10461
|
+
swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
|
|
9654
10462
|
};
|
|
9655
10463
|
const initSlides = () => {
|
|
9656
10464
|
const params = swiper.params.a11y;
|
|
@@ -9715,9 +10523,6 @@
|
|
|
9715
10523
|
}
|
|
9716
10524
|
|
|
9717
10525
|
// Tab focus
|
|
9718
|
-
const document = getDocument();
|
|
9719
|
-
document.addEventListener('visibilitychange', onVisibilityChange);
|
|
9720
|
-
swiper.el.addEventListener('focus', handleFocus, true);
|
|
9721
10526
|
swiper.el.addEventListener('focus', handleFocus, true);
|
|
9722
10527
|
swiper.el.addEventListener('pointerdown', handlePointerDown, true);
|
|
9723
10528
|
swiper.el.addEventListener('pointerup', handlePointerUp, true);
|
|
@@ -9744,14 +10549,11 @@
|
|
|
9744
10549
|
el.removeEventListener('keydown', onEnterOrSpaceKey);
|
|
9745
10550
|
});
|
|
9746
10551
|
}
|
|
9747
|
-
|
|
9748
|
-
document.removeEventListener('visibilitychange', onVisibilityChange);
|
|
10552
|
+
|
|
9749
10553
|
// Tab focus
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
swiper.el.removeEventListener('pointerup', handlePointerUp, true);
|
|
9754
|
-
}
|
|
10554
|
+
swiper.el.removeEventListener('focus', handleFocus, true);
|
|
10555
|
+
swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
|
|
10556
|
+
swiper.el.removeEventListener('pointerup', handlePointerUp, true);
|
|
9755
10557
|
}
|
|
9756
10558
|
on('beforeInit', () => {
|
|
9757
10559
|
liveRegion = createElement('span', swiper.params.a11y.notificationClass);
|
|
@@ -9823,7 +10625,7 @@
|
|
|
9823
10625
|
if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
|
|
9824
10626
|
if (e.target !== swiper.wrapperEl) return;
|
|
9825
10627
|
swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
|
|
9826
|
-
if (pausedByPointerEnter
|
|
10628
|
+
if (pausedByPointerEnter) {
|
|
9827
10629
|
return;
|
|
9828
10630
|
}
|
|
9829
10631
|
resume();
|
|
@@ -9994,10 +10796,8 @@
|
|
|
9994
10796
|
}
|
|
9995
10797
|
};
|
|
9996
10798
|
const detachMouseEvents = () => {
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
swiper.el.removeEventListener('pointerleave', onPointerLeave);
|
|
10000
|
-
}
|
|
10799
|
+
swiper.el.removeEventListener('pointerenter', onPointerEnter);
|
|
10800
|
+
swiper.el.removeEventListener('pointerleave', onPointerLeave);
|
|
10001
10801
|
};
|
|
10002
10802
|
const attachDocumentEvents = () => {
|
|
10003
10803
|
const document = getDocument();
|
|
@@ -10335,49 +11135,6 @@
|
|
|
10335
11135
|
};
|
|
10336
11136
|
var Scroll$1 = React.memo(Scroll);
|
|
10337
11137
|
|
|
10338
|
-
const FormatImage = React.forwardRef((props, ref) => {
|
|
10339
|
-
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
|
10340
|
-
const [imgSrc, setImgSrc] = React.useState(src);
|
|
10341
|
-
const imgRef = React.useRef(null);
|
|
10342
|
-
const [visible, setVisible] = React.useState(false);
|
|
10343
|
-
React.useImperativeHandle(ref, () => ({
|
|
10344
|
-
setSrc: (v) => {
|
|
10345
|
-
if (v)
|
|
10346
|
-
setImgSrc(v);
|
|
10347
|
-
}
|
|
10348
|
-
}));
|
|
10349
|
-
React.useEffect(() => {
|
|
10350
|
-
if (src)
|
|
10351
|
-
setImgSrc(src);
|
|
10352
|
-
}, [src]);
|
|
10353
|
-
React.useEffect(() => {
|
|
10354
|
-
const onShow = () => {
|
|
10355
|
-
if (src && !visible && imgRef.current) {
|
|
10356
|
-
imgRef.current.src = '';
|
|
10357
|
-
imgRef.current.src = src;
|
|
10358
|
-
}
|
|
10359
|
-
};
|
|
10360
|
-
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
|
10361
|
-
return () => {
|
|
10362
|
-
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
|
10363
|
-
};
|
|
10364
|
-
}, [src, visible]);
|
|
10365
|
-
return (React.createElement(React.Fragment, null,
|
|
10366
|
-
!visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
|
10367
|
-
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
|
10368
|
-
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
|
10369
|
-
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
|
10370
|
-
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
|
10371
|
-
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
|
10372
|
-
setVisible(true);
|
|
10373
|
-
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
|
10374
|
-
}, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
|
10375
|
-
setVisible(true);
|
|
10376
|
-
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
|
10377
|
-
}, alt: alt }))));
|
|
10378
|
-
});
|
|
10379
|
-
var FormatImage$1 = React.memo(FormatImage);
|
|
10380
|
-
|
|
10381
11138
|
const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
|
|
10382
11139
|
var _a;
|
|
10383
11140
|
const { productView } = useEventReport();
|
|
@@ -10467,13 +11224,13 @@
|
|
|
10467
11224
|
styleElement.id = 'onetrust-pc-sdk';
|
|
10468
11225
|
styleElement.setAttribute('type', 'text/css');
|
|
10469
11226
|
document.head.appendChild(styleElement);
|
|
10470
|
-
const css = `
|
|
10471
|
-
#onetrust-pc-sdk {
|
|
10472
|
-
height: ${finalHeight}px !important;
|
|
10473
|
-
}
|
|
10474
|
-
#onetrust-pc-sdk #ot-pc-content{
|
|
10475
|
-
bottom: ${b}px !important;
|
|
10476
|
-
}
|
|
11227
|
+
const css = `
|
|
11228
|
+
#onetrust-pc-sdk {
|
|
11229
|
+
height: ${finalHeight}px !important;
|
|
11230
|
+
}
|
|
11231
|
+
#onetrust-pc-sdk #ot-pc-content{
|
|
11232
|
+
bottom: ${b}px !important;
|
|
11233
|
+
}
|
|
10477
11234
|
`;
|
|
10478
11235
|
styleElement.textContent = css;
|
|
10479
11236
|
}
|
|
@@ -11020,10 +11777,10 @@
|
|
|
11020
11777
|
__html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
|
11021
11778
|
} }),
|
|
11022
11779
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
|
11023
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
|
11024
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
|
11025
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
|
11026
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
|
11780
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
|
11781
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
|
11782
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
|
11783
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
|
11027
11784
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
|
11028
11785
|
};
|
|
11029
11786
|
const renderBtn = () => {
|
|
@@ -12022,7 +12779,7 @@
|
|
|
12022
12779
|
const productInfoText = ({ isPost }) => {
|
|
12023
12780
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
|
12024
12781
|
React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
|
12025
|
-
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
|
12782
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
|
12026
12783
|
Made in Italy` })));
|
|
12027
12784
|
};
|
|
12028
12785
|
const getStyle = React.useCallback((style) => {
|
|
@@ -16235,7 +16992,7 @@ Made in Italy` })));
|
|
|
16235
16992
|
* @Author: binruan@chatlabs.com
|
|
16236
16993
|
* @Date: 2024-01-10 10:58:24
|
|
16237
16994
|
* @LastEditors: binruan@chatlabs.com
|
|
16238
|
-
* @LastEditTime: 2025-
|
|
16995
|
+
* @LastEditTime: 2025-05-09 15:30:41
|
|
16239
16996
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
|
16240
16997
|
*
|
|
16241
16998
|
*/
|
|
@@ -16273,7 +17030,7 @@ Made in Italy` })));
|
|
|
16273
17030
|
}
|
|
16274
17031
|
}, [waterFallData]);
|
|
16275
17032
|
const reportTagsView = React.useCallback(() => {
|
|
16276
|
-
var _a, _b, _c, _d, _e, _f;
|
|
17033
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16277
17034
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
|
16278
17035
|
if (!rec)
|
|
16279
17036
|
return;
|
|
@@ -16293,9 +17050,10 @@ Made in Italy` })));
|
|
|
16293
17050
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
16294
17051
|
eventInfo: {
|
|
16295
17052
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
|
17053
|
+
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 : '',
|
|
16296
17054
|
position: cacheActiveIndex + '',
|
|
16297
|
-
contentTags: JSON.stringify((
|
|
16298
|
-
traceInfo: (
|
|
17055
|
+
contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
|
|
17056
|
+
traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
|
|
16299
17057
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
|
16300
17058
|
fromKName,
|
|
16301
17059
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
@@ -18203,10 +18961,10 @@ Made in Italy` })));
|
|
|
18203
18961
|
const traceInfo = ((_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) || ((_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || '';
|
|
18204
18962
|
const getPropsVal = React.useCallback((index, str) => {
|
|
18205
18963
|
try {
|
|
18206
|
-
return new Function('props', 'str', `if (str) {
|
|
18207
|
-
return props?.button${index + 1}${str}
|
|
18208
|
-
} else {
|
|
18209
|
-
return props?.button${index + 1}
|
|
18964
|
+
return new Function('props', 'str', `if (str) {
|
|
18965
|
+
return props?.button${index + 1}${str}
|
|
18966
|
+
} else {
|
|
18967
|
+
return props?.button${index + 1}
|
|
18210
18968
|
}`)(props, str);
|
|
18211
18969
|
}
|
|
18212
18970
|
catch (_a) { }
|
|
@@ -18402,21 +19160,22 @@ Made in Italy` })));
|
|
|
18402
19160
|
const likeIcon = useIconLink(defaultLikeIconPath$2);
|
|
18403
19161
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
|
|
18404
19162
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18405
|
-
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;
|
|
19163
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
18406
19164
|
if (state) {
|
|
18407
19165
|
// 先设置状态
|
|
18408
19166
|
setState(false);
|
|
18409
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
|
19167
|
+
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;
|
|
18410
19168
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18411
19169
|
eventInfo: {
|
|
18412
19170
|
eventSubject: 'favoriteContentCanceled',
|
|
18413
19171
|
eventDescription: 'This content was unfavorite by the user',
|
|
18414
19172
|
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 : '',
|
|
18415
|
-
|
|
18416
|
-
|
|
19173
|
+
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 : '',
|
|
19174
|
+
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 : '',
|
|
19175
|
+
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 : []),
|
|
18417
19176
|
position: position + '',
|
|
18418
|
-
contentFormat: ((
|
|
18419
|
-
traceInfo: (
|
|
19177
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
|
19178
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
18420
19179
|
}
|
|
18421
19180
|
});
|
|
18422
19181
|
// 如果接口调用失败,则回滚状态
|
|
@@ -18424,48 +19183,49 @@ Made in Italy` })));
|
|
|
18424
19183
|
setState(true);
|
|
18425
19184
|
}
|
|
18426
19185
|
else {
|
|
18427
|
-
const nRtcList = (
|
|
19186
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18428
19187
|
if (index === position) {
|
|
18429
19188
|
item.isCollected = false;
|
|
18430
19189
|
}
|
|
18431
19190
|
return item;
|
|
18432
|
-
})) !== null &&
|
|
19191
|
+
})) !== null && _s !== void 0 ? _s : [];
|
|
18433
19192
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18434
19193
|
}
|
|
18435
19194
|
}
|
|
18436
19195
|
else {
|
|
18437
19196
|
setState(true);
|
|
18438
|
-
const result = (
|
|
19197
|
+
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;
|
|
18439
19198
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18440
19199
|
eventInfo: {
|
|
18441
19200
|
eventSubject: 'favoriteContent',
|
|
18442
19201
|
eventDescription: 'This content was favorite by the user',
|
|
18443
|
-
contentId: (
|
|
18444
|
-
|
|
18445
|
-
|
|
19202
|
+
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 : '',
|
|
19203
|
+
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 : '',
|
|
19204
|
+
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 : '',
|
|
19205
|
+
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 : []),
|
|
18446
19206
|
position: position + '',
|
|
18447
|
-
contentFormat: ((
|
|
18448
|
-
traceInfo: (
|
|
19207
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
|
19208
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
|
18449
19209
|
}
|
|
18450
19210
|
});
|
|
18451
19211
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
18452
19212
|
eventName: 'Engagement',
|
|
18453
|
-
product: (
|
|
19213
|
+
product: (_7 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _7 === void 0 ? void 0 : _7.bindProducts,
|
|
18454
19214
|
rec: recData,
|
|
18455
19215
|
position,
|
|
18456
|
-
content_id: (
|
|
19216
|
+
content_id: (_9 = (_8 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _8 === void 0 ? void 0 : _8.itemId) !== null && _9 !== void 0 ? _9 : '',
|
|
18457
19217
|
engagement_type: 'like'
|
|
18458
19218
|
});
|
|
18459
19219
|
if (!result) {
|
|
18460
19220
|
setState(false);
|
|
18461
19221
|
}
|
|
18462
19222
|
else {
|
|
18463
|
-
const nRtcList = (
|
|
19223
|
+
const nRtcList = (_10 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
|
18464
19224
|
if (index === position) {
|
|
18465
19225
|
item.isCollected = true;
|
|
18466
19226
|
}
|
|
18467
19227
|
return item;
|
|
18468
|
-
})) !== null &&
|
|
19228
|
+
})) !== null && _10 !== void 0 ? _10 : [];
|
|
18469
19229
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
|
18470
19230
|
}
|
|
18471
19231
|
}
|
|
@@ -18502,7 +19262,7 @@ Made in Italy` })));
|
|
|
18502
19262
|
const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
|
|
18503
19263
|
var _a, _b;
|
|
18504
19264
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
|
18505
|
-
const { bffEventReport, sxpParameter,
|
|
19265
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
|
18506
19266
|
const videoStartTime = React.useRef(0);
|
|
18507
19267
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
|
18508
19268
|
const { isActive } = useSwiperSlide();
|
|
@@ -18519,7 +19279,7 @@ Made in Italy` })));
|
|
|
18519
19279
|
const loopPlayRef = React.useRef(loopPlay);
|
|
18520
19280
|
const scene = rec.video.scene;
|
|
18521
19281
|
const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
|
|
18522
|
-
const videoCover = (
|
|
19282
|
+
const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
|
18523
19283
|
const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
|
|
18524
19284
|
React.useImperativeHandle(ref, () => {
|
|
18525
19285
|
return {
|
|
@@ -18568,6 +19328,23 @@ Made in Italy` })));
|
|
|
18568
19328
|
return;
|
|
18569
19329
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18570
19330
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
19331
|
+
const handleEnd = () => {
|
|
19332
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19333
|
+
if (!videoRef.current)
|
|
19334
|
+
return;
|
|
19335
|
+
if (isDiyH5) {
|
|
19336
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
19337
|
+
if (!loopPlayRef.current)
|
|
19338
|
+
return;
|
|
19339
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
19340
|
+
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;
|
|
19341
|
+
(_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);
|
|
19342
|
+
}
|
|
19343
|
+
}
|
|
19344
|
+
else {
|
|
19345
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
|
19346
|
+
}
|
|
19347
|
+
};
|
|
18571
19348
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
18572
19349
|
const handlePlaying = React.useCallback(() => {
|
|
18573
19350
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
@@ -18576,7 +19353,7 @@ Made in Italy` })));
|
|
|
18576
19353
|
setIsLoadFinish(true);
|
|
18577
19354
|
}, []);
|
|
18578
19355
|
const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18579
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
19356
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
18580
19357
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18581
19358
|
return;
|
|
18582
19359
|
setIsPauseVideo(false);
|
|
@@ -18587,16 +19364,11 @@ Made in Italy` })));
|
|
|
18587
19364
|
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);
|
|
18588
19365
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
|
18589
19366
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
|
18590
|
-
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 : '',
|
|
19367
|
+
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) + '' }))
|
|
18591
19368
|
});
|
|
18592
19369
|
isFirstPlayRef.current = false;
|
|
18593
19370
|
}
|
|
18594
19371
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18595
|
-
const setCurrentTimeByStartTime = React.useCallback(() => {
|
|
18596
|
-
if (isDiyH5) {
|
|
18597
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18598
|
-
}
|
|
18599
|
-
}, []);
|
|
18600
19372
|
const handLoadeddata = React.useCallback(() => {
|
|
18601
19373
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
|
18602
19374
|
return;
|
|
@@ -18621,13 +19393,12 @@ Made in Italy` })));
|
|
|
18621
19393
|
const handleLoadedmetadata = React.useCallback(() => {
|
|
18622
19394
|
if (!videoRef.current)
|
|
18623
19395
|
return;
|
|
18624
|
-
setCurrentTimeByStartTime();
|
|
18625
19396
|
loadedTimeRef.current = new Date();
|
|
18626
19397
|
handleStartPlay();
|
|
18627
19398
|
handLoadeddata();
|
|
18628
19399
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
|
18629
19400
|
const handleClickVideo = React.useCallback((type) => () => {
|
|
18630
|
-
var _a, _b, _c, _d, _e
|
|
19401
|
+
var _a, _b, _c, _d, _e;
|
|
18631
19402
|
if (!videoRef.current)
|
|
18632
19403
|
return;
|
|
18633
19404
|
if (!isLoadFinish)
|
|
@@ -18648,20 +19419,17 @@ Made in Italy` })));
|
|
|
18648
19419
|
break;
|
|
18649
19420
|
default:
|
|
18650
19421
|
if (isPause) {
|
|
18651
|
-
|
|
18652
|
-
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
|
18653
|
-
}
|
|
18654
|
-
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
|
19422
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
|
18655
19423
|
}
|
|
18656
19424
|
else {
|
|
18657
|
-
(
|
|
19425
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
|
18658
19426
|
}
|
|
18659
19427
|
setIsPauseVideo(!isPause);
|
|
18660
19428
|
break;
|
|
18661
19429
|
}
|
|
18662
19430
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
|
18663
19431
|
const handlePause = React.useCallback(() => {
|
|
18664
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
19432
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
18665
19433
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
|
18666
19434
|
return;
|
|
18667
19435
|
if (activeIndex !== index)
|
|
@@ -18677,14 +19445,15 @@ Made in Italy` })));
|
|
|
18677
19445
|
eventSubject: 'playOverVideo',
|
|
18678
19446
|
eventDescription: 'User finished playing the video',
|
|
18679
19447
|
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 : '',
|
|
18680
|
-
|
|
19448
|
+
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 : '',
|
|
19449
|
+
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 : '',
|
|
18681
19450
|
endTime: videoCurrentTime,
|
|
18682
19451
|
videoDuration,
|
|
18683
19452
|
playDuration,
|
|
18684
|
-
contentTags: JSON.stringify((
|
|
19453
|
+
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 : []),
|
|
18685
19454
|
position: index + '',
|
|
18686
19455
|
contentFormat: 'video',
|
|
18687
|
-
traceInfo: (
|
|
19456
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
18688
19457
|
}
|
|
18689
19458
|
});
|
|
18690
19459
|
}
|
|
@@ -18692,27 +19461,8 @@ Made in Italy` })));
|
|
|
18692
19461
|
const handleWaiting = React.useCallback(() => {
|
|
18693
19462
|
setWaiting(true);
|
|
18694
19463
|
}, []);
|
|
18695
|
-
const handleTimeUpload = () => {
|
|
18696
|
-
if (!videoRef.current || !isDiyH5)
|
|
18697
|
-
return;
|
|
18698
|
-
setTimeout(() => {
|
|
18699
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18700
|
-
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)) {
|
|
18701
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
|
18702
|
-
if (!loopPlayRef.current)
|
|
18703
|
-
return;
|
|
18704
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
|
18705
|
-
(_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);
|
|
18706
|
-
}
|
|
18707
|
-
else {
|
|
18708
|
-
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;
|
|
18709
|
-
(_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);
|
|
18710
|
-
}
|
|
18711
|
-
}
|
|
18712
|
-
});
|
|
18713
|
-
};
|
|
18714
19464
|
React.useEffect(() => {
|
|
18715
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
19465
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18716
19466
|
if (!isActive)
|
|
18717
19467
|
return;
|
|
18718
19468
|
const videoSrc = videoUrl;
|
|
@@ -18733,7 +19483,6 @@ Made in Italy` })));
|
|
|
18733
19483
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
|
18734
19484
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
18735
19485
|
var _a;
|
|
18736
|
-
setCurrentTimeByStartTime();
|
|
18737
19486
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18738
19487
|
});
|
|
18739
19488
|
}
|
|
@@ -18747,12 +19496,11 @@ Made in Italy` })));
|
|
|
18747
19496
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
|
18748
19497
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
|
18749
19498
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
|
18750
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
|
19499
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
|
|
18751
19500
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
|
18752
19501
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
|
18753
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
|
18754
19502
|
return () => {
|
|
18755
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
19503
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18756
19504
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
|
18757
19505
|
if (!isPause)
|
|
18758
19506
|
handlePause();
|
|
@@ -18764,10 +19512,9 @@ Made in Italy` })));
|
|
|
18764
19512
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
|
18765
19513
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
|
18766
19514
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
|
18767
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
|
19515
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
|
|
18768
19516
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
|
18769
19517
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
|
18770
|
-
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
|
18771
19518
|
};
|
|
18772
19519
|
}, [isActive]);
|
|
18773
19520
|
React.useEffect(() => {
|
|
@@ -18982,19 +19729,45 @@ Made in Italy` })));
|
|
|
18982
19729
|
}, onLoad: onShowFirstImage }))));
|
|
18983
19730
|
};
|
|
18984
19731
|
|
|
18985
|
-
const PictureGroup$4 = ({ imgUrls,
|
|
19732
|
+
const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
|
18986
19733
|
var _a, _b;
|
|
18987
19734
|
const { isActive } = useSwiperSlide();
|
|
18988
|
-
const {
|
|
19735
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
|
18989
19736
|
const [isLoad, setIsLoad] = React.useState(false);
|
|
18990
19737
|
const [imgInfo, setImgInfo] = React.useState();
|
|
18991
19738
|
const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
|
|
18992
|
-
const
|
|
19739
|
+
const imgsSwiperRef = React.useRef();
|
|
18993
19740
|
const isFirstPlayRef = React.useRef(true);
|
|
19741
|
+
const loopPlayRef = React.useRef(true);
|
|
18994
19742
|
const initTime = new Date();
|
|
19743
|
+
React.useImperativeHandle(ref, () => {
|
|
19744
|
+
return {
|
|
19745
|
+
setLoopPlay(v) {
|
|
19746
|
+
loopPlayRef.current = v;
|
|
19747
|
+
}
|
|
19748
|
+
};
|
|
19749
|
+
});
|
|
19750
|
+
React.useEffect(() => {
|
|
19751
|
+
let timerId;
|
|
19752
|
+
if (isLoad && isActive && isDiyH5) {
|
|
19753
|
+
timerId = setTimeout(() => {
|
|
19754
|
+
var _a, _b, _c, _d;
|
|
19755
|
+
if (!loopPlayRef.current)
|
|
19756
|
+
return;
|
|
19757
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
|
19758
|
+
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;
|
|
19759
|
+
(_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);
|
|
19760
|
+
}
|
|
19761
|
+
}, 3000);
|
|
19762
|
+
}
|
|
19763
|
+
return () => {
|
|
19764
|
+
if (timerId)
|
|
19765
|
+
clearTimeout(timerId);
|
|
19766
|
+
};
|
|
19767
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
|
18995
19768
|
React.useEffect(() => {
|
|
18996
19769
|
if (isLoad && isActive) {
|
|
18997
|
-
(
|
|
19770
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
|
18998
19771
|
if (openHashtag) {
|
|
18999
19772
|
onViewImageEndEvent(rec);
|
|
19000
19773
|
}
|
|
@@ -19004,7 +19777,7 @@ Made in Italy` })));
|
|
|
19004
19777
|
}
|
|
19005
19778
|
}
|
|
19006
19779
|
else {
|
|
19007
|
-
(
|
|
19780
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
|
19008
19781
|
}
|
|
19009
19782
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
|
19010
19783
|
const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19031,13 +19804,13 @@ Made in Italy` })));
|
|
|
19031
19804
|
};
|
|
19032
19805
|
}, [isActive, imgInfo]);
|
|
19033
19806
|
const handleMouseEnter = React.useCallback(() => {
|
|
19034
|
-
if (
|
|
19035
|
-
|
|
19807
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
|
19808
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
|
19036
19809
|
}
|
|
19037
19810
|
}, []);
|
|
19038
19811
|
const handleMouseLeave = React.useCallback(() => {
|
|
19039
|
-
if (
|
|
19040
|
-
|
|
19812
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
|
19813
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
|
19041
19814
|
}
|
|
19042
19815
|
}, []);
|
|
19043
19816
|
const handleSlideChange = React.useCallback((swiper) => {
|
|
@@ -19058,7 +19831,7 @@ Made in Italy` })));
|
|
|
19058
19831
|
enabled: true
|
|
19059
19832
|
}
|
|
19060
19833
|
}
|
|
19061
|
-
: {}), { loop: true, ref:
|
|
19834
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
|
19062
19835
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
|
19063
19836
|
fontSize: '14px'
|
|
19064
19837
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
|
@@ -19075,7 +19848,7 @@ Made in Italy` })));
|
|
|
19075
19848
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
|
19076
19849
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
|
19077
19850
|
}))));
|
|
19078
|
-
};
|
|
19851
|
+
});
|
|
19079
19852
|
var PictureGroup$5 = React.memo(PictureGroup$4);
|
|
19080
19853
|
|
|
19081
19854
|
/*
|
|
@@ -19367,7 +20140,7 @@ Made in Italy` })));
|
|
|
19367
20140
|
* @Author: binruan@chatlabs.com
|
|
19368
20141
|
* @Date: 2024-03-20 10:27:31
|
|
19369
20142
|
* @LastEditors: binruan@chatlabs.com
|
|
19370
|
-
* @LastEditTime: 2025-05-
|
|
20143
|
+
* @LastEditTime: 2025-05-12 14:26:15
|
|
19371
20144
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
|
19372
20145
|
*
|
|
19373
20146
|
*/
|
|
@@ -19388,6 +20161,7 @@ Made in Italy` })));
|
|
|
19388
20161
|
const [pageNum, setPageNum] = React.useState(2);
|
|
19389
20162
|
React.useState(false);
|
|
19390
20163
|
const videoWidgetRef = React.useRef(null);
|
|
20164
|
+
const pictureGroupRef = React.useRef(null);
|
|
19391
20165
|
const fbcRef = React.useRef('');
|
|
19392
20166
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5, pixelPvStatusRef } = useSxpDataSource();
|
|
19393
20167
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
@@ -19437,7 +20211,7 @@ Made in Italy` })));
|
|
|
19437
20211
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
|
19438
20212
|
}, [data, ctaType, swiperRef]);
|
|
19439
20213
|
const handleSessionCompleted = React.useCallback((fk) => {
|
|
19440
|
-
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;
|
|
20214
|
+
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;
|
|
19441
20215
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
19442
20216
|
let fromKName = '';
|
|
19443
20217
|
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))) {
|
|
@@ -19464,22 +20238,23 @@ Made in Italy` })));
|
|
|
19464
20238
|
eventSubject: 'sessionCompleted',
|
|
19465
20239
|
eventDescription: 'Session completed',
|
|
19466
20240
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
|
19467
|
-
|
|
20241
|
+
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 : '',
|
|
20242
|
+
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
|
19468
20243
|
position: activeIndex + '',
|
|
19469
20244
|
fromKName: fk || fromKName,
|
|
19470
20245
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
19471
|
-
ctatId: (
|
|
19472
|
-
traceInfo: (
|
|
20246
|
+
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 : '',
|
|
20247
|
+
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 : ''
|
|
19473
20248
|
}
|
|
19474
20249
|
});
|
|
19475
|
-
const isPostType = ((
|
|
20250
|
+
const isPostType = ((_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.url) || ((_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.imgUrls) === null || _1 === void 0 ? void 0 : _1.length);
|
|
19476
20251
|
if (!popupDetailData) {
|
|
19477
20252
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19478
20253
|
eventName: 'ExitFeed',
|
|
19479
|
-
product: isPostType ? (
|
|
20254
|
+
product: isPostType ? (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
|
|
19480
20255
|
rec: item,
|
|
19481
20256
|
position: activeIndex,
|
|
19482
|
-
content_id: isPostType ? (
|
|
20257
|
+
content_id: isPostType ? (_4 = (_3 = item === null || item === void 0 ? void 0 : item.video) === null || _3 === void 0 ? void 0 : _3.itemId) !== null && _4 !== void 0 ? _4 : '' : (_6 = (_5 = item === null || item === void 0 ? void 0 : item.product) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
|
|
19483
20258
|
view_time: new Date() - viewTime.current
|
|
19484
20259
|
});
|
|
19485
20260
|
}
|
|
@@ -19539,8 +20314,9 @@ Made in Italy` })));
|
|
|
19539
20314
|
refreshFeSession
|
|
19540
20315
|
]);
|
|
19541
20316
|
const handleSessionExpire = React.useCallback(lodash.debounce(() => {
|
|
19542
|
-
var _a;
|
|
20317
|
+
var _a, _b;
|
|
19543
20318
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
20319
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
19544
20320
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
|
19545
20321
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
|
19546
20322
|
React.useEffect(() => {
|
|
@@ -19611,18 +20387,18 @@ Made in Italy` })));
|
|
|
19611
20387
|
return null;
|
|
19612
20388
|
}, [globalConfig, activeIndex, visList]);
|
|
19613
20389
|
const renderContent = React.useCallback((rec, index) => {
|
|
19614
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
20390
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
19615
20391
|
if (rec === 'organic menu') {
|
|
19616
20392
|
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)));
|
|
19617
20393
|
}
|
|
19618
|
-
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null ||
|
|
20394
|
+
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)) {
|
|
19619
20395
|
return (React.createElement(VideoWidget$5, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef, visibleHeight: visibleHeight })));
|
|
19620
20396
|
}
|
|
19621
|
-
if ((
|
|
19622
|
-
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 }));
|
|
20397
|
+
if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
|
|
20398
|
+
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 })));
|
|
19623
20399
|
}
|
|
19624
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
|
19625
|
-
return (
|
|
20400
|
+
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) {
|
|
20401
|
+
return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
|
|
19626
20402
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19627
20403
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
|
19628
20404
|
const Component = withBindDataSource(t);
|
|
@@ -19661,7 +20437,7 @@ Made in Italy` })));
|
|
|
19661
20437
|
};
|
|
19662
20438
|
}, [isShowMore]);
|
|
19663
20439
|
const renderBottom = React.useCallback((rec, index) => {
|
|
19664
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
20440
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
19665
20441
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
|
19666
20442
|
let cta = null;
|
|
19667
20443
|
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) {
|
|
@@ -19670,24 +20446,27 @@ Made in Italy` })));
|
|
|
19670
20446
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
|
19671
20447
|
cta = '商品CTA';
|
|
19672
20448
|
}
|
|
20449
|
+
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)) {
|
|
20450
|
+
cta = '服务CTA';
|
|
20451
|
+
}
|
|
19673
20452
|
else {
|
|
19674
|
-
cta = (
|
|
20453
|
+
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;
|
|
19675
20454
|
}
|
|
19676
20455
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
|
19677
20456
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
|
19678
20457
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
|
|
19679
|
-
((
|
|
20458
|
+
((_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));
|
|
19680
20459
|
return (React.createElement(React.Fragment, null,
|
|
19681
20460
|
isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
|
19682
|
-
((
|
|
19683
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
|
20461
|
+
((_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' }),
|
|
20462
|
+
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` } },
|
|
19684
20463
|
React.createElement(Nudge, { nudge: nudge }),
|
|
19685
20464
|
((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' },
|
|
19686
20465
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
19687
20466
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
19688
|
-
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: (
|
|
20467
|
+
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 }),
|
|
19689
20468
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
19690
|
-
React.createElement(Hashtag$1, { index: activeIndex, tags: (
|
|
20469
|
+
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) }))),
|
|
19691
20470
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
|
19692
20471
|
}
|
|
19693
20472
|
return null;
|
|
@@ -19729,7 +20508,7 @@ Made in Italy` })));
|
|
|
19729
20508
|
return null;
|
|
19730
20509
|
}, [globalConfig, waterFallData, bottomHeight]);
|
|
19731
20510
|
const handleViewImageStartEnd = (item) => {
|
|
19732
|
-
var _a, _b, _c, _d, _e, _f;
|
|
20511
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19733
20512
|
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)) {
|
|
19734
20513
|
const endTime = Date.now();
|
|
19735
20514
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
|
@@ -19738,10 +20517,11 @@ Made in Italy` })));
|
|
|
19738
20517
|
eventSubject: 'viewImageCarouselEnd',
|
|
19739
20518
|
eventDescription: 'User end view the image carousel',
|
|
19740
20519
|
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 : '',
|
|
19741
|
-
|
|
20520
|
+
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 : '',
|
|
20521
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19742
20522
|
imageEndTime: `${endTime}`,
|
|
19743
20523
|
playDuration: `${duration}`,
|
|
19744
|
-
contentTags: JSON.stringify((
|
|
20524
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
|
19745
20525
|
position: activeIndex + '',
|
|
19746
20526
|
contentFormat: 'image',
|
|
19747
20527
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
|
@@ -19750,7 +20530,7 @@ Made in Italy` })));
|
|
|
19750
20530
|
}
|
|
19751
20531
|
};
|
|
19752
20532
|
const handleSlideSkip = (item, position) => {
|
|
19753
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
20533
|
+
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;
|
|
19754
20534
|
if (isPreview || waterFallData)
|
|
19755
20535
|
return;
|
|
19756
20536
|
const t = new Date() - curTime.current;
|
|
@@ -19776,7 +20556,8 @@ Made in Italy` })));
|
|
|
19776
20556
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
|
19777
20557
|
position: position + '',
|
|
19778
20558
|
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 : '',
|
|
19779
|
-
|
|
20559
|
+
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 : '',
|
|
20560
|
+
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 : '',
|
|
19780
20561
|
contentFormat
|
|
19781
20562
|
}
|
|
19782
20563
|
});
|
|
@@ -19786,7 +20567,7 @@ Made in Italy` })));
|
|
|
19786
20567
|
}
|
|
19787
20568
|
};
|
|
19788
20569
|
const handleScrollEvent = (swiper) => {
|
|
19789
|
-
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;
|
|
20570
|
+
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;
|
|
19790
20571
|
const item = data[swiper.previousIndex];
|
|
19791
20572
|
const activeItem = data[swiper.activeIndex];
|
|
19792
20573
|
if (!item)
|
|
@@ -19819,11 +20600,12 @@ Made in Italy` })));
|
|
|
19819
20600
|
eventSubject: 'scrollDown',
|
|
19820
20601
|
eventDescription: 'User scroll down',
|
|
19821
20602
|
contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
19822
|
-
|
|
20603
|
+
sceneId: (_x = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '',
|
|
20604
|
+
productId: (_z = (_y = item === null || item === void 0 ? void 0 : item.product) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
|
19823
20605
|
requestId: null,
|
|
19824
|
-
traceInfo: (
|
|
20606
|
+
traceInfo: (_3 = (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.traceInfo) !== null && _3 !== void 0 ? _3 : '',
|
|
19825
20607
|
contentFormat,
|
|
19826
|
-
position: ((
|
|
20608
|
+
position: ((_4 = swiper.previousIndex) !== null && _4 !== void 0 ? _4 : 0) + ''
|
|
19827
20609
|
}
|
|
19828
20610
|
});
|
|
19829
20611
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19836,12 +20618,13 @@ Made in Italy` })));
|
|
|
19836
20618
|
eventInfo: {
|
|
19837
20619
|
eventSubject: 'scrollUp',
|
|
19838
20620
|
eventDescription: 'User scroll up',
|
|
19839
|
-
contentId: (
|
|
19840
|
-
|
|
20621
|
+
contentId: (_6 = (_5 = item === null || item === void 0 ? void 0 : item.video) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
|
|
20622
|
+
sceneId: (_9 = (_8 = (_7 = item === null || item === void 0 ? void 0 : item.video) === null || _7 === void 0 ? void 0 : _7.scene) === null || _8 === void 0 ? void 0 : _8.sceneId) !== null && _9 !== void 0 ? _9 : '',
|
|
20623
|
+
productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
|
|
19841
20624
|
requestId: null,
|
|
19842
|
-
traceInfo: (
|
|
20625
|
+
traceInfo: (_15 = (_13 = (_12 = item === null || item === void 0 ? void 0 : item.video) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_14 = item === null || item === void 0 ? void 0 : item.product) === null || _14 === void 0 ? void 0 : _14.traceInfo) !== null && _15 !== void 0 ? _15 : '',
|
|
19843
20626
|
contentFormat,
|
|
19844
|
-
position: ((
|
|
20627
|
+
position: ((_16 = swiper.previousIndex) !== null && _16 !== void 0 ? _16 : 0) + ''
|
|
19845
20628
|
}
|
|
19846
20629
|
});
|
|
19847
20630
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
|
@@ -19941,7 +20724,7 @@ Made in Italy` })));
|
|
|
19941
20724
|
};
|
|
19942
20725
|
}, [globalConfig, bffEventReport, data, activeIndex]);
|
|
19943
20726
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
|
19944
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
20727
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
19945
20728
|
const item = data[activeIndex];
|
|
19946
20729
|
// 如果是图片集则上报事件
|
|
19947
20730
|
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)) {
|
|
@@ -19952,9 +20735,10 @@ Made in Italy` })));
|
|
|
19952
20735
|
eventSubject: 'viewImageCarouselStart',
|
|
19953
20736
|
eventDescription: 'User start view the image carousel',
|
|
19954
20737
|
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 : '',
|
|
19955
|
-
|
|
20738
|
+
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 : '',
|
|
20739
|
+
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
19956
20740
|
imageStartTime: `${startTime}`,
|
|
19957
|
-
contentTags: JSON.stringify((
|
|
20741
|
+
contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
|
|
19958
20742
|
position: activeIndex + '',
|
|
19959
20743
|
contentFormat: 'image',
|
|
19960
20744
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
|
@@ -19964,13 +20748,13 @@ Made in Italy` })));
|
|
|
19964
20748
|
if (enableCapi) {
|
|
19965
20749
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19966
20750
|
eventName: 'ViewContent',
|
|
19967
|
-
product: (
|
|
20751
|
+
product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProducts,
|
|
19968
20752
|
rec: item,
|
|
19969
20753
|
position: activeIndex
|
|
19970
20754
|
});
|
|
19971
20755
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
19972
20756
|
eventName: 'PageView',
|
|
19973
|
-
product: (
|
|
20757
|
+
product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProducts,
|
|
19974
20758
|
rec: item,
|
|
19975
20759
|
position: activeIndex
|
|
19976
20760
|
});
|
|
@@ -20063,20 +20847,31 @@ Made in Italy` })));
|
|
|
20063
20847
|
React.createElement(Swiper, { style: {
|
|
20064
20848
|
marginTop: tagHeight
|
|
20065
20849
|
}, ref: swiperRef, onSlideChange: () => {
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
swiperRef.current.swiper.allowTouchMove =
|
|
20069
|
-
|
|
20850
|
+
var _a;
|
|
20851
|
+
if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
|
|
20852
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
|
20853
|
+
setTimeout(() => {
|
|
20854
|
+
var _a;
|
|
20855
|
+
if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
|
|
20856
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
|
20857
|
+
}
|
|
20858
|
+
}, 500);
|
|
20859
|
+
}
|
|
20070
20860
|
}, onActiveIndexChange: (swiper) => {
|
|
20861
|
+
var _a, _b;
|
|
20071
20862
|
setActiveIndex(swiper.activeIndex);
|
|
20072
20863
|
if (openHashtag)
|
|
20073
20864
|
return;
|
|
20074
20865
|
// 处理上滑下滑事件
|
|
20075
20866
|
handleScrollEvent(swiper);
|
|
20076
|
-
if (waterFallData || isEditor
|
|
20867
|
+
if (waterFallData || isEditor)
|
|
20077
20868
|
return;
|
|
20078
20869
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
|
20079
20870
|
if (!isLoadMore) {
|
|
20871
|
+
if (isDiyH5) {
|
|
20872
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
20873
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
20874
|
+
}
|
|
20080
20875
|
setIsLoadMore(true);
|
|
20081
20876
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
|
20082
20877
|
var _a;
|
|
@@ -20149,7 +20944,7 @@ Made in Italy` })));
|
|
|
20149
20944
|
}, []);
|
|
20150
20945
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
|
20151
20946
|
const handlePlaying = React.useCallback(() => {
|
|
20152
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20947
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
20153
20948
|
setIsPauseVideo(false);
|
|
20154
20949
|
const item = data[index];
|
|
20155
20950
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
|
@@ -20162,14 +20957,15 @@ Made in Italy` })));
|
|
|
20162
20957
|
eventSubject: 'playVideo',
|
|
20163
20958
|
eventDescription: 'User played the video',
|
|
20164
20959
|
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 : '',
|
|
20165
|
-
|
|
20960
|
+
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 : '',
|
|
20961
|
+
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 : '',
|
|
20166
20962
|
playType,
|
|
20167
20963
|
startTime: videoCurrentTime,
|
|
20168
20964
|
videoDuration,
|
|
20169
|
-
contentTags: JSON.stringify((
|
|
20965
|
+
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 : []),
|
|
20170
20966
|
position: index + '',
|
|
20171
20967
|
contentFormat: 'video',
|
|
20172
|
-
traceInfo: (
|
|
20968
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
20173
20969
|
}
|
|
20174
20970
|
});
|
|
20175
20971
|
setIsFirstPlay(false);
|
|
@@ -20208,7 +21004,7 @@ Made in Italy` })));
|
|
|
20208
21004
|
}
|
|
20209
21005
|
}, [isLoadFinish]);
|
|
20210
21006
|
const onPause = React.useCallback(() => {
|
|
20211
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
21007
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
20212
21008
|
const item = data[index];
|
|
20213
21009
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
|
20214
21010
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
|
@@ -20219,14 +21015,15 @@ Made in Italy` })));
|
|
|
20219
21015
|
eventSubject: 'playOverVideo',
|
|
20220
21016
|
eventDescription: 'User finished playing the video',
|
|
20221
21017
|
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 : '',
|
|
20222
|
-
|
|
21018
|
+
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 : '',
|
|
21019
|
+
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 : '',
|
|
20223
21020
|
endTime: videoCurrentTime,
|
|
20224
21021
|
videoDuration,
|
|
20225
21022
|
playDuration,
|
|
20226
|
-
contentTags: JSON.stringify((
|
|
21023
|
+
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 : []),
|
|
20227
21024
|
position: index + '',
|
|
20228
21025
|
contentFormat: 'video',
|
|
20229
|
-
traceInfo: (
|
|
21026
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
|
20230
21027
|
}
|
|
20231
21028
|
});
|
|
20232
21029
|
}
|
|
@@ -20952,10 +21749,16 @@ Made in Italy` })));
|
|
|
20952
21749
|
// className={style['clc-sxp-container']}
|
|
20953
21750
|
style: { height: containerHeight, position: 'relative', pointerEvents } },
|
|
20954
21751
|
React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
|
|
20955
|
-
|
|
20956
|
-
|
|
20957
|
-
swiperRef.current.swiper.allowTouchMove =
|
|
20958
|
-
|
|
21752
|
+
var _a;
|
|
21753
|
+
if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
|
|
21754
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
|
21755
|
+
setTimeout(() => {
|
|
21756
|
+
var _a;
|
|
21757
|
+
if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
|
|
21758
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
|
21759
|
+
}
|
|
21760
|
+
}, 500);
|
|
21761
|
+
}
|
|
20959
21762
|
}, onActiveIndexChange: (swiper) => {
|
|
20960
21763
|
setCurIndex(swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex);
|
|
20961
21764
|
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
|
|
@@ -21111,6 +21914,7 @@ Made in Italy` })));
|
|
|
21111
21914
|
exports.DiyStoryPreview = index$1;
|
|
21112
21915
|
exports.EditorDataProvider = EditorDataProvider;
|
|
21113
21916
|
exports.Modal = Modal$1;
|
|
21917
|
+
exports.StructurePage = StructurePage;
|
|
21114
21918
|
exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
|
|
21115
21919
|
exports.SxpPageCore = index;
|
|
21116
21920
|
exports.SxpPageRender = SxpPageRender$1;
|