pb-sxp-ui 1.20.24 → 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/index.js CHANGED
@@ -1124,7 +1124,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1124
1124
  return undefined;
1125
1125
  }
1126
1126
  setLoading(false);
1127
- 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 : []);
1127
+ 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 : []);
1128
1128
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
1129
1129
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1130
1130
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
@@ -1132,7 +1132,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1132
1132
  setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1133
1133
  }
1134
1134
  }
1135
- 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));
1135
+ 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));
1136
1136
  if (isNotNullList) {
1137
1137
  pageNum = pageNum + 1;
1138
1138
  yield recurveRecList(query);
@@ -1158,13 +1158,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1158
1158
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
1159
1159
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
1160
1160
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
1161
- 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));
1161
+ 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));
1162
1162
  if (!isNotNullList) {
1163
1163
  setIsNoMoreData(true);
1164
1164
  }
1165
1165
  }
1166
1166
  let list = [];
1167
- 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 : []);
1167
+ 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 : []);
1168
1168
  return Object.assign(Object.assign({}, result.data), { recList: list });
1169
1169
  }), [
1170
1170
  bffFetch,
@@ -1562,6 +1562,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1562
1562
  if (id) {
1563
1563
  curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
1564
1564
  if (curData) {
1565
+ // 找到对应的变体页面配置
1565
1566
  setPageData(curData);
1566
1567
  document.title = (_c = curData === null || curData === void 0 ? void 0 : curData.name) !== null && _c !== void 0 ? _c : 'home';
1567
1568
  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;
@@ -1569,11 +1570,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1569
1570
  onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
1570
1571
  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)
1571
1572
  setShowConsent(true);
1573
+ else
1574
+ setShowConsent(true);
1572
1575
  }
1573
1576
  else {
1577
+ // A/B测试或实验场景:找不到对应变体时,使用默认页面配置继续渲染
1578
+ 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`);
1579
+ // 使用默认globalConfig,不改变showConsent状态,让页面正常渲染
1580
+ gldata = globalConfig;
1574
1581
  setShowConsent(true);
1575
1582
  }
1576
1583
  }
1584
+ else {
1585
+ gldata = globalConfig;
1586
+ setShowConsent(true);
1587
+ }
1577
1588
  }
1578
1589
  else {
1579
1590
  setShowConsent(true);