pb-sxp-ui 1.6.5 → 1.7.0

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 (35) hide show
  1. package/dist/index.cjs +114 -51
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +114 -51
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +114 -51
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/ExpandableText.js +3 -1
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +25 -21
  15. package/es/core/components/SxpPageRender/WaterFall/index.js +6 -1
  16. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  17. package/es/core/components/SxpPageRender/index.js +7 -11
  18. package/es/core/context/SxpDataSourceProvider.d.ts +2 -4
  19. package/es/core/context/SxpDataSourceProvider.js +52 -11
  20. package/es/materials/sxp/popup/CommodityDetail/index.js +6 -1
  21. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +6 -1
  22. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +6 -1
  23. package/es/materials/sxp/popup/CommodityList/index.js +7 -2
  24. package/lib/core/components/SxpPageRender/ExpandableText.js +3 -1
  25. package/lib/core/components/SxpPageRender/VideoWidget/index.js +25 -21
  26. package/lib/core/components/SxpPageRender/WaterFall/index.js +6 -1
  27. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  28. package/lib/core/components/SxpPageRender/index.js +7 -11
  29. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -4
  30. package/lib/core/context/SxpDataSourceProvider.js +52 -11
  31. package/lib/materials/sxp/popup/CommodityDetail/index.js +6 -1
  32. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +6 -1
  33. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +6 -1
  34. package/lib/materials/sxp/popup/CommodityList/index.js +6 -1
  35. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -797,23 +797,64 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
797
797
  type: 'beacon'
798
798
  });
799
799
  }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
800
- const bffFbReport = useCallback((_a) => {
801
- var _b, _c, _d;
802
- var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
800
+ const bffFbReport = useCallback(({ eventName, product }) => {
801
+ var _a, _b, _c, _d;
803
802
  if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
804
803
  return;
805
804
  }
806
- const fakeUserId = storeAndLoadFeUserId();
805
+ let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
807
806
  const urlParams = new URLSearchParams(window.location.search);
808
- const fbclid = urlParams.get('fbclid');
807
+ const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
808
+ const fix_par = {
809
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
810
+ external_id: storeAndLoadFeUserId(),
811
+ client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
812
+ fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
813
+ fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
814
+ time: new Date().getTime()
815
+ };
816
+ const regex = /\{\{(.*?)\}\}/g;
817
+ const getEventParams = (obj) => {
818
+ if (!obj)
819
+ return;
820
+ if (obj instanceof Array) {
821
+ obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
822
+ }
823
+ else {
824
+ for (const key in obj) {
825
+ if (obj.hasOwnProperty(key)) {
826
+ const value = obj === null || obj === void 0 ? void 0 : obj[key];
827
+ if (typeof value === 'object') {
828
+ getEventParams(value);
829
+ }
830
+ else if (typeof value === 'string') {
831
+ const matches = value === null || value === void 0 ? void 0 : value.match(regex);
832
+ if (matches) {
833
+ matches.forEach((match) => {
834
+ const prop = match.substring(2, match.length - 2);
835
+ try {
836
+ const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
837
+ if (replaceValue) {
838
+ obj[key] = replaceValue;
839
+ }
840
+ else {
841
+ delete obj[key];
842
+ }
843
+ }
844
+ catch (error) {
845
+ console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
846
+ }
847
+ });
848
+ }
849
+ }
850
+ }
851
+ }
852
+ }
853
+ };
854
+ getEventParams(jsonParams);
809
855
  return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
810
856
  method: 'POST',
811
- body: {
812
- eventName,
813
- actionSource,
814
- eventSourceUrl,
815
- userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { clientUserAgent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
816
- },
857
+ body: jsonParams,
817
858
  type: 'beacon'
818
859
  });
819
860
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
@@ -9060,7 +9101,7 @@ var Modal$1 = memo(Modal);
9060
9101
  * @Author: binruan@chatlabs.com
9061
9102
  * @Date: 2023-12-26 16:11:34
9062
9103
  * @LastEditors: binruan@chatlabs.com
9063
- * @LastEditTime: 2024-06-28 15:17:10
9104
+ * @LastEditTime: 2024-10-18 14:52:42
9064
9105
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
9065
9106
  *
9066
9107
  */
@@ -9097,6 +9138,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
9097
9138
  }, [text, maxStr, isShowMore]);
9098
9139
  useEffect(() => {
9099
9140
  var _a, _b;
9141
+ if (multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current)
9142
+ multiRowCopy.current.style.display = 'block';
9100
9143
  if (((_a = multiRowCopy === null || multiRowCopy === void 0 ? void 0 : multiRowCopy.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) > ((_b = multiRow === null || multiRow === void 0 ? void 0 : multiRow.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) && isPost) {
9101
9144
  setIsShow(true);
9102
9145
  }
@@ -9104,7 +9147,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
9104
9147
  setIsShow(false);
9105
9148
  }
9106
9149
  multiRowCopy.current.style.display = 'none';
9107
- }, [isPost]);
9150
+ }, [isPost, text]);
9108
9151
  return (React.createElement("div", { className: className, style: Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' }), hidden: !text || text === '' },
9109
9152
  React.createElement("div", { ref: multiRow, style: {
9110
9153
  overflow: 'hidden',
@@ -9340,9 +9383,14 @@ const CommodityDetail$1 = (_a) => {
9340
9383
  useEffect(() => {
9341
9384
  if (!isPost) {
9342
9385
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9343
- eventName: 'ProductView'
9386
+ eventName: 'ProductView',
9387
+ product
9344
9388
  });
9345
9389
  }
9390
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9391
+ eventName: 'PageView',
9392
+ product
9393
+ });
9346
9394
  }, [isPost, bffFbReport]);
9347
9395
  useEffect(() => {
9348
9396
  const initTime = () => {
@@ -10221,7 +10269,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
10221
10269
  useEffect(() => {
10222
10270
  if (!isPost) {
10223
10271
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10224
- eventName: 'ProductView'
10272
+ eventName: 'ProductView',
10273
+ product
10274
+ });
10275
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10276
+ eventName: 'PageView',
10277
+ product
10225
10278
  });
10226
10279
  }
10227
10280
  }, [isPost, bffFbReport]);
@@ -10846,7 +10899,7 @@ var Img$1 = memo(Img);
10846
10899
  const CommodityList$1 = (_a) => {
10847
10900
  var _b, _c, _d;
10848
10901
  var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
10849
- const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
10902
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
10850
10903
  const { jumpToWeb } = useEventReport();
10851
10904
  const { popup } = useEditor();
10852
10905
  const recData = isPost ? rec : popupDetailData;
@@ -10876,6 +10929,11 @@ const CommodityList$1 = (_a) => {
10876
10929
  onClick === null || onClick === void 0 ? void 0 : onClick();
10877
10930
  }
10878
10931
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
10932
+ useEffect(() => {
10933
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10934
+ eventName: 'PageView'
10935
+ });
10936
+ }, []);
10879
10937
  return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
10880
10938
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
10881
10939
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
@@ -14393,17 +14451,22 @@ function WaterfallList(_a) {
14393
14451
  * @Author: binruan@chatlabs.com
14394
14452
  * @Date: 2024-01-10 10:58:24
14395
14453
  * @LastEditors: binruan@chatlabs.com
14396
- * @LastEditTime: 2024-10-11 13:43:22
14454
+ * @LastEditTime: 2024-10-18 18:59:47
14397
14455
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
14398
14456
  *
14399
14457
  */
14400
14458
  const WaterFall = (props) => {
14401
14459
  var _a;
14402
- const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
14460
+ const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
14403
14461
  const { backMainFeed } = useEventReport();
14404
14462
  useRef(null);
14405
14463
  const modalEleRef = useRef(null);
14406
14464
  const [viewTime, setViewTime] = useState();
14465
+ useEffect(() => {
14466
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
14467
+ eventName: 'PageView'
14468
+ });
14469
+ }, []);
14407
14470
  useEffect(() => {
14408
14471
  const parentNode = document.getElementById('sxp-render');
14409
14472
  const node = document.getElementById('water-fall');
@@ -15557,6 +15620,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15557
15620
  const videoRef = useRef();
15558
15621
  const videoId = `pb-cache-video-${index}`;
15559
15622
  const videoEleRef = useRef(null);
15623
+ const hlsRef = useRef(null);
15560
15624
  const blur = useMemo(() => {
15561
15625
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
15562
15626
  }, [videoPostConfig]);
@@ -15735,12 +15799,12 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15735
15799
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15736
15800
  return;
15737
15801
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
15738
- let hls = null;
15802
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
15739
15803
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
15740
15804
  hls = new Hls();
15741
- hls.loadSource(videoSrc);
15742
- hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
15743
- hls.on(Hls.Events.MANIFEST_PARSED, function () {
15805
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
15806
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
15807
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
15744
15808
  var _a;
15745
15809
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15746
15810
  });
@@ -15759,35 +15823,36 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15759
15823
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
15760
15824
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
15761
15825
  return () => {
15762
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15826
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
15763
15827
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
15764
15828
  if (!isPause)
15765
15829
  handlePause();
15766
- if (hls)
15767
- hls === null || hls === void 0 ? void 0 : hls.destroy();
15830
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
15831
+ (_b = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
15768
15832
  setIsLoadFinish(false);
15769
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedmetadata);
15770
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
15771
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handleStartPlay);
15772
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('playing', handlePlaying);
15773
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('pause', handlePause);
15774
- (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('ended', handlePlay);
15775
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('canplay', handlePlay);
15776
- (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('waiting', handleWaiting);
15833
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadedmetadata', handleLoadedmetadata);
15834
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
15835
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
15836
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
15837
+ (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
15838
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
15839
+ (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
15840
+ (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
15777
15841
  };
15778
- }, [isActive, videoId, rec, handlePause]);
15842
+ }, [isActive]);
15779
15843
  useEffect(() => {
15780
- var _a, _b;
15844
+ var _a, _b, _c, _d;
15781
15845
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
15782
15846
  return;
15783
15847
  if (isActive) {
15784
15848
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15785
- eventName: 'ViewContent'
15849
+ eventName: 'ViewContent',
15850
+ product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
15786
15851
  });
15787
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15852
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
15788
15853
  }
15789
15854
  else {
15790
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
15855
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
15791
15856
  }
15792
15857
  }, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15793
15858
  /*
@@ -15809,9 +15874,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15809
15874
  if (!isActive)
15810
15875
  return;
15811
15876
  const onShow = () => {
15877
+ var _a, _b;
15812
15878
  handleClickVideo('start')();
15813
15879
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15814
- eventName: 'ViewContent'
15880
+ eventName: 'ViewContent',
15881
+ product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
15815
15882
  });
15816
15883
  };
15817
15884
  const onHide = handleClickVideo('pause');
@@ -16298,7 +16365,7 @@ var Tagbar$1 = memo(Tagbar);
16298
16365
  * @Author: binruan@chatlabs.com
16299
16366
  * @Date: 2024-01-15 19:03:09
16300
16367
  * @LastEditors: binruan@chatlabs.com
16301
- * @LastEditTime: 2024-10-17 17:16:42
16368
+ * @LastEditTime: 2024-10-18 18:54:40
16302
16369
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16303
16370
  *
16304
16371
  */
@@ -16328,9 +16395,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16328
16395
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
16329
16396
  const now = new Date();
16330
16397
  viewTime.current = now;
16331
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16332
- eventName: 'PageView'
16333
- });
16334
16398
  }
16335
16399
  }, [data === null || data === void 0 ? void 0 : data.length]);
16336
16400
  const handleH5EnterLink = useCallback(() => {
@@ -16339,11 +16403,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16339
16403
  if (data.length > 0) {
16340
16404
  const now = new Date();
16341
16405
  viewTime.current = now;
16342
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16343
- eventName: 'PageView'
16344
- });
16345
16406
  }
16346
- }, [data.length, bffFbReport, h5EnterLink]);
16407
+ }, [data.length, h5EnterLink]);
16347
16408
  useEffect(() => {
16348
16409
  var _a;
16349
16410
  if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
@@ -16648,7 +16709,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16648
16709
  }
16649
16710
  };
16650
16711
  const handleScrollEvent = (swiper) => {
16651
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
16712
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
16652
16713
  const item = data[swiper.previousIndex];
16653
16714
  if (!item)
16654
16715
  return;
@@ -16695,7 +16756,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16695
16756
  const curItem = data[swiper.activeIndex];
16696
16757
  if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
16697
16758
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16698
- eventName: 'ProductView'
16759
+ eventName: 'ProductView',
16760
+ product: (_t = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _t === void 0 ? void 0 : _t.bindProduct
16699
16761
  });
16700
16762
  }
16701
16763
  viewTime.current = new Date();
@@ -16716,7 +16778,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16716
16778
  }
16717
16779
  }, [openHashtag, data, activeIndex]);
16718
16780
  const handleViewImageStartEvent = (activeIndex) => {
16719
- var _a, _b, _c, _d, _e, _f;
16781
+ var _a, _b, _c, _d, _e, _f, _g;
16720
16782
  const item = data[activeIndex];
16721
16783
  // 如果是图片集则上报事件
16722
16784
  if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
@@ -16736,7 +16798,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16736
16798
  }
16737
16799
  });
16738
16800
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16739
- eventName: 'ViewContent'
16801
+ eventName: 'ViewContent',
16802
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
16740
16803
  });
16741
16804
  }
16742
16805
  };