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/index.cjs +30 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -7
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +30 -7
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.js +12 -4
- package/es/materials/sxp/popup/CommodityDetail/index.js +15 -3
- package/lib/core/context/SxpDataSourceProvider.js +12 -4
- package/lib/materials/sxp/popup/CommodityDetail/index.js +15 -3
- package/package.json +1 -1
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);
|
|
@@ -11660,6 +11671,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
|
11660
11671
|
const CommodityDetail$1 = (_a) => {
|
|
11661
11672
|
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;
|
|
11662
11673
|
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"]);
|
|
11674
|
+
console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
|
|
11663
11675
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
|
11664
11676
|
const { jumpToWeb, productView } = useEventReport();
|
|
11665
11677
|
const curTimeRef = useRef(null);
|
|
@@ -11840,7 +11852,7 @@ const CommodityDetail$1 = (_a) => {
|
|
|
11840
11852
|
const renderBtn = () => {
|
|
11841
11853
|
var _a, _b;
|
|
11842
11854
|
const handleBtnClick = (e) => {
|
|
11843
|
-
console.log('[CommodityDetail] Shop Now
|
|
11855
|
+
console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
|
|
11844
11856
|
product,
|
|
11845
11857
|
cta,
|
|
11846
11858
|
enableAddToCart,
|
|
@@ -11849,9 +11861,20 @@ const CommodityDetail$1 = (_a) => {
|
|
|
11849
11861
|
});
|
|
11850
11862
|
handleLink(e);
|
|
11851
11863
|
};
|
|
11864
|
+
console.log('[CommodityDetail] renderBtn 被调用', {
|
|
11865
|
+
ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
11866
|
+
buttonStyle
|
|
11867
|
+
});
|
|
11852
11868
|
return (React.createElement(React.Fragment, null,
|
|
11853
|
-
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) =>
|
|
11854
|
-
|
|
11869
|
+
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) => {
|
|
11870
|
+
console.log('[CommodityDetail] mousedown 事件触发!!!', e);
|
|
11871
|
+
e.stopPropagation();
|
|
11872
|
+
}, onPointerDown: (e) => {
|
|
11873
|
+
console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
|
|
11874
|
+
}, onTouchStart: (e) => {
|
|
11875
|
+
console.log('[CommodityDetail] touchstart 事件触发!!!', e);
|
|
11876
|
+
}, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
|
|
11877
|
+
React.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
|
|
11855
11878
|
__html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
|
|
11856
11879
|
} }))));
|
|
11857
11880
|
};
|