pb-sxp-ui 1.2.5 → 1.2.7

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 (42) hide show
  1. package/dist/index.cjs +102 -58
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +10 -4
  4. package/dist/index.js +102 -58
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +102 -58
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/FormatImage.js +7 -3
  15. package/es/core/components/SxpPageRender/Popup/index.js +8 -6
  16. package/es/core/components/SxpPageRender/index.js +5 -5
  17. package/es/core/context/SxpDataSourceProvider.js +26 -16
  18. package/es/core/hooks/useEventReport.js +4 -4
  19. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  20. package/es/materials/sxp/popup/CommodityDetail/index.js +11 -6
  21. package/es/materials/sxp/popup/CommodityDetail/material.js +6 -0
  22. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
  23. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +5 -2
  24. package/es/materials/sxp/popup/CommodityList/index.d.ts +0 -1
  25. package/es/materials/sxp/popup/CommodityList/index.js +12 -11
  26. package/es/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
  27. package/es/materials/sxp/template/components/CommodityGroup.js +12 -1
  28. package/lib/core/components/SxpPageRender/FormatImage.js +7 -3
  29. package/lib/core/components/SxpPageRender/Popup/index.js +8 -6
  30. package/lib/core/components/SxpPageRender/index.js +5 -5
  31. package/lib/core/context/SxpDataSourceProvider.js +26 -16
  32. package/lib/core/hooks/useEventReport.js +4 -4
  33. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  34. package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -5
  35. package/lib/materials/sxp/popup/CommodityDetail/material.js +6 -0
  36. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +4 -0
  37. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +5 -2
  38. package/lib/materials/sxp/popup/CommodityList/index.d.ts +0 -1
  39. package/lib/materials/sxp/popup/CommodityList/index.js +12 -11
  40. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
  41. package/lib/materials/sxp/template/components/CommodityGroup.js +12 -1
  42. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -574,12 +574,25 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
574
574
  const themeTag = React.useRef();
575
575
  const curTime = React.useRef();
576
576
  const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
577
- const checkCommodityIndexRef = React.useRef();
577
+ const checkCommodityIndexRef = React.useRef(-1);
578
578
  const popupCurTimeRef = React.useRef(null);
579
579
  const isShowConsent = React.useMemo(() => {
580
580
  var _a, _b, _c, _d;
581
581
  return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
582
582
  }, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
583
+ const getFilterRecList = React.useCallback((data) => {
584
+ var _a;
585
+ const recList = data === null || data === void 0 ? void 0 : data.recList;
586
+ const nList = (_a = recList === null || recList === void 0 ? void 0 : recList.map((item) => {
587
+ var _a, _b, _c, _d, _e, _f;
588
+ if (((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c.length) > 0) {
589
+ const bindProducts = (_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e.filter((item) => !!(item === null || item === void 0 ? void 0 : item.bindCta))) !== null && _f !== void 0 ? _f : [];
590
+ return Object.assign(Object.assign({}, item), { video: Object.assign(Object.assign({}, item === null || item === void 0 ? void 0 : item.video), { bindProducts }) });
591
+ }
592
+ return item;
593
+ })) !== null && _a !== void 0 ? _a : [];
594
+ return nList;
595
+ }, []);
583
596
  React.useEffect(() => {
584
597
  const handleChangeThemeTag = (tag) => {
585
598
  themeTag.current = tag;
@@ -651,7 +664,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
651
664
  return result === null || result === void 0 ? void 0 : result.data;
652
665
  }), [bffFetch, utmVal, maxSize, defaultSize]);
653
666
  const loadVideos = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
654
- var _j, _k;
655
667
  if (rtcList.length <= 0) {
656
668
  return;
657
669
  }
@@ -661,8 +673,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
661
673
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
662
674
  themeTag: themeTag.current
663
675
  });
664
- setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
665
- setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
676
+ setRtcList(getFilterRecList(data));
677
+ setCacheRtcList(getFilterRecList(data));
666
678
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
667
679
  const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
668
680
  // 关闭 BFF 事件上报
@@ -726,24 +738,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
726
738
  }), [bffFetch]);
727
739
  // 获取 Tag
728
740
  const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
729
- var _l, _m, _o, _p, _q;
741
+ var _j, _k, _l, _m, _o;
730
742
  if (!utmVal || !isShowTag)
731
743
  return;
732
744
  try {
733
- const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
745
+ const val = (_l = (_k = (_j = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _j === void 0 ? void 0 : _j.filter((val) => {
734
746
  var _a, _b;
735
747
  const key = val.split('=')[0];
736
748
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
737
- })) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
749
+ })) === null || _k === void 0 ? void 0 : _k.join('&')) !== null && _l !== void 0 ? _l : '';
738
750
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
739
- setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
751
+ setTagList((_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []);
740
752
  }
741
753
  catch (e) {
742
754
  console.log('e', e);
743
755
  }
744
756
  }), [bffFetch, utmVal, isShowTag]);
745
757
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
746
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
758
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
747
759
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
748
760
  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);
749
761
  let fromKName = '';
@@ -757,7 +769,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
757
769
  fromKName = 'imagePage';
758
770
  }
759
771
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
760
- 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 + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: 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, fromKPage: (_o = location === null || location === void 0 ? void 0 : location.href) !== null && _o !== void 0 ? _o : '' })
772
+ 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 + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_2 = (_z = (_u = (_q = (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProduct) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : (_y = (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.bindProducts) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.bindCta) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_1 = (_0 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '', fromKName, fromKPage: (_3 = location === null || location === void 0 ? void 0 : location.href) !== null && _3 !== void 0 ? _3 : '' })
761
773
  });
762
774
  }, [bffEventReport, isFromHashtag]);
763
775
  const h5EnterLink = React.useCallback(() => {
@@ -797,9 +809,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
797
809
  bffGetTagList();
798
810
  getRecommendVideos()
799
811
  .then((data) => {
800
- var _a, _b;
801
- setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
802
- setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
812
+ setRtcList(getFilterRecList(data));
813
+ setCacheRtcList(getFilterRecList(data));
803
814
  })
804
815
  .finally(() => {
805
816
  bffEventReport({
@@ -819,9 +830,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
819
830
  bffGetTagList();
820
831
  getRecommendVideos()
821
832
  .then((data) => {
822
- var _a, _b;
823
- setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
824
- setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
833
+ setRtcList(getFilterRecList(data));
834
+ setCacheRtcList(getFilterRecList(data));
825
835
  })
826
836
  .finally(() => {
827
837
  setLoading(false);
@@ -1289,14 +1299,14 @@ var settingRender$9 = [
1289
1299
  * @Author: binruan@chatlabs.com
1290
1300
  * @Date: 2024-03-12 10:59:06
1291
1301
  * @LastEditors: binruan@chatlabs.com
1292
- * @LastEditTime: 2024-06-20 13:39:07
1302
+ * @LastEditTime: 2024-08-01 17:36:34
1293
1303
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
1294
1304
  *
1295
1305
  */
1296
1306
  function useEventReport() {
1297
1307
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
1298
1308
  const jumpToWeb = React.useCallback((data, product, cta, position) => {
1299
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1309
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
1300
1310
  let fromKName = '';
1301
1311
  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))) {
1302
1312
  fromKName = 'pdpPage';
@@ -1327,12 +1337,12 @@ function useEventReport() {
1327
1337
  position: position + '',
1328
1338
  contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
1329
1339
  ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
1330
- traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
1340
+ traceInfo: (_1 = (_y = (_w = (_s = (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_v = (_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = data === null || data === void 0 ? void 0 : data.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = data === null || data === void 0 ? void 0 : data.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : ''
1331
1341
  }
1332
1342
  });
1333
1343
  }, [bffEventReport, popupDetailData, isFromHashtag]);
1334
1344
  const productView = React.useCallback((data, product, cta, viewTime, position) => {
1335
- var _a, _b, _c, _d;
1345
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1336
1346
  let fromKName = '';
1337
1347
  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))) {
1338
1348
  fromKName = 'pdpPage';
@@ -1352,7 +1362,7 @@ function useEventReport() {
1352
1362
  position: position + '',
1353
1363
  contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
1354
1364
  ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
1355
- traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
1365
+ traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
1356
1366
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
1357
1367
  eventSubject: 'productView',
1358
1368
  eventDescription: 'User browsed the product'
@@ -1628,6 +1638,10 @@ var settingRender$8 = [
1628
1638
  {
1629
1639
  label: '商品描述',
1630
1640
  value: 'info'
1641
+ },
1642
+ {
1643
+ label: '税费说明',
1644
+ value: 'taxInfo'
1631
1645
  }
1632
1646
  ],
1633
1647
  name: ['props', 'commodityStyles', 'field'],
@@ -8802,13 +8816,14 @@ var ExpandableText$1 = React.memo(ExpandableText);
8802
8816
  * @Author: binruan@chatlabs.com
8803
8817
  * @Date: 2024-03-20 10:27:31
8804
8818
  * @LastEditors: binruan@chatlabs.com
8805
- * @LastEditTime: 2024-06-20 18:56:52
8819
+ * @LastEditTime: 2024-07-31 17:54:50
8806
8820
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
8807
8821
  *
8808
8822
  */
8809
8823
  const FormatImage = React.forwardRef((props, ref) => {
8810
8824
  const { src, onLoad, style, className, loading } = props;
8811
8825
  const [imgSrc, setImgSrc] = React.useState();
8826
+ const imgRef = React.useRef(null);
8812
8827
  React.useImperativeHandle(ref, () => ({
8813
8828
  setSrc: (v) => {
8814
8829
  setImgSrc(v);
@@ -8817,7 +8832,6 @@ const FormatImage = React.forwardRef((props, ref) => {
8817
8832
  React.useEffect(() => {
8818
8833
  setImgSrc(src);
8819
8834
  }, [src]);
8820
- React.useRef(null);
8821
8835
  // useEffect(() => {
8822
8836
  // let observer: any = null;
8823
8837
  // const { current } = imgRef;
@@ -8845,9 +8859,13 @@ const FormatImage = React.forwardRef((props, ref) => {
8845
8859
  React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
8846
8860
  React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
8847
8861
  React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
8848
- React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8862
+ React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8863
+ if (imgRef.current)
8864
+ imgRef.current.style.display = 'block';
8849
8865
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8850
- }, alt: 'image' }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8866
+ }, alt: 'image' }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8867
+ if (imgRef.current)
8868
+ imgRef.current.style.display = 'block';
8851
8869
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8852
8870
  }, alt: 'image' }))));
8853
8871
  });
@@ -8875,6 +8893,15 @@ var Scroll$1 = React.memo(Scroll);
8875
8893
 
8876
8894
  const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
8877
8895
  var _a;
8896
+ const { productView } = useEventReport();
8897
+ const { popupCurTimeRef } = useSxpDataSource();
8898
+ const handleClick = (item, index) => {
8899
+ if (check === index)
8900
+ return;
8901
+ const prevItem = products === null || products === void 0 ? void 0 : products[check];
8902
+ productView(popupDetailData, prevItem, prevItem === null || prevItem === void 0 ? void 0 : prevItem.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
8903
+ onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
8904
+ };
8878
8905
  return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (React.createElement(Scroll$1, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
8879
8906
  var _a, _b, _c;
8880
8907
  return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css.css({
@@ -8882,7 +8909,7 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
8882
8909
  height: '50px',
8883
8910
  marginRight: '10px'
8884
8911
  }), onClick: () => {
8885
- onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
8912
+ handleClick(item, index);
8886
8913
  }, key: index },
8887
8914
  React.createElement(FormatImage$1, { style: {
8888
8915
  height: '100%',
@@ -8900,8 +8927,7 @@ var CommodityGroup$1 = React.memo(CommodityGroup);
8900
8927
  const CommodityDetail$1 = (_a) => {
8901
8928
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
8902
8929
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
8903
- const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
8904
- useEditor();
8930
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
8905
8931
  const { jumpToWeb, productView } = useEventReport();
8906
8932
  const curTimeRef = React.useRef(null);
8907
8933
  const [showModal, setShowModal] = React.useState(false);
@@ -8914,6 +8940,7 @@ const CommodityDetail$1 = (_a) => {
8914
8940
  : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
8915
8941
  const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
8916
8942
  if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_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.length) > 0) {
8943
+ checkCommodityIndexRef.current = checkCommodityIndex;
8917
8944
  const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
8918
8945
  product = p;
8919
8946
  cta = p === null || p === void 0 ? void 0 : p.bindCta;
@@ -8957,7 +8984,7 @@ const CommodityDetail$1 = (_a) => {
8957
8984
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8958
8985
  const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
8959
8986
  const renderContent = ({ isPost }) => {
8960
- var _a, _b, _c;
8987
+ var _a, _b, _c, _d;
8961
8988
  return (React.createElement("div", null,
8962
8989
  React.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), dangerouslySetInnerHTML: {
8963
8990
  __html: setFontForText((_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -8968,8 +8995,11 @@ const CommodityDetail$1 = (_a) => {
8968
8995
  React.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
8969
8996
  __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
8970
8997
  } }),
8998
+ React.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
8999
+ __html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
9000
+ } }),
8971
9001
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8972
- React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
9002
+ React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
8973
9003
  bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8974
9004
  collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8975
9005
  necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
@@ -8991,6 +9021,7 @@ const CommodityDetail$1 = (_a) => {
8991
9021
  const handleClick = React.useCallback((index) => {
8992
9022
  popupCurTimeRef.current = new Date();
8993
9023
  setCheckCommodityIndex(index);
9024
+ checkCommodityIndexRef.current = index;
8994
9025
  }, []);
8995
9026
  const renderCommodityGroup = React.useCallback(() => {
8996
9027
  var _a, _b, _c;
@@ -9011,6 +9042,7 @@ const CommodityDetail$1 = (_a) => {
9011
9042
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9012
9043
  } },
9013
9044
  React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
9045
+ var _a;
9014
9046
  return (React.createElement(SwiperSlide, { key: src },
9015
9047
  React.createElement("div", { style: {
9016
9048
  overflow: 'hidden',
@@ -9023,7 +9055,7 @@ const CommodityDetail$1 = (_a) => {
9023
9055
  objectFit: 'cover',
9024
9056
  display: 'block',
9025
9057
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9026
- }, src: src }))));
9058
+ }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
9027
9059
  }))))),
9028
9060
  !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
9029
9061
  position: 'relative',
@@ -9087,7 +9119,7 @@ var interactionRender$c = [
9087
9119
  * @Author: binruan@chatlabs.com
9088
9120
  * @Date: 2023-07-28 18:29:57
9089
9121
  * @LastEditors: binruan@chatlabs.com
9090
- * @LastEditTime: 2024-07-12 17:40:06
9122
+ * @LastEditTime: 2024-07-31 13:58:45
9091
9123
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
9092
9124
  *
9093
9125
  */
@@ -9125,6 +9157,12 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
9125
9157
  info: {
9126
9158
  color: 'gray',
9127
9159
  fontSize: 12
9160
+ },
9161
+ taxInfo: {
9162
+ color: '#000',
9163
+ fontSize: 13,
9164
+ textAlign: 'left',
9165
+ marginBottom: '10px'
9128
9166
  }
9129
9167
  },
9130
9168
  buttonStyle: {
@@ -9610,7 +9648,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
9610
9648
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
9611
9649
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
9612
9650
  React.useState(true);
9613
- const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
9651
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
9614
9652
  const { jumpToWeb, productView } = useEventReport();
9615
9653
  React.useState(false);
9616
9654
  React.useState(false);
@@ -9625,6 +9663,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
9625
9663
  : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
9626
9664
  const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
9627
9665
  if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_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.length) > 0) {
9666
+ checkCommodityIndexRef.current = checkCommodityIndex;
9628
9667
  const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
9629
9668
  product = p;
9630
9669
  cta = p === null || p === void 0 ? void 0 : p.bindCta;
@@ -9732,6 +9771,7 @@ Made in Italy` })));
9732
9771
  const handleClick = React.useCallback((index) => {
9733
9772
  popupCurTimeRef.current = new Date();
9734
9773
  setCheckCommodityIndex(index);
9774
+ checkCommodityIndexRef.current = index;
9735
9775
  }, []);
9736
9776
  const renderCommodityGroup = React.useCallback(() => {
9737
9777
  var _a, _b, _c;
@@ -9750,6 +9790,7 @@ Made in Italy` })));
9750
9790
  }, loop: true, autoplay: {
9751
9791
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9752
9792
  } }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
9793
+ var _a;
9753
9794
  return (React.createElement(SwiperSlide, { key: src },
9754
9795
  React.createElement("div", { style: {
9755
9796
  overflow: 'hidden',
@@ -9762,7 +9803,7 @@ Made in Italy` })));
9762
9803
  objectFit: 'cover',
9763
9804
  display: 'block',
9764
9805
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9765
- }, src: src }))));
9806
+ }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
9766
9807
  }))),
9767
9808
  !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
9768
9809
  position: 'relative',
@@ -10179,12 +10220,13 @@ var Img$1 = React.memo(Img);
10179
10220
 
10180
10221
  const CommodityList$1 = (_a) => {
10181
10222
  var _b, _c;
10182
- var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
10223
+ 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"]);
10183
10224
  const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
10184
10225
  const { jumpToWeb } = useEventReport();
10185
10226
  const { popup } = useEditor();
10186
10227
  const recData = isPost ? rec : popupDetailData;
10187
10228
  const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
10229
+ const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
10188
10230
  const priceText = React.useCallback((product) => {
10189
10231
  var _a, _b, _c, _d, _e;
10190
10232
  if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
@@ -10212,25 +10254,24 @@ const CommodityList$1 = (_a) => {
10212
10254
  onClick === null || onClick === void 0 ? void 0 : onClick();
10213
10255
  }
10214
10256
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
10215
- return (React.createElement("div", { className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
10216
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10257
+ return (React.createElement("div", { className: css.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) => {
10258
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
10217
10259
  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.css({
10218
10260
  display: 'flex'
10219
10261
  }), onClick: () => handleClick(item, index) }),
10220
10262
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
10221
10263
  React.createElement("div", { style: {
10222
- flex: 1,
10223
- width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px - ${(_g = style === null || style === void 0 ? void 0 : style.padding) !== null && _g !== void 0 ? _g : 0}px)`,
10264
+ width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
10224
10265
  display: 'flex',
10225
10266
  flexDirection: 'column',
10226
10267
  justifyContent: 'space-between'
10227
10268
  } },
10228
10269
  React.createElement("div", null,
10229
10270
  React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
10230
- __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.title) !== null && _h !== void 0 ? _h : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
10271
+ __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
10231
10272
  } }),
10232
10273
  React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
10233
- __html: setFontForText((_j = item === null || item === void 0 ? void 0 : item.collection) !== null && _j !== void 0 ? _j : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
10274
+ __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
10234
10275
  } })),
10235
10276
  React.createElement("div", { className: css.css({
10236
10277
  display: 'flex',
@@ -10239,11 +10280,12 @@ const CommodityList$1 = (_a) => {
10239
10280
  width: '100%',
10240
10281
  overflow: 'hidden'
10241
10282
  }) },
10242
- React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
10243
- __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10244
- } }),
10283
+ React.createElement("div", null,
10284
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
10285
+ __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10286
+ } })),
10245
10287
  React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
10246
- __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
10288
+ __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', buttonStyle)
10247
10289
  } })))))));
10248
10290
  })));
10249
10291
  };
@@ -15502,7 +15544,7 @@ var Tagbar$1 = React.memo(Tagbar);
15502
15544
  * @Author: binruan@chatlabs.com
15503
15545
  * @Date: 2024-01-15 19:03:09
15504
15546
  * @LastEditors: binruan@chatlabs.com
15505
- * @LastEditTime: 2024-07-29 10:02:52
15547
+ * @LastEditTime: 2024-08-01 17:42:09
15506
15548
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15507
15549
  *
15508
15550
  */
@@ -15563,7 +15605,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15563
15605
  React.useEffect(() => {
15564
15606
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
15565
15607
  const visibleChange = () => {
15566
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15608
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
15567
15609
  const repCond = !openHashtag && !isShowConsent;
15568
15610
  if (document.visibilityState === 'hidden') {
15569
15611
  // 当用户导航到新页面、切换标签页、关闭标签页、最小化或关闭浏览器、刷新原页面(即离开原页面时),或者在移动设备上从浏览器切换到不同的应用程序时
@@ -15603,7 +15645,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15603
15645
  fromKName,
15604
15646
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
15605
15647
  ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
15606
- traceInfo: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : ''
15648
+ traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
15607
15649
  }
15608
15650
  });
15609
15651
  }
@@ -15648,7 +15690,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15648
15690
  const minusHeight = React.useMemo(() => {
15649
15691
  let minusHeight = 0;
15650
15692
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
15651
- minusHeight += 45;
15693
+ minusHeight += 56;
15652
15694
  }
15653
15695
  return minusHeight;
15654
15696
  }, []);
@@ -15774,7 +15816,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15774
15816
  }
15775
15817
  };
15776
15818
  const handleSlideSkip = (item, position) => {
15777
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
15819
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
15778
15820
  if (isPreview || waterFallData)
15779
15821
  return;
15780
15822
  const t = new Date() - curTime.current;
@@ -15793,7 +15835,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15793
15835
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
15794
15836
  position: position + '',
15795
15837
  contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
15796
- traceInfo: (_r = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _r !== void 0 ? _r : ''
15838
+ traceInfo: (_u = (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_t = item === null || item === void 0 ? void 0 : item.product) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : ''
15797
15839
  }
15798
15840
  });
15799
15841
  setSlideSkipState();
@@ -16324,7 +16366,7 @@ var index$1 = React.memo(DiyPortalPreview);
16324
16366
  * @Author: binruan@chatlabs.com
16325
16367
  * @Date: 2023-10-31 10:56:01
16326
16368
  * @LastEditors: binruan@chatlabs.com
16327
- * @LastEditTime: 2024-07-29 18:06:11
16369
+ * @LastEditTime: 2024-08-01 15:23:51
16328
16370
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16329
16371
  *
16330
16372
  */
@@ -16350,7 +16392,7 @@ const Popup = () => {
16350
16392
  }
16351
16393
  }, [popup]);
16352
16394
  const handleClose = () => {
16353
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16395
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
16354
16396
  if (!popup ||
16355
16397
  (popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
16356
16398
  !visible ||
@@ -16361,12 +16403,14 @@ const Popup = () => {
16361
16403
  const value = (_d = (_c = (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.popupList) === null || _d === void 0 ? void 0 : _d.find((item) => (item === null || item === void 0 ? void 0 : item.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
16362
16404
  if (((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'CommodityDetail' || ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type) === 'CommodityDetailDiroNew') {
16363
16405
  const data = popupDetailData;
16364
- let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
16365
- let cta = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta;
16406
+ let product = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0];
16407
+ let cta = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProduct) === null || _m === void 0 ? void 0 : _m.bindCta) !== null && _o !== void 0 ? _o : (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.bindCta;
16366
16408
  if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
16367
- const p = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
16368
- product = p;
16369
- cta = p === null || p === void 0 ? void 0 : p.bindCta;
16409
+ const p = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
16410
+ if (p) {
16411
+ product = p;
16412
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
16413
+ }
16370
16414
  }
16371
16415
  if (product && cta) {
16372
16416
  productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);