pb-sxp-ui 1.20.22 → 1.20.25

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/pb-ui.js CHANGED
@@ -1139,7 +1139,7 @@
1139
1139
  return undefined;
1140
1140
  }
1141
1141
  setLoading(false);
1142
- list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
1142
+ list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _1 !== void 0 ? _1 : []);
1143
1143
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
1144
1144
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1145
1145
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
@@ -1147,7 +1147,7 @@
1147
1147
  setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1148
1148
  }
1149
1149
  }
1150
- const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
1150
+ const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
1151
1151
  if (isNotNullList) {
1152
1152
  pageNum = pageNum + 1;
1153
1153
  yield recurveRecList(query);
@@ -1173,13 +1173,13 @@
1173
1173
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
1174
1174
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
1175
1175
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
1176
- const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
1176
+ const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
1177
1177
  if (!isNotNullList) {
1178
1178
  setIsNoMoreData(true);
1179
1179
  }
1180
1180
  }
1181
1181
  let list = [];
1182
- list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
1182
+ list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _x !== void 0 ? _x : []);
1183
1183
  return Object.assign(Object.assign({}, result.data), { recList: list });
1184
1184
  }), [
1185
1185
  bffFetch,
@@ -1577,6 +1577,7 @@
1577
1577
  if (id) {
1578
1578
  curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
1579
1579
  if (curData) {
1580
+ // 找到对应的变体页面配置
1580
1581
  setPageData(curData);
1581
1582
  document.title = (_c = curData === null || curData === void 0 ? void 0 : curData.name) !== null && _c !== void 0 ? _c : 'home';
1582
1583
  gldata = (_e = (_d = curData === null || curData === void 0 ? void 0 : curData.data) === null || _d === void 0 ? void 0 : _d.sxpPageConf) === null || _e === void 0 ? void 0 : _e.globalConfig;
@@ -1584,11 +1585,21 @@
1584
1585
  onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
1585
1586
  if ((_j = (_h = (_g = (_f = gldata === null || gldata === void 0 ? void 0 : gldata.consent) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.props) === null || _j === void 0 ? void 0 : _j.privacy_necessity)
1586
1587
  setShowConsent(true);
1588
+ else
1589
+ setShowConsent(true);
1587
1590
  }
1588
1591
  else {
1592
+ // A/B测试或实验场景:找不到对应变体时,使用默认页面配置继续渲染
1593
+ console.warn(`[SxpDataSourceProvider] Layout variant ${id} not found in dataList (count: ${(dataList === null || dataList === void 0 ? void 0 : dataList.length) || 0}), using default page config`);
1594
+ // 使用默认globalConfig,不改变showConsent状态,让页面正常渲染
1595
+ gldata = globalConfig;
1589
1596
  setShowConsent(true);
1590
1597
  }
1591
1598
  }
1599
+ else {
1600
+ gldata = globalConfig;
1601
+ setShowConsent(true);
1602
+ }
1592
1603
  }
1593
1604
  else {
1594
1605
  setShowConsent(true);
@@ -11675,6 +11686,7 @@
11675
11686
  const CommodityDetail$1 = (_a) => {
11676
11687
  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;
11677
11688
  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"]);
11689
+ console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
11678
11690
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
11679
11691
  const { jumpToWeb, productView } = useEventReport();
11680
11692
  const curTimeRef = React.useRef(null);
@@ -11855,7 +11867,7 @@
11855
11867
  const renderBtn = () => {
11856
11868
  var _a, _b;
11857
11869
  const handleBtnClick = (e) => {
11858
- console.log('[CommodityDetail] Shop Now 按钮被点击', {
11870
+ console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
11859
11871
  product,
11860
11872
  cta,
11861
11873
  enableAddToCart,
@@ -11864,9 +11876,20 @@
11864
11876
  });
11865
11877
  handleLink(e);
11866
11878
  };
11879
+ console.log('[CommodityDetail] renderBtn 被调用', {
11880
+ ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
11881
+ buttonStyle
11882
+ });
11867
11883
  return (React.createElement(React.Fragment, null,
11868
- 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) => console.log('[CommodityDetail] mousedown 事件', e), onPointerDown: (e) => console.log('[CommodityDetail] pointerdown 事件', e), className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto' }) },
11869
- React.createElement("span", { dangerouslySetInnerHTML: {
11884
+ 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) => {
11885
+ console.log('[CommodityDetail] mousedown 事件触发!!!', e);
11886
+ e.stopPropagation();
11887
+ }, onPointerDown: (e) => {
11888
+ console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
11889
+ }, onTouchStart: (e) => {
11890
+ console.log('[CommodityDetail] touchstart 事件触发!!!', e);
11891
+ }, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
11892
+ React.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
11870
11893
  __html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
11871
11894
  } }))));
11872
11895
  };