pb-sxp-ui 1.0.2-alpha.1 → 1.0.3-alpha.1
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 +476 -411
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -115
- package/dist/index.js +476 -411
- 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 +476 -411
- 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/ExpandableText.js +2 -2
- package/es/core/components/SxpPageRender/index.js +1 -1
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +20 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +44 -21
- package/es/materials/sxp/popup/CommodityDetail/material.js +36 -1
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +167 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +11 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +6 -6
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +4 -8
- package/es/materials/sxp/popup/index.d.ts +0 -1
- package/es/materials/sxp/popup/index.js +0 -1
- package/lib/core/components/SxpPageRender/ExpandableText.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +20 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -20
- package/lib/materials/sxp/popup/CommodityDetail/material.js +36 -1
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +169 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +11 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +6 -6
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +4 -8
- package/lib/materials/sxp/popup/index.d.ts +0 -1
- package/lib/materials/sxp/popup/index.js +0 -1
- package/package.json +1 -1
@@ -47,7 +47,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
47
47
|
}, 100);
|
48
48
|
}
|
49
49
|
}, [multiRow, text, lineClamp, style, isPost]);
|
50
|
-
return (React.createElement("div", { className: className, style: Object.assign({}, style) },
|
50
|
+
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
51
51
|
React.createElement("div", { ref: multiRow, style: {
|
52
52
|
overflow: 'hidden',
|
53
53
|
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
@@ -55,7 +55,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
55
55
|
display: '-webkit-box',
|
56
56
|
WebkitBoxOrient: 'vertical',
|
57
57
|
wordBreak: 'break-word'
|
58
|
-
}, dangerouslySetInnerHTML: { __html: text
|
58
|
+
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
59
59
|
isShow && text && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick }, isShowMore ? unfoldText || 'show less' : foldText || 'show more'))));
|
60
60
|
};
|
61
61
|
export default memo(ExpandableText);
|
@@ -160,7 +160,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
160
160
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
|
161
161
|
var _a, _b, _c, _d, _e, _f;
|
162
162
|
const Component = withBindDataSource(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
|
163
|
-
return (React.createElement(Component, Object.assign({ key: index, textStyle: (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.textStyle, bindDatas: (_d = (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.bindDatas) !== null && _d !== void 0 ? _d : [] }, (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.props, { event: ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: { height: '100%', overflow: 'auto' }
|
163
|
+
return (React.createElement(Component, Object.assign({ key: index, textStyle: (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.textStyle, bindDatas: (_d = (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.bindDatas) !== null && _d !== void 0 ? _d : [] }, (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.props, { event: ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: { height: '100%', overflow: 'auto' } })));
|
164
164
|
});
|
165
165
|
}
|
166
166
|
return null;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import { IEditorContext } from '../../../../core/context/EditorContext';
|
3
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
4
|
import './index.less';
|
4
5
|
export interface ICommodityDetailProps {
|
5
6
|
content?: string;
|
@@ -9,6 +10,24 @@ export interface ICommodityDetailProps {
|
|
9
10
|
schema?: IEditorContext['schema'];
|
10
11
|
isDefault?: boolean;
|
11
12
|
bottom_image?: string;
|
13
|
+
tipText?: {
|
14
|
+
foldText?: string;
|
15
|
+
unfoldText?: string;
|
16
|
+
};
|
17
|
+
isPost?: boolean;
|
18
|
+
viewTime?: any;
|
19
|
+
rec?: RecItemType;
|
20
|
+
swiper: {
|
21
|
+
dotsAlign: 'left' | 'center';
|
22
|
+
delay: number;
|
23
|
+
};
|
24
|
+
commodityStyles?: {
|
25
|
+
title: CSSProperties;
|
26
|
+
collection: CSSProperties;
|
27
|
+
price: CSSProperties;
|
28
|
+
info: CSSProperties;
|
29
|
+
};
|
30
|
+
buttonStyle?: CSSProperties;
|
12
31
|
}
|
13
32
|
declare const _default: React.NamedExoticComponent<ICommodityDetailProps>;
|
14
33
|
export default _default;
|
@@ -1,24 +1,30 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
|
-
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
3
|
+
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
6
|
import { Autoplay, Pagination } from 'swiper/modules';
|
7
7
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
8
8
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
9
|
+
import Modal from '../../../../core/components/SxpPageRender/Modal';
|
10
|
+
import ExpandableText from '../../../../core/components/SxpPageRender/ExpandableText';
|
9
11
|
const CommodityDetail = (_a) => {
|
10
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
11
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image"]);
|
12
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
13
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle"]);
|
12
14
|
const { sxpParameter } = useSxpDataSource();
|
13
15
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
14
16
|
const { jumpToWeb, productView } = useEventReport();
|
15
17
|
const curTimeRef = useRef(null);
|
16
|
-
const
|
17
|
-
const
|
18
|
+
const [showModal, setShowModal] = useState(false);
|
19
|
+
const data = isPost ? rec : popupDetailData;
|
20
|
+
const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
21
|
+
const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
|
18
22
|
const handleLink = () => {
|
19
23
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
20
24
|
jumpToWeb(popupDetailData, product, cta);
|
21
|
-
|
25
|
+
if (!isPost) {
|
26
|
+
productView(data, product, cta, viewTime || curTimeRef.current);
|
27
|
+
}
|
22
28
|
window.location.href = window.getJointUtmLink(product.link);
|
23
29
|
}
|
24
30
|
};
|
@@ -44,11 +50,33 @@ const CommodityDetail = (_a) => {
|
|
44
50
|
}
|
45
51
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
46
52
|
const width = isPreview ? 375 : window.innerWidth;
|
53
|
+
const renderContent = ({ isPost }) => {
|
54
|
+
var _a, _b, _c;
|
55
|
+
return (React.createElement("div", { className: 'pb-commondity-content' },
|
56
|
+
React.createElement("div", { className: 'pb-commondity-content-collection', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock'),
|
57
|
+
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
58
|
+
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
59
|
+
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
60
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
61
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
62
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
63
|
+
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info })));
|
64
|
+
};
|
65
|
+
const renderBtn = () => {
|
66
|
+
var _a;
|
67
|
+
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website'))));
|
68
|
+
};
|
47
69
|
return (React.createElement("div", { className: 'pb-commondity' },
|
48
70
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
49
|
-
product && ((
|
50
|
-
|
51
|
-
|
71
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
72
|
+
clickable: true,
|
73
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
74
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
75
|
+
? 'commondityDetail-swiper-clickable-left'
|
76
|
+
: 'commondityDetail-swiper-clickable-center'
|
77
|
+
}, loop: true, autoplay: {
|
78
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
79
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
52
80
|
return (React.createElement(SwiperSlide, { key: src },
|
53
81
|
React.createElement("div", { style: {
|
54
82
|
overflow: 'hidden',
|
@@ -57,7 +85,7 @@ const CommodityDetail = (_a) => {
|
|
57
85
|
} },
|
58
86
|
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
59
87
|
}))),
|
60
|
-
!((
|
88
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
|
61
89
|
position: 'relative',
|
62
90
|
height: 0,
|
63
91
|
width: '100%',
|
@@ -70,16 +98,11 @@ const CommodityDetail = (_a) => {
|
|
70
98
|
top: 0,
|
71
99
|
objectFit: 'cover',
|
72
100
|
width: '100%'
|
73
|
-
}), src: (
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
80
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
81
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
82
|
-
18-karat gold, this necklace is embellished with hand-set diamonds.`))),
|
83
|
-
(isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn' }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Purchase on Website'))));
|
101
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
102
|
+
renderContent({ isPost })),
|
103
|
+
renderBtn(),
|
104
|
+
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
|
105
|
+
renderContent({ isPost: false }),
|
106
|
+
renderBtn())));
|
84
107
|
};
|
85
108
|
export default memo(CommodityDetail);
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import settingRender from './settingRender';
|
1
2
|
import CommodityDetailComponent from '.';
|
2
3
|
import { createMaterial } from '../../../../core/create';
|
3
4
|
const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
@@ -5,8 +6,42 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
5
6
|
icon: '',
|
6
7
|
category: 'popup',
|
7
8
|
type: 'CommodityDetail',
|
9
|
+
related: {
|
10
|
+
settingRender
|
11
|
+
},
|
8
12
|
defaulSetting: {
|
9
|
-
props: {
|
13
|
+
props: {
|
14
|
+
swiper: {
|
15
|
+
dotsAlign: 'center',
|
16
|
+
delay: 3
|
17
|
+
},
|
18
|
+
commodityStyles: {
|
19
|
+
price: {
|
20
|
+
color: '#000',
|
21
|
+
fontSize: 18
|
22
|
+
},
|
23
|
+
title: {
|
24
|
+
color: '#000',
|
25
|
+
fontSize: 23
|
26
|
+
},
|
27
|
+
collection: {
|
28
|
+
fontSize: 12,
|
29
|
+
color: '#000'
|
30
|
+
},
|
31
|
+
info: {
|
32
|
+
color: 'gray',
|
33
|
+
fontSize: 12
|
34
|
+
}
|
35
|
+
},
|
36
|
+
buttonStyle: {
|
37
|
+
backgroundColor: '#000',
|
38
|
+
fontSize: 12,
|
39
|
+
height: 45,
|
40
|
+
fontWeight: 'bold',
|
41
|
+
textAlign: 'center',
|
42
|
+
color: 'rgba(255, 255, 255, 0.9)'
|
43
|
+
}
|
44
|
+
},
|
10
45
|
style: {}
|
11
46
|
},
|
12
47
|
w: 100,
|
@@ -0,0 +1,134 @@
|
|
1
|
+
declare const _default: ({
|
2
|
+
title: string;
|
3
|
+
child: ({
|
4
|
+
type: string;
|
5
|
+
label: string;
|
6
|
+
options: {
|
7
|
+
label: string;
|
8
|
+
value: string;
|
9
|
+
}[];
|
10
|
+
name: string[];
|
11
|
+
addonAfter?: undefined;
|
12
|
+
} | {
|
13
|
+
type: string;
|
14
|
+
name: string[];
|
15
|
+
addonAfter: string;
|
16
|
+
label?: undefined;
|
17
|
+
options?: undefined;
|
18
|
+
})[];
|
19
|
+
} | {
|
20
|
+
title: string;
|
21
|
+
child: {
|
22
|
+
name: string[];
|
23
|
+
type: string;
|
24
|
+
child: ({
|
25
|
+
label: string;
|
26
|
+
type: string;
|
27
|
+
options: {
|
28
|
+
label: string;
|
29
|
+
value: string;
|
30
|
+
}[];
|
31
|
+
name: string[];
|
32
|
+
initialValue: string;
|
33
|
+
child?: undefined;
|
34
|
+
} | {
|
35
|
+
type: string;
|
36
|
+
label: string;
|
37
|
+
child: ({
|
38
|
+
type: string;
|
39
|
+
name: string[];
|
40
|
+
options?: undefined;
|
41
|
+
addonAfter?: undefined;
|
42
|
+
} | {
|
43
|
+
type: string;
|
44
|
+
options: {
|
45
|
+
label: string;
|
46
|
+
value: string;
|
47
|
+
}[];
|
48
|
+
name: string[];
|
49
|
+
addonAfter?: undefined;
|
50
|
+
} | {
|
51
|
+
type: string;
|
52
|
+
addonAfter: string;
|
53
|
+
name: string[];
|
54
|
+
options?: undefined;
|
55
|
+
})[];
|
56
|
+
options?: undefined;
|
57
|
+
name?: undefined;
|
58
|
+
initialValue?: undefined;
|
59
|
+
} | {
|
60
|
+
label: string;
|
61
|
+
type: string;
|
62
|
+
options?: undefined;
|
63
|
+
name?: undefined;
|
64
|
+
initialValue?: undefined;
|
65
|
+
child?: undefined;
|
66
|
+
} | {
|
67
|
+
label: string;
|
68
|
+
type: string;
|
69
|
+
name: string[];
|
70
|
+
options?: undefined;
|
71
|
+
initialValue?: undefined;
|
72
|
+
child?: undefined;
|
73
|
+
})[];
|
74
|
+
}[];
|
75
|
+
} | {
|
76
|
+
title: string;
|
77
|
+
child: ({
|
78
|
+
type: string;
|
79
|
+
label: string;
|
80
|
+
name: string[];
|
81
|
+
initialValue: string;
|
82
|
+
child?: undefined;
|
83
|
+
} | {
|
84
|
+
type: string;
|
85
|
+
label: string;
|
86
|
+
child: ({
|
87
|
+
type: string;
|
88
|
+
name: string[];
|
89
|
+
max: number;
|
90
|
+
addonAfter?: undefined;
|
91
|
+
} | {
|
92
|
+
type: string;
|
93
|
+
name: string[];
|
94
|
+
addonAfter: string;
|
95
|
+
max: number;
|
96
|
+
})[];
|
97
|
+
name?: undefined;
|
98
|
+
initialValue?: undefined;
|
99
|
+
} | {
|
100
|
+
type: string;
|
101
|
+
name: string[];
|
102
|
+
label?: undefined;
|
103
|
+
initialValue?: undefined;
|
104
|
+
child?: undefined;
|
105
|
+
} | {
|
106
|
+
type: string;
|
107
|
+
label: string;
|
108
|
+
child: ({
|
109
|
+
type: string;
|
110
|
+
name: string[];
|
111
|
+
initialValue: string;
|
112
|
+
options?: undefined;
|
113
|
+
addonAfter?: undefined;
|
114
|
+
} | {
|
115
|
+
type: string;
|
116
|
+
name: string[];
|
117
|
+
options: {
|
118
|
+
label: string;
|
119
|
+
value: string;
|
120
|
+
}[];
|
121
|
+
initialValue?: undefined;
|
122
|
+
addonAfter?: undefined;
|
123
|
+
} | {
|
124
|
+
type: string;
|
125
|
+
name: string[];
|
126
|
+
addonAfter: string;
|
127
|
+
initialValue?: undefined;
|
128
|
+
options?: undefined;
|
129
|
+
})[];
|
130
|
+
name?: undefined;
|
131
|
+
initialValue?: undefined;
|
132
|
+
})[];
|
133
|
+
})[];
|
134
|
+
export default _default;
|
@@ -0,0 +1,167 @@
|
|
1
|
+
export default [
|
2
|
+
{
|
3
|
+
title: '商品图片',
|
4
|
+
child: [
|
5
|
+
{
|
6
|
+
type: 'Radius',
|
7
|
+
label: '轮播指示器',
|
8
|
+
options: [
|
9
|
+
{
|
10
|
+
label: '居左',
|
11
|
+
value: 'left'
|
12
|
+
},
|
13
|
+
{
|
14
|
+
label: '居中',
|
15
|
+
value: 'center'
|
16
|
+
}
|
17
|
+
],
|
18
|
+
name: ['props', 'swiper', 'dotsAlign']
|
19
|
+
},
|
20
|
+
{
|
21
|
+
type: 'Number',
|
22
|
+
name: ['props', 'swiper', 'delay'],
|
23
|
+
addonAfter: 's'
|
24
|
+
}
|
25
|
+
]
|
26
|
+
},
|
27
|
+
{
|
28
|
+
title: '商品文本',
|
29
|
+
child: [
|
30
|
+
{
|
31
|
+
name: ['props', 'commodityStyles'],
|
32
|
+
type: 'SelectLinkage',
|
33
|
+
child: [
|
34
|
+
{
|
35
|
+
label: '字段',
|
36
|
+
type: 'Select',
|
37
|
+
options: [
|
38
|
+
{
|
39
|
+
label: '商品名称',
|
40
|
+
value: 'title'
|
41
|
+
},
|
42
|
+
{
|
43
|
+
label: '系列名称',
|
44
|
+
value: 'collection'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
label: '价格',
|
48
|
+
value: 'price'
|
49
|
+
},
|
50
|
+
{
|
51
|
+
label: '商品描述',
|
52
|
+
value: 'info'
|
53
|
+
}
|
54
|
+
],
|
55
|
+
name: ['props', 'commodityStyles', 'field'],
|
56
|
+
initialValue: 'title'
|
57
|
+
},
|
58
|
+
{
|
59
|
+
type: 'Group',
|
60
|
+
label: '标题字体',
|
61
|
+
child: [
|
62
|
+
{
|
63
|
+
type: 'Color',
|
64
|
+
name: ['color']
|
65
|
+
},
|
66
|
+
{
|
67
|
+
type: 'Select',
|
68
|
+
options: [{ label: '黑体', value: '黑体' }],
|
69
|
+
name: ['fontFamily']
|
70
|
+
},
|
71
|
+
{
|
72
|
+
type: 'Number',
|
73
|
+
addonAfter: 'px',
|
74
|
+
name: ['fontSize']
|
75
|
+
}
|
76
|
+
]
|
77
|
+
},
|
78
|
+
{
|
79
|
+
label: '标题样式',
|
80
|
+
type: 'TextStyle'
|
81
|
+
},
|
82
|
+
{
|
83
|
+
label: '标题对齐',
|
84
|
+
type: 'TextAlign'
|
85
|
+
},
|
86
|
+
{
|
87
|
+
label: '默认行数',
|
88
|
+
type: 'Number',
|
89
|
+
name: ['lineClamp']
|
90
|
+
}
|
91
|
+
]
|
92
|
+
}
|
93
|
+
]
|
94
|
+
},
|
95
|
+
{
|
96
|
+
title: '购买按钮样式',
|
97
|
+
child: [
|
98
|
+
{
|
99
|
+
type: 'Color',
|
100
|
+
label: '背景色',
|
101
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
102
|
+
initialValue: '#000'
|
103
|
+
},
|
104
|
+
{
|
105
|
+
type: 'Group',
|
106
|
+
label: '尺寸',
|
107
|
+
child: [
|
108
|
+
{
|
109
|
+
type: 'Number',
|
110
|
+
name: ['props', 'buttonStyle', 'height'],
|
111
|
+
addonAfter: 'H'
|
112
|
+
}
|
113
|
+
]
|
114
|
+
},
|
115
|
+
{
|
116
|
+
type: 'Group',
|
117
|
+
label: '圆角',
|
118
|
+
child: [
|
119
|
+
{
|
120
|
+
type: 'Slider',
|
121
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
122
|
+
max: 100
|
123
|
+
},
|
124
|
+
{
|
125
|
+
type: 'Number',
|
126
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
127
|
+
addonAfter: 'px',
|
128
|
+
max: 100
|
129
|
+
}
|
130
|
+
]
|
131
|
+
},
|
132
|
+
{
|
133
|
+
type: 'TextMargin',
|
134
|
+
name: ['props', 'buttonStyle']
|
135
|
+
},
|
136
|
+
{
|
137
|
+
type: 'Group',
|
138
|
+
label: '字体',
|
139
|
+
child: [
|
140
|
+
{
|
141
|
+
type: 'Color',
|
142
|
+
name: ['props', 'buttonStyle', 'color'],
|
143
|
+
initialValue: '#fff'
|
144
|
+
},
|
145
|
+
{
|
146
|
+
type: 'Select',
|
147
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
148
|
+
options: [{ label: '黑体', value: '黑体' }]
|
149
|
+
},
|
150
|
+
{
|
151
|
+
type: 'Number',
|
152
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
153
|
+
addonAfter: 'px'
|
154
|
+
}
|
155
|
+
]
|
156
|
+
},
|
157
|
+
{
|
158
|
+
type: 'TextStyle',
|
159
|
+
name: ['props', 'buttonStyle']
|
160
|
+
},
|
161
|
+
{
|
162
|
+
type: 'TextAlign',
|
163
|
+
name: ['props', 'buttonStyle']
|
164
|
+
}
|
165
|
+
]
|
166
|
+
}
|
167
|
+
];
|
@@ -79,7 +79,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
79
79
|
}
|
80
80
|
}
|
81
81
|
};
|
82
|
-
const productInfoText = () => {
|
82
|
+
const productInfoText = ({ isPost }) => {
|
83
83
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
84
84
|
React.createElement(ExpandableText, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
85
85
|
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
@@ -126,7 +126,7 @@ Made in Italy` })));
|
|
126
126
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
|
127
127
|
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: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin'),
|
128
128
|
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Shop now')),
|
129
|
-
productInfoText())),
|
130
|
-
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText())));
|
129
|
+
productInfoText({ isPost }))),
|
130
|
+
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
131
131
|
};
|
132
132
|
export default memo(CommodityDetailDiroNew);
|
@@ -39,6 +39,17 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
|
39
39
|
fontSize: 13,
|
40
40
|
textAlign: 'right'
|
41
41
|
}
|
42
|
+
},
|
43
|
+
buttonStyle: {
|
44
|
+
backgroundColor: '#000',
|
45
|
+
fontSize: 12,
|
46
|
+
height: 52,
|
47
|
+
fontWeight: 'bold',
|
48
|
+
textAlign: 'center',
|
49
|
+
color: '#fff',
|
50
|
+
borderRadius: 25,
|
51
|
+
marginTop: 16,
|
52
|
+
marginBottom: 16
|
42
53
|
}
|
43
54
|
},
|
44
55
|
style: {}
|
@@ -96,6 +96,12 @@ declare const _default: ({
|
|
96
96
|
})[];
|
97
97
|
name?: undefined;
|
98
98
|
initialValue?: undefined;
|
99
|
+
} | {
|
100
|
+
type: string;
|
101
|
+
name: string[];
|
102
|
+
label?: undefined;
|
103
|
+
initialValue?: undefined;
|
104
|
+
child?: undefined;
|
99
105
|
} | {
|
100
106
|
type: string;
|
101
107
|
label: string;
|
@@ -123,12 +129,6 @@ declare const _default: ({
|
|
123
129
|
})[];
|
124
130
|
name?: undefined;
|
125
131
|
initialValue?: undefined;
|
126
|
-
} | {
|
127
|
-
type: string;
|
128
|
-
name: string[];
|
129
|
-
label?: undefined;
|
130
|
-
initialValue?: undefined;
|
131
|
-
child?: undefined;
|
132
132
|
})[];
|
133
133
|
})[];
|
134
134
|
export default _default;
|
@@ -133,6 +133,10 @@ export default [
|
|
133
133
|
}
|
134
134
|
]
|
135
135
|
},
|
136
|
+
{
|
137
|
+
type: 'TextMargin',
|
138
|
+
name: ['props', 'buttonStyle']
|
139
|
+
},
|
136
140
|
{
|
137
141
|
type: 'Group',
|
138
142
|
label: '字体',
|
@@ -161,14 +165,6 @@ export default [
|
|
161
165
|
{
|
162
166
|
type: 'TextAlign',
|
163
167
|
name: ['props', 'buttonStyle']
|
164
|
-
},
|
165
|
-
{
|
166
|
-
type: 'TextSpace',
|
167
|
-
name: ['props', 'buttonStyle']
|
168
|
-
},
|
169
|
-
{
|
170
|
-
type: 'TextMargin',
|
171
|
-
name: ['props', 'buttonStyle']
|
172
168
|
}
|
173
169
|
]
|
174
170
|
}
|
@@ -50,7 +50,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
50
50
|
}, 100);
|
51
51
|
}
|
52
52
|
}, [multiRow, text, lineClamp, style, isPost]);
|
53
|
-
return (react_1.default.createElement("div", { className: className, style: Object.assign({}, style) },
|
53
|
+
return (react_1.default.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
54
54
|
react_1.default.createElement("div", { ref: multiRow, style: {
|
55
55
|
overflow: 'hidden',
|
56
56
|
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
@@ -58,7 +58,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
58
58
|
display: '-webkit-box',
|
59
59
|
WebkitBoxOrient: 'vertical',
|
60
60
|
wordBreak: 'break-word'
|
61
|
-
}, dangerouslySetInnerHTML: { __html: text
|
61
|
+
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
62
62
|
isShow && text && (react_1.default.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick }, isShowMore ? unfoldText || 'show less' : foldText || 'show more'))));
|
63
63
|
};
|
64
64
|
exports.default = (0, react_1.memo)(ExpandableText);
|