pb-sxp-ui 1.0.78 → 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.
Files changed (34) hide show
  1. package/dist/index.cjs +407 -38
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +187 -1
  4. package/dist/index.js +407 -38
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +407 -38
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -0
  15. package/es/core/components/SxpPageRender/PictureGroup/Picture.js +2 -2
  16. package/es/core/components/SxpPageRender/PictureGroup/index.js +9 -5
  17. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +52 -37
  18. package/es/core/components/SxpPageRender/WaterFall/index.js +3 -2
  19. package/es/core/components/SxpPageRender/index.js +4 -1
  20. package/es/core/context/SxpDataSourceProvider.js +6 -0
  21. package/es/materials/sxp/HashTag/index.d.ts +2 -0
  22. package/es/materials/sxp/HashTag/settingRender.d.ts +7 -2
  23. package/es/materials/sxp/HashTag/settingRender.js +15 -0
  24. package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -0
  25. package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +2 -2
  26. package/lib/core/components/SxpPageRender/PictureGroup/index.js +8 -4
  27. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +52 -37
  28. package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -2
  29. package/lib/core/components/SxpPageRender/index.js +4 -1
  30. package/lib/core/context/SxpDataSourceProvider.js +6 -0
  31. package/lib/materials/sxp/HashTag/index.d.ts +2 -0
  32. package/lib/materials/sxp/HashTag/settingRender.d.ts +7 -2
  33. package/lib/materials/sxp/HashTag/settingRender.js +15 -0
  34. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -650,6 +650,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
650
650
  setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
651
651
  })
652
652
  .finally(() => {
653
+ bffEventReport({
654
+ eventInfo: {
655
+ eventSubject: 'apiRequest',
656
+ eventDescription: 'api request succeed'
657
+ }
658
+ });
653
659
  setLoading(false);
654
660
  isInit.current = true;
655
661
  });
@@ -10361,19 +10367,29 @@ var _a, _b;
10361
10367
  *
10362
10368
  */
10363
10369
  var settingRender = [
10370
+ {
10371
+ title: 'Banner',
10372
+ child: [
10373
+ {
10374
+ type: 'Switch',
10375
+ label: 'Banner图开关',
10376
+ name: ['props', 'showBanner']
10377
+ }
10378
+ ]
10379
+ },
10364
10380
  {
10365
10381
  title: '卡片样式',
10366
10382
  child: [
10367
- // {
10368
- // type: 'Number',
10369
- // label: '文本行数',
10370
- // name: ['props', 'lineClamp']
10371
- // },
10372
10383
  {
10373
10384
  type: 'Number',
10374
10385
  label: '上下边距',
10375
10386
  name: ['props', 'space'],
10376
10387
  addonAfter: 'px'
10388
+ },
10389
+ {
10390
+ type: 'Switch',
10391
+ label: '固定宽高',
10392
+ name: ['props', 'isWaterfallFlow']
10377
10393
  }
10378
10394
  ]
10379
10395
  },
@@ -11842,6 +11858,374 @@ var previewData = {
11842
11858
  hashTag: hashTag
11843
11859
  };
11844
11860
 
11861
+ const WaterfallFlowItem$1 = (props) => {
11862
+ const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
11863
+ const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
11864
+ const [showVideo, setShowVideo] = React.useState(false);
11865
+ const [isLoading, setIsLoading] = React.useState(false);
11866
+ const [imgInfo, setImgInfo] = React.useState({
11867
+ height: 1,
11868
+ width: 1
11869
+ });
11870
+ const imgDom = React.useRef(null);
11871
+ const ref = React.useRef(null);
11872
+ const videoDom = React.useRef(null);
11873
+ const canvasRef = React.useRef(null);
11874
+ const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
11875
+ const src = React.useMemo(() => {
11876
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11877
+ if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
11878
+ return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
11879
+ }
11880
+ 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) {
11881
+ 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];
11882
+ }
11883
+ 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) {
11884
+ 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];
11885
+ }
11886
+ else {
11887
+ return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
11888
+ }
11889
+ }, [rec, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image]);
11890
+ const title = React.useMemo(() => {
11891
+ var _a, _b;
11892
+ 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;
11893
+ }, [rec]);
11894
+ /** 离父亲上边框的距离 */
11895
+ const top = React.useMemo(() => {
11896
+ var _a;
11897
+ const y = style.transform
11898
+ ? Number((_a = style.transform) === null || _a === void 0 ? void 0 : _a.substring(style.transform.indexOf(',', 0) + 1, style.transform.length - 3))
11899
+ : undefined;
11900
+ return y;
11901
+ }, [style]);
11902
+ /** 是否加载图片 */
11903
+ const isImgShow = React.useMemo(() => {
11904
+ if (top === undefined) {
11905
+ return false;
11906
+ }
11907
+ if (top <= showBorder) {
11908
+ return true;
11909
+ }
11910
+ else {
11911
+ return false;
11912
+ }
11913
+ }, [top, showBorder]);
11914
+ const priceText = React.useMemo(() => {
11915
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11916
+ 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)) {
11917
+ 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', {
11918
+ minimumFractionDigits: 0
11919
+ })) !== null && _j !== void 0 ? _j : ''}`;
11920
+ }
11921
+ else {
11922
+ return null;
11923
+ }
11924
+ }, [rec]);
11925
+ React.useEffect(() => {
11926
+ if (imgDom.current === null || src === '') {
11927
+ return;
11928
+ }
11929
+ const img = new Image();
11930
+ if (showVideo && firstFrameSrc) {
11931
+ img.src = firstFrameSrc;
11932
+ }
11933
+ else {
11934
+ img.src = src;
11935
+ }
11936
+ img.onload = () => {
11937
+ setImgInfo({
11938
+ height: img.height,
11939
+ width: img.width
11940
+ });
11941
+ setIsLoading(true);
11942
+ };
11943
+ imgDom.current.setSrc(img.src);
11944
+ }, [src, showVideo, firstFrameSrc, isImgShow]);
11945
+ React.useEffect(() => {
11946
+ // 通过宽度比例获取图片高度
11947
+ const height = imgInfo.height * (unitWidth / imgInfo.width);
11948
+ if (isLoading) {
11949
+ // 加40是因为下方文字部分高度为40,可以自己设置
11950
+ sizeChange(height + 76 + space, index);
11951
+ }
11952
+ }, [imgInfo, index, unitWidth, isLoading, space]); /* 增加sizeChange依赖项会导致在admin预览编辑时无限刷新 */
11953
+ const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
11954
+ const aspectRatio = videoWidth / videoHeight;
11955
+ const targetHeight = targetWidth / aspectRatio;
11956
+ return targetHeight;
11957
+ };
11958
+ React.useEffect(() => {
11959
+ const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
11960
+ if (video === null || src === '' || !showVideo) {
11961
+ return;
11962
+ }
11963
+ video.src = src;
11964
+ video.currentTime = 1;
11965
+ video.crossOrigin = 'anonymous';
11966
+ video.onloadeddata = () => {
11967
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
11968
+ if (!canvas)
11969
+ return;
11970
+ const ctx = canvas.getContext('2d');
11971
+ const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
11972
+ const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
11973
+ canvas.height = targetHeight;
11974
+ canvas.width = targetWidth;
11975
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
11976
+ setFirstFrameSrc(canvas.toDataURL());
11977
+ video.remove();
11978
+ canvas.remove();
11979
+ };
11980
+ }, [src, showVideo]);
11981
+ const handleClickToDetail = () => {
11982
+ reportTagsView();
11983
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
11984
+ setTimeout(() => {
11985
+ var _a;
11986
+ (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index, 0, false);
11987
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
11988
+ }, 0);
11989
+ };
11990
+ return (React.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
11991
+ React.createElement("div", { className: 'waterFallList-content-listItem-picture' },
11992
+ showVideo && (React.createElement("div", { style: { display: 'none' } },
11993
+ React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
11994
+ React.createElement("canvas", { ref: canvasRef }))),
11995
+ React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
11996
+ React.createElement("div", { className: 'waterFallList-content-listItem-info' },
11997
+ 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),
11998
+ React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
11999
+ };
12000
+ function WaterfallList$1(_a) {
12001
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
12002
+ var { reportTagsView } = _a, props = __rest(_a, ["reportTagsView"]);
12003
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
12004
+ /** 滚动的父元素 */
12005
+ const scrollParent = React.useRef(null);
12006
+ /** 向上滚动的距离 */
12007
+ const [scrollTop, setScrollTop] = React.useState(0);
12008
+ /** 数据列表 */
12009
+ const [data, setData] = React.useState();
12010
+ const waterfallFlowDom = React.useRef(null);
12011
+ /** 样式列表 */
12012
+ const [styleList, setStyleList] = React.useState([]);
12013
+ const styleListRef = React.useRef();
12014
+ /** 自定义骨架屏高度 */
12015
+ const heightList = [170, 230, 300];
12016
+ /** 到达底部 */
12017
+ const [isLoadingData, setIsLoadingData] = React.useState(false);
12018
+ const [list, setList] = React.useState([]);
12019
+ const buttonRef = React.useRef();
12020
+ /** 生成随机数 */
12021
+ const createRandomNum = React.useCallback((min, max) => {
12022
+ return Math.floor(Math.random() * (max - min + 1)) + min;
12023
+ }, []);
12024
+ const waterfallFlowListInfo = React.useRef([]);
12025
+ /** 当前容器信息 */
12026
+ const [frameInfo, setFrameInfoInfo] = React.useState({ width: 0 });
12027
+ /** 每行个数 */
12028
+ const rowsNum = React.useMemo(() => {
12029
+ const width = frameInfo.width || 0;
12030
+ if (width >= 1200) {
12031
+ return 6;
12032
+ }
12033
+ else if (width >= 768 && width <= 1199) {
12034
+ return 4;
12035
+ }
12036
+ else {
12037
+ return 2;
12038
+ }
12039
+ }, [frameInfo]);
12040
+ /** 每一个的宽度 */
12041
+ const unitWidth = React.useMemo(() => {
12042
+ return frameInfo.width / rowsNum - 2;
12043
+ }, [rowsNum, frameInfo]);
12044
+ /** 获取位置 */
12045
+ const getStyleList = React.useCallback(() => {
12046
+ var _a;
12047
+ const temporaryStyleList = (_a = styleListRef.current) !== null && _a !== void 0 ? _a : [];
12048
+ /** 目前最下一行的index */
12049
+ const bottomItemIndex = [];
12050
+ for (let i = 0; i < (list === null || list === void 0 ? void 0 : list.length); i++) {
12051
+ // 原本应对应的行数
12052
+ const currentRow = Math.floor(i / rowsNum);
12053
+ //
12054
+ const remainder = (i % rowsNum) + 1;
12055
+ // 最低item下标
12056
+ let minHeightInd = 0;
12057
+ // 最低高度
12058
+ let minHeight = 9999999999;
12059
+ // 寻找最低高度的下标
12060
+ if (currentRow === 0) {
12061
+ bottomItemIndex[i] = i;
12062
+ }
12063
+ else {
12064
+ for (let j = 0; j < bottomItemIndex.length; j++) {
12065
+ if (waterfallFlowListInfo.current[bottomItemIndex[j]].top +
12066
+ waterfallFlowListInfo.current[bottomItemIndex[j]].height <
12067
+ minHeight) {
12068
+ minHeightInd = j;
12069
+ minHeight =
12070
+ waterfallFlowListInfo.current[bottomItemIndex[j]].top +
12071
+ waterfallFlowListInfo.current[bottomItemIndex[j]].height;
12072
+ }
12073
+ }
12074
+ bottomItemIndex[minHeightInd] = i;
12075
+ }
12076
+ if (waterfallFlowListInfo.current[i] === undefined) {
12077
+ waterfallFlowListInfo.current[i] = {};
12078
+ }
12079
+ // 第一行特殊处理,一定是从左到右铺的
12080
+ if (currentRow === 0) {
12081
+ if (remainder === 1) {
12082
+ waterfallFlowListInfo.current[i].left = 0;
12083
+ }
12084
+ else {
12085
+ waterfallFlowListInfo.current[i].left = waterfallFlowListInfo.current[i - 1].left + unitWidth + 4;
12086
+ }
12087
+ waterfallFlowListInfo.current[i].top = 0;
12088
+ }
12089
+ // 剩下的行数,铺在当前最低高度下面
12090
+ else {
12091
+ waterfallFlowListInfo.current[i].left = waterfallFlowListInfo.current[minHeightInd].left;
12092
+ waterfallFlowListInfo.current[i].top = minHeight;
12093
+ }
12094
+ // 是否已经有高度,有高度使用已有高度,否则随机生成
12095
+ waterfallFlowListInfo.current[i].height =
12096
+ waterfallFlowListInfo.current[i].height || heightList[createRandomNum(0, 2)];
12097
+ temporaryStyleList[i] = {
12098
+ transform: `translate(${waterfallFlowListInfo.current[i].left}px,${waterfallFlowListInfo.current[i].top}px)`,
12099
+ width: `${unitWidth}px`,
12100
+ height: waterfallFlowListInfo.current[i].height
12101
+ };
12102
+ }
12103
+ setStyleList([...temporaryStyleList]);
12104
+ return [...temporaryStyleList];
12105
+ }, [unitWidth, rowsNum, heightList, createRandomNum, list]);
12106
+ /** 图片加载完更新高度 */
12107
+ const onSizeChange = React.useCallback((height, index) => {
12108
+ if (waterfallFlowListInfo.current[index] === undefined) {
12109
+ waterfallFlowListInfo.current[index] = {};
12110
+ }
12111
+ waterfallFlowListInfo.current[index].height = height;
12112
+ styleListRef.current = getStyleList();
12113
+ }, [getStyleList]);
12114
+ /** 大小、数量发生变化时触发 */
12115
+ React.useEffect(() => {
12116
+ styleListRef.current = getStyleList();
12117
+ }, [unitWidth, rowsNum, list]); /* 增加getStyleList依赖项会导致在admin预览编辑时无限刷新 */
12118
+ /** 初始化请求数据 */
12119
+ React.useEffect(() => {
12120
+ var _a, _b;
12121
+ setIsLoadingData(true);
12122
+ waterFallData &&
12123
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
12124
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
12125
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
12126
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
12127
+ defaultSize: hashTagSize,
12128
+ maxSize: hashTagSize
12129
+ }).then((res) => {
12130
+ var _a, _b;
12131
+ setData(res);
12132
+ 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 : []);
12133
+ setIsLoadingData(false);
12134
+ }));
12135
+ if (isOpenHashTag) {
12136
+ const res = previewData;
12137
+ setData(res);
12138
+ 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 : []);
12139
+ setIsLoadingData(false);
12140
+ }
12141
+ }, [waterFallData, getRecommendVideos, hashTagSize, isOpenHashTag]);
12142
+ const onResize = React.useCallback(() => {
12143
+ if (waterfallFlowDom.current === null) {
12144
+ return;
12145
+ }
12146
+ setFrameInfoInfo({
12147
+ width: waterfallFlowDom.current.getBoundingClientRect().width
12148
+ });
12149
+ }, []);
12150
+ /** 监听列表容器大小变化 */
12151
+ React.useEffect(() => {
12152
+ if (waterfallFlowDom.current === null) {
12153
+ return;
12154
+ }
12155
+ const resizeObserver = new ResizeObserver((entries) => {
12156
+ onResize();
12157
+ });
12158
+ resizeObserver.observe(waterfallFlowDom.current);
12159
+ return () => {
12160
+ resizeObserver.disconnect();
12161
+ };
12162
+ }, [onResize]);
12163
+ React.useCallback(() => {
12164
+ setIsLoadingData(true);
12165
+ waterFallData &&
12166
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
12167
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
12168
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
12169
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
12170
+ }).then((res) => {
12171
+ var _a, _b;
12172
+ setList(list === null || list === void 0 ? void 0 : list.concat((_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 && _b !== void 0 ? _b : []));
12173
+ setIsLoadingData(false);
12174
+ }));
12175
+ }, [waterFallData, getRecommendVideos, list]);
12176
+ const onScroll = React.useCallback(() => {
12177
+ // 记录滚动值
12178
+ setScrollTop(scrollParent.current.scrollTop);
12179
+ // const top = (scrollParent.current as any).scrollTop;
12180
+ // const clientHeight = (scrollParent.current as any).clientHeight;
12181
+ // const scrollHeight = (scrollParent.current as any).scrollHeight;
12182
+ // // 做底部加载
12183
+ // if (scrollHeight <= top + clientHeight && !isLoadingData) {
12184
+ // loadMoreData();
12185
+ // }
12186
+ }, []);
12187
+ /** 监听滚动 */
12188
+ React.useEffect(() => {
12189
+ var _a;
12190
+ (_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', onScroll);
12191
+ return () => {
12192
+ var _a;
12193
+ (_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', onScroll);
12194
+ };
12195
+ }, [onScroll, scrollParent]);
12196
+ const handleClickLink = () => {
12197
+ var _a, _b;
12198
+ if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
12199
+ reportTagsView();
12200
+ window.location.href = (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link;
12201
+ }
12202
+ };
12203
+ return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
12204
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'waterFallList', ref: waterfallFlowDom },
12205
+ React.createElement("div", { className: 'waterFallList-scroll', ref: scrollParent },
12206
+ React.createElement("div", { className: 'waterFallList-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),
12207
+ React.createElement("div", { hidden: !((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.link), className: 'waterFallList-collection', style: Object.assign({}, (_e = props === null || props === void 0 ? void 0 : props.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagLink), onClick: handleClickLink }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'),
12208
+ React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
12209
+ list.map((item, ind) => {
12210
+ var _a;
12211
+ 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)));
12212
+ }),
12213
+ React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), style: {
12214
+ position: 'absolute',
12215
+ width: '100%',
12216
+ transform: `translate(0px,${(_m = ((_j = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_h = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _h === void 0 ? void 0 : _h.length) - 1]) === null || _j === void 0 ? void 0 : _j.top) +
12217
+ ((_l = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_k = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _k === void 0 ? void 0 : _k.length) - 1]) === null || _l === void 0 ? void 0 : _l.height)) !== null && _m !== void 0 ? _m : 0}px)`,
12218
+ height: ((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link)
12219
+ ? ((_p = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _p === void 0 ? void 0 : _p.offsetHeight) || ((_q = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _q === void 0 ? void 0 : _q.height) || '100px'
12220
+ : 0
12221
+ } }))),
12222
+ React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
12223
+ React.createElement("div", { ref: buttonRef, hidden: !((_s = data === null || data === void 0 ? void 0 : data.tag) === null || _s === void 0 ? void 0 : _s.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
12224
+ React.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.linkTitle) || 'Shop the collection'))))));
12225
+ }
12226
+
12227
+ var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
12228
+
11845
12229
  const WaterfallFlowItem = (props) => {
11846
12230
  const { rec, index, list, reportTagsView, textStyles, space } = props;
11847
12231
  const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
@@ -12052,13 +12436,11 @@ function WaterfallList(_a) {
12052
12436
  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'))))));
12053
12437
  }
12054
12438
 
12055
- var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
12056
-
12057
12439
  /*
12058
12440
  * @Author: binruan@chatlabs.com
12059
12441
  * @Date: 2024-01-10 10:58:24
12060
12442
  * @LastEditors: binruan@chatlabs.com
12061
- * @LastEditTime: 2024-04-15 17:57:59
12443
+ * @LastEditTime: 2024-06-07 10:35:35
12062
12444
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
12063
12445
  *
12064
12446
  */
@@ -12152,7 +12534,7 @@ const WaterFall = (props) => {
12152
12534
  display: openHashtag ? 'block' : 'none'
12153
12535
  } },
12154
12536
  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 }),
12155
- React.createElement(WaterfallList, Object.assign({ reportTagsView: reportTagsView }, props))), modalEleRef.current);
12537
+ (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);
12156
12538
  };
12157
12539
  var WaterFall$1 = React.memo(WaterFall);
12158
12540
 
@@ -12676,7 +13058,7 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
12676
13058
  *
12677
13059
  */
12678
13060
  const Picture = (props) => {
12679
- const { src, height, imgUrlsPostConfig } = props;
13061
+ const { src, height, imgUrlsPostConfig, onShowFirstImage } = props;
12680
13062
  const blur = React.useMemo(() => {
12681
13063
  return (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.mode) === '2';
12682
13064
  }, [imgUrlsPostConfig]);
@@ -12701,7 +13083,7 @@ const Picture = (props) => {
12701
13083
  return isBgColor && (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.bgColor) ? { backgroundColor: imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.bgColor } : {};
12702
13084
  }, [imgUrlsPostConfig, isBgColor]);
12703
13085
  return (React.createElement("div", { style: Object.assign({ overflow: 'hidden', height, width: '100%', position: 'relative' }, bgStyle) },
12704
- (!blur || !isBgColor) && (React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
13086
+ (!blur || !isBgColor) && (React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle), onLoad: onShowFirstImage })),
12705
13087
  blur && (React.createElement(FormatImage$1, { src: src, style: {
12706
13088
  width: '100%',
12707
13089
  height: '100%',
@@ -12718,7 +13100,7 @@ const Picture = (props) => {
12718
13100
  * @Author: lewinlu@chatlabs.com
12719
13101
  * @Date: 2024-01-03 14:39:09
12720
13102
  * @LastEditors: binruan@chatlabs.com
12721
- * @LastEditTime: 2024-04-18 19:56:22
13103
+ * @LastEditTime: 2024-06-07 14:05:08
12722
13104
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12723
13105
  */
12724
13106
  const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
@@ -12738,16 +13120,20 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
12738
13120
  }
12739
13121
  }
12740
13122
  else {
12741
- setIsLoad(true);
12742
13123
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
12743
13124
  }
12744
13125
  }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
13126
+ const showFirstImageFn = React.useCallback(() => {
13127
+ if (!isLoad) {
13128
+ setIsLoad(true);
13129
+ }
13130
+ }, [isLoad]);
12745
13131
  // if (!isActive) {
12746
13132
  // return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
12747
13133
  // }
12748
- 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) => {
12749
- return (React.createElement(SwiperSlide, { key: url },
12750
- React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13134
+ 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) => {
13135
+ return (React.createElement(SwiperSlide, { key: index },
13136
+ React.createElement(Picture, { src: !isLoad && index > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
12751
13137
  })));
12752
13138
  };
12753
13139
  var PictureGroup$3 = React.memo(PictureGroup$2);
@@ -12967,7 +13353,7 @@ var Tagbar$1 = React.memo(Tagbar);
12967
13353
  * @Author: binruan@chatlabs.com
12968
13354
  * @Date: 2024-01-15 19:03:09
12969
13355
  * @LastEditors: binruan@chatlabs.com
12970
- * @LastEditTime: 2024-06-06 18:42:24
13356
+ * @LastEditTime: 2024-06-07 11:10:42
12971
13357
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12972
13358
  *
12973
13359
  */
@@ -12990,6 +13376,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12990
13376
  return data.length > 0 && !loading && getFeUserId();
12991
13377
  }, [data, loading]);
12992
13378
  const handleH5EnterLink = React.useCallback(() => {
13379
+ var _a, _b;
12993
13380
  if (data.length <= 0) {
12994
13381
  return;
12995
13382
  }
@@ -13012,7 +13399,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13012
13399
  utmId: getVal('utm_id'),
13013
13400
  utmContent: getVal('utm_content'),
13014
13401
  enterTime: `${Date.now()}`,
13015
- requestId: null
13402
+ requestId: null,
13403
+ 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 : '',
13404
+ clSource: getVal('cl_sourc')
13016
13405
  }
13017
13406
  });
13018
13407
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
@@ -13072,26 +13461,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13072
13461
  })) || 0;
13073
13462
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
13074
13463
  }, [ctaType, swiperRef]);
13075
- // useEffect(() => {
13076
- // const handleBeforeUnload = (event: any) => {
13077
- // event.preventDefault();
13078
- // const item = data?.[activeIndex];
13079
- // bffEventReport?.({
13080
- // eventInfo: {
13081
- // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
13082
- // eventSubject: 'sessionCompleted',
13083
- // eventDescription: 'Session completed',
13084
- // contentId: item?.video?.itemId,
13085
- // productId: item?.product?.itemId,
13086
- // position: item?.position
13087
- // }
13088
- // });
13089
- // };
13090
- // window.addEventListener('beforeunload', handleBeforeUnload);
13091
- // return () => {
13092
- // window.removeEventListener('beforeunload', handleBeforeUnload);
13093
- // };
13094
- // }, [activeIndex, data, bffEventReport, curTime]);
13095
13464
  React.useEffect(() => {
13096
13465
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
13097
13466
  const visibleChange = () => {