pb-sxp-ui 14.0.2 → 14.0.3

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
@@ -749,8 +749,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
749
749
  }
750
750
  setLoading(false);
751
751
  list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
752
- setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
753
- setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
752
+ if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
753
+ setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
754
+ setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
755
+ }
754
756
  const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
755
757
  if (isNotNullList) {
756
758
  pageNum = pageNum + 1;
@@ -760,7 +762,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
760
762
  yield recurveRecList(query);
761
763
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
762
764
  setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
763
- return Object.assign(Object.assign({}, result.data), { recList: list });
765
+ return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
764
766
  }
765
767
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
766
768
  query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
@@ -815,7 +817,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
815
817
  return expire;
816
818
  }, [data]);
817
819
  const bffEventReport = React.useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
818
- var _a;
820
+ var _a, _b;
819
821
  // 关闭 BFF 事件上报
820
822
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
821
823
  return;
@@ -828,7 +830,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
828
830
  };
829
831
  }
830
832
  const sessionID = storeAndLoadFeSessionId();
831
- const ef = Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, { playbookType }), (layoutVariantId && reportLayId && { layoutVariantId })), eventInfo), ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) && channel && { position: Number(eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) + 1 + '' }));
833
+ const urlParams = new URLSearchParams((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.search);
834
+ const cl_source = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('cl_source');
835
+ const ef = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, { playbookType }), (layoutVariantId && reportLayId && { layoutVariantId })), eventInfo), ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) && channel && { position: Number(eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.position) + 1 + '' })), (cl_source && { cl_source }));
832
836
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
833
837
  const realEventInfo = Object.entries(ef)
834
838
  .map(([k, v]) => v && { name: k, value: v })
@@ -837,7 +841,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
837
841
  console.log('userInfo:', userInfo);
838
842
  console.log('eventInfo:', ef);
839
843
  console.log('========= 结束 =========');
840
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
844
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
841
845
  method: 'POST',
842
846
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
843
847
  type: 'beacon'
@@ -860,7 +864,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
860
864
  !((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
861
865
  return;
862
866
  }
863
- let jsonParams = lodash.cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
867
+ const jsonParams = lodash.cloneDeep((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]);
864
868
  const urlParams = new URLSearchParams(window.location.search);
865
869
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
866
870
  const fix_par = {