pb-sxp-ui 1.2.9 → 1.3.0
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 +611 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +62 -2
- package/dist/index.js +611 -260
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +611 -260
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/FormatImage.js +19 -17
- package/es/core/components/SxpPageRender/Modal/index.js +33 -20
- package/es/core/components/SxpPageRender/Popup/index.js +2 -2
- package/es/core/components/SxpPageRender/ToggleButton/index.js +4 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +5 -14
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
- package/es/core/components/SxpPageRender/index.d.ts +6 -1
- package/es/core/components/SxpPageRender/index.js +46 -23
- package/es/core/components/SxpPageRender/typing.d.ts +2 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
- package/es/core/context/SxpDataSourceProvider.js +27 -30
- package/es/core/hooks/useEventReport.js +9 -8
- package/es/core/utils/tool.d.ts +5 -1
- package/es/core/utils/tool.js +69 -1
- package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
- package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
- package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
- package/es/materials/sxp/popup/Iframe/index.js +18 -0
- package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
- package/es/materials/sxp/popup/Iframe/material.js +21 -0
- package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
- package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
- package/es/materials/sxp/popup/index.d.ts +1 -0
- package/es/materials/sxp/popup/index.js +1 -0
- package/es/materials/sxp/template/Link/index.js +5 -11
- package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/Link/interactionRender.js +11 -0
- package/es/materials/sxp/template/Link/material.js +3 -1
- package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
- package/es/materials/sxp/template/components/EventProvider.js +3 -3
- package/lib/core/components/SxpPageRender/FormatImage.js +19 -17
- package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
- package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
- package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
- package/lib/core/components/SxpPageRender/index.d.ts +6 -1
- package/lib/core/components/SxpPageRender/index.js +46 -23
- package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
- package/lib/core/context/SxpDataSourceProvider.js +27 -30
- package/lib/core/hooks/useEventReport.js +9 -8
- package/lib/core/utils/tool.d.ts +5 -1
- package/lib/core/utils/tool.js +73 -1
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
- package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
- package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
- package/lib/materials/sxp/popup/Iframe/index.js +20 -0
- package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
- package/lib/materials/sxp/popup/Iframe/material.js +25 -0
- package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
- package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
- package/lib/materials/sxp/popup/index.d.ts +1 -0
- package/lib/materials/sxp/popup/index.js +1 -0
- package/lib/materials/sxp/template/Link/index.js +5 -11
- package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
- package/lib/materials/sxp/template/Link/material.js +3 -1
- package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
- package/lib/materials/sxp/template/components/EventProvider.js +3 -3
- package/package.json +1 -1
@@ -14,8 +14,8 @@ const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/componen
|
|
14
14
|
const tool_1 = require("../../../../core/utils/tool");
|
15
15
|
const CommodityGroup_1 = tslib_1.__importDefault(require("../../template/components/CommodityGroup"));
|
16
16
|
const CommodityDetailDiroNew = (_a) => {
|
17
|
-
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, _1;
|
18
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
17
|
+
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, _1, _2, _3, _4, _5, _6, _7, _8;
|
18
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
|
19
19
|
const [spread, setSpread] = (0, react_1.useState)(true);
|
20
20
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = (0, hooks_1.useSxpDataSource)();
|
21
21
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
@@ -24,6 +24,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
24
24
|
const [isTop, setIsTop] = (0, react_1.useState)(true);
|
25
25
|
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
26
26
|
const curTimeRef = (0, react_1.useRef)(null);
|
27
|
+
const [show3DModal, setShow3DModal] = (0, react_1.useState)(false);
|
27
28
|
const [checkCommodityIndex, setCheckCommodityIndex] = (0, react_1.useState)((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
28
29
|
const data = isPost ? rec : popupDetailData;
|
29
30
|
let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
|
@@ -74,7 +75,8 @@ const CommodityDetailDiroNew = (_a) => {
|
|
74
75
|
return '£102,300.00';
|
75
76
|
}
|
76
77
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
77
|
-
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
78
|
+
const width = (isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth) - ((_u = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _u !== void 0 ? _u : 0) * 2;
|
79
|
+
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
78
80
|
const handleClickCollapse = () => {
|
79
81
|
setSpread(!spread);
|
80
82
|
};
|
@@ -101,52 +103,69 @@ Made in Italy` })));
|
|
101
103
|
return;
|
102
104
|
return (react_1.default.createElement(CommodityGroup_1.default, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
|
103
105
|
}, [checkCommodityIndex]);
|
106
|
+
const getDotsAlign = (0, react_1.useMemo)(() => {
|
107
|
+
const dotsAlignClass = {
|
108
|
+
left: 'commondityDetail-swiper-clickable-left',
|
109
|
+
center: 'commondityDetail-swiper-clickable-center',
|
110
|
+
right: 'commondityDetail-swiper-clickable-right'
|
111
|
+
};
|
112
|
+
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
113
|
+
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
114
|
+
const iframeUrl = ((_w = (_v = data === null || data === void 0 ? void 0 : data.video) === null || _v === void 0 ? void 0 : _v.bindProduct) === null || _w === void 0 ? void 0 : _w.remark) || ((_z = (_y = (_x = data === null || data === void 0 ? void 0 : data.video) === null || _x === void 0 ? void 0 : _x.bindProducts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.remark) || ((_0 = data === null || data === void 0 ? void 0 : data.product) === null || _0 === void 0 ? void 0 : _0.remark);
|
104
115
|
return (react_1.default.createElement("div", { className: 'pb-commondityDiroNew' },
|
105
116
|
react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
117
|
+
react_1.default.createElement("div", { style: { position: 'relative' } },
|
118
|
+
product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
119
|
+
clickable: true,
|
120
|
+
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
121
|
+
clickableClass: getDotsAlign
|
122
|
+
}, loop: true, autoplay: {
|
123
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
124
|
+
} }, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
|
125
|
+
var _a;
|
126
|
+
return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
|
127
|
+
react_1.default.createElement("div", { style: {
|
128
|
+
overflow: 'hidden',
|
129
|
+
width,
|
130
|
+
height
|
131
|
+
} },
|
132
|
+
react_1.default.createElement(FormatImage_1.default, { style: {
|
133
|
+
height: '100%',
|
134
|
+
width: '100%',
|
135
|
+
objectFit: 'cover',
|
136
|
+
display: 'block',
|
137
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
138
|
+
}, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
|
139
|
+
}))),
|
140
|
+
!((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
|
141
|
+
height,
|
142
|
+
width
|
143
|
+
}) },
|
144
|
+
react_1.default.createElement("img", { className: (0, css_1.css)({
|
145
|
+
objectFit: 'cover',
|
146
|
+
width: '100%',
|
147
|
+
height: '100%'
|
148
|
+
}), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
|
149
|
+
(iframeUrl && iframeIcon) ||
|
150
|
+
(!product && iframeIcon && (react_1.default.createElement("div", { style: {
|
151
|
+
padding: '5px 10px',
|
152
|
+
display: 'flex',
|
153
|
+
alignItems: 'center',
|
154
|
+
position: 'absolute',
|
155
|
+
right: '10px',
|
156
|
+
bottom: '10px',
|
157
|
+
zIndex: 1,
|
158
|
+
background: '#fff',
|
159
|
+
borderRadius: '3px'
|
160
|
+
}, onClick: () => setShow3DModal(true) },
|
161
|
+
react_1.default.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
|
162
|
+
react_1.default.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
|
144
163
|
renderCommodityGroup(),
|
145
164
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
146
165
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
147
166
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
148
167
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
149
|
-
__html: (0, tool_1.setFontForText)((
|
168
|
+
__html: (0, tool_1.setFontForText)((_5 = product === null || product === void 0 ? void 0 : product.title) !== null && _5 !== void 0 ? _5 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
|
150
169
|
} }),
|
151
170
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
|
152
171
|
__html: (0, tool_1.setFontForText)((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -156,13 +175,20 @@ Made in Italy` })));
|
|
156
175
|
__html: (0, tool_1.setFontForText)(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
157
176
|
} }),
|
158
177
|
react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
159
|
-
__html: (0, tool_1.setFontForText)((
|
178
|
+
__html: (0, tool_1.setFontForText)((_6 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _6 !== void 0 ? _6 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
160
179
|
} }))),
|
161
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (
|
180
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_7 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _7 !== void 0 ? _7 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
|
162
181
|
react_1.default.createElement("span", { dangerouslySetInnerHTML: {
|
163
|
-
__html: (0, tool_1.setFontForText)((
|
182
|
+
__html: (0, tool_1.setFontForText)((_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', buttonStyle)
|
164
183
|
} }))),
|
165
184
|
productInfoText({ isPost }))),
|
166
|
-
react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))
|
185
|
+
react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
|
186
|
+
react_1.default.createElement(Modal_1.default, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
|
187
|
+
react_1.default.createElement("iframe", { src: iframeUrl, style: {
|
188
|
+
width: '100%',
|
189
|
+
height: 'calc(100% - 50px)',
|
190
|
+
marginTop: '40px',
|
191
|
+
border: 'none'
|
192
|
+
} }))));
|
167
193
|
};
|
168
194
|
exports.default = (0, react_1.memo)(CommodityDetailDiroNew);
|
@@ -1,6 +1,17 @@
|
|
1
1
|
declare const _default: ({
|
2
2
|
title: string;
|
3
3
|
child: ({
|
4
|
+
type: string;
|
5
|
+
label: string;
|
6
|
+
child: {
|
7
|
+
type: string;
|
8
|
+
name: string[];
|
9
|
+
addonAfter: string;
|
10
|
+
}[];
|
11
|
+
options?: undefined;
|
12
|
+
name?: undefined;
|
13
|
+
addonAfter?: undefined;
|
14
|
+
} | {
|
4
15
|
type: string;
|
5
16
|
label: string;
|
6
17
|
options: {
|
@@ -8,15 +19,15 @@ declare const _default: ({
|
|
8
19
|
value: string;
|
9
20
|
}[];
|
10
21
|
name: string[];
|
11
|
-
addonAfter?: undefined;
|
12
22
|
child?: undefined;
|
23
|
+
addonAfter?: undefined;
|
13
24
|
} | {
|
14
25
|
type: string;
|
15
26
|
name: string[];
|
16
27
|
addonAfter: string;
|
17
28
|
label?: undefined;
|
18
|
-
options?: undefined;
|
19
29
|
child?: undefined;
|
30
|
+
options?: undefined;
|
20
31
|
} | {
|
21
32
|
type: string;
|
22
33
|
child: {
|
@@ -183,5 +194,13 @@ declare const _default: ({
|
|
183
194
|
name?: undefined;
|
184
195
|
initialValue?: undefined;
|
185
196
|
})[];
|
197
|
+
} | {
|
198
|
+
title: string;
|
199
|
+
child: {
|
200
|
+
label: string;
|
201
|
+
type: string;
|
202
|
+
name: string[];
|
203
|
+
text: string;
|
204
|
+
}[];
|
186
205
|
})[];
|
187
206
|
export default _default;
|
@@ -1,9 +1,40 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = [
|
4
|
+
{
|
5
|
+
title: '弹窗背景',
|
6
|
+
child: [
|
7
|
+
{
|
8
|
+
type: 'Number',
|
9
|
+
label: '左右边距',
|
10
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
11
|
+
},
|
12
|
+
{
|
13
|
+
type: 'Number',
|
14
|
+
label: '下边距',
|
15
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
16
|
+
}
|
17
|
+
]
|
18
|
+
},
|
4
19
|
{
|
5
20
|
title: '商品图片',
|
6
21
|
child: [
|
22
|
+
{
|
23
|
+
type: 'Group',
|
24
|
+
label: '宽高比',
|
25
|
+
child: [
|
26
|
+
{
|
27
|
+
type: 'Number',
|
28
|
+
name: ['props', 'commodityImgRatio', 'w'],
|
29
|
+
addonAfter: 'w'
|
30
|
+
},
|
31
|
+
{
|
32
|
+
type: 'Number',
|
33
|
+
name: ['props', 'commodityImgRatio', 'h'],
|
34
|
+
addonAfter: 'h'
|
35
|
+
}
|
36
|
+
]
|
37
|
+
},
|
7
38
|
{
|
8
39
|
type: 'Radius',
|
9
40
|
label: '轮播指示器',
|
@@ -15,6 +46,10 @@ exports.default = [
|
|
15
46
|
{
|
16
47
|
label: '居中',
|
17
48
|
value: 'center'
|
49
|
+
},
|
50
|
+
{
|
51
|
+
label: '居右',
|
52
|
+
value: 'right'
|
18
53
|
}
|
19
54
|
],
|
20
55
|
name: ['props', 'swiper', 'dotsAlign']
|
@@ -245,5 +280,16 @@ exports.default = [
|
|
245
280
|
name: ['props', 'buttonStyle']
|
246
281
|
}
|
247
282
|
]
|
283
|
+
},
|
284
|
+
{
|
285
|
+
title: 'Iframe商品弹窗',
|
286
|
+
child: [
|
287
|
+
{
|
288
|
+
label: '弹窗按钮',
|
289
|
+
type: 'Upload',
|
290
|
+
name: ['props', 'iframeIcon'],
|
291
|
+
text: '建议尺寸:106 * 41'
|
292
|
+
}
|
293
|
+
]
|
248
294
|
}
|
249
295
|
];
|
@@ -1,6 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = [
|
4
|
+
{
|
5
|
+
title: '弹窗背景',
|
6
|
+
child: [
|
7
|
+
{
|
8
|
+
type: 'Number',
|
9
|
+
label: '左右边距',
|
10
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
11
|
+
},
|
12
|
+
{
|
13
|
+
type: 'Number',
|
14
|
+
label: '下边距',
|
15
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
16
|
+
}
|
17
|
+
]
|
18
|
+
},
|
4
19
|
{
|
5
20
|
title: '商品图片',
|
6
21
|
child: [
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
|
+
import './index.less';
|
3
|
+
export interface IIframeProps {
|
4
|
+
content?: string;
|
5
|
+
btnText?: string;
|
6
|
+
style?: Record<string, any>;
|
7
|
+
icon?: Record<string, any> | string;
|
8
|
+
isExternalLink?: boolean;
|
9
|
+
isPopup?: boolean;
|
10
|
+
onClose?: () => void;
|
11
|
+
onClick?: () => void;
|
12
|
+
submitButtonStyle?: CSSProperties;
|
13
|
+
contentStyle?: CSSProperties;
|
14
|
+
}
|
15
|
+
declare const _default: React.NamedExoticComponent<IIframeProps>;
|
16
|
+
export default _default;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const css_1 = require("@emotion/css");
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
+
require("./index.less");
|
7
|
+
const hooks_1 = require("../../../../core/hooks");
|
8
|
+
const Iframe = (_a) => {
|
9
|
+
var _b, _c;
|
10
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
|
11
|
+
const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
12
|
+
const iframeUrl = (_c = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindCta) === null || _c === void 0 ? void 0 : _c.remark;
|
13
|
+
return (react_1.default.createElement("div", Object.assign({ className: `${(0, css_1.css)(Object.assign({}, style))}` }, props), iframeUrl && (react_1.default.createElement("iframe", { src: iframeUrl, style: {
|
14
|
+
width: '100%',
|
15
|
+
height: 'calc(100% - 50px)',
|
16
|
+
marginTop: '40px',
|
17
|
+
border: 'none'
|
18
|
+
} }))));
|
19
|
+
};
|
20
|
+
exports.default = (0, react_1.memo)(Iframe);
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Iframe = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const settingRender_1 = tslib_1.__importDefault(require("./settingRender"));
|
6
|
+
const _1 = tslib_1.__importDefault(require("."));
|
7
|
+
const create_1 = require("../../../../core/create");
|
8
|
+
const Iframe = (0, create_1.createMaterial)(_1.default, {
|
9
|
+
displayName: 'Iframe弹窗',
|
10
|
+
icon: '',
|
11
|
+
category: 'popup',
|
12
|
+
type: 'Iframe',
|
13
|
+
related: {
|
14
|
+
settingRender: settingRender_1.default,
|
15
|
+
bindableProps: []
|
16
|
+
},
|
17
|
+
defaulSetting: {
|
18
|
+
props: {},
|
19
|
+
style: {}
|
20
|
+
},
|
21
|
+
w: 100,
|
22
|
+
h: 40,
|
23
|
+
sort: 3
|
24
|
+
});
|
25
|
+
exports.Iframe = Iframe;
|
@@ -2,7 +2,22 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = [
|
4
4
|
{
|
5
|
-
title: '',
|
5
|
+
title: '弹窗背景',
|
6
|
+
child: [
|
7
|
+
{
|
8
|
+
type: 'Number',
|
9
|
+
label: '左右边距',
|
10
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
11
|
+
},
|
12
|
+
{
|
13
|
+
type: 'Number',
|
14
|
+
label: '下边距',
|
15
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
16
|
+
}
|
17
|
+
]
|
18
|
+
},
|
19
|
+
{
|
20
|
+
title: '内容',
|
6
21
|
child: [
|
7
22
|
{
|
8
23
|
type: 'Media',
|
@@ -6,3 +6,4 @@ tslib_1.__exportStar(require("./CommodityDetail/material"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./Prompt/material"), exports);
|
7
7
|
tslib_1.__exportStar(require("./CommodityDetailDiroNew/material"), exports);
|
8
8
|
tslib_1.__exportStar(require("./CommodityList/material"), exports);
|
9
|
+
tslib_1.__exportStar(require("./Iframe/material"), exports);
|
@@ -10,21 +10,15 @@ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
|
10
10
|
const tool_1 = require("../../../../core/utils/tool");
|
11
11
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
12
12
|
const Link = (_a) => {
|
13
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
13
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
14
14
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
|
15
15
|
const { sxpParameter, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
16
16
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
17
17
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
18
18
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
19
|
-
const handleTo = () => {
|
20
|
-
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
21
|
-
jumpToWeb(recData, product, cta, index);
|
22
|
-
window.location.href = window.getJointUtmLink(cta.link);
|
23
|
-
}
|
24
|
-
};
|
25
19
|
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
26
|
-
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, {
|
27
|
-
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (
|
20
|
+
return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
|
21
|
+
react_1.default.createElement(Img_1.default, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
28
22
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
29
23
|
display: 'flex',
|
30
24
|
alignItems: 'center',
|
@@ -33,9 +27,9 @@ const Link = (_a) => {
|
|
33
27
|
}) },
|
34
28
|
react_1.default.createElement("div", null,
|
35
29
|
react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
|
36
|
-
__html: (0, tool_1.setFontForText)((
|
30
|
+
__html: (0, tool_1.setFontForText)((_j = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
37
31
|
} }),
|
38
|
-
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((
|
32
|
+
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_k = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _k === void 0 ? void 0 : _k.height) + 'px' }), className: index_module_less_1.default['one-line-ellipsis'], dangerouslySetInnerHTML: {
|
39
33
|
__html: (0, tool_1.setFontForText)(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
|
40
34
|
} }))))));
|
41
35
|
};
|
@@ -7,6 +7,7 @@ const settingRender_1 = tslib_1.__importDefault(require("../components/settingRe
|
|
7
7
|
const settingRender_2 = tslib_1.__importDefault(require("./settingRender"));
|
8
8
|
const _1 = tslib_1.__importDefault(require("."));
|
9
9
|
const create_1 = require("../../../../core/create");
|
10
|
+
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
10
11
|
const Link = (0, create_1.createMaterial)(_1.default, {
|
11
12
|
displayName: '跳转指引',
|
12
13
|
icon: '',
|
@@ -14,7 +15,8 @@ const Link = (0, create_1.createMaterial)(_1.default, {
|
|
14
15
|
type: 'Link',
|
15
16
|
related: {
|
16
17
|
settingRender: (_a = settingRender_1.default === null || settingRender_1.default === void 0 ? void 0 : settingRender_1.default.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(settingRender_2.default),
|
17
|
-
bindableProps: []
|
18
|
+
bindableProps: [],
|
19
|
+
interactionRender: interactionRender_1.default
|
18
20
|
},
|
19
21
|
defaulSetting: {
|
20
22
|
props: {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
|
-
export interface
|
3
|
+
export interface IEventProviderProps {
|
4
4
|
rec?: RecItemType;
|
5
5
|
children: any;
|
6
6
|
className?: any;
|
@@ -8,6 +8,7 @@ export interface IImgProps {
|
|
8
8
|
style?: CSSProperties;
|
9
9
|
isExternalLink?: boolean;
|
10
10
|
index?: number;
|
11
|
+
jumpLink?: string;
|
11
12
|
}
|
12
|
-
declare const _default: React.NamedExoticComponent<
|
13
|
+
declare const _default: React.NamedExoticComponent<IEventProviderProps>;
|
13
14
|
export default _default;
|
@@ -6,7 +6,7 @@ const lodash_1 = require("lodash");
|
|
6
6
|
const hooks_1 = require("../../../../core/hooks");
|
7
7
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
8
8
|
const EventProvider = (_a) => {
|
9
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
9
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
|
10
10
|
const ref = (0, react_1.useRef)(null);
|
11
11
|
const { popup } = (0, hooks_1.useEditor)();
|
12
12
|
const { setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
@@ -20,11 +20,11 @@ const EventProvider = (_a) => {
|
|
20
20
|
}, rec, item, index);
|
21
21
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
22
22
|
if (isExternalLink) {
|
23
|
-
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
23
|
+
if (jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link)) {
|
24
24
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
25
25
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
26
26
|
jumpToWeb(rec, product, cta, index);
|
27
|
-
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
27
|
+
window.location.href = window.getJointUtmLink(jumpLink || ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link) || '');
|
28
28
|
}
|
29
29
|
}
|
30
30
|
else {
|