pb-sxp-ui 1.2.10 → 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 +595 -308
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +62 -2
- package/dist/index.js +595 -308
- 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 +595 -308
- 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 +1 -1
- 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/HashTag/settingRender.d.ts +7 -6
- package/es/materials/sxp/HashTag/settingRender.js +0 -9
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +0 -5
- package/es/materials/sxp/cta/AniLink/settingRender.js +0 -4
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +5 -8
- package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -12
- 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 +19 -6
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +45 -8
- 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 +19 -6
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +45 -8
- package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -4
- 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 -11
- 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/Link/settingRender.js +0 -5
- 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 +1 -1
- 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/HashTag/settingRender.d.ts +7 -6
- package/lib/materials/sxp/HashTag/settingRender.js +0 -9
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +0 -5
- package/lib/materials/sxp/cta/AniLink/settingRender.js +0 -4
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +5 -8
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -12
- 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 +19 -6
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +45 -8
- 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 +19 -6
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +45 -8
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -4
- 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 -11
- 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/Link/settingRender.js +0 -5
- 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
@@ -12,8 +12,8 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
|
12
12
|
import { setFontForText } from '../../../../core/utils/tool';
|
13
13
|
import CommodityGroup from '../../template/components/CommodityGroup';
|
14
14
|
const CommodityDetailDiroNew = (_a) => {
|
15
|
-
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;
|
16
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
|
15
|
+
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;
|
16
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
|
17
17
|
const [spread, setSpread] = useState(true);
|
18
18
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
|
19
19
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -22,6 +22,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
22
22
|
const [isTop, setIsTop] = useState(true);
|
23
23
|
const [showModal, setShowModal] = useState(false);
|
24
24
|
const curTimeRef = useRef(null);
|
25
|
+
const [show3DModal, setShow3DModal] = useState(false);
|
25
26
|
const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
|
26
27
|
const data = isPost ? rec : popupDetailData;
|
27
28
|
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];
|
@@ -72,7 +73,8 @@ const CommodityDetailDiroNew = (_a) => {
|
|
72
73
|
return '£102,300.00';
|
73
74
|
}
|
74
75
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
75
|
-
const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
|
76
|
+
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;
|
77
|
+
const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
|
76
78
|
const handleClickCollapse = () => {
|
77
79
|
setSpread(!spread);
|
78
80
|
};
|
@@ -99,52 +101,69 @@ Made in Italy` })));
|
|
99
101
|
return;
|
100
102
|
return (React.createElement(CommodityGroup, { 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 }));
|
101
103
|
}, [checkCommodityIndex]);
|
104
|
+
const getDotsAlign = useMemo(() => {
|
105
|
+
const dotsAlignClass = {
|
106
|
+
left: 'commondityDetail-swiper-clickable-left',
|
107
|
+
center: 'commondityDetail-swiper-clickable-center',
|
108
|
+
right: 'commondityDetail-swiper-clickable-right'
|
109
|
+
};
|
110
|
+
return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
|
111
|
+
}, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
|
112
|
+
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);
|
102
113
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
103
114
|
React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
|
104
|
-
|
105
|
-
|
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
|
-
|
115
|
+
React.createElement("div", { style: { position: 'relative' } },
|
116
|
+
product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
117
|
+
clickable: true,
|
118
|
+
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
119
|
+
clickableClass: getDotsAlign
|
120
|
+
}, loop: true, autoplay: {
|
121
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
122
|
+
} }, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
|
123
|
+
var _a;
|
124
|
+
return (React.createElement(SwiperSlide, { key: src },
|
125
|
+
React.createElement("div", { style: {
|
126
|
+
overflow: 'hidden',
|
127
|
+
width,
|
128
|
+
height
|
129
|
+
} },
|
130
|
+
React.createElement(FormatImage, { style: {
|
131
|
+
height: '100%',
|
132
|
+
width: '100%',
|
133
|
+
objectFit: 'cover',
|
134
|
+
display: 'block',
|
135
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
136
|
+
}, 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 }))));
|
137
|
+
}))),
|
138
|
+
!((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css({
|
139
|
+
height,
|
140
|
+
width
|
141
|
+
}) },
|
142
|
+
React.createElement("img", { className: css({
|
143
|
+
objectFit: 'cover',
|
144
|
+
width: '100%',
|
145
|
+
height: '100%'
|
146
|
+
}), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
|
147
|
+
(iframeUrl && iframeIcon) ||
|
148
|
+
(!product && iframeIcon && (React.createElement("div", { style: {
|
149
|
+
padding: '5px 10px',
|
150
|
+
display: 'flex',
|
151
|
+
alignItems: 'center',
|
152
|
+
position: 'absolute',
|
153
|
+
right: '10px',
|
154
|
+
bottom: '10px',
|
155
|
+
zIndex: 1,
|
156
|
+
background: '#fff',
|
157
|
+
borderRadius: '3px'
|
158
|
+
}, onClick: () => setShow3DModal(true) },
|
159
|
+
React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
|
160
|
+
React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
|
142
161
|
renderCommodityGroup(),
|
143
162
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
144
163
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
145
164
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
146
165
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
|
147
|
-
__html: setFontForText((
|
166
|
+
__html: 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)
|
148
167
|
} }),
|
149
168
|
React.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: {
|
150
169
|
__html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
|
@@ -154,13 +173,20 @@ Made in Italy` })));
|
|
154
173
|
__html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
|
155
174
|
} }),
|
156
175
|
React.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: {
|
157
|
-
__html: setFontForText((
|
176
|
+
__html: 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)
|
158
177
|
} }))),
|
159
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (
|
178
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.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 },
|
160
179
|
React.createElement("span", { dangerouslySetInnerHTML: {
|
161
|
-
__html: setFontForText((
|
180
|
+
__html: setFontForText((_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', buttonStyle)
|
162
181
|
} }))),
|
163
182
|
productInfoText({ isPost }))),
|
164
|
-
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))
|
183
|
+
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
|
184
|
+
React.createElement(Modal, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
|
185
|
+
React.createElement("iframe", { src: iframeUrl, style: {
|
186
|
+
width: '100%',
|
187
|
+
height: 'calc(100% - 50px)',
|
188
|
+
marginTop: '40px',
|
189
|
+
border: 'none'
|
190
|
+
} }))));
|
165
191
|
};
|
166
192
|
export default 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: {
|
@@ -182,12 +193,14 @@ declare const _default: ({
|
|
182
193
|
})[];
|
183
194
|
name?: undefined;
|
184
195
|
initialValue?: undefined;
|
185
|
-
}
|
196
|
+
})[];
|
197
|
+
} | {
|
198
|
+
title: string;
|
199
|
+
child: {
|
186
200
|
label: string;
|
187
201
|
type: string;
|
188
202
|
name: string[];
|
189
|
-
|
190
|
-
|
191
|
-
})[];
|
203
|
+
text: string;
|
204
|
+
}[];
|
192
205
|
})[];
|
193
206
|
export default _default;
|
@@ -1,7 +1,38 @@
|
|
1
1
|
export default [
|
2
|
+
{
|
3
|
+
title: '弹窗背景',
|
4
|
+
child: [
|
5
|
+
{
|
6
|
+
type: 'Number',
|
7
|
+
label: '左右边距',
|
8
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
9
|
+
},
|
10
|
+
{
|
11
|
+
type: 'Number',
|
12
|
+
label: '下边距',
|
13
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
2
17
|
{
|
3
18
|
title: '商品图片',
|
4
19
|
child: [
|
20
|
+
{
|
21
|
+
type: 'Group',
|
22
|
+
label: '宽高比',
|
23
|
+
child: [
|
24
|
+
{
|
25
|
+
type: 'Number',
|
26
|
+
name: ['props', 'commodityImgRatio', 'w'],
|
27
|
+
addonAfter: 'w'
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'Number',
|
31
|
+
name: ['props', 'commodityImgRatio', 'h'],
|
32
|
+
addonAfter: 'h'
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
5
36
|
{
|
6
37
|
type: 'Radius',
|
7
38
|
label: '轮播指示器',
|
@@ -13,6 +44,10 @@ export default [
|
|
13
44
|
{
|
14
45
|
label: '居中',
|
15
46
|
value: 'center'
|
47
|
+
},
|
48
|
+
{
|
49
|
+
label: '居右',
|
50
|
+
value: 'right'
|
16
51
|
}
|
17
52
|
],
|
18
53
|
name: ['props', 'swiper', 'dotsAlign']
|
@@ -156,10 +191,6 @@ export default [
|
|
156
191
|
label: '默认行数',
|
157
192
|
type: 'Number',
|
158
193
|
name: ['lineClamp']
|
159
|
-
},
|
160
|
-
{
|
161
|
-
label: '间距',
|
162
|
-
type: 'TextSpace'
|
163
194
|
}
|
164
195
|
]
|
165
196
|
}
|
@@ -245,11 +276,17 @@ export default [
|
|
245
276
|
{
|
246
277
|
type: 'TextAlign',
|
247
278
|
name: ['props', 'buttonStyle']
|
248
|
-
}
|
279
|
+
}
|
280
|
+
]
|
281
|
+
},
|
282
|
+
{
|
283
|
+
title: 'Iframe商品弹窗',
|
284
|
+
child: [
|
249
285
|
{
|
250
|
-
label: '
|
251
|
-
type: '
|
252
|
-
name: ['props', '
|
286
|
+
label: '弹窗按钮',
|
287
|
+
type: 'Upload',
|
288
|
+
name: ['props', 'iframeIcon'],
|
289
|
+
text: '建议尺寸:106 * 41'
|
253
290
|
}
|
254
291
|
]
|
255
292
|
}
|
@@ -1,4 +1,19 @@
|
|
1
1
|
export default [
|
2
|
+
{
|
3
|
+
title: '弹窗背景',
|
4
|
+
child: [
|
5
|
+
{
|
6
|
+
type: 'Number',
|
7
|
+
label: '左右边距',
|
8
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
9
|
+
},
|
10
|
+
{
|
11
|
+
type: 'Number',
|
12
|
+
label: '下边距',
|
13
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
2
17
|
{
|
3
18
|
title: '商品图片',
|
4
19
|
child: [
|
@@ -116,10 +131,6 @@ export default [
|
|
116
131
|
{
|
117
132
|
label: '标题对齐',
|
118
133
|
type: 'TextAlign'
|
119
|
-
},
|
120
|
-
{
|
121
|
-
label: '间距',
|
122
|
-
type: 'TextSpace'
|
123
134
|
}
|
124
135
|
]
|
125
136
|
}
|
@@ -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,18 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo } from 'react';
|
4
|
+
import './index.less';
|
5
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
6
|
+
const Iframe = (_a) => {
|
7
|
+
var _b, _c;
|
8
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
|
9
|
+
const { popupDetailData } = useSxpDataSource();
|
10
|
+
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;
|
11
|
+
return (React.createElement("div", Object.assign({ className: `${css(Object.assign({}, style))}` }, props), iframeUrl && (React.createElement("iframe", { src: iframeUrl, style: {
|
12
|
+
width: '100%',
|
13
|
+
height: 'calc(100% - 50px)',
|
14
|
+
marginTop: '40px',
|
15
|
+
border: 'none'
|
16
|
+
} }))));
|
17
|
+
};
|
18
|
+
export default memo(Iframe);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import settingRender from './settingRender';
|
2
|
+
import IframeComponent from '.';
|
3
|
+
import { createMaterial } from '../../../../core/create';
|
4
|
+
const Iframe = createMaterial(IframeComponent, {
|
5
|
+
displayName: 'Iframe弹窗',
|
6
|
+
icon: '',
|
7
|
+
category: 'popup',
|
8
|
+
type: 'Iframe',
|
9
|
+
related: {
|
10
|
+
settingRender,
|
11
|
+
bindableProps: []
|
12
|
+
},
|
13
|
+
defaulSetting: {
|
14
|
+
props: {},
|
15
|
+
style: {}
|
16
|
+
},
|
17
|
+
w: 100,
|
18
|
+
h: 40,
|
19
|
+
sort: 3
|
20
|
+
});
|
21
|
+
export { Iframe };
|
@@ -1,6 +1,21 @@
|
|
1
1
|
export default [
|
2
2
|
{
|
3
|
-
title: '',
|
3
|
+
title: '弹窗背景',
|
4
|
+
child: [
|
5
|
+
{
|
6
|
+
type: 'Number',
|
7
|
+
label: '左右边距',
|
8
|
+
name: ['props', 'popupBg', 'horizontalMargin']
|
9
|
+
},
|
10
|
+
{
|
11
|
+
type: 'Number',
|
12
|
+
label: '下边距',
|
13
|
+
name: ['props', 'popupBg', 'bottomMargin']
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
17
|
+
{
|
18
|
+
title: '内容',
|
4
19
|
child: [
|
5
20
|
{
|
6
21
|
type: 'Media',
|
@@ -46,11 +61,6 @@ export default [
|
|
46
61
|
}
|
47
62
|
]
|
48
63
|
},
|
49
|
-
{
|
50
|
-
label: '内容字体间距',
|
51
|
-
type: 'TextSpace',
|
52
|
-
name: ['props', 'contentStyle']
|
53
|
-
},
|
54
64
|
{
|
55
65
|
type: 'Group',
|
56
66
|
label: '提交按钮字体',
|
@@ -84,11 +94,6 @@ export default [
|
|
84
94
|
}
|
85
95
|
]
|
86
96
|
},
|
87
|
-
{
|
88
|
-
label: '提交按钮间距',
|
89
|
-
type: 'TextSpace',
|
90
|
-
name: ['props', 'submitButtonStyle']
|
91
|
-
},
|
92
97
|
{
|
93
98
|
type: 'TextStyle',
|
94
99
|
name: ['props', 'submitButtonStyle']
|
@@ -8,21 +8,15 @@ import Img from '../components/Img';
|
|
8
8
|
import { setFontForText } from '../../../../core/utils/tool';
|
9
9
|
import styles from './index.module.less';
|
10
10
|
const Link = (_a) => {
|
11
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
11
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
12
12
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
|
13
13
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
14
14
|
const { jumpToWeb } = useEventReport();
|
15
15
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
16
16
|
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
17
|
-
const handleTo = () => {
|
18
|
-
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
19
|
-
jumpToWeb(recData, product, cta, index);
|
20
|
-
window.location.href = window.getJointUtmLink(cta.link);
|
21
|
-
}
|
22
|
-
};
|
23
17
|
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;
|
24
|
-
return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, {
|
25
|
-
React.createElement(Img, { src: src, rec: recData, item: (
|
18
|
+
return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, className: 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 : '' }),
|
19
|
+
React.createElement(Img, { 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 }),
|
26
20
|
React.createElement("div", { className: css({
|
27
21
|
display: 'flex',
|
28
22
|
alignItems: 'center',
|
@@ -31,9 +25,9 @@ const Link = (_a) => {
|
|
31
25
|
}) },
|
32
26
|
React.createElement("div", null,
|
33
27
|
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
|
34
|
-
__html: setFontForText((
|
28
|
+
__html: 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)
|
35
29
|
} }),
|
36
|
-
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((
|
30
|
+
(customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.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: styles['one-line-ellipsis'], dangerouslySetInnerHTML: {
|
37
31
|
__html: setFontForText(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
|
38
32
|
} }))))));
|
39
33
|
};
|
@@ -3,6 +3,7 @@ import settingRender from '../components/settingRender';
|
|
3
3
|
import linkSettingRender from './settingRender';
|
4
4
|
import LinkComponent from '.';
|
5
5
|
import { createMaterial } from '../../../../core/create';
|
6
|
+
import interactionRender from './interactionRender';
|
6
7
|
const Link = createMaterial(LinkComponent, {
|
7
8
|
displayName: '跳转指引',
|
8
9
|
icon: '',
|
@@ -10,7 +11,8 @@ const Link = createMaterial(LinkComponent, {
|
|
10
11
|
type: 'Link',
|
11
12
|
related: {
|
12
13
|
settingRender: (_a = settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
|
13
|
-
bindableProps: []
|
14
|
+
bindableProps: [],
|
15
|
+
interactionRender
|
14
16
|
},
|
15
17
|
defaulSetting: {
|
16
18
|
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;
|
@@ -4,7 +4,7 @@ import { throttle } from 'lodash';
|
|
4
4
|
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
6
|
const EventProvider = (_a) => {
|
7
|
-
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
7
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
|
8
8
|
const ref = useRef(null);
|
9
9
|
const { popup } = useEditor();
|
10
10
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
@@ -18,11 +18,11 @@ const EventProvider = (_a) => {
|
|
18
18
|
}, rec, item, index);
|
19
19
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
20
20
|
if (isExternalLink) {
|
21
|
-
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) {
|
21
|
+
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)) {
|
22
22
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
23
23
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
24
24
|
jumpToWeb(rec, product, cta, index);
|
25
|
-
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);
|
25
|
+
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) || '');
|
26
26
|
}
|
27
27
|
}
|
28
28
|
else {
|