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/pb-ui.js CHANGED
@@ -642,6 +642,12 @@
642
642
  setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
643
643
  })
644
644
  .finally(() => {
645
+ bffEventReport({
646
+ eventInfo: {
647
+ eventSubject: 'apiRequest',
648
+ eventDescription: 'api request succeed'
649
+ }
650
+ });
645
651
  setLoading(false);
646
652
  isInit.current = true;
647
653
  });
@@ -11844,7 +11850,7 @@ Made in Italy` })));
11844
11850
  hashTag: hashTag
11845
11851
  };
11846
11852
 
11847
- const WaterfallFlowItem = (props) => {
11853
+ const WaterfallFlowItem$1 = (props) => {
11848
11854
  const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
11849
11855
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
11850
11856
  const [showVideo, setShowVideo] = React.useState(false);
@@ -11908,29 +11914,8 @@ Made in Italy` })));
11908
11914
  return null;
11909
11915
  }
11910
11916
  }, [rec]);
11911
- // useEffect(() => {
11912
- // const observer = new IntersectionObserver((entries) => {
11913
- // entries.forEach((entry) => {
11914
- // if (entry.isIntersecting) {
11915
- // if (ref.current === null || src === '') {
11916
- // return;
11917
- // }
11918
- // if (showVideo && firstFrameSrc) {
11919
- // imgDom.current.setSrc(firstFrameSrc);
11920
- // } else {
11921
- // imgDom.current.setSrc(src);
11922
- // }
11923
- // observer.unobserve(ref.current);
11924
- // }
11925
- // });
11926
- // });
11927
- // observer.observe(ref.current);
11928
- // return () => {
11929
- // observer.disconnect();
11930
- // };
11931
- // }, [src, showVideo, firstFrameSrc]);
11932
11917
  React.useEffect(() => {
11933
- if (imgDom.current === null || src === '' || isImgShow === false) {
11918
+ if (imgDom.current === null || src === '') {
11934
11919
  return;
11935
11920
  }
11936
11921
  const img = new Image();
@@ -11947,8 +11932,7 @@ Made in Italy` })));
11947
11932
  });
11948
11933
  setIsLoading(true);
11949
11934
  };
11950
- // imgDom.current.setSrc(img.src);
11951
- imgDom.current.src = img.src;
11935
+ imgDom.current.setSrc(img.src);
11952
11936
  }, [src, showVideo, firstFrameSrc, isImgShow]);
11953
11937
  React.useEffect(() => {
11954
11938
  // 通过宽度比例获取图片高度
@@ -12000,12 +11984,12 @@ Made in Italy` })));
12000
11984
  showVideo && (React.createElement("div", { style: { display: 'none' } },
12001
11985
  React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
12002
11986
  React.createElement("canvas", { ref: canvasRef }))),
12003
- React.createElement("img", { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
11987
+ React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
12004
11988
  React.createElement("div", { className: 'waterFallList-content-listItem-info' },
12005
11989
  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),
12006
11990
  React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
12007
11991
  };
12008
- function WaterfallList(_a) {
11992
+ function WaterfallList$1(_a) {
12009
11993
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
12010
11994
  var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
12011
11995
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
@@ -12216,7 +12200,7 @@ Made in Italy` })));
12216
12200
  React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
12217
12201
  list.map((item, ind) => {
12218
12202
  var _a;
12219
- 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)));
12203
+ 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)));
12220
12204
  }),
12221
12205
  React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
12222
12206
  position: 'absolute',
@@ -12234,11 +12218,221 @@ Made in Italy` })));
12234
12218
 
12235
12219
  var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
12236
12220
 
12221
+ const WaterfallFlowItem = (props) => {
12222
+ const { rec, index, list, reportTagsView, textStyles, space } = props;
12223
+ const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
12224
+ const [showVideo, setShowVideo] = React.useState(false);
12225
+ const imgDom = React.useRef(null);
12226
+ const ref = React.useRef(null);
12227
+ const videoDom = React.useRef(null);
12228
+ const canvasRef = React.useRef(null);
12229
+ const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
12230
+ const src = React.useMemo(() => {
12231
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12232
+ if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
12233
+ return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
12234
+ }
12235
+ 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) {
12236
+ 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];
12237
+ }
12238
+ 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) {
12239
+ 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];
12240
+ }
12241
+ else {
12242
+ return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
12243
+ }
12244
+ }, [rec, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image]);
12245
+ const title = React.useMemo(() => {
12246
+ var _a, _b;
12247
+ 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;
12248
+ }, [rec]);
12249
+ const priceText = React.useMemo(() => {
12250
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12251
+ 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)) {
12252
+ 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', {
12253
+ minimumFractionDigits: 0
12254
+ })) !== null && _j !== void 0 ? _j : ''}`;
12255
+ }
12256
+ else {
12257
+ return null;
12258
+ }
12259
+ }, [rec]);
12260
+ // useEffect(() => {
12261
+ // if (imgDom.current === null || src === '') {
12262
+ // return;
12263
+ // }
12264
+ // const img = new Image();
12265
+ // if (showVideo && firstFrameSrc) {
12266
+ // img.src = firstFrameSrc;
12267
+ // } else {
12268
+ // img.src = src;
12269
+ // }
12270
+ // // img.onload = () => {
12271
+ // // setIsLoading(true);
12272
+ // // };
12273
+ // imgDom.current.src = img.src;
12274
+ // }, [src, showVideo, firstFrameSrc]);
12275
+ React.useEffect(() => {
12276
+ const observer = new IntersectionObserver((entries) => {
12277
+ entries.forEach((entry) => {
12278
+ if (entry.isIntersecting) {
12279
+ if (ref.current === null || src === '') {
12280
+ return;
12281
+ }
12282
+ if (showVideo && firstFrameSrc) {
12283
+ imgDom.current.setSrc(firstFrameSrc);
12284
+ }
12285
+ else {
12286
+ imgDom.current.setSrc(src);
12287
+ }
12288
+ observer.unobserve(ref.current);
12289
+ }
12290
+ });
12291
+ });
12292
+ observer.observe(ref.current);
12293
+ return () => {
12294
+ observer.disconnect();
12295
+ };
12296
+ }, [src, showVideo, firstFrameSrc]);
12297
+ const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
12298
+ const aspectRatio = videoWidth / videoHeight;
12299
+ const targetHeight = targetWidth / aspectRatio;
12300
+ return targetHeight;
12301
+ };
12302
+ React.useEffect(() => {
12303
+ const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
12304
+ if (video === null || src === '' || !showVideo) {
12305
+ return;
12306
+ }
12307
+ video.src = src;
12308
+ video.currentTime = 1;
12309
+ video.crossOrigin = 'anonymous';
12310
+ video.onloadeddata = () => {
12311
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12312
+ if (!canvas)
12313
+ return;
12314
+ const ctx = canvas.getContext('2d');
12315
+ const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
12316
+ const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
12317
+ canvas.height = targetHeight;
12318
+ canvas.width = targetWidth;
12319
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12320
+ setFirstFrameSrc(canvas.toDataURL());
12321
+ video.remove();
12322
+ canvas.remove();
12323
+ };
12324
+ }, [src, showVideo]);
12325
+ const handleClickToDetail = () => {
12326
+ reportTagsView();
12327
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
12328
+ setTimeout(() => {
12329
+ var _a;
12330
+ (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index, 0, false);
12331
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
12332
+ }, 0);
12333
+ };
12334
+ return (React.createElement("div", { ref: ref, className: 'list-content-listItem', key: index, onClick: handleClickToDetail, style: { marginBottom: space } },
12335
+ React.createElement("div", { className: 'list-content-listItem-picture' },
12336
+ showVideo && (React.createElement("div", { style: { display: 'none' } },
12337
+ React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
12338
+ React.createElement("canvas", { ref: canvasRef }))),
12339
+ React.createElement(FormatImage$1, { loading: 'lazy', className: 'list-content-listItem-picture-img', ref: imgDom })),
12340
+ React.createElement("div", { className: 'list-content-listItem-info' },
12341
+ 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),
12342
+ React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
12343
+ };
12344
+ function WaterfallList(_a) {
12345
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12346
+ var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
12347
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
12348
+ const [list, setList] = React.useState();
12349
+ const [data, setData] = React.useState();
12350
+ const [isLoadingData, setIsLoadingData] = React.useState(false);
12351
+ const containerRef = React.useRef(null);
12352
+ const [isLoadMore, setIsLoadMore] = React.useState(false);
12353
+ React.useCallback(() => {
12354
+ if (isLoadMore)
12355
+ return;
12356
+ setIsLoadMore(true);
12357
+ waterFallData &&
12358
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
12359
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
12360
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
12361
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
12362
+ }).then((res) => {
12363
+ var _a;
12364
+ 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 : []));
12365
+ setIsLoadMore(false);
12366
+ }));
12367
+ }, [waterFallData, getRecommendVideos, list, isLoadMore]);
12368
+ React.useEffect(() => {
12369
+ var _a, _b;
12370
+ setIsLoadingData(true);
12371
+ waterFallData &&
12372
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
12373
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
12374
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
12375
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
12376
+ defaultSize: hashTagSize,
12377
+ maxSize: hashTagSize
12378
+ }).then((res) => {
12379
+ var _a, _b;
12380
+ setData(res);
12381
+ 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 : []);
12382
+ setIsLoadingData(false);
12383
+ }));
12384
+ if (isOpenHashTag) {
12385
+ const res = previewData;
12386
+ setData(res);
12387
+ 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 : []);
12388
+ setIsLoadingData(false);
12389
+ }
12390
+ }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
12391
+ // useEffect(() => {
12392
+ // const container = containerRef?.current;
12393
+ // if (!container) return;
12394
+ // const handleScroll = () => {
12395
+ // const top = (container as any)?.scrollTop;
12396
+ // const clientHeight = (container as any)?.clientHeight;
12397
+ // const scrollHeight = (container as any)?.scrollHeight;
12398
+ // if (scrollHeight <= top + clientHeight && !isLoadingData) {
12399
+ // loadMoreData();
12400
+ // }
12401
+ // };
12402
+ // container?.addEventListener('scroll', handleScroll);
12403
+ // return () => {
12404
+ // container?.removeEventListener('scroll', handleScroll); // 在组件卸载时移除事件监听器
12405
+ // };
12406
+ // }, [isLoadingData, containerRef, loadMoreData]);
12407
+ const handleClickLink = () => {
12408
+ var _a, _b;
12409
+ if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
12410
+ reportTagsView();
12411
+ window.location.href = (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link;
12412
+ }
12413
+ };
12414
+ return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
12415
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'list' },
12416
+ React.createElement("div", { className: 'list-scroll', ref: containerRef },
12417
+ 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),
12418
+ 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'),
12419
+ React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
12420
+ return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
12421
+ })),
12422
+ React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
12423
+ React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
12424
+ 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
12425
+ } })),
12426
+ 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 }),
12427
+ 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' }) },
12428
+ 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'))))));
12429
+ }
12430
+
12237
12431
  /*
12238
12432
  * @Author: binruan@chatlabs.com
12239
12433
  * @Date: 2024-01-10 10:58:24
12240
12434
  * @LastEditors: binruan@chatlabs.com
12241
- * @LastEditTime: 2024-06-06 17:19:25
12435
+ * @LastEditTime: 2024-06-07 10:35:35
12242
12436
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
12243
12437
  *
12244
12438
  */
@@ -12332,7 +12526,7 @@ Made in Italy` })));
12332
12526
  display: openHashtag ? 'block' : 'none'
12333
12527
  } },
12334
12528
  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 }),
12335
- React.createElement(WaterfallList, Object.assign({ reportTagsView: reportTagsView }, props))), modalEleRef.current);
12529
+ (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);
12336
12530
  };
12337
12531
  var WaterFall$1 = React.memo(WaterFall);
12338
12532
 
@@ -12856,7 +13050,7 @@ Made in Italy` })));
12856
13050
  *
12857
13051
  */
12858
13052
  const Picture = (props) => {
12859
- const { src, height, imgUrlsPostConfig } = props;
13053
+ const { src, height, imgUrlsPostConfig, onShowFirstImage } = props;
12860
13054
  const blur = React.useMemo(() => {
12861
13055
  return (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.mode) === '2';
12862
13056
  }, [imgUrlsPostConfig]);
@@ -12881,7 +13075,7 @@ Made in Italy` })));
12881
13075
  return isBgColor && (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.bgColor) ? { backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.bgColor } : {};
12882
13076
  }, [imgUrlsPostConfig, isBgColor]);
12883
13077
  return (React.createElement("div", { style: Object.assign({ overflow: 'hidden', height, width: '100%', position: 'relative' }, bgStyle) },
12884
- (!blur || !isBgColor) && (React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
13078
+ (!blur || !isBgColor) && (React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle), onLoad: onShowFirstImage })),
12885
13079
  blur && (React.createElement(FormatImage$1, { src: src, style: {
12886
13080
  width: '100%',
12887
13081
  height: '100%',
@@ -12898,7 +13092,7 @@ Made in Italy` })));
12898
13092
  * @Author: lewinlu@chatlabs.com
12899
13093
  * @Date: 2024-01-03 14:39:09
12900
13094
  * @LastEditors: binruan@chatlabs.com
12901
- * @LastEditTime: 2024-04-18 19:56:22
13095
+ * @LastEditTime: 2024-06-07 14:05:08
12902
13096
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12903
13097
  */
12904
13098
  const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
@@ -12918,16 +13112,20 @@ Made in Italy` })));
12918
13112
  }
12919
13113
  }
12920
13114
  else {
12921
- setIsLoad(true);
12922
13115
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
12923
13116
  }
12924
13117
  }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
13118
+ const showFirstImageFn = React.useCallback(() => {
13119
+ if (!isLoad) {
13120
+ setIsLoad(true);
13121
+ }
13122
+ }, [isLoad]);
12925
13123
  // if (!isActive) {
12926
13124
  // return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
12927
13125
  // }
12928
- 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) => {
12929
- return (React.createElement(SwiperSlide, { key: url },
12930
- React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13126
+ 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) => {
13127
+ return (React.createElement(SwiperSlide, { key: index },
13128
+ React.createElement(Picture, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
12931
13129
  })));
12932
13130
  };
12933
13131
  var PictureGroup$3 = React.memo(PictureGroup$2);
@@ -13147,7 +13345,7 @@ Made in Italy` })));
13147
13345
  * @Author: binruan@chatlabs.com
13148
13346
  * @Date: 2024-01-15 19:03:09
13149
13347
  * @LastEditors: binruan@chatlabs.com
13150
- * @LastEditTime: 2024-06-06 18:42:24
13348
+ * @LastEditTime: 2024-06-07 11:10:42
13151
13349
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
13152
13350
  *
13153
13351
  */
@@ -13170,6 +13368,7 @@ Made in Italy` })));
13170
13368
  return data.length > 0 && !loading && getFeUserId();
13171
13369
  }, [data, loading]);
13172
13370
  const handleH5EnterLink = React.useCallback(() => {
13371
+ var _a, _b;
13173
13372
  if (data.length <= 0) {
13174
13373
  return;
13175
13374
  }
@@ -13192,7 +13391,9 @@ Made in Italy` })));
13192
13391
  utmId: getVal('utm_id'),
13193
13392
  utmContent: getVal('utm_content'),
13194
13393
  enterTime: `${Date.now()}`,
13195
- requestId: null
13394
+ requestId: null,
13395
+ 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 : '',
13396
+ clSource: getVal('cl_sourc')
13196
13397
  }
13197
13398
  });
13198
13399
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
@@ -13252,26 +13453,6 @@ Made in Italy` })));
13252
13453
  })) || 0;
13253
13454
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
13254
13455
  }, [ctaType, swiperRef]);
13255
- // useEffect(() => {
13256
- // const handleBeforeUnload = (event: any) => {
13257
- // event.preventDefault();
13258
- // const item = data?.[activeIndex];
13259
- // bffEventReport?.({
13260
- // eventInfo: {
13261
- // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
13262
- // eventSubject: 'sessionCompleted',
13263
- // eventDescription: 'Session completed',
13264
- // contentId: item?.video?.itemId,
13265
- // productId: item?.product?.itemId,
13266
- // position: item?.position
13267
- // }
13268
- // });
13269
- // };
13270
- // window.addEventListener('beforeunload', handleBeforeUnload);
13271
- // return () => {
13272
- // window.removeEventListener('beforeunload', handleBeforeUnload);
13273
- // };
13274
- // }, [activeIndex, data, bffEventReport, curTime]);
13275
13456
  React.useEffect(() => {
13276
13457
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
13277
13458
  const visibleChange = () => {