pb-sxp-ui 1.16.10 → 1.16.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -16
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +32 -16
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +4 -5
- package/es/core/components/SxpPageRender/VideoWidget/index.js +4 -5
- package/es/core/components/SxpPageRender/index.js +6 -1
- package/es/core/context/SxpDataSourceProvider.js +16 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +4 -5
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +4 -5
- package/lib/core/components/SxpPageRender/index.js +6 -1
- package/lib/core/context/SxpDataSourceProvider.js +16 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -637,6 +637,7 @@
|
|
637
637
|
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 }) => {
|
638
638
|
var _a, _b, _c, _d, _e;
|
639
639
|
const [rtcList, setRtcList] = React.useState([]);
|
640
|
+
const [firstRtcList, setFirstRtcList] = React.useState([]);
|
640
641
|
const [tagList, setTagList] = React.useState([]);
|
641
642
|
const [loading, setLoading] = React.useState(true);
|
642
643
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
@@ -807,6 +808,9 @@
|
|
807
808
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
808
809
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
809
810
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
811
|
+
if (isDiyH5) {
|
812
|
+
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
813
|
+
}
|
810
814
|
}
|
811
815
|
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
812
816
|
if (isNotNullList) {
|
@@ -846,12 +850,17 @@
|
|
846
850
|
if (rtcList.length <= 0) {
|
847
851
|
return;
|
848
852
|
}
|
853
|
+
if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
|
854
|
+
setRtcList(rtcList.concat(firstRtcList));
|
855
|
+
setCacheRtcList(cacheRtcList.concat(firstRtcList));
|
856
|
+
return;
|
857
|
+
}
|
849
858
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
850
859
|
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
851
860
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
852
861
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
853
862
|
return data;
|
854
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
863
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyH5, firstRtcList]);
|
855
864
|
const refreshFeSession = React.useCallback((enableReSid, event) => {
|
856
865
|
var _a, _b, _c, _d, _e;
|
857
866
|
let expire = false;
|
@@ -1198,6 +1207,9 @@
|
|
1198
1207
|
}
|
1199
1208
|
setRtcList(list);
|
1200
1209
|
setCacheRtcList(list);
|
1210
|
+
if (isDiyH5) {
|
1211
|
+
setFirstRtcList(list);
|
1212
|
+
}
|
1201
1213
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1202
1214
|
if (channel) {
|
1203
1215
|
const item = list === null || list === void 0 ? void 0 : list[0];
|
@@ -1233,6 +1245,9 @@
|
|
1233
1245
|
}
|
1234
1246
|
setRtcList(list);
|
1235
1247
|
setCacheRtcList(list);
|
1248
|
+
if (isDiyH5) {
|
1249
|
+
setFirstRtcList(list);
|
1250
|
+
}
|
1236
1251
|
}
|
1237
1252
|
})
|
1238
1253
|
.finally(() => {
|
@@ -17929,23 +17944,21 @@ Made in Italy` })));
|
|
17929
17944
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
17930
17945
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
17931
17946
|
const handleEnd = () => {
|
17932
|
-
var _a, _b, _c, _d, _e, _f
|
17947
|
+
var _a, _b, _c, _d, _e, _f;
|
17933
17948
|
if (!videoRef.current)
|
17934
17949
|
return;
|
17935
17950
|
if (isDiyH5) {
|
17936
17951
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
17937
17952
|
if (!loopPlayRef.current)
|
17938
17953
|
return;
|
17939
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1)
|
17940
|
-
(_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.slideTo(0);
|
17941
|
-
}
|
17954
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
|
17942
17955
|
else {
|
17943
|
-
const i = (
|
17944
|
-
(
|
17956
|
+
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;
|
17957
|
+
(_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);
|
17945
17958
|
}
|
17946
17959
|
}
|
17947
17960
|
else {
|
17948
|
-
(
|
17961
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
17949
17962
|
}
|
17950
17963
|
};
|
17951
17964
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
@@ -18350,15 +18363,13 @@ Made in Italy` })));
|
|
18350
18363
|
let timerId;
|
18351
18364
|
if (isLoad && isActive && isDiyH5) {
|
18352
18365
|
timerId = setTimeout(() => {
|
18353
|
-
var _a, _b, _c, _d
|
18366
|
+
var _a, _b, _c, _d;
|
18354
18367
|
if (!loopPlayRef.current)
|
18355
18368
|
return;
|
18356
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1)
|
18357
|
-
(_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.slideTo(0);
|
18358
|
-
}
|
18369
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
|
18359
18370
|
else {
|
18360
|
-
const i = (
|
18361
|
-
(
|
18371
|
+
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;
|
18372
|
+
(_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);
|
18362
18373
|
}
|
18363
18374
|
}, 3000);
|
18364
18375
|
}
|
@@ -18366,7 +18377,7 @@ Made in Italy` })));
|
|
18366
18377
|
if (timerId)
|
18367
18378
|
clearTimeout(timerId);
|
18368
18379
|
};
|
18369
|
-
}, [isLoad, isActive, isDiyH5,
|
18380
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef]);
|
18370
18381
|
React.useEffect(() => {
|
18371
18382
|
if (isLoad && isActive) {
|
18372
18383
|
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
@@ -19324,15 +19335,20 @@ Made in Italy` })));
|
|
19324
19335
|
swiperRef.current.swiper.allowTouchMove = true;
|
19325
19336
|
}, 500);
|
19326
19337
|
}, onActiveIndexChange: (swiper) => {
|
19338
|
+
var _a, _b;
|
19327
19339
|
setActiveIndex(swiper.activeIndex);
|
19328
19340
|
if (openHashtag)
|
19329
19341
|
return;
|
19330
19342
|
// 处理上滑下滑事件
|
19331
19343
|
handleScrollEvent(swiper);
|
19332
|
-
if (waterFallData || isEditor
|
19344
|
+
if (waterFallData || isEditor)
|
19333
19345
|
return;
|
19334
19346
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
19335
19347
|
if (!isLoadMore) {
|
19348
|
+
if (isDiyH5) {
|
19349
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
19350
|
+
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
19351
|
+
}
|
19336
19352
|
setIsLoadMore(true);
|
19337
19353
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
19338
19354
|
var _a;
|