pb-sxp-ui 1.20.68 → 1.20.70

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 CHANGED
@@ -2277,16 +2277,19 @@ function useEventReport() {
2277
2277
  });
2278
2278
  }, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
2279
2279
  const productView = React.useCallback((data, product, cta, viewTime, position) => {
2280
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
2280
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2281
2281
  let fromKName = '';
2282
2282
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
2283
2283
  fromKName = 'pdpPage';
2284
2284
  }
2285
+ else if (((_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e.length) || ((_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) {
2286
+ fromKName = 'videoPage';
2287
+ }
2285
2288
  else if (data === null || data === void 0 ? void 0 : data.product) {
2286
2289
  fromKName = 'productPage';
2287
2290
  }
2288
2291
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
2289
- eventInfo: Object.assign(Object.assign({ productId: product === null || product === void 0 ? void 0 : product.itemId, productName: product === null || product === void 0 ? void 0 : product.title, price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: product === null || product === void 0 ? void 0 : product.collection, fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags), position: (position !== null && position !== void 0 ? position : 0) + '', contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId, sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '', ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId, traceInfo: (_s = (_q = (_l = (_h = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProducts) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_r = data === null || data === void 0 ? void 0 : data.product) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : '', timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '', eventSubject: 'productView', eventDescription: 'User browsed the product' }, ((product === null || product === void 0 ? void 0 : product.variantId) && { variantId: product.variantId })), ((product === null || product === void 0 ? void 0 : product.variantOption) && { variantOption: product.variantOption }))
2292
+ eventInfo: Object.assign(Object.assign({ productId: product === null || product === void 0 ? void 0 : product.itemId, productName: product === null || product === void 0 ? void 0 : product.title, price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: product === null || product === void 0 ? void 0 : product.collection, fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags), position: (position !== null && position !== void 0 ? position : 0) + '', contentId: (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.itemId, sceneId: (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '', ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId, traceInfo: (_v = (_t = (_p = (_l = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _l !== void 0 ? _l : (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProduct) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : (_s = (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = data === null || data === void 0 ? void 0 : data.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '', timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '', eventSubject: 'productView', eventDescription: 'User browsed the product' }, ((product === null || product === void 0 ? void 0 : product.variantId) && { variantId: product.variantId })), ((product === null || product === void 0 ? void 0 : product.variantOption) && { variantOption: product.variantOption }))
2290
2293
  });
2291
2294
  }, [bffEventReport, popupDetailData]);
2292
2295
  const backMainFeed = React.useCallback((lastFeed, selectTag, themeTag, hashTag) => {
@@ -11363,6 +11366,7 @@ const CommodityDetail$1 = (_a) => {
11363
11366
  eventSubject: 'clickShopifyPopup',
11364
11367
  eventDescription: 'User clicked to open Shopify popup'
11365
11368
  }, data, product, position);
11369
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
11366
11370
  console.log('[CommodityDetail] 打开加购弹窗:', addToCartPopupId);
11367
11371
  // 打开加购弹窗
11368
11372
  if (typeof window !== 'undefined' && window.sxpPopup) {
@@ -12754,7 +12758,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
12754
12758
  var { style, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "iframeBgColor", "isActive"]);
12755
12759
  const { sxpParameter, popupCurTimeRef, popupDetailData, setPopupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
12756
12760
  useEditor();
12757
- const { productView } = useEventReport();
12761
+ const { productView, jumpToWeb } = useEventReport();
12758
12762
  const [showModal, setShowModal] = React.useState(false);
12759
12763
  const curTimeRef = React.useRef(null);
12760
12764
  const [show3DModal, setShow3DModal] = React.useState(false);
@@ -12777,20 +12781,20 @@ const CommodityDetailDiroNew$1 = (_a) => {
12777
12781
  }
12778
12782
  // 是否为 SKU 层绑定(variantId 和 variantOption 同时存在时)
12779
12783
  const isSkuLevel = !!(product === null || product === void 0 ? void 0 : product.variantId) && !!(product === null || product === void 0 ? void 0 : product.variantOption);
12780
- const handleOpenAddToCart = (variantId) => {
12781
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({ eventSubject: 'clickCta', eventDescription: 'User clicked the CTA' }, data, product, position);
12782
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12783
- eventName: 'ClickCTA',
12784
- product: product ? [product] : undefined,
12785
- contentType: 'product',
12786
- data,
12787
- position,
12788
- cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
12789
- cta_action_type: 'open_internal_popup',
12790
- target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
12791
- target_url: product === null || product === void 0 ? void 0 : product.link
12792
- });
12793
- if (!isPost) {
12784
+ const handleOpenAddToCart = (variantId, isUserClick = false) => {
12785
+ if (isUserClick) {
12786
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({ eventSubject: 'clickCta', eventDescription: 'User clicked the CTA' }, data, product, position);
12787
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12788
+ eventName: 'ClickCTA',
12789
+ product: product ? [product] : undefined,
12790
+ contentType: 'product',
12791
+ data,
12792
+ position,
12793
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
12794
+ cta_action_type: 'open_internal_popup',
12795
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
12796
+ target_url: product === null || product === void 0 ? void 0 : product.link
12797
+ });
12794
12798
  productView(data, product, cta, viewTime || curTimeRef.current, position);
12795
12799
  }
12796
12800
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({ eventSubject: 'clickShopifyPopup', eventDescription: 'User clicked to open Shopify popup' }, data, product, position);
@@ -12815,12 +12819,13 @@ const CommodityDetailDiroNew$1 = (_a) => {
12815
12819
  });
12816
12820
  productView(data, product, cta, viewTime || curTimeRef.current, position);
12817
12821
  if (product === null || product === void 0 ? void 0 : product.link) {
12822
+ jumpToWeb(e, data, product, cta, position);
12818
12823
  window.location.href = window.getJointUtmLink(product.link);
12819
12824
  }
12820
12825
  return;
12821
12826
  }
12822
12827
  // SKU 层绑定:直接传入 variantId 预选该 SKU
12823
- handleOpenAddToCart(isSkuLevel ? product === null || product === void 0 ? void 0 : product.variantId : undefined);
12828
+ handleOpenAddToCart(isSkuLevel ? product === null || product === void 0 ? void 0 : product.variantId : undefined, true);
12824
12829
  };
12825
12830
  // popup 模式下,若为 SKU 层绑定,直接自动打开加购弹窗
12826
12831
  React.useEffect(() => {
@@ -20788,29 +20793,8 @@ const StructurePage = (_a) => {
20788
20793
  else if (viewPosition === 'footerSection') {
20789
20794
  fromKName = 'pdpPage';
20790
20795
  }
20791
- console.log('[handleProductViewLeave] 上报 productView 事件:', {
20792
- productId,
20793
- timeOnSite,
20794
- fromKName
20795
- });
20796
20796
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
20797
- eventInfo: {
20798
- eventSubject: 'productView',
20799
- eventDescription: 'User browsed the product',
20800
- productId: (productData === null || productData === void 0 ? void 0 : productData.itemId) || '',
20801
- productName: (productData === null || productData === void 0 ? void 0 : productData.title) || '',
20802
- price: (productData === null || productData === void 0 ? void 0 : productData.price) ? `${productData.price}` : '0',
20803
- productCollection: (productData === null || productData === void 0 ? void 0 : productData.collection) || '',
20804
- fromKName,
20805
- fromKPage: (location === null || location === void 0 ? void 0 : location.href) || '',
20806
- contentTags: (productData === null || productData === void 0 ? void 0 : productData.tags) ? JSON.stringify(productData.tags) : '[]',
20807
- position: `${sectionIndex || 0}`,
20808
- contentId: '',
20809
- sceneId: '',
20810
- ctatId: ((_a = productData === null || productData === void 0 ? void 0 : productData.bindCta) === null || _a === void 0 ? void 0 : _a.itemId) || '',
20811
- traceInfo: (productData === null || productData === void 0 ? void 0 : productData.traceInfo) || '',
20812
- timeOnSite: `${timeOnSite}`
20813
- }
20797
+ eventInfo: Object.assign(Object.assign({ eventSubject: 'productView', eventDescription: 'User browsed the product', productId: (productData === null || productData === void 0 ? void 0 : productData.itemId) || '', productName: (productData === null || productData === void 0 ? void 0 : productData.title) || '', price: (productData === null || productData === void 0 ? void 0 : productData.price) ? `${productData.price}` : '0', productCollection: (productData === null || productData === void 0 ? void 0 : productData.collection) || '', fromKName, fromKPage: (location === null || location === void 0 ? void 0 : location.href) || '', contentTags: (productData === null || productData === void 0 ? void 0 : productData.tags) ? JSON.stringify(productData.tags) : '[]', position: `${sectionIndex || 0}`, contentId: '', sceneId: '', ctatId: ((_a = productData === null || productData === void 0 ? void 0 : productData.bindCta) === null || _a === void 0 ? void 0 : _a.itemId) || '', traceInfo: (productData === null || productData === void 0 ? void 0 : productData.traceInfo) || '', timeOnSite: `${timeOnSite}` }, ((productData === null || productData === void 0 ? void 0 : productData.variantId) && { variantId: productData.variantId })), ((productData === null || productData === void 0 ? void 0 : productData.variantOption) && { variantOption: productData.variantOption }))
20814
20798
  });
20815
20799
  }, [bffEventReport]);
20816
20800
  // 渲染 CTA 按钮或模版组件(带曝光事件上报)
@@ -21988,7 +21972,7 @@ const StructurePage = (_a) => {
21988
21972
  // 注意:只上报,不从 visibleProducts 移除,也不删除 productViewStartTime
21989
21973
  // 这样页面恢复可见时可以重新记录 startTime,后续滑走/再次最小化能正常上报
21990
21974
  visibleProducts.current.forEach((product) => {
21991
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
21975
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
21992
21976
  const productId = `${(_a = product.productData) === null || _a === void 0 ? void 0 : _a.itemId}-${product.viewPosition}-${product.sectionIndex}`;
21993
21977
  const startTime = productViewStartTime.current[productId];
21994
21978
  if (!startTime)
@@ -22002,23 +21986,7 @@ const StructurePage = (_a) => {
22002
21986
  else if (product.viewPosition === 'footerSection')
22003
21987
  fromKName = 'pdpPage';
22004
21988
  (_b = bffEventReportRef.current) === null || _b === void 0 ? void 0 : _b.call(bffEventReportRef, {
22005
- eventInfo: {
22006
- eventSubject: 'productView',
22007
- eventDescription: 'User browsed the product',
22008
- productId: ((_c = product.productData) === null || _c === void 0 ? void 0 : _c.itemId) || '',
22009
- productName: ((_d = product.productData) === null || _d === void 0 ? void 0 : _d.title) || '',
22010
- price: ((_e = product.productData) === null || _e === void 0 ? void 0 : _e.price) ? `${product.productData.price}` : '0',
22011
- productCollection: ((_f = product.productData) === null || _f === void 0 ? void 0 : _f.collection) || '',
22012
- fromKName,
22013
- fromKPage: (location === null || location === void 0 ? void 0 : location.href) || '',
22014
- contentTags: ((_g = product.productData) === null || _g === void 0 ? void 0 : _g.tags) ? JSON.stringify(product.productData.tags) : '[]',
22015
- position: `${product.sectionIndex || 0}`,
22016
- contentId: '',
22017
- sceneId: '',
22018
- ctatId: ((_j = (_h = product.productData) === null || _h === void 0 ? void 0 : _h.bindCta) === null || _j === void 0 ? void 0 : _j.itemId) || '',
22019
- traceInfo: ((_k = product.productData) === null || _k === void 0 ? void 0 : _k.traceInfo) || '',
22020
- timeOnSite: `${timeOnSite}`
22021
- }
21989
+ eventInfo: Object.assign(Object.assign({ eventSubject: 'productView', eventDescription: 'User browsed the product', productId: ((_c = product.productData) === null || _c === void 0 ? void 0 : _c.itemId) || '', productName: ((_d = product.productData) === null || _d === void 0 ? void 0 : _d.title) || '', price: ((_e = product.productData) === null || _e === void 0 ? void 0 : _e.price) ? `${product.productData.price}` : '0', productCollection: ((_f = product.productData) === null || _f === void 0 ? void 0 : _f.collection) || '', fromKName, fromKPage: (location === null || location === void 0 ? void 0 : location.href) || '', contentTags: ((_g = product.productData) === null || _g === void 0 ? void 0 : _g.tags) ? JSON.stringify(product.productData.tags) : '[]', position: `${product.sectionIndex || 0}`, contentId: '', sceneId: '', ctatId: ((_j = (_h = product.productData) === null || _h === void 0 ? void 0 : _h.bindCta) === null || _j === void 0 ? void 0 : _j.itemId) || '', traceInfo: ((_k = product.productData) === null || _k === void 0 ? void 0 : _k.traceInfo) || '', timeOnSite: `${timeOnSite}` }, (((_l = product.productData) === null || _l === void 0 ? void 0 : _l.variantId) && { variantId: product.productData.variantId })), (((_m = product.productData) === null || _m === void 0 ? void 0 : _m.variantOption) && { variantOption: product.productData.variantOption }))
22022
21990
  });
22023
21991
  });
22024
21992
  // 不清空 visibleProducts,保留快照供页面恢复时使用
@@ -23330,6 +23298,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
23330
23298
  const initTimeRef = React.useRef();
23331
23299
  const loadedTimeRef = React.useRef();
23332
23300
  const isFirstPlayRef = React.useRef(true);
23301
+ const lastPlayReportTimeRef = React.useRef(0);
23333
23302
  const loopPlayRef = React.useRef(loopPlay);
23334
23303
  const scene = rec.video.scene;
23335
23304
  const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
@@ -23408,6 +23377,9 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
23408
23377
  return;
23409
23378
  setIsPauseVideo(false);
23410
23379
  const item = data[index];
23380
+ const now = Date.now();
23381
+ if (now - lastPlayReportTimeRef.current < 500)
23382
+ return;
23411
23383
  if (item && ((_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration)) {
23412
23384
  videoStartTime.current = ((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) || 0;
23413
23385
  const videoDuration = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) !== null && _f !== void 0 ? _f : 0).toFixed(2);
@@ -23416,6 +23388,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
23416
23388
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
23417
23389
  eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', sceneId: (_o = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.scene) === null || _m === void 0 ? void 0 : _m.sceneId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
23418
23390
  });
23391
+ lastPlayReportTimeRef.current = Date.now();
23419
23392
  isFirstPlayRef.current = false;
23420
23393
  }
23421
23394
  }), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
@@ -23444,9 +23417,8 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
23444
23417
  if (!videoRef.current)
23445
23418
  return;
23446
23419
  loadedTimeRef.current = new Date();
23447
- handleStartPlay();
23448
23420
  handLoadeddata();
23449
- }, [videoRef.current, handLoadeddata, handleStartPlay]);
23421
+ }, [videoRef.current, handLoadeddata]);
23450
23422
  const handleClickVideo = React.useCallback((type) => () => {
23451
23423
  var _a, _b, _c, _d, _e;
23452
23424
  if (!videoRef.current)
@@ -24701,13 +24673,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
24701
24673
  viewTime.current = new Date();
24702
24674
  };
24703
24675
  const handleReportProductView = (item, position) => {
24704
- var _a, _b, _c, _d;
24676
+ var _a, _b, _c, _d, _e, _f, _g;
24677
+ const pos = position !== null && position !== void 0 ? position : activeIndex;
24705
24678
  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) && (item === null || item === void 0 ? void 0 : item.product)) {
24706
- // Shopify 加购模式下,点击 Shop Now 打开购物车不上报 productView,只有跳外链才上报
24707
- const isEnableAddToCart = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.some((v) => { var _a, _b; return (_b = (_a = v === null || v === void 0 ? void 0 : v.item) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.enableAddToCart; });
24708
- if (isEnableAddToCart)
24709
- return;
24710
- productView(item, item.product, (_d = item === null || item === void 0 ? void 0 : item.product) === null || _d === void 0 ? void 0 : _d.bindCta, viewTime.current, position !== null && position !== void 0 ? position : activeIndex);
24679
+ productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, pos);
24680
+ }
24681
+ else if (!((_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.url) && !((_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.imgUrls) && ((_g = (_f = item === null || item === void 0 ? void 0 : item.video) === null || _f === void 0 ? void 0 : _f.bindProducts) === null || _g === void 0 ? void 0 : _g.length)) {
24682
+ item.video.bindProducts.forEach((product) => {
24683
+ productView(item, product, product === null || product === void 0 ? void 0 : product.bindCta, viewTime.current, pos);
24684
+ });
24711
24685
  }
24712
24686
  };
24713
24687
  React.useEffect(() => {