pb-sxp-ui 1.0.8 → 1.0.9

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 (81) hide show
  1. package/dist/index.cjs +67 -65
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +67 -65
  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 +67 -65
  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/LikeButton/index.d.ts +1 -0
  14. package/es/core/components/SxpPageRender/LikeButton/index.js +3 -3
  15. package/es/core/components/SxpPageRender/Popup/index.js +1 -1
  16. package/es/core/components/SxpPageRender/RenderCard.js +1 -1
  17. package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  18. package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
  19. package/es/core/components/SxpPageRender/WaterFall/index.js +3 -3
  20. package/es/core/components/SxpPageRender/index.js +8 -8
  21. package/es/core/context/SxpDataSourceProvider.d.ts +4 -2
  22. package/es/core/context/SxpDataSourceProvider.js +2 -2
  23. package/es/core/hooks/useEventReport.d.ts +2 -2
  24. package/es/core/hooks/useEventReport.js +4 -4
  25. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  26. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -3
  27. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  28. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  30. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  31. package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
  32. package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
  33. package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  34. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  35. package/es/materials/sxp/template/Link/index.d.ts +1 -0
  36. package/es/materials/sxp/template/Link/index.js +3 -3
  37. package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  38. package/es/materials/sxp/template/MultiCommodity/index.js +5 -5
  39. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  40. package/es/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
  41. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  42. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
  43. package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
  44. package/es/materials/sxp/template/components/EventProvider.js +6 -6
  45. package/es/materials/sxp/template/components/Img.d.ts +1 -0
  46. package/es/materials/sxp/template/components/Img.js +3 -3
  47. package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +1 -0
  48. package/lib/core/components/SxpPageRender/LikeButton/index.js +3 -3
  49. package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
  50. package/lib/core/components/SxpPageRender/RenderCard.js +1 -1
  51. package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  52. package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
  53. package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -3
  54. package/lib/core/components/SxpPageRender/index.js +8 -8
  55. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -2
  56. package/lib/core/context/SxpDataSourceProvider.js +2 -2
  57. package/lib/core/hooks/useEventReport.d.ts +2 -2
  58. package/lib/core/hooks/useEventReport.js +4 -4
  59. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  60. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -3
  61. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  62. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
  63. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  64. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  65. package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
  66. package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
  67. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  68. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  69. package/lib/materials/sxp/template/Link/index.d.ts +1 -0
  70. package/lib/materials/sxp/template/Link/index.js +3 -3
  71. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  72. package/lib/materials/sxp/template/MultiCommodity/index.js +5 -5
  73. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  74. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
  75. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  76. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
  77. package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
  78. package/lib/materials/sxp/template/components/EventProvider.js +6 -6
  79. package/lib/materials/sxp/template/components/Img.d.ts +1 -0
  80. package/lib/materials/sxp/template/components/Img.js +3 -3
  81. package/package.json +1 -1
@@ -7,6 +7,7 @@ export interface IImgProps {
7
7
  onClick?: any;
8
8
  style?: CSSProperties;
9
9
  isExternalLink?: boolean;
10
+ index?: number;
10
11
  }
11
12
  declare const _default: React.NamedExoticComponent<IImgProps>;
12
13
  export default _default;
@@ -5,7 +5,7 @@ import useOnScreen from '../../../../core/hooks/useOnScreen';
5
5
  import { useEditor, useSxpDataSource } from '../../../../core/hooks';
6
6
  import { useEventReport } from '../../../../core/hooks/useEventReport';
7
7
  const EventProvider = (_a) => {
8
- var { rec, children, className, onClick, style, isExternalLink = false } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
8
+ var { rec, children, className, onClick, style, isExternalLink = false, index } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
9
9
  const ref = useRef(null);
10
10
  const isOnScreen = useOnScreen(ref);
11
11
  const { popup } = useEditor();
@@ -18,22 +18,22 @@ const EventProvider = (_a) => {
18
18
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
19
19
  eventSubject: 'ctaExposure',
20
20
  eventDescription: 'The cta was shown to the user'
21
- }, rec, item);
21
+ }, rec, item, index);
22
22
  }
23
- }, [isOnScreen, ref, rec, ctaEvent]);
23
+ }, [isOnScreen, ref, rec, ctaEvent, index]);
24
24
  const handleClick = throttle(() => {
25
25
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26
26
  const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
27
27
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
28
28
  eventSubject: 'clickCta',
29
29
  eventDescription: 'User clicked the CTA'
30
- }, rec, item);
31
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
30
+ }, rec, item, index);
31
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
32
32
  if (isExternalLink) {
33
33
  if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
34
34
  const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
35
35
  const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
36
- jumpToWeb(rec, product, cta);
36
+ jumpToWeb(rec, product, cta, index);
37
37
  window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link;
38
38
  window.location.href = window.getJointUtmLink((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.link);
39
39
  }
@@ -4,6 +4,7 @@ export interface IImgProps {
4
4
  src: string;
5
5
  rec?: RecItemType;
6
6
  item?: ProductInfoType;
7
+ index?: number;
7
8
  }
8
9
  declare const _default: React.NamedExoticComponent<IImgProps>;
9
10
  export default _default;
@@ -2,7 +2,7 @@ import { css } from '@emotion/css';
2
2
  import React, { memo, useEffect, useRef } from 'react';
3
3
  import useOnScreen from '../../../../core/hooks/useOnScreen';
4
4
  import { useSxpDataSource } from '../../../../core/hooks';
5
- const Img = ({ src, rec, item }) => {
5
+ const Img = ({ src, rec, item, index }) => {
6
6
  const ref = useRef(null);
7
7
  const isOnScreen = useOnScreen(ref);
8
8
  const { ctaEvent } = useSxpDataSource();
@@ -11,9 +11,9 @@ const Img = ({ src, rec, item }) => {
11
11
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12
12
  eventSubject: 'ctaExposure',
13
13
  eventDescription: 'The cta was shown to the user'
14
- }, rec, item);
14
+ }, rec, item, index);
15
15
  }
16
- }, [isOnScreen, src, ref, rec, ctaEvent, item]);
16
+ }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
17
17
  return (React.createElement("img", { ref: ref, hidden: !src, className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, alt: '' }));
18
18
  };
19
19
  export default memo(Img);
@@ -5,6 +5,7 @@ interface ILikeProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<
5
5
  unActicveIcon?: string;
6
6
  active?: boolean;
7
7
  recData: RecItemType;
8
+ position: number;
8
9
  }
9
10
  declare const _default: React.NamedExoticComponent<ILikeProps>;
10
11
  export default _default;
@@ -8,7 +8,7 @@ const hooks_1 = require("../../../../core/hooks");
8
8
  const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
9
9
  const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
10
10
  const LikeButton = (_a) => {
11
- var { active, activeIcon, unActicveIcon, recData } = _a, props = tslib_1.__rest(_a, ["active", "activeIcon", "unActicveIcon", "recData"]);
11
+ var { active, activeIcon, unActicveIcon, recData, position } = _a, props = tslib_1.__rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
12
12
  const { mutateLike, mutateUnlike, bffEventReport } = (0, hooks_1.useSxpDataSource)();
13
13
  const [state, setState] = (0, react_1.useState)(active);
14
14
  const likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath);
@@ -25,7 +25,7 @@ const LikeButton = (_a) => {
25
25
  contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
26
26
  contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
27
27
  contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
28
- position: recData.position,
28
+ position: position + '',
29
29
  contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
30
30
  traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
31
31
  }
@@ -44,7 +44,7 @@ const LikeButton = (_a) => {
44
44
  contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
45
45
  contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
46
46
  contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
47
- position: recData.position,
47
+ position: position + '',
48
48
  contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
49
49
  traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
50
50
  }
@@ -38,7 +38,7 @@ const Popup = () => {
38
38
  const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
39
39
  const cta = (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
40
40
  if (product && cta) {
41
- productView(data, product, cta, curTimeRef.current);
41
+ productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
42
42
  }
43
43
  setTimeout(() => {
44
44
  window === null || window === void 0 ? void 0 : window.sxpPopup('');
@@ -35,7 +35,7 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
35
35
  const Component = (0, withBindDataSource_1.default)(t);
36
36
  const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
37
37
  const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
38
- return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink })));
38
+ return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index })));
39
39
  }
40
40
  else {
41
41
  return null;
@@ -42,7 +42,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
42
42
  startTime: videoCurrentTime,
43
43
  videoDuration,
44
44
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
45
- position: item.position,
45
+ position: index + '',
46
46
  contentFormat: 'video',
47
47
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
48
48
  }
@@ -70,7 +70,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
70
70
  startTime: videoCurrentTime,
71
71
  videoDuration,
72
72
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
73
- position: item.position,
73
+ position: index + '',
74
74
  contentFormat: 'video',
75
75
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
76
76
  }
@@ -130,7 +130,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
130
130
  videoDuration,
131
131
  playDuration,
132
132
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
133
- position: item.position,
133
+ position: index + '',
134
134
  contentFormat: 'video',
135
135
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
136
136
  }
@@ -98,7 +98,7 @@ const WaterfallFlowItem = (props) => {
98
98
  };
99
99
  }, [src, showVideo]);
100
100
  const handleClickToDetail = () => {
101
- reportTagsView();
101
+ reportTagsView(index);
102
102
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
103
103
  setTimeout(() => {
104
104
  var _a;
@@ -32,7 +32,7 @@ const WaterFall = (props) => {
32
32
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
33
33
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
34
34
  }
35
- reportTagsView();
35
+ reportTagsView(0);
36
36
  setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
37
37
  setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
38
38
  setTimeout(() => {
@@ -49,7 +49,7 @@ const WaterFall = (props) => {
49
49
  setRecData(waterFallData);
50
50
  }
51
51
  }, [waterFallData]);
52
- const reportTagsView = (0, react_1.useCallback)(() => {
52
+ const reportTagsView = (0, react_1.useCallback)((index) => {
53
53
  var _a, _b, _c, _d, _e, _f;
54
54
  const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
55
55
  if (!rec)
@@ -67,7 +67,7 @@ const WaterFall = (props) => {
67
67
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
68
68
  eventInfo: {
69
69
  relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
70
- position: rec === null || rec === void 0 ? void 0 : rec.position,
70
+ position: index + '',
71
71
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
72
72
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
73
73
  hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
@@ -123,7 +123,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
123
123
  eventDescription: 'Session completed',
124
124
  relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
125
125
  relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
126
- position: item === null || item === void 0 ? void 0 : item.position,
126
+ position: activeIndex,
127
127
  fromKName,
128
128
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
129
129
  relatedCtatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
@@ -165,7 +165,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
165
165
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
166
166
  const Component = (0, withBindDataSource_1.default)(t);
167
167
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
168
- return (react_1.default.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }) })));
168
+ return (react_1.default.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
169
169
  });
170
170
  }
171
171
  return null;
@@ -184,7 +184,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
184
184
  }
185
185
  return null;
186
186
  }, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle]);
187
- const renderLikeButton = (0, react_1.useCallback)((rec) => {
187
+ const renderLikeButton = (0, react_1.useCallback)((rec, index) => {
188
188
  var _a, _b;
189
189
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
190
190
  return;
@@ -196,7 +196,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
196
196
  return (react_1.default.createElement(LikeButton_1.default, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
197
197
  top,
198
198
  right: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _b !== void 0 ? _b : 0
199
- } }));
199
+ }, position: index }));
200
200
  }
201
201
  return null;
202
202
  }, [globalConfig, waterFallData]);
@@ -214,7 +214,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
214
214
  imageEndTime: `${endTime}`,
215
215
  playDuration: `${duration}`,
216
216
  contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
217
- position: item.position,
217
+ position: activeIndex,
218
218
  contentFormat: 'image',
219
219
  traceInfo: item.video.traceInfo
220
220
  }
@@ -256,7 +256,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
256
256
  const handleReportProductView = (item) => {
257
257
  var _a, _b, _c;
258
258
  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)) {
259
- productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
259
+ productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
260
260
  }
261
261
  };
262
262
  (0, react_1.useEffect)(() => {
@@ -278,7 +278,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
278
278
  contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
279
279
  imageStartTime: `${startTime}`,
280
280
  contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
281
- position: item.position,
281
+ position: activeIndex,
282
282
  contentFormat: 'image',
283
283
  traceInfo: item.video.traceInfo
284
284
  }
@@ -312,7 +312,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
312
312
  react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement(react_1.default.Fragment, null,
313
313
  renderContent(rec, index),
314
314
  renderBottom(rec, index),
315
- renderLikeButton(rec)))))));
315
+ renderLikeButton(rec, index)))))));
316
316
  });
317
317
  }, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
318
318
  const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
@@ -22,7 +22,9 @@ export interface ISxpDataSourceContext {
22
22
  mutateLike?: (body: {
23
23
  content: string;
24
24
  }) => Promise<boolean>;
25
- popupDetailData?: RecItemType;
25
+ popupDetailData?: RecItemType & {
26
+ index: number;
27
+ };
26
28
  setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
27
29
  loadVideos?: (page: number) => Promise<void>;
28
30
  getRecommendVideos?: (query?: {
@@ -44,7 +46,7 @@ export interface ISxpDataSourceContext {
44
46
  sxpParameter?: PageData['sxp_parameter'];
45
47
  waterFallData?: IWaterFallDataType;
46
48
  setWaterFallData?: React.Dispatch<React.SetStateAction<IWaterFallDataType | undefined>>;
47
- ctaEvent?: (eventInfo: any, rec?: RecItemType, product?: ProductInfoType | VideoInfoType | null) => void;
49
+ ctaEvent?: (eventInfo: any, rec?: RecItemType, product?: ProductInfoType | VideoInfoType | null, number?: number) => void;
48
50
  swiperRef?: any;
49
51
  openHashtag?: boolean;
50
52
  setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -129,7 +129,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
129
129
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
130
130
  return res === null || res === void 0 ? void 0 : res.success;
131
131
  }), [bffFetch]);
132
- const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product) => {
132
+ const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
133
133
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
134
134
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
135
135
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
@@ -144,7 +144,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
144
144
  fromKName = 'imagePage';
145
145
  }
146
146
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
147
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: rec === null || rec === void 0 ? void 0 : rec.position, relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
147
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
148
148
  });
149
149
  }, [bffEventReport, isFromHashtag]);
150
150
  (0, react_1.useEffect)(() => {
@@ -1,5 +1,5 @@
1
1
  import { RecItemType } from '../components/SxpPageRender/typing';
2
2
  export declare function useEventReport(): {
3
- jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta']) => void;
4
- productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any) => void;
3
+ jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
4
+ productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
5
5
  };
@@ -5,7 +5,7 @@ const react_1 = require("react");
5
5
  const useSxpDataSource_1 = require("./useSxpDataSource");
6
6
  function useEventReport() {
7
7
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
8
- const jumpToWeb = (0, react_1.useCallback)((data, product, cta) => {
8
+ const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
9
9
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
10
10
  let fromKName = '';
11
11
  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))) {
@@ -34,14 +34,14 @@ function useEventReport() {
34
34
  fromKName,
35
35
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
36
36
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
37
- position: (data === null || data === void 0 ? void 0 : data.position) + '',
37
+ position: position + '',
38
38
  relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
39
39
  relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
40
40
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
41
41
  }
42
42
  });
43
43
  }, [bffEventReport, popupDetailData, isFromHashtag]);
44
- const productView = (0, react_1.useCallback)((data, product, cta, viewTime) => {
44
+ const productView = (0, react_1.useCallback)((data, product, cta, viewTime, position) => {
45
45
  var _a, _b, _c, _d;
46
46
  let fromKName = '';
47
47
  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))) {
@@ -59,7 +59,7 @@ function useEventReport() {
59
59
  fromKName,
60
60
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
61
61
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
62
- position: (data === null || data === void 0 ? void 0 : data.position) + '',
62
+ position: position + '',
63
63
  relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
64
64
  relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
65
65
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
@@ -28,6 +28,7 @@ export interface ICommodityDetailProps {
28
28
  info: CSSProperties;
29
29
  };
30
30
  buttonStyle?: CSSProperties;
31
+ index?: number;
31
32
  }
32
33
  declare const _default: React.NamedExoticComponent<ICommodityDetailProps>;
33
34
  export default _default;
@@ -12,7 +12,7 @@ const Modal_1 = tslib_1.__importDefault(require("../../../../core/components/Sxp
12
12
  const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/ExpandableText"));
13
13
  const CommodityDetail = (_a) => {
14
14
  var _b, _c, _d, _e, _f, _g, _h, _j;
15
- var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle"]);
15
+ var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
16
16
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
17
17
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = (0, hooks_1.useSxpDataSource)();
18
18
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
@@ -21,11 +21,12 @@ const CommodityDetail = (_a) => {
21
21
  const data = isPost ? rec : popupDetailData;
22
22
  const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
23
23
  const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
24
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
24
25
  const handleLink = () => {
25
26
  if (product === null || product === void 0 ? void 0 : product.link) {
26
- jumpToWeb(popupDetailData, product, cta);
27
+ jumpToWeb(popupDetailData, product, cta, position);
27
28
  if (!isPost) {
28
- productView(data, product, cta, viewTime || curTimeRef.current);
29
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
29
30
  }
30
31
  window.location.href = window.getJointUtmLink(product.link);
31
32
  }
@@ -13,6 +13,7 @@ export interface ICommodityDetailDiroProps {
13
13
  viewTime?: any;
14
14
  isPost?: boolean;
15
15
  bottom_image?: string;
16
+ index?: number;
16
17
  }
17
18
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroProps>;
18
19
  export default _default;
@@ -11,7 +11,7 @@ const arrow_png_1 = tslib_1.__importDefault(require("./arrow.png"));
11
11
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
12
12
  const CommodityDetailDiro = (_a) => {
13
13
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
14
- var { style, isDefault, rec, viewTime, isPost, bottom_image } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image"]);
14
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
15
15
  const [spread, setSpread] = (0, react_1.useState)(true);
16
16
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
17
17
  const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = (0, hooks_1.useSxpDataSource)();
@@ -26,11 +26,12 @@ const CommodityDetailDiro = (_a) => {
26
26
  const data = isPost ? rec : popupDetailData;
27
27
  const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
28
28
  const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
29
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
29
30
  const handleLink = () => {
30
31
  if (product === null || product === void 0 ? void 0 : product.link) {
31
- jumpToWeb(data, product, cta);
32
+ jumpToWeb(data, product, cta, position);
32
33
  if (!isPost) {
33
- productView(data, product, cta, viewTime || curTimeRef.current);
34
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
34
35
  }
35
36
  window.location.href = window.getJointUtmLink(product.link);
36
37
  }
@@ -29,6 +29,7 @@ export interface ICommodityDetailDiroNewProps {
29
29
  info: CSSProperties;
30
30
  };
31
31
  buttonStyle?: CSSProperties;
32
+ index?: number;
32
33
  }
33
34
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroNewProps>;
34
35
  export default _default;
@@ -12,7 +12,7 @@ const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/compo
12
12
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
13
13
  const CommodityDetailDiroNew = (_a) => {
14
14
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
15
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle"]);
15
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
16
16
  const [spread, setSpread] = (0, react_1.useState)(true);
17
17
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
18
18
  const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = (0, hooks_1.useSxpDataSource)();
@@ -28,11 +28,12 @@ const CommodityDetailDiroNew = (_a) => {
28
28
  const data = isPost ? rec : popupDetailData;
29
29
  const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
30
30
  const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
31
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
31
32
  const handleLink = () => {
32
33
  if (product === null || product === void 0 ? void 0 : product.link) {
33
- jumpToWeb(data, product, cta);
34
+ jumpToWeb(data, product, cta, position);
34
35
  if (!isPost) {
35
- productView(data, product, cta, viewTime || curTimeRef.current);
36
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
36
37
  }
37
38
  window.location.href = window.getJointUtmLink(product.link);
38
39
  }
@@ -9,6 +9,7 @@ export interface IAppointProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<IAppointProps>;
14
15
  export default _default;
@@ -9,6 +9,7 @@ export interface ICommodityProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ICommodityProps>;
14
15
  export default _default;
@@ -9,6 +9,7 @@ export interface ICommodityDiroProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ICommodityDiroProps>;
14
15
  export default _default;
@@ -9,6 +9,7 @@ export interface ICommodityDiroNewProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ICommodityDiroNewProps>;
14
15
  export default _default;
@@ -8,6 +8,7 @@ export interface ILinkProps {
8
8
  recData?: RecItemType;
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
+ index?: number;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ILinkProps>;
13
14
  export default _default;
@@ -9,18 +9,18 @@ const hooks_1 = require("../../../../core/hooks");
9
9
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
10
10
  const Link = (_a) => {
11
11
  var _b, _c, _d, _e, _f;
12
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
12
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
13
13
  const { sxpParameter, bffEventReport } = (0, hooks_1.useSxpDataSource)();
14
14
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
15
15
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
16
16
  const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
17
17
  const handleTo = () => {
18
18
  if (cta === null || cta === void 0 ? void 0 : cta.link) {
19
- jumpToWeb(recData, product, cta);
19
+ jumpToWeb(recData, product, cta, index);
20
20
  window.location.href = window.getJointUtmLink(cta.link);
21
21
  }
22
22
  };
23
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
23
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
24
24
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
25
25
  react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image, alt: '' })),
26
26
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -10,6 +10,7 @@ export interface IMultiCommodityProps {
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
12
  isExternalLink?: boolean;
13
+ index?: number;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
15
16
  export default _default;
@@ -12,7 +12,7 @@ const hooks_1 = require("../../../../core/hooks");
12
12
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
13
13
  const MultiCommodity = (_a) => {
14
14
  var _b, _c;
15
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
15
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
16
16
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
17
17
  const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
18
18
  const { popup } = (0, hooks_1.useEditor)();
@@ -22,11 +22,11 @@ const MultiCommodity = (_a) => {
22
22
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
23
23
  eventSubject: 'clickCta',
24
24
  eventDescription: 'User clicked the CTA'
25
- }, recData, item);
26
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
25
+ }, recData, item, index);
26
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
27
27
  if (isExternalLink) {
28
28
  if (item === null || item === void 0 ? void 0 : item.link) {
29
- jumpToWeb(recData, item, item.bindCta);
29
+ jumpToWeb(recData, item, item.bindCta, index);
30
30
  window.location.href = window.getJointUtmLink(item.link);
31
31
  }
32
32
  }
@@ -38,7 +38,7 @@ const MultiCommodity = (_a) => {
38
38
  var _a, _b, _c, _d, _e, _f;
39
39
  return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
40
40
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
41
- react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
41
+ react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
42
42
  react_1.default.createElement("div", { className: (0, css_1.css)({
43
43
  color: '#fff',
44
44
  display: 'flex',
@@ -10,6 +10,7 @@ export interface IMultiCommodityDiroProps {
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
12
  isExternalLink?: boolean;
13
+ index?: number;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
15
16
  export default _default;