pb-sxp-ui 1.20.21 → 1.20.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -11682,6 +11682,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
11682
11682
  const CommodityDetail$1 = (_a) => {
11683
11683
  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;
11684
11684
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true, enableAddToCart = false, addToCartPopupId = '' } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive", "enableAddToCart", "addToCartPopupId"]);
11685
+ console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
11685
11686
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
11686
11687
  const { jumpToWeb, productView } = useEventReport();
11687
11688
  const curTimeRef = React.useRef(null);
@@ -11861,9 +11862,30 @@ const CommodityDetail$1 = (_a) => {
11861
11862
  };
11862
11863
  const renderBtn = () => {
11863
11864
  var _a, _b;
11865
+ const handleBtnClick = (e) => {
11866
+ console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
11867
+ product,
11868
+ cta,
11869
+ enableAddToCart,
11870
+ addToCartPopupId,
11871
+ productLink: product === null || product === void 0 ? void 0 : product.link
11872
+ });
11873
+ handleLink(e);
11874
+ };
11875
+ console.log('[CommodityDetail] renderBtn 被调用', {
11876
+ ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
11877
+ buttonStyle
11878
+ });
11864
11879
  return (React.createElement(React.Fragment, null,
11865
- React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
11866
- React.createElement("span", { dangerouslySetInnerHTML: {
11880
+ React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) => {
11881
+ console.log('[CommodityDetail] mousedown 事件触发!!!', e);
11882
+ e.stopPropagation();
11883
+ }, onPointerDown: (e) => {
11884
+ console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
11885
+ }, onTouchStart: (e) => {
11886
+ console.log('[CommodityDetail] touchstart 事件触发!!!', e);
11887
+ }, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
11888
+ React.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
11867
11889
  __html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
11868
11890
  } }))));
11869
11891
  };
@@ -11912,7 +11934,7 @@ const CommodityDetail$1 = (_a) => {
11912
11934
  }, []);
11913
11935
  const isAlly = React.useMemo(() => getScreenReader(), []);
11914
11936
  return (React.createElement(React.Fragment, null,
11915
- React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
11937
+ React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { position: 'relative' })) }, props),
11916
11938
  React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
11917
11939
  product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
11918
11940
  clickable: true,
@@ -11978,8 +12000,8 @@ const CommodityDetail$1 = (_a) => {
11978
12000
  }, onClick: () => setShow3DModal(true) },
11979
12001
  React.createElement("img", { src: iframeIcon, alt: '3d', width: '72px' })))),
11980
12002
  renderCommodityGroup(),
11981
- React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
11982
- renderBtn(),
12003
+ React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost })),
12004
+ renderBtn()),
11983
12005
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
11984
12006
  React.createElement("div", { style: { paddingTop: '34px', paddingBottom: '80px' } }, renderContent({ isPost: false })),
11985
12007
  renderBtn()),