pb-sxp-ui 1.0.77 → 1.0.79
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 +240 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +118 -0
- package/dist/index.js +240 -59
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +240 -59
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -0
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +2 -2
- package/es/core/components/SxpPageRender/PictureGroup/index.js +9 -5
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +4 -3
- package/es/core/components/SxpPageRender/WaterFall/index.js +2 -1
- package/es/core/components/SxpPageRender/index.js +4 -1
- package/es/core/context/SxpDataSourceProvider.js +6 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +2 -2
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +8 -4
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +4 -3
- package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -1
- package/lib/core/components/SxpPageRender/index.js +4 -1
- package/lib/core/context/SxpDataSourceProvider.js +6 -0
- package/package.json +1 -1
package/dist/index.css
CHANGED
@@ -836,6 +836,124 @@
|
|
836
836
|
box-sizing: border-box;
|
837
837
|
}
|
838
838
|
|
839
|
+
.list {
|
840
|
+
position: absolute;
|
841
|
+
bottom: 0;
|
842
|
+
left: 0;
|
843
|
+
right: 0;
|
844
|
+
top: 70px;
|
845
|
+
}
|
846
|
+
.list-scroll {
|
847
|
+
position: absolute;
|
848
|
+
top: 0;
|
849
|
+
width: 100%;
|
850
|
+
height: 100%;
|
851
|
+
overflow: auto;
|
852
|
+
}
|
853
|
+
.list-info {
|
854
|
+
font-size: 13px;
|
855
|
+
line-height: 20px;
|
856
|
+
padding: 0 54px;
|
857
|
+
text-align: center;
|
858
|
+
}
|
859
|
+
.list-collection {
|
860
|
+
margin-top: 4px;
|
861
|
+
margin-left: auto;
|
862
|
+
margin-right: auto;
|
863
|
+
margin-bottom: 40px;
|
864
|
+
text-align: center;
|
865
|
+
color: #757575;
|
866
|
+
font-size: 12px;
|
867
|
+
text-decoration: underline;
|
868
|
+
cursor: pointer;
|
869
|
+
}
|
870
|
+
.list-content {
|
871
|
+
display: -webkit-box;
|
872
|
+
display: -webkit-flex;
|
873
|
+
display: -ms-flexbox;
|
874
|
+
display: flex;
|
875
|
+
-webkit-flex-wrap: wrap;
|
876
|
+
-ms-flex-wrap: wrap;
|
877
|
+
flex-wrap: wrap;
|
878
|
+
-webkit-box-pack: justify;
|
879
|
+
-webkit-justify-content: space-between;
|
880
|
+
-ms-flex-pack: justify;
|
881
|
+
justify-content: space-between;
|
882
|
+
}
|
883
|
+
.list-content-listItem {
|
884
|
+
width: 49.5%;
|
885
|
+
margin-bottom: 40px;
|
886
|
+
cursor: pointer;
|
887
|
+
}
|
888
|
+
.list-content-listItem-picture {
|
889
|
+
position: relative;
|
890
|
+
width: 100%;
|
891
|
+
padding-bottom: 100%;
|
892
|
+
overflow: hidden;
|
893
|
+
}
|
894
|
+
.list-content-listItem-picture-img {
|
895
|
+
position: absolute;
|
896
|
+
width: 100%;
|
897
|
+
height: 100%;
|
898
|
+
-o-object-fit: cover;
|
899
|
+
object-fit: cover;
|
900
|
+
}
|
901
|
+
.list-content-listItem-info {
|
902
|
+
padding: 8px;
|
903
|
+
}
|
904
|
+
.list-content-listItem-info-title {
|
905
|
+
font-size: 13px;
|
906
|
+
line-height: 20px;
|
907
|
+
line-clamp: 2;
|
908
|
+
overflow: hidden;
|
909
|
+
text-overflow: ellipsis;
|
910
|
+
display: -webkit-box;
|
911
|
+
-webkit-box-orient: vertical;
|
912
|
+
-webkit-line-clamp: 2;
|
913
|
+
}
|
914
|
+
.list-content-listItem-info-nowrap {
|
915
|
+
line-clamp: 1 !important;
|
916
|
+
-webkit-line-clamp: 1 !important;
|
917
|
+
}
|
918
|
+
.list-content-listItem-info-price {
|
919
|
+
font-size: 13px;
|
920
|
+
line-height: 20px;
|
921
|
+
font-weight: bold;
|
922
|
+
}
|
923
|
+
.list-bottom {
|
924
|
+
position: absolute;
|
925
|
+
left: 0;
|
926
|
+
right: 0;
|
927
|
+
bottom: 0;
|
928
|
+
background-color: #fff;
|
929
|
+
-webkit-box-sizing: content-box;
|
930
|
+
box-sizing: content-box;
|
931
|
+
height: 92px;
|
932
|
+
}
|
933
|
+
.list-btn-wrap {
|
934
|
+
position: absolute;
|
935
|
+
left: 0;
|
936
|
+
right: 0;
|
937
|
+
bottom: 0;
|
938
|
+
padding: 20px;
|
939
|
+
-webkit-box-sizing: border-box;
|
940
|
+
box-sizing: border-box;
|
941
|
+
}
|
942
|
+
.list-btn {
|
943
|
+
height: 52px;
|
944
|
+
width: 100%;
|
945
|
+
background: #000000;
|
946
|
+
border-radius: 25px;
|
947
|
+
font-size: 13px;
|
948
|
+
line-height: 100%;
|
949
|
+
font-weight: bold;
|
950
|
+
color: #fff;
|
951
|
+
border: none;
|
952
|
+
cursor: pointer;
|
953
|
+
-webkit-box-sizing: border-box;
|
954
|
+
box-sizing: border-box;
|
955
|
+
}
|
956
|
+
|
839
957
|
/**
|
840
958
|
* Swiper 11.0.7
|
841
959
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
package/dist/index.js
CHANGED
@@ -627,6 +627,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
627
627
|
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
628
628
|
})
|
629
629
|
.finally(() => {
|
630
|
+
bffEventReport({
|
631
|
+
eventInfo: {
|
632
|
+
eventSubject: 'apiRequest',
|
633
|
+
eventDescription: 'api request succeed'
|
634
|
+
}
|
635
|
+
});
|
630
636
|
setLoading(false);
|
631
637
|
isInit.current = true;
|
632
638
|
});
|
@@ -11829,7 +11835,7 @@ var previewData = {
|
|
11829
11835
|
hashTag: hashTag
|
11830
11836
|
};
|
11831
11837
|
|
11832
|
-
const WaterfallFlowItem = (props) => {
|
11838
|
+
const WaterfallFlowItem$1 = (props) => {
|
11833
11839
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
11834
11840
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
11835
11841
|
const [showVideo, setShowVideo] = useState(false);
|
@@ -11893,29 +11899,8 @@ const WaterfallFlowItem = (props) => {
|
|
11893
11899
|
return null;
|
11894
11900
|
}
|
11895
11901
|
}, [rec]);
|
11896
|
-
// useEffect(() => {
|
11897
|
-
// const observer = new IntersectionObserver((entries) => {
|
11898
|
-
// entries.forEach((entry) => {
|
11899
|
-
// if (entry.isIntersecting) {
|
11900
|
-
// if (ref.current === null || src === '') {
|
11901
|
-
// return;
|
11902
|
-
// }
|
11903
|
-
// if (showVideo && firstFrameSrc) {
|
11904
|
-
// imgDom.current.setSrc(firstFrameSrc);
|
11905
|
-
// } else {
|
11906
|
-
// imgDom.current.setSrc(src);
|
11907
|
-
// }
|
11908
|
-
// observer.unobserve(ref.current);
|
11909
|
-
// }
|
11910
|
-
// });
|
11911
|
-
// });
|
11912
|
-
// observer.observe(ref.current);
|
11913
|
-
// return () => {
|
11914
|
-
// observer.disconnect();
|
11915
|
-
// };
|
11916
|
-
// }, [src, showVideo, firstFrameSrc]);
|
11917
11902
|
useEffect(() => {
|
11918
|
-
if (imgDom.current === null || src === ''
|
11903
|
+
if (imgDom.current === null || src === '') {
|
11919
11904
|
return;
|
11920
11905
|
}
|
11921
11906
|
const img = new Image();
|
@@ -11932,8 +11917,7 @@ const WaterfallFlowItem = (props) => {
|
|
11932
11917
|
});
|
11933
11918
|
setIsLoading(true);
|
11934
11919
|
};
|
11935
|
-
|
11936
|
-
imgDom.current.src = img.src;
|
11920
|
+
imgDom.current.setSrc(img.src);
|
11937
11921
|
}, [src, showVideo, firstFrameSrc, isImgShow]);
|
11938
11922
|
useEffect(() => {
|
11939
11923
|
// 通过宽度比例获取图片高度
|
@@ -11985,12 +11969,12 @@ const WaterfallFlowItem = (props) => {
|
|
11985
11969
|
showVideo && (React.createElement("div", { style: { display: 'none' } },
|
11986
11970
|
React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
|
11987
11971
|
React.createElement("canvas", { ref: canvasRef }))),
|
11988
|
-
React.createElement(
|
11972
|
+
React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
|
11989
11973
|
React.createElement("div", { className: 'waterFallList-content-listItem-info' },
|
11990
11974
|
React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title) }, title && title),
|
11991
11975
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
|
11992
11976
|
};
|
11993
|
-
function WaterfallList(_a) {
|
11977
|
+
function WaterfallList$1(_a) {
|
11994
11978
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
11995
11979
|
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
11996
11980
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
@@ -12201,7 +12185,7 @@ function WaterfallList(_a) {
|
|
12201
12185
|
React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
|
12202
12186
|
list.map((item, ind) => {
|
12203
12187
|
var _a;
|
12204
|
-
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
|
12188
|
+
return (React.createElement(WaterfallFlowItem$1, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
|
12205
12189
|
}),
|
12206
12190
|
React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
|
12207
12191
|
position: 'absolute',
|
@@ -12219,11 +12203,221 @@ function WaterfallList(_a) {
|
|
12219
12203
|
|
12220
12204
|
var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
|
12221
12205
|
|
12206
|
+
const WaterfallFlowItem = (props) => {
|
12207
|
+
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
12208
|
+
const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
|
12209
|
+
const [showVideo, setShowVideo] = useState(false);
|
12210
|
+
const imgDom = useRef(null);
|
12211
|
+
const ref = useRef(null);
|
12212
|
+
const videoDom = useRef(null);
|
12213
|
+
const canvasRef = useRef(null);
|
12214
|
+
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
12215
|
+
const src = useMemo(() => {
|
12216
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12217
|
+
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
|
12218
|
+
return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
12219
|
+
}
|
12220
|
+
else if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.imgUrls) === null || _d === void 0 ? void 0 : _d.length) {
|
12221
|
+
return (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.imgUrls) === null || _f === void 0 ? void 0 : _f[0];
|
12222
|
+
}
|
12223
|
+
else if ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.homePage) === null || _h === void 0 ? void 0 : _h.length) {
|
12224
|
+
return (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.homePage) === null || _k === void 0 ? void 0 : _k[0];
|
12225
|
+
}
|
12226
|
+
else {
|
12227
|
+
return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
|
12228
|
+
}
|
12229
|
+
}, [rec, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image]);
|
12230
|
+
const title = useMemo(() => {
|
12231
|
+
var _a, _b;
|
12232
|
+
return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
|
12233
|
+
}, [rec]);
|
12234
|
+
const priceText = useMemo(() => {
|
12235
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12236
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.currency) && ((_b = rec === null || rec === void 0 ? void 0 : rec.product) === null || _b === void 0 ? void 0 : _b.price)) {
|
12237
|
+
return `${(_f = (_e = (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) === null || _d === void 0 ? void 0 : _d.split('-')[1]) === null || _e === void 0 ? void 0 : _e.toUpperCase()) !== null && _f !== void 0 ? _f : ''}${(_j = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.price) === null || _h === void 0 ? void 0 : _h.toLocaleString('zh', {
|
12238
|
+
minimumFractionDigits: 0
|
12239
|
+
})) !== null && _j !== void 0 ? _j : ''}`;
|
12240
|
+
}
|
12241
|
+
else {
|
12242
|
+
return null;
|
12243
|
+
}
|
12244
|
+
}, [rec]);
|
12245
|
+
// useEffect(() => {
|
12246
|
+
// if (imgDom.current === null || src === '') {
|
12247
|
+
// return;
|
12248
|
+
// }
|
12249
|
+
// const img = new Image();
|
12250
|
+
// if (showVideo && firstFrameSrc) {
|
12251
|
+
// img.src = firstFrameSrc;
|
12252
|
+
// } else {
|
12253
|
+
// img.src = src;
|
12254
|
+
// }
|
12255
|
+
// // img.onload = () => {
|
12256
|
+
// // setIsLoading(true);
|
12257
|
+
// // };
|
12258
|
+
// imgDom.current.src = img.src;
|
12259
|
+
// }, [src, showVideo, firstFrameSrc]);
|
12260
|
+
useEffect(() => {
|
12261
|
+
const observer = new IntersectionObserver((entries) => {
|
12262
|
+
entries.forEach((entry) => {
|
12263
|
+
if (entry.isIntersecting) {
|
12264
|
+
if (ref.current === null || src === '') {
|
12265
|
+
return;
|
12266
|
+
}
|
12267
|
+
if (showVideo && firstFrameSrc) {
|
12268
|
+
imgDom.current.setSrc(firstFrameSrc);
|
12269
|
+
}
|
12270
|
+
else {
|
12271
|
+
imgDom.current.setSrc(src);
|
12272
|
+
}
|
12273
|
+
observer.unobserve(ref.current);
|
12274
|
+
}
|
12275
|
+
});
|
12276
|
+
});
|
12277
|
+
observer.observe(ref.current);
|
12278
|
+
return () => {
|
12279
|
+
observer.disconnect();
|
12280
|
+
};
|
12281
|
+
}, [src, showVideo, firstFrameSrc]);
|
12282
|
+
const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
|
12283
|
+
const aspectRatio = videoWidth / videoHeight;
|
12284
|
+
const targetHeight = targetWidth / aspectRatio;
|
12285
|
+
return targetHeight;
|
12286
|
+
};
|
12287
|
+
useEffect(() => {
|
12288
|
+
const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
|
12289
|
+
if (video === null || src === '' || !showVideo) {
|
12290
|
+
return;
|
12291
|
+
}
|
12292
|
+
video.src = src;
|
12293
|
+
video.currentTime = 1;
|
12294
|
+
video.crossOrigin = 'anonymous';
|
12295
|
+
video.onloadeddata = () => {
|
12296
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12297
|
+
if (!canvas)
|
12298
|
+
return;
|
12299
|
+
const ctx = canvas.getContext('2d');
|
12300
|
+
const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
|
12301
|
+
const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
|
12302
|
+
canvas.height = targetHeight;
|
12303
|
+
canvas.width = targetWidth;
|
12304
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
12305
|
+
setFirstFrameSrc(canvas.toDataURL());
|
12306
|
+
video.remove();
|
12307
|
+
canvas.remove();
|
12308
|
+
};
|
12309
|
+
}, [src, showVideo]);
|
12310
|
+
const handleClickToDetail = () => {
|
12311
|
+
reportTagsView();
|
12312
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
|
12313
|
+
setTimeout(() => {
|
12314
|
+
var _a;
|
12315
|
+
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index, 0, false);
|
12316
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
|
12317
|
+
}, 0);
|
12318
|
+
};
|
12319
|
+
return (React.createElement("div", { ref: ref, className: 'list-content-listItem', key: index, onClick: handleClickToDetail, style: { marginBottom: space } },
|
12320
|
+
React.createElement("div", { className: 'list-content-listItem-picture' },
|
12321
|
+
showVideo && (React.createElement("div", { style: { display: 'none' } },
|
12322
|
+
React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
|
12323
|
+
React.createElement("canvas", { ref: canvasRef }))),
|
12324
|
+
React.createElement(FormatImage$1, { loading: 'lazy', className: 'list-content-listItem-picture-img', ref: imgDom })),
|
12325
|
+
React.createElement("div", { className: 'list-content-listItem-info' },
|
12326
|
+
React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}`, style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.title }, title && title),
|
12327
|
+
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
|
12328
|
+
};
|
12329
|
+
function WaterfallList(_a) {
|
12330
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12331
|
+
var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
|
12332
|
+
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
12333
|
+
const [list, setList] = useState();
|
12334
|
+
const [data, setData] = useState();
|
12335
|
+
const [isLoadingData, setIsLoadingData] = useState(false);
|
12336
|
+
const containerRef = useRef(null);
|
12337
|
+
const [isLoadMore, setIsLoadMore] = useState(false);
|
12338
|
+
useCallback(() => {
|
12339
|
+
if (isLoadMore)
|
12340
|
+
return;
|
12341
|
+
setIsLoadMore(true);
|
12342
|
+
waterFallData &&
|
12343
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
12344
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
12345
|
+
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
12346
|
+
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
12347
|
+
}).then((res) => {
|
12348
|
+
var _a;
|
12349
|
+
setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
|
12350
|
+
setIsLoadMore(false);
|
12351
|
+
}));
|
12352
|
+
}, [waterFallData, getRecommendVideos, list, isLoadMore]);
|
12353
|
+
useEffect(() => {
|
12354
|
+
var _a, _b;
|
12355
|
+
setIsLoadingData(true);
|
12356
|
+
waterFallData &&
|
12357
|
+
(getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
12358
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
12359
|
+
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
12360
|
+
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
12361
|
+
defaultSize: hashTagSize,
|
12362
|
+
maxSize: hashTagSize
|
12363
|
+
}).then((res) => {
|
12364
|
+
var _a, _b;
|
12365
|
+
setData(res);
|
12366
|
+
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
12367
|
+
setIsLoadingData(false);
|
12368
|
+
}));
|
12369
|
+
if (isOpenHashTag) {
|
12370
|
+
const res = previewData;
|
12371
|
+
setData(res);
|
12372
|
+
setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
|
12373
|
+
setIsLoadingData(false);
|
12374
|
+
}
|
12375
|
+
}, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
|
12376
|
+
// useEffect(() => {
|
12377
|
+
// const container = containerRef?.current;
|
12378
|
+
// if (!container) return;
|
12379
|
+
// const handleScroll = () => {
|
12380
|
+
// const top = (container as any)?.scrollTop;
|
12381
|
+
// const clientHeight = (container as any)?.clientHeight;
|
12382
|
+
// const scrollHeight = (container as any)?.scrollHeight;
|
12383
|
+
// if (scrollHeight <= top + clientHeight && !isLoadingData) {
|
12384
|
+
// loadMoreData();
|
12385
|
+
// }
|
12386
|
+
// };
|
12387
|
+
// container?.addEventListener('scroll', handleScroll);
|
12388
|
+
// return () => {
|
12389
|
+
// container?.removeEventListener('scroll', handleScroll); // 在组件卸载时移除事件监听器
|
12390
|
+
// };
|
12391
|
+
// }, [isLoadingData, containerRef, loadMoreData]);
|
12392
|
+
const handleClickLink = () => {
|
12393
|
+
var _a, _b;
|
12394
|
+
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
12395
|
+
reportTagsView();
|
12396
|
+
window.location.href = (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link;
|
12397
|
+
}
|
12398
|
+
};
|
12399
|
+
return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
12400
|
+
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'list' },
|
12401
|
+
React.createElement("div", { className: 'list-scroll', ref: containerRef },
|
12402
|
+
React.createElement("div", { className: 'list-info', style: (_b = props === null || props === void 0 ? void 0 : props.textStyles) === null || _b === void 0 ? void 0 : _b.hashTagDesc }, (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.info),
|
12403
|
+
React.createElement("div", { hidden: !((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.link), className: 'list-collection', onClick: handleClickLink, style: Object.assign(Object.assign({}, (_e = props === null || props === void 0 ? void 0 : props.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagLink), { marginBottom: props === null || props === void 0 ? void 0 : props.space }) }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'),
|
12404
|
+
React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
12405
|
+
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
|
12406
|
+
})),
|
12407
|
+
React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
|
12408
|
+
React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
|
12409
|
+
height: ((_h = data === null || data === void 0 ? void 0 : data.tag) === null || _h === void 0 ? void 0 : _h.link) ? ((_j = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _j === void 0 ? void 0 : _j.height) || ((_k = props === null || props === void 0 ? void 0 : props.buttonStyle) === null || _k === void 0 ? void 0 : _k.height) || '100px' : 0
|
12410
|
+
} })),
|
12411
|
+
React.createElement("div", { className: 'list-bottom', hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
12412
|
+
React.createElement("div", { hidden: !((_m = data === null || data === void 0 ? void 0 : data.tag) === null || _m === void 0 ? void 0 : _m.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
12413
|
+
React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.linkTitle) || 'Shop the collection'))))));
|
12414
|
+
}
|
12415
|
+
|
12222
12416
|
/*
|
12223
12417
|
* @Author: binruan@chatlabs.com
|
12224
12418
|
* @Date: 2024-01-10 10:58:24
|
12225
12419
|
* @LastEditors: binruan@chatlabs.com
|
12226
|
-
* @LastEditTime: 2024-06-
|
12420
|
+
* @LastEditTime: 2024-06-07 10:35:35
|
12227
12421
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
12228
12422
|
*
|
12229
12423
|
*/
|
@@ -12317,7 +12511,7 @@ const WaterFall = (props) => {
|
|
12317
12511
|
display: openHashtag ? 'block' : 'none'
|
12318
12512
|
} },
|
12319
12513
|
React.createElement(Navbar$1, { icon: img$1, styles: { top: '32px' }, textStyle: (_a = props === null || props === void 0 ? void 0 : props.textStyles) === null || _a === void 0 ? void 0 : _a.hashTagTitle, onClose: handleClose }),
|
12320
|
-
React.createElement(WaterfallList, Object.assign({ reportTagsView: reportTagsView }, props))), modalEleRef.current);
|
12514
|
+
(props === null || props === void 0 ? void 0 : props.isWaterfallFlow) ? (React.createElement(WaterfallList$1, Object.assign({ reportTagsView: reportTagsView }, props))) : (React.createElement(WaterfallList, Object.assign({ reportTagsView: reportTagsView }, props)))), modalEleRef.current);
|
12321
12515
|
};
|
12322
12516
|
var WaterFall$1 = memo(WaterFall);
|
12323
12517
|
|
@@ -12841,7 +13035,7 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
|
|
12841
13035
|
*
|
12842
13036
|
*/
|
12843
13037
|
const Picture = (props) => {
|
12844
|
-
const { src, height, imgUrlsPostConfig } = props;
|
13038
|
+
const { src, height, imgUrlsPostConfig, onShowFirstImage } = props;
|
12845
13039
|
const blur = useMemo(() => {
|
12846
13040
|
return (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.mode) === '2';
|
12847
13041
|
}, [imgUrlsPostConfig]);
|
@@ -12866,7 +13060,7 @@ const Picture = (props) => {
|
|
12866
13060
|
return isBgColor && (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.bgColor) ? { backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.bgColor } : {};
|
12867
13061
|
}, [imgUrlsPostConfig, isBgColor]);
|
12868
13062
|
return (React.createElement("div", { style: Object.assign({ overflow: 'hidden', height, width: '100%', position: 'relative' }, bgStyle) },
|
12869
|
-
(!blur || !isBgColor) && (React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
13063
|
+
(!blur || !isBgColor) && (React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle), onLoad: onShowFirstImage })),
|
12870
13064
|
blur && (React.createElement(FormatImage$1, { src: src, style: {
|
12871
13065
|
width: '100%',
|
12872
13066
|
height: '100%',
|
@@ -12883,7 +13077,7 @@ const Picture = (props) => {
|
|
12883
13077
|
* @Author: lewinlu@chatlabs.com
|
12884
13078
|
* @Date: 2024-01-03 14:39:09
|
12885
13079
|
* @LastEditors: binruan@chatlabs.com
|
12886
|
-
* @LastEditTime: 2024-
|
13080
|
+
* @LastEditTime: 2024-06-07 14:05:08
|
12887
13081
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12888
13082
|
*/
|
12889
13083
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
@@ -12903,16 +13097,20 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
12903
13097
|
}
|
12904
13098
|
}
|
12905
13099
|
else {
|
12906
|
-
setIsLoad(true);
|
12907
13100
|
(ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
|
12908
13101
|
}
|
12909
13102
|
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
13103
|
+
const showFirstImageFn = useCallback(() => {
|
13104
|
+
if (!isLoad) {
|
13105
|
+
setIsLoad(true);
|
13106
|
+
}
|
13107
|
+
}, [isLoad]);
|
12910
13108
|
// if (!isActive) {
|
12911
13109
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
12912
13110
|
// }
|
12913
|
-
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, loop: true, autoplay: { delay: ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _a !== void 0 ? _a : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
12914
|
-
return (React.createElement(SwiperSlide, { key:
|
12915
|
-
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
13111
|
+
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, loop: true, autoplay: { delay: ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _a !== void 0 ? _a : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url, index) => {
|
13112
|
+
return (React.createElement(SwiperSlide, { key: index },
|
13113
|
+
React.createElement(Picture, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
12916
13114
|
})));
|
12917
13115
|
};
|
12918
13116
|
var PictureGroup$3 = memo(PictureGroup$2);
|
@@ -13132,7 +13330,7 @@ var Tagbar$1 = memo(Tagbar);
|
|
13132
13330
|
* @Author: binruan@chatlabs.com
|
13133
13331
|
* @Date: 2024-01-15 19:03:09
|
13134
13332
|
* @LastEditors: binruan@chatlabs.com
|
13135
|
-
* @LastEditTime: 2024-06-
|
13333
|
+
* @LastEditTime: 2024-06-07 11:10:42
|
13136
13334
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13137
13335
|
*
|
13138
13336
|
*/
|
@@ -13155,6 +13353,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13155
13353
|
return data.length > 0 && !loading && getFeUserId();
|
13156
13354
|
}, [data, loading]);
|
13157
13355
|
const handleH5EnterLink = useCallback(() => {
|
13356
|
+
var _a, _b;
|
13158
13357
|
if (data.length <= 0) {
|
13159
13358
|
return;
|
13160
13359
|
}
|
@@ -13177,7 +13376,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13177
13376
|
utmId: getVal('utm_id'),
|
13178
13377
|
utmContent: getVal('utm_content'),
|
13179
13378
|
enterTime: `${Date.now()}`,
|
13180
|
-
requestId: null
|
13379
|
+
requestId: null,
|
13380
|
+
enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : '',
|
13381
|
+
clSource: getVal('cl_sourc')
|
13181
13382
|
}
|
13182
13383
|
});
|
13183
13384
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
@@ -13237,26 +13438,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13237
13438
|
})) || 0;
|
13238
13439
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
13239
13440
|
}, [ctaType, swiperRef]);
|
13240
|
-
// useEffect(() => {
|
13241
|
-
// const handleBeforeUnload = (event: any) => {
|
13242
|
-
// event.preventDefault();
|
13243
|
-
// const item = data?.[activeIndex];
|
13244
|
-
// bffEventReport?.({
|
13245
|
-
// eventInfo: {
|
13246
|
-
// sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
|
13247
|
-
// eventSubject: 'sessionCompleted',
|
13248
|
-
// eventDescription: 'Session completed',
|
13249
|
-
// contentId: item?.video?.itemId,
|
13250
|
-
// productId: item?.product?.itemId,
|
13251
|
-
// position: item?.position
|
13252
|
-
// }
|
13253
|
-
// });
|
13254
|
-
// };
|
13255
|
-
// window.addEventListener('beforeunload', handleBeforeUnload);
|
13256
|
-
// return () => {
|
13257
|
-
// window.removeEventListener('beforeunload', handleBeforeUnload);
|
13258
|
-
// };
|
13259
|
-
// }, [activeIndex, data, bffEventReport, curTime]);
|
13260
13441
|
useEffect(() => {
|
13261
13442
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
13262
13443
|
const visibleChange = () => {
|