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
package/dist/pb-ui.js
CHANGED
@@ -882,7 +882,7 @@
|
|
882
882
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
|
883
883
|
*
|
884
884
|
*/
|
885
|
-
var settingRender$
|
885
|
+
var settingRender$4 = [
|
886
886
|
{
|
887
887
|
type: 'Text',
|
888
888
|
label: '组件名称',
|
@@ -1071,7 +1071,7 @@
|
|
1071
1071
|
category: 'popup',
|
1072
1072
|
type: 'AppointForm',
|
1073
1073
|
related: {
|
1074
|
-
settingRender: settingRender$
|
1074
|
+
settingRender: settingRender$4,
|
1075
1075
|
bindableProps: [],
|
1076
1076
|
interactionRender: interactionRender$8
|
1077
1077
|
},
|
@@ -1097,6 +1097,190 @@
|
|
1097
1097
|
sort: 2
|
1098
1098
|
});
|
1099
1099
|
|
1100
|
+
/*
|
1101
|
+
* @Author: binruan@chatlabs.com
|
1102
|
+
* @Date: 2024-04-02 18:01:34
|
1103
|
+
* @LastEditors: binruan@chatlabs.com
|
1104
|
+
* @LastEditTime: 2024-04-02 18:01:41
|
1105
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiro\settingRender.tsx
|
1106
|
+
*
|
1107
|
+
*/
|
1108
|
+
/*
|
1109
|
+
* @Author: binruan@chatlabs.com
|
1110
|
+
* @Date: 2024-03-26 16:50:25
|
1111
|
+
* @LastEditors: binruan@chatlabs.com
|
1112
|
+
* @LastEditTime: 2024-03-28 18:42:26
|
1113
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
1114
|
+
*
|
1115
|
+
*/
|
1116
|
+
var settingRender$3 = [
|
1117
|
+
{
|
1118
|
+
title: '商品图片',
|
1119
|
+
child: [
|
1120
|
+
{
|
1121
|
+
type: 'Radius',
|
1122
|
+
label: '轮播指示器',
|
1123
|
+
options: [
|
1124
|
+
{
|
1125
|
+
label: '居左',
|
1126
|
+
value: 'left'
|
1127
|
+
},
|
1128
|
+
{
|
1129
|
+
label: '居中',
|
1130
|
+
value: 'center'
|
1131
|
+
}
|
1132
|
+
],
|
1133
|
+
name: ['props', 'swiper', 'dotsAlign']
|
1134
|
+
},
|
1135
|
+
{
|
1136
|
+
type: 'Number',
|
1137
|
+
name: ['props', 'swiper', 'delay'],
|
1138
|
+
addonAfter: 's'
|
1139
|
+
}
|
1140
|
+
]
|
1141
|
+
},
|
1142
|
+
{
|
1143
|
+
title: '商品文本',
|
1144
|
+
child: [
|
1145
|
+
{
|
1146
|
+
name: ['props', 'commodityStyles'],
|
1147
|
+
type: 'SelectLinkage',
|
1148
|
+
child: [
|
1149
|
+
{
|
1150
|
+
label: '字段',
|
1151
|
+
type: 'Select',
|
1152
|
+
options: [
|
1153
|
+
{
|
1154
|
+
label: '商品名称',
|
1155
|
+
value: 'title'
|
1156
|
+
},
|
1157
|
+
{
|
1158
|
+
label: '系列名称',
|
1159
|
+
value: 'collection'
|
1160
|
+
},
|
1161
|
+
{
|
1162
|
+
label: '价格',
|
1163
|
+
value: 'price'
|
1164
|
+
},
|
1165
|
+
{
|
1166
|
+
label: '商品描述',
|
1167
|
+
value: 'info'
|
1168
|
+
}
|
1169
|
+
],
|
1170
|
+
name: ['props', 'commodityStyles', 'field'],
|
1171
|
+
initialValue: 'title'
|
1172
|
+
},
|
1173
|
+
{
|
1174
|
+
type: 'Group',
|
1175
|
+
label: '标题字体',
|
1176
|
+
child: [
|
1177
|
+
{
|
1178
|
+
type: 'Color',
|
1179
|
+
name: ['color']
|
1180
|
+
},
|
1181
|
+
{
|
1182
|
+
type: 'Select',
|
1183
|
+
options: [{ label: '黑体', value: '黑体' }],
|
1184
|
+
name: ['fontFamily']
|
1185
|
+
},
|
1186
|
+
{
|
1187
|
+
type: 'Number',
|
1188
|
+
addonAfter: 'px',
|
1189
|
+
name: ['fontSize']
|
1190
|
+
}
|
1191
|
+
]
|
1192
|
+
},
|
1193
|
+
{
|
1194
|
+
label: '标题样式',
|
1195
|
+
type: 'TextStyle'
|
1196
|
+
},
|
1197
|
+
{
|
1198
|
+
label: '标题对齐',
|
1199
|
+
type: 'TextAlign'
|
1200
|
+
},
|
1201
|
+
{
|
1202
|
+
label: '默认行数',
|
1203
|
+
type: 'Number',
|
1204
|
+
name: ['lineClamp']
|
1205
|
+
}
|
1206
|
+
]
|
1207
|
+
}
|
1208
|
+
]
|
1209
|
+
},
|
1210
|
+
{
|
1211
|
+
title: '购买按钮样式',
|
1212
|
+
child: [
|
1213
|
+
{
|
1214
|
+
type: 'Color',
|
1215
|
+
label: '背景色',
|
1216
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
1217
|
+
initialValue: '#000'
|
1218
|
+
},
|
1219
|
+
{
|
1220
|
+
type: 'Group',
|
1221
|
+
label: '尺寸',
|
1222
|
+
child: [
|
1223
|
+
{
|
1224
|
+
type: 'Number',
|
1225
|
+
name: ['props', 'buttonStyle', 'height'],
|
1226
|
+
addonAfter: 'H'
|
1227
|
+
}
|
1228
|
+
]
|
1229
|
+
},
|
1230
|
+
{
|
1231
|
+
type: 'Group',
|
1232
|
+
label: '圆角',
|
1233
|
+
child: [
|
1234
|
+
{
|
1235
|
+
type: 'Slider',
|
1236
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
1237
|
+
max: 100
|
1238
|
+
},
|
1239
|
+
{
|
1240
|
+
type: 'Number',
|
1241
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
1242
|
+
addonAfter: 'px',
|
1243
|
+
max: 100
|
1244
|
+
}
|
1245
|
+
]
|
1246
|
+
},
|
1247
|
+
{
|
1248
|
+
type: 'TextMargin',
|
1249
|
+
name: ['props', 'buttonStyle']
|
1250
|
+
},
|
1251
|
+
{
|
1252
|
+
type: 'Group',
|
1253
|
+
label: '字体',
|
1254
|
+
child: [
|
1255
|
+
{
|
1256
|
+
type: 'Color',
|
1257
|
+
name: ['props', 'buttonStyle', 'color'],
|
1258
|
+
initialValue: '#fff'
|
1259
|
+
},
|
1260
|
+
{
|
1261
|
+
type: 'Select',
|
1262
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
1263
|
+
options: [{ label: '黑体', value: '黑体' }]
|
1264
|
+
},
|
1265
|
+
{
|
1266
|
+
type: 'Number',
|
1267
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
1268
|
+
addonAfter: 'px'
|
1269
|
+
}
|
1270
|
+
]
|
1271
|
+
},
|
1272
|
+
{
|
1273
|
+
type: 'TextStyle',
|
1274
|
+
name: ['props', 'buttonStyle']
|
1275
|
+
},
|
1276
|
+
{
|
1277
|
+
type: 'TextAlign',
|
1278
|
+
name: ['props', 'buttonStyle']
|
1279
|
+
}
|
1280
|
+
]
|
1281
|
+
}
|
1282
|
+
];
|
1283
|
+
|
1100
1284
|
/**
|
1101
1285
|
* SSR Window 4.0.2
|
1102
1286
|
* Better handling for window object in SSR environment
|
@@ -7980,100 +8164,278 @@
|
|
7980
8164
|
};
|
7981
8165
|
}
|
7982
8166
|
|
7983
|
-
const CommodityDetail$1 = (_a) => {
|
7984
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
7985
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image"]);
|
7986
|
-
const { sxpParameter } = useSxpDataSource();
|
7987
|
-
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
7988
|
-
const { jumpToWeb, productView } = useEventReport();
|
7989
|
-
const curTimeRef = React.useRef(null);
|
7990
|
-
const product = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
7991
|
-
const cta = (_d = (_c = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
|
7992
|
-
const handleLink = () => {
|
7993
|
-
if (product === null || product === void 0 ? void 0 : product.link) {
|
7994
|
-
jumpToWeb(popupDetailData, product, cta);
|
7995
|
-
productView(popupDetailData, product, cta, curTimeRef.current);
|
7996
|
-
window.location.href = window.getJointUtmLink(product.link);
|
7997
|
-
}
|
7998
|
-
};
|
7999
|
-
React.useEffect(() => {
|
8000
|
-
const initTime = () => {
|
8001
|
-
curTimeRef.current = new Date();
|
8002
|
-
};
|
8003
|
-
initTime();
|
8004
|
-
window.addEventListener('pageshow', initTime);
|
8005
|
-
return () => {
|
8006
|
-
window.removeEventListener('pageshow', initTime);
|
8007
|
-
};
|
8008
|
-
}, []);
|
8009
|
-
const priceText = React.useMemo(() => {
|
8010
|
-
var _a, _b, _c, _d, _e;
|
8011
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
8012
|
-
return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
|
8013
|
-
minimumFractionDigits: 0
|
8014
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
8015
|
-
}
|
8016
|
-
else {
|
8017
|
-
return '$7,000';
|
8018
|
-
}
|
8019
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8020
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8021
|
-
return (React.createElement("div", { className: 'pb-commondity' },
|
8022
|
-
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8023
|
-
product && ((_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
8024
|
-
delay: 3000
|
8025
|
-
} }, (_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.map((src) => {
|
8026
|
-
return (React.createElement(SwiperSlide, { key: src },
|
8027
|
-
React.createElement("div", { style: {
|
8028
|
-
overflow: 'hidden',
|
8029
|
-
width,
|
8030
|
-
height: width
|
8031
|
-
} },
|
8032
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8033
|
-
}))),
|
8034
|
-
!((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) && (React.createElement("div", { className: css.css({
|
8035
|
-
position: 'relative',
|
8036
|
-
height: 0,
|
8037
|
-
width: '100%',
|
8038
|
-
paddingBottom: '100%',
|
8039
|
-
overflow: 'hidden'
|
8040
|
-
}) },
|
8041
|
-
React.createElement("img", { className: css.css({
|
8042
|
-
position: 'absolute',
|
8043
|
-
left: 0,
|
8044
|
-
top: 0,
|
8045
|
-
objectFit: 'cover',
|
8046
|
-
width: '100%'
|
8047
|
-
}), src: (_h = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _h !== void 0 ? _h : bottom_image, alt: '' }))),
|
8048
|
-
React.createElement("div", { className: 'pb-commondity-content' },
|
8049
|
-
React.createElement("div", { className: 'pb-commondity-content-collection' }, (_j = product === null || product === void 0 ? void 0 : product.collection) !== null && _j !== void 0 ? _j : 'Tiffany Lock'),
|
8050
|
-
React.createElement("div", { className: 'pb-commondity-content-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
8051
|
-
React.createElement("div", { className: 'pb-commondity-content-price' }, priceText),
|
8052
|
-
React.createElement("div", { className: 'pb-commondity-content-info' }, (_l = product === null || product === void 0 ? void 0 : product.info) !== null && _l !== void 0 ? _l : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8053
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8054
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8055
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8056
|
-
18-karat gold, this necklace is embellished with hand-set diamonds.`))),
|
8057
|
-
(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'))));
|
8058
|
-
};
|
8059
|
-
var CommodityDetailComponent = React.memo(CommodityDetail$1);
|
8060
|
-
|
8061
8167
|
/*
|
8062
8168
|
* @Author: binruan@chatlabs.com
|
8063
|
-
* @Date: 2023-
|
8169
|
+
* @Date: 2023-11-02 18:34:34
|
8064
8170
|
* @LastEditors: binruan@chatlabs.com
|
8065
|
-
* @LastEditTime: 2024-
|
8066
|
-
* @FilePath: \pb-sxp-ui\src\
|
8171
|
+
* @LastEditTime: 2024-04-02 10:33:15
|
8172
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8067
8173
|
*
|
8068
8174
|
*/
|
8069
|
-
const
|
8070
|
-
|
8071
|
-
|
8072
|
-
|
8073
|
-
|
8074
|
-
|
8075
|
-
|
8076
|
-
|
8175
|
+
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8176
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
|
8177
|
+
const { popupAni } = useEditor();
|
8178
|
+
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8179
|
+
const [isShow, setIsShow] = React.useState(false);
|
8180
|
+
const modalEleRef = React.useRef(null);
|
8181
|
+
React.useEffect(() => {
|
8182
|
+
const parentNode = document.getElementById('sxp-render');
|
8183
|
+
const node = document.getElementById('pb-modal');
|
8184
|
+
if (node) {
|
8185
|
+
modalEleRef.current = node;
|
8186
|
+
}
|
8187
|
+
else {
|
8188
|
+
modalEleRef.current = document.createElement('div');
|
8189
|
+
modalEleRef.current.setAttribute('id', 'pb-modal');
|
8190
|
+
parentNode === null || parentNode === void 0 ? void 0 : parentNode.appendChild(modalEleRef.current);
|
8191
|
+
}
|
8192
|
+
}, []);
|
8193
|
+
React.useEffect(() => {
|
8194
|
+
if (visible) {
|
8195
|
+
setIsShow(true);
|
8196
|
+
}
|
8197
|
+
else {
|
8198
|
+
setTimeout(() => {
|
8199
|
+
setIsShow(false);
|
8200
|
+
}, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
|
8201
|
+
}
|
8202
|
+
}, [visible, cssAni]);
|
8203
|
+
if (!modalEleRef.current)
|
8204
|
+
return null;
|
8205
|
+
const handleClose = lodash.debounce(() => {
|
8206
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8207
|
+
}, 300);
|
8208
|
+
return ReactDOM__namespace.createPortal(React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: isShow ? 'flex' : 'none', backgroundColor: visible ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
|
8209
|
+
React.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding, animationDuration: (cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration) / 1000 + 's' }, onClick: (e) => {
|
8210
|
+
e.stopPropagation();
|
8211
|
+
e.preventDefault();
|
8212
|
+
} },
|
8213
|
+
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8214
|
+
React.createElement("img", { src: closeIcon, alt: 'close', className: 'modal-icon' })),
|
8215
|
+
children)), modalEleRef.current);
|
8216
|
+
};
|
8217
|
+
var Modal$1 = React.memo(Modal);
|
8218
|
+
|
8219
|
+
/*
|
8220
|
+
* @Author: binruan@chatlabs.com
|
8221
|
+
* @Date: 2023-12-26 16:11:34
|
8222
|
+
* @LastEditors: binruan@chatlabs.com
|
8223
|
+
* @LastEditTime: 2024-04-02 18:52:59
|
8224
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
8225
|
+
*
|
8226
|
+
*/
|
8227
|
+
const limitTextLastWholeWord = (originalText = '', limit) => {
|
8228
|
+
// 匹配到中文
|
8229
|
+
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
8230
|
+
if (chineseRegex.test(originalText)) {
|
8231
|
+
return originalText.slice(0, 54);
|
8232
|
+
}
|
8233
|
+
const words = originalText.split(' ');
|
8234
|
+
const newWords = [];
|
8235
|
+
for (let i = 0; i < words.length; i++) {
|
8236
|
+
newWords.push(words[i]);
|
8237
|
+
const tempText = newWords.join(' ');
|
8238
|
+
if (tempText.length >= limit)
|
8239
|
+
break;
|
8240
|
+
}
|
8241
|
+
// const _words = newWords.length === words.length ? newWords : newWords.slice(0, newWords.length - 1);
|
8242
|
+
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8243
|
+
return _words.join(' ') + ' ';
|
8244
|
+
};
|
8245
|
+
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
|
8246
|
+
const [isShowMore, setIsShowMore] = React.useState(true);
|
8247
|
+
const [isShow, setIsShow] = React.useState(false);
|
8248
|
+
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
8249
|
+
const multiRow = React.useRef(null);
|
8250
|
+
const handleClick = React.useCallback(() => {
|
8251
|
+
setIsShowMore(!isShowMore);
|
8252
|
+
}, [isShowMore]);
|
8253
|
+
React.useMemo(() => {
|
8254
|
+
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8255
|
+
}, [text, maxStr, isShowMore]);
|
8256
|
+
React.useEffect(() => {
|
8257
|
+
if (multiRow.current && isPost) {
|
8258
|
+
setIsShowMore(true);
|
8259
|
+
setTimeout(() => {
|
8260
|
+
var _a;
|
8261
|
+
setIsShow(false);
|
8262
|
+
try {
|
8263
|
+
const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
|
8264
|
+
const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
|
8265
|
+
const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
|
8266
|
+
const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
|
8267
|
+
const lineHeight = isNaN(lh) ? fs : lh;
|
8268
|
+
if (text && height > lineHeight * lineClamp) {
|
8269
|
+
setIsShowMore(false);
|
8270
|
+
setIsShow(true);
|
8271
|
+
}
|
8272
|
+
}
|
8273
|
+
catch (_b) { }
|
8274
|
+
}, 100);
|
8275
|
+
}
|
8276
|
+
}, [multiRow, text, lineClamp, style, isPost]);
|
8277
|
+
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
8278
|
+
React.createElement("div", { ref: multiRow, style: {
|
8279
|
+
overflow: 'hidden',
|
8280
|
+
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
8281
|
+
textOverflow: 'ellipsis',
|
8282
|
+
display: '-webkit-box',
|
8283
|
+
WebkitBoxOrient: 'vertical',
|
8284
|
+
wordBreak: 'break-word'
|
8285
|
+
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
8286
|
+
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'))));
|
8287
|
+
};
|
8288
|
+
var ExpandableText$1 = React.memo(ExpandableText);
|
8289
|
+
|
8290
|
+
const CommodityDetail$1 = (_a) => {
|
8291
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8292
|
+
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"]);
|
8293
|
+
const { sxpParameter } = useSxpDataSource();
|
8294
|
+
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
8295
|
+
const { jumpToWeb, productView } = useEventReport();
|
8296
|
+
const curTimeRef = React.useRef(null);
|
8297
|
+
const [showModal, setShowModal] = React.useState(false);
|
8298
|
+
const data = isPost ? rec : popupDetailData;
|
8299
|
+
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;
|
8300
|
+
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;
|
8301
|
+
const handleLink = () => {
|
8302
|
+
if (product === null || product === void 0 ? void 0 : product.link) {
|
8303
|
+
jumpToWeb(popupDetailData, product, cta);
|
8304
|
+
if (!isPost) {
|
8305
|
+
productView(data, product, cta, viewTime || curTimeRef.current);
|
8306
|
+
}
|
8307
|
+
window.location.href = window.getJointUtmLink(product.link);
|
8308
|
+
}
|
8309
|
+
};
|
8310
|
+
React.useEffect(() => {
|
8311
|
+
const initTime = () => {
|
8312
|
+
curTimeRef.current = new Date();
|
8313
|
+
};
|
8314
|
+
initTime();
|
8315
|
+
window.addEventListener('pageshow', initTime);
|
8316
|
+
return () => {
|
8317
|
+
window.removeEventListener('pageshow', initTime);
|
8318
|
+
};
|
8319
|
+
}, []);
|
8320
|
+
const priceText = React.useMemo(() => {
|
8321
|
+
var _a, _b, _c, _d, _e;
|
8322
|
+
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
8323
|
+
return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
|
8324
|
+
minimumFractionDigits: 0
|
8325
|
+
})) !== null && _e !== void 0 ? _e : ''}`;
|
8326
|
+
}
|
8327
|
+
else {
|
8328
|
+
return '$7,000';
|
8329
|
+
}
|
8330
|
+
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8331
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8332
|
+
const renderContent = ({ isPost }) => {
|
8333
|
+
var _a, _b, _c;
|
8334
|
+
return (React.createElement("div", { className: 'pb-commondity-content' },
|
8335
|
+
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'),
|
8336
|
+
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'),
|
8337
|
+
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
8338
|
+
React.createElement(ExpandableText$1, { 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
|
8339
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8340
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8341
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8342
|
+
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 })));
|
8343
|
+
};
|
8344
|
+
const renderBtn = () => {
|
8345
|
+
var _a;
|
8346
|
+
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'))));
|
8347
|
+
};
|
8348
|
+
return (React.createElement("div", { className: 'pb-commondity' },
|
8349
|
+
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8350
|
+
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: {
|
8351
|
+
clickable: true,
|
8352
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
8353
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
8354
|
+
? 'commondityDetail-swiper-clickable-left'
|
8355
|
+
: 'commondityDetail-swiper-clickable-center'
|
8356
|
+
}, loop: true, autoplay: {
|
8357
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8358
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8359
|
+
return (React.createElement(SwiperSlide, { key: src },
|
8360
|
+
React.createElement("div", { style: {
|
8361
|
+
overflow: 'hidden',
|
8362
|
+
width,
|
8363
|
+
height: width
|
8364
|
+
} },
|
8365
|
+
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8366
|
+
}))),
|
8367
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8368
|
+
position: 'relative',
|
8369
|
+
height: 0,
|
8370
|
+
width: '100%',
|
8371
|
+
paddingBottom: '100%',
|
8372
|
+
overflow: 'hidden'
|
8373
|
+
}) },
|
8374
|
+
React.createElement("img", { className: css.css({
|
8375
|
+
position: 'absolute',
|
8376
|
+
left: 0,
|
8377
|
+
top: 0,
|
8378
|
+
objectFit: 'cover',
|
8379
|
+
width: '100%'
|
8380
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8381
|
+
renderContent({ isPost })),
|
8382
|
+
renderBtn(),
|
8383
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
8384
|
+
renderContent({ isPost: false }),
|
8385
|
+
renderBtn())));
|
8386
|
+
};
|
8387
|
+
var CommodityDetailComponent = React.memo(CommodityDetail$1);
|
8388
|
+
|
8389
|
+
/*
|
8390
|
+
* @Author: binruan@chatlabs.com
|
8391
|
+
* @Date: 2023-07-28 18:29:57
|
8392
|
+
* @LastEditors: binruan@chatlabs.com
|
8393
|
+
* @LastEditTime: 2024-04-02 18:13:10
|
8394
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
|
8395
|
+
*
|
8396
|
+
*/
|
8397
|
+
const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
8398
|
+
displayName: '商品详情',
|
8399
|
+
icon: '',
|
8400
|
+
category: 'popup',
|
8401
|
+
type: 'CommodityDetail',
|
8402
|
+
related: {
|
8403
|
+
settingRender: settingRender$3
|
8404
|
+
},
|
8405
|
+
defaulSetting: {
|
8406
|
+
props: {
|
8407
|
+
swiper: {
|
8408
|
+
dotsAlign: 'center',
|
8409
|
+
delay: 3
|
8410
|
+
},
|
8411
|
+
commodityStyles: {
|
8412
|
+
price: {
|
8413
|
+
color: '#000',
|
8414
|
+
fontSize: 18
|
8415
|
+
},
|
8416
|
+
title: {
|
8417
|
+
color: '#000',
|
8418
|
+
fontSize: 23
|
8419
|
+
},
|
8420
|
+
collection: {
|
8421
|
+
fontSize: 12,
|
8422
|
+
color: '#000'
|
8423
|
+
},
|
8424
|
+
info: {
|
8425
|
+
color: 'gray',
|
8426
|
+
fontSize: 12
|
8427
|
+
}
|
8428
|
+
},
|
8429
|
+
buttonStyle: {
|
8430
|
+
backgroundColor: '#000',
|
8431
|
+
fontSize: 12,
|
8432
|
+
height: 45,
|
8433
|
+
fontWeight: 'bold',
|
8434
|
+
textAlign: 'center',
|
8435
|
+
color: 'rgba(255, 255, 255, 0.9)'
|
8436
|
+
}
|
8437
|
+
},
|
8438
|
+
style: {}
|
8077
8439
|
},
|
8078
8440
|
w: 100,
|
8079
8441
|
h: 40,
|
@@ -8119,7 +8481,7 @@
|
|
8119
8481
|
}
|
8120
8482
|
];
|
8121
8483
|
|
8122
|
-
var img$
|
8484
|
+
var img$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABHBJREFUeF7lmzuoFkcYhp/TihdIl0JBESubSCCCih4NXgJeUphCjyKmEEVtLRSjooWtShILRRJtgpCoeLzgLUZBQbTwAoooqLWoCWIXeZdd3bP++8/st7OX33+ac2Dn8r3Pvzv7zcy7A9RT5gDjgQnx3/T/iuA58Cz+m/7/StXhDVQ0gATOBhYCi4GxxnHeAKeAs8DfMSBjV52bhQTwBbApFj4YNMqPnV0GrgL7gJchxggFQMI3A5NDBOXRx+MYwn6Pul2rlAWwMv7VvykbiLH9TUAQjhnbYwUwA9gKLLIOHLjdGWAPcL1ovxYAG4G9wKiig1Vc/y2wBThQZJyiAA4Ba4sM0EDdw8CPvuMWAXAb+Mq344br3QGm+cTgC+B/n85aWMepz1kBOBknMy3U5wxJSdSSbrVcAPR+V9LRy0X5SW6+0A3AMuDPXlaeiv174K9OWvIAfA1cAMZ9JgBeA98Ct7J68gAMtyjJCfUbKFn6zgeA0tujoUZtWT9D2bS50x1wA2gqt6+al9YO09ODZAF8DrO+C+KIt0IagNbzIlTXktYVaKfr9+PNkSklchMtpXWHR/sJaQA7gJ8sUdXURuJ/AB7E4/0BLDeOvROQ3hEA/gFmGjusullWfDKeFcI1YFYawETgSdUqjP3niS8LYRLwNHkE1gM/GwOssplLfBkIG4BfEgBKE5dWqcTQt694da1td22YFikngGUJgH+B0UVaV1y3iHiFYpnA/wPGCICFXpX66xCfxD8oAKuA3wIpegToHW0tdYpXjKsFQLu7u60Rx+3exSCPG29HdVO3eI25TQB+BdaVAKCMSneRVpBJKfpMNiFesR4UgNOdlomeQF4AWj3quCpbfCE0JV7xDgvAXWCqp+B0tYfACkC7xXnFBaFJ8Yr5ngC8Mu78KHnS4+MqeRCaFq+4X5cB8MnmQoE7oQ3iPwCwPgJWEdZ2rjvNcj16BMpMghYxWsElS1pX0K45xNXedT2aBMu+BotCcAVlfZX69puuF70GQyRCoSFU/csnEKJEKFQqHApCXeIFIUqFQy6GykKoU7wARIuh6HVQwsmVffasEOoWLwfauASADkKU0oYqRSHULV465SsaSgAoqfk9lPq4H18ITYhXiJr7jiYAZGyUUzN0cUFoSrx0yrX6PH0ucEmTQmgCXdb5TYrX/uFcaa3rYCR7JzQpXro1vg5HRgCo+mhMEOT3/RKQYaGpkns0poD6+nA0+UX6+nhcEPreICEIfW2REQCZoc+30A9snTjlI57fyUzdzSYnU3RpP7414sDtNLl3NFG7jJK9YI52sepqnnYBUOe9ZJLOwnCapn0AqNO+NksnVHvJNO00SSeifO+ApH4vZIpdzdHZZ6QoALWXifqI8TTJNWGVua5drTV5pui8ji0A1JfM1Lta5CeWD3h7JzO0i6gVQNJv3342lwXbtx9OpkFoP0ET0LwKDZcyOF5s46ez2TtCxkt9OL0gBmJ1oMnJJcHnYo/wU9czXfR62TnAd7zWfj7/HrAAAKDnDZ8VAAAAAElFTkSuQmCC";
|
8123
8485
|
|
8124
8486
|
/*
|
8125
8487
|
* @Author: binruan@chatlabs.com
|
@@ -8163,7 +8525,7 @@
|
|
8163
8525
|
};
|
8164
8526
|
return (React.createElement("div", Object.assign({ className: `pb-prompt ${css.css(Object.assign({}, style))}` }, props),
|
8165
8527
|
React.createElement("div", { className: 'pb-prompt-icon' },
|
8166
|
-
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$
|
8528
|
+
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2 })),
|
8167
8529
|
React.createElement("div", { className: 'pb-prompt-content' }, content),
|
8168
8530
|
React.createElement("button", { className: 'pb-prompt-btn', onClick: handleOk }, btnText)));
|
8169
8531
|
};
|
@@ -8181,7 +8543,7 @@
|
|
8181
8543
|
},
|
8182
8544
|
defaulSetting: {
|
8183
8545
|
props: {
|
8184
|
-
icon: img$
|
8546
|
+
icon: img$2,
|
8185
8547
|
content: 'You have successfully completed the appointment!',
|
8186
8548
|
btnText: 'OK'
|
8187
8549
|
},
|
@@ -8192,184 +8554,6 @@
|
|
8192
8554
|
sort: 3
|
8193
8555
|
});
|
8194
8556
|
|
8195
|
-
var img$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAmhJREFUeF7t2dFKFFEcx/HvPkE3XvcA9hpedS2JhlioISKSEqESWkhUSISIiIomWiFCl973EvYM3XTnA7QHdmEb5sz8d+b8z+xh/guCwjj7/33md2bWY4eWvzotz48BWANaLmBLoOUFsJugLQFbAi0XsCXQ8gLYU8CWgC2BfIEHwBowCdwD34GDxLCeAzPAQ+AIuAL+ZjP4lsBj4DZz8A0wlQjCW2AnM6sDuZACfAWe5YS9BqZHHCEvvBv5Z6/R/43va8AicOIJ+gN4OqIIvvBu3E3go7QBY8Av4JEn6DdgdsQQisLfARPAHymAO268++XWvQ/hEpgbEYSy8E+A33mzln0OKENwNxV3c2nyVTm8G7oMQNKEc2C+IYFa4aUAEoQzYCEyQu3wwwBIEE6BF5EQgoQfFkCCcNy90y4pIwQLXwVAguA+di4rIQQNXxVAgnAIrARGCB6+DoAEwf3xtBoIQSV8XQAJwj7wsiaCWvgQABKEL8B6RQTV8KEAJAifu/sKr4ZEUA8fEkCCsAe8FiJECR8aQILwCdgoQYgWXgNAgvAB2PIgRA2vBSBBeA+8ySBED68JIEHYBbZ7CI2E1waQILzrAWQ3MPvlcDs53s0M4Q218DDJfkDd9ynbVPGdXz18jAb0ww2LECV8TADJcohW+8HKxVgCg+9X1oRoV74/VGyAoiZEDx97CRQ1oZHwTQIMNsF9r/qoK3qMNbEEsk1wP+f+06Lu81fy+00DSGZUPcYAVHkTOLk1IIGLpDqiNUCVN4GTWwMSuEiqI1oDVHkTOLk1IIGLpDqiNUCVN4GTWwMSuEiqI/4DSCuFQaIHE+8AAAAASUVORK5CYII=";
|
8196
|
-
|
8197
|
-
const CommodityDetailDiro$1 = (_a) => {
|
8198
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
8199
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image"]);
|
8200
|
-
const [spread, setSpread] = React.useState(true);
|
8201
|
-
const { sxpParameter } = useSxpDataSource();
|
8202
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
8203
|
-
const { jumpToWeb, productView } = useEventReport();
|
8204
|
-
const scrollRef = React.useRef(null);
|
8205
|
-
const touchRef = React.useRef(null);
|
8206
|
-
const touchMoveRef = React.useRef(null);
|
8207
|
-
const [stopSlide, setStopSlide] = React.useState(false);
|
8208
|
-
const [isBottom, setIsBottom] = React.useState(false);
|
8209
|
-
const [isTop, setIsTop] = React.useState(true);
|
8210
|
-
const curTimeRef = React.useRef(null);
|
8211
|
-
const data = isPost ? rec : popupDetailData;
|
8212
|
-
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;
|
8213
|
-
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;
|
8214
|
-
const handleLink = () => {
|
8215
|
-
if (product === null || product === void 0 ? void 0 : product.link) {
|
8216
|
-
jumpToWeb(data, product, cta);
|
8217
|
-
if (!isPost) {
|
8218
|
-
productView(data, product, cta, viewTime || curTimeRef.current);
|
8219
|
-
}
|
8220
|
-
window.location.href = window.getJointUtmLink(product.link);
|
8221
|
-
}
|
8222
|
-
};
|
8223
|
-
React.useEffect(() => {
|
8224
|
-
const initTime = () => {
|
8225
|
-
curTimeRef.current = new Date();
|
8226
|
-
};
|
8227
|
-
initTime();
|
8228
|
-
window.addEventListener('pageshow', initTime);
|
8229
|
-
return () => {
|
8230
|
-
window.removeEventListener('pageshow', initTime);
|
8231
|
-
};
|
8232
|
-
}, []);
|
8233
|
-
const priceText = React.useMemo(() => {
|
8234
|
-
var _a, _b, _c, _d, _e;
|
8235
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
8236
|
-
return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
|
8237
|
-
minimumFractionDigits: 0
|
8238
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
8239
|
-
}
|
8240
|
-
else {
|
8241
|
-
return '$7,000';
|
8242
|
-
}
|
8243
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8244
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8245
|
-
const handleClickCollapse = () => {
|
8246
|
-
setSpread(!spread);
|
8247
|
-
};
|
8248
|
-
React.useEffect(() => {
|
8249
|
-
var _a, _b;
|
8250
|
-
console.log((_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight, window.innerHeight);
|
8251
|
-
if ((scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) && ((_b = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) > window.innerHeight) {
|
8252
|
-
setStopSlide(true);
|
8253
|
-
}
|
8254
|
-
}, [scrollRef]);
|
8255
|
-
React.useEffect(() => {
|
8256
|
-
const handleScroll = () => {
|
8257
|
-
if (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) {
|
8258
|
-
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
|
8259
|
-
const isBottom = scrollTop + clientHeight === scrollHeight;
|
8260
|
-
if (isBottom) {
|
8261
|
-
setIsBottom(true);
|
8262
|
-
}
|
8263
|
-
else {
|
8264
|
-
setIsBottom(false);
|
8265
|
-
}
|
8266
|
-
if (scrollTop === 0) {
|
8267
|
-
setIsTop(true);
|
8268
|
-
}
|
8269
|
-
else {
|
8270
|
-
setIsTop(false);
|
8271
|
-
}
|
8272
|
-
}
|
8273
|
-
};
|
8274
|
-
if (scrollRef.current) {
|
8275
|
-
scrollRef.current.addEventListener('scroll', handleScroll);
|
8276
|
-
}
|
8277
|
-
return () => {
|
8278
|
-
if (scrollRef.current) {
|
8279
|
-
scrollRef.current.removeEventListener('scroll', handleScroll);
|
8280
|
-
}
|
8281
|
-
};
|
8282
|
-
}, [scrollRef]);
|
8283
|
-
const handleTouchStart = (event) => {
|
8284
|
-
event.stopPropagation();
|
8285
|
-
touchRef.current = event.touches[0].clientY;
|
8286
|
-
touchMoveRef.current = true;
|
8287
|
-
};
|
8288
|
-
const handleTouchMove = (event) => {
|
8289
|
-
var _a, _b, _c, _d;
|
8290
|
-
if (touchMoveRef.current) {
|
8291
|
-
touchMoveRef.current = false;
|
8292
|
-
const currentY = event.touches[0].clientY;
|
8293
|
-
const diff = touchRef.current - currentY;
|
8294
|
-
if (diff > 0 && (isBottom || !stopSlide)) {
|
8295
|
-
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideNext();
|
8296
|
-
}
|
8297
|
-
else if (diff < 0 && (isTop || !stopSlide)) {
|
8298
|
-
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slidePrev();
|
8299
|
-
}
|
8300
|
-
}
|
8301
|
-
};
|
8302
|
-
return (React.createElement("div", { className: 'pb-commondityDiro' },
|
8303
|
-
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props, { onTouchStart: handleTouchStart, onTouchMove: (e) => {
|
8304
|
-
e.stopPropagation();
|
8305
|
-
handleTouchMove(e);
|
8306
|
-
} }),
|
8307
|
-
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: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
8308
|
-
delay: 3000
|
8309
|
-
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8310
|
-
return (React.createElement(SwiperSlide, { key: src },
|
8311
|
-
React.createElement("div", { style: {
|
8312
|
-
overflow: 'hidden',
|
8313
|
-
width,
|
8314
|
-
height: width
|
8315
|
-
} },
|
8316
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8317
|
-
}))),
|
8318
|
-
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8319
|
-
position: 'relative',
|
8320
|
-
height: 0,
|
8321
|
-
width: '100%',
|
8322
|
-
paddingBottom: '100%',
|
8323
|
-
overflow: 'hidden'
|
8324
|
-
}) },
|
8325
|
-
React.createElement("img", { className: css.css({
|
8326
|
-
position: 'absolute',
|
8327
|
-
left: 0,
|
8328
|
-
top: 0,
|
8329
|
-
objectFit: 'cover',
|
8330
|
-
width: '100%'
|
8331
|
-
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8332
|
-
React.createElement("div", { className: 'pb-commondityDiro-content' },
|
8333
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'MEDIUM LADY D-LITE BAG'),
|
8334
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (product === null || product === void 0 ? void 0 : product.collection) || 'Gold-Tone and White Butterfly Zodiac Embroidery'),
|
8335
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-scrollRef', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.itemId) }, (product === null || product === void 0 ? void 0 : product.itemId) ? `Reference: ${product === null || product === void 0 ? void 0 : product.itemId}` : 'Reference: M0565OESU_M01E'),
|
8336
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-line' }),
|
8337
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-price' }, priceText)),
|
8338
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8339
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse', onClick: handleClickCollapse },
|
8340
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse-title' }, "DESCRIPTION"),
|
8341
|
-
React.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: img$2, alt: '' })),
|
8342
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-info', hidden: !spread }, (product === null || product === void 0 ? void 0 : product.info) ||
|
8343
|
-
'The Lady D-Lite bag combines classic elegance with House modernity. The style is fully embroidered with a gold-tone and white Butterfly Zodiac motif by Pietro Ruffo, showcasing a constellation enhanced by astrological signs and adorned with butterflies. A Christian Dior Paris signature adorns the front, while D.I.O.R. charms in pale gold-finish metal further enhance and highlight the silhouette. Featuring a wide, removable embroidered shoulder strap, the medium Lady D-Lite bag can be carried by hand or worn crossbody.')),
|
8344
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement(React.Fragment, null,
|
8345
|
-
React.createElement("div", { className: 'pb-commondityDiro-h90' }),
|
8346
|
-
React.createElement("div", { className: 'pb-commondityDiro-bottom' },
|
8347
|
-
React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiro-bottom-btn' }, (_l = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _l !== void 0 ? _l : 'SHOP NOW')))))));
|
8348
|
-
};
|
8349
|
-
var CommodityDetailDiroComponent = React.memo(CommodityDetailDiro$1);
|
8350
|
-
|
8351
|
-
/*
|
8352
|
-
* @Author: binruan@chatlabs.com
|
8353
|
-
* @Date: 2023-07-28 18:29:57
|
8354
|
-
* @LastEditors: binruan@chatlabs.com
|
8355
|
-
* @LastEditTime: 2024-01-05 11:37:37
|
8356
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiro\material.tsx
|
8357
|
-
*
|
8358
|
-
*/
|
8359
|
-
const CommodityDetailDiro = createMaterial(CommodityDetailDiroComponent, {
|
8360
|
-
displayName: '商品详情',
|
8361
|
-
icon: '',
|
8362
|
-
category: 'popup',
|
8363
|
-
type: 'CommodityDetailDiro',
|
8364
|
-
defaulSetting: {
|
8365
|
-
props: {},
|
8366
|
-
style: {}
|
8367
|
-
},
|
8368
|
-
w: 100,
|
8369
|
-
h: 40,
|
8370
|
-
sort: 1
|
8371
|
-
});
|
8372
|
-
|
8373
8557
|
/*
|
8374
8558
|
* @Author: binruan@chatlabs.com
|
8375
8559
|
* @Date: 2024-03-26 16:50:25
|
@@ -8513,6 +8697,10 @@
|
|
8513
8697
|
}
|
8514
8698
|
]
|
8515
8699
|
},
|
8700
|
+
{
|
8701
|
+
type: 'TextMargin',
|
8702
|
+
name: ['props', 'buttonStyle']
|
8703
|
+
},
|
8516
8704
|
{
|
8517
8705
|
type: 'Group',
|
8518
8706
|
label: '字体',
|
@@ -8541,142 +8729,11 @@
|
|
8541
8729
|
{
|
8542
8730
|
type: 'TextAlign',
|
8543
8731
|
name: ['props', 'buttonStyle']
|
8544
|
-
},
|
8545
|
-
{
|
8546
|
-
type: 'TextSpace',
|
8547
|
-
name: ['props', 'buttonStyle']
|
8548
|
-
},
|
8549
|
-
{
|
8550
|
-
type: 'TextMargin',
|
8551
|
-
name: ['props', 'buttonStyle']
|
8552
8732
|
}
|
8553
8733
|
]
|
8554
8734
|
}
|
8555
8735
|
];
|
8556
8736
|
|
8557
|
-
/*
|
8558
|
-
* @Author: binruan@chatlabs.com
|
8559
|
-
* @Date: 2023-11-02 18:34:34
|
8560
|
-
* @LastEditors: binruan@chatlabs.com
|
8561
|
-
* @LastEditTime: 2024-04-02 10:33:15
|
8562
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8563
|
-
*
|
8564
|
-
*/
|
8565
|
-
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8566
|
-
const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
|
8567
|
-
const { popupAni } = useEditor();
|
8568
|
-
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8569
|
-
const [isShow, setIsShow] = React.useState(false);
|
8570
|
-
const modalEleRef = React.useRef(null);
|
8571
|
-
React.useEffect(() => {
|
8572
|
-
const parentNode = document.getElementById('sxp-render');
|
8573
|
-
const node = document.getElementById('pb-modal');
|
8574
|
-
if (node) {
|
8575
|
-
modalEleRef.current = node;
|
8576
|
-
}
|
8577
|
-
else {
|
8578
|
-
modalEleRef.current = document.createElement('div');
|
8579
|
-
modalEleRef.current.setAttribute('id', 'pb-modal');
|
8580
|
-
parentNode === null || parentNode === void 0 ? void 0 : parentNode.appendChild(modalEleRef.current);
|
8581
|
-
}
|
8582
|
-
}, []);
|
8583
|
-
React.useEffect(() => {
|
8584
|
-
if (visible) {
|
8585
|
-
setIsShow(true);
|
8586
|
-
}
|
8587
|
-
else {
|
8588
|
-
setTimeout(() => {
|
8589
|
-
setIsShow(false);
|
8590
|
-
}, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
|
8591
|
-
}
|
8592
|
-
}, [visible, cssAni]);
|
8593
|
-
if (!modalEleRef.current)
|
8594
|
-
return null;
|
8595
|
-
const handleClose = lodash.debounce(() => {
|
8596
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8597
|
-
}, 300);
|
8598
|
-
return ReactDOM__namespace.createPortal(React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: isShow ? 'flex' : 'none', backgroundColor: visible ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
|
8599
|
-
React.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding, animationDuration: (cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration) / 1000 + 's' }, onClick: (e) => {
|
8600
|
-
e.stopPropagation();
|
8601
|
-
e.preventDefault();
|
8602
|
-
} },
|
8603
|
-
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8604
|
-
React.createElement("img", { src: closeIcon, alt: 'close', className: 'modal-icon' })),
|
8605
|
-
children)), modalEleRef.current);
|
8606
|
-
};
|
8607
|
-
var Modal$1 = React.memo(Modal);
|
8608
|
-
|
8609
|
-
/*
|
8610
|
-
* @Author: binruan@chatlabs.com
|
8611
|
-
* @Date: 2023-12-26 16:11:34
|
8612
|
-
* @LastEditors: binruan@chatlabs.com
|
8613
|
-
* @LastEditTime: 2024-04-02 10:57:30
|
8614
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
8615
|
-
*
|
8616
|
-
*/
|
8617
|
-
const limitTextLastWholeWord = (originalText = '', limit) => {
|
8618
|
-
// 匹配到中文
|
8619
|
-
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
8620
|
-
if (chineseRegex.test(originalText)) {
|
8621
|
-
return originalText.slice(0, 54);
|
8622
|
-
}
|
8623
|
-
const words = originalText.split(' ');
|
8624
|
-
const newWords = [];
|
8625
|
-
for (let i = 0; i < words.length; i++) {
|
8626
|
-
newWords.push(words[i]);
|
8627
|
-
const tempText = newWords.join(' ');
|
8628
|
-
if (tempText.length >= limit)
|
8629
|
-
break;
|
8630
|
-
}
|
8631
|
-
// const _words = newWords.length === words.length ? newWords : newWords.slice(0, newWords.length - 1);
|
8632
|
-
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8633
|
-
return _words.join(' ') + ' ';
|
8634
|
-
};
|
8635
|
-
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
|
8636
|
-
const [isShowMore, setIsShowMore] = React.useState(true);
|
8637
|
-
const [isShow, setIsShow] = React.useState(false);
|
8638
|
-
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
8639
|
-
const multiRow = React.useRef(null);
|
8640
|
-
const handleClick = React.useCallback(() => {
|
8641
|
-
setIsShowMore(!isShowMore);
|
8642
|
-
}, [isShowMore]);
|
8643
|
-
React.useMemo(() => {
|
8644
|
-
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8645
|
-
}, [text, maxStr, isShowMore]);
|
8646
|
-
React.useEffect(() => {
|
8647
|
-
if (multiRow.current && isPost) {
|
8648
|
-
setIsShowMore(true);
|
8649
|
-
setTimeout(() => {
|
8650
|
-
var _a;
|
8651
|
-
setIsShow(false);
|
8652
|
-
try {
|
8653
|
-
const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
|
8654
|
-
const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
|
8655
|
-
const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
|
8656
|
-
const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
|
8657
|
-
const lineHeight = isNaN(lh) ? fs : lh;
|
8658
|
-
if (text && height > lineHeight * lineClamp) {
|
8659
|
-
setIsShowMore(false);
|
8660
|
-
setIsShow(true);
|
8661
|
-
}
|
8662
|
-
}
|
8663
|
-
catch (_b) { }
|
8664
|
-
}, 100);
|
8665
|
-
}
|
8666
|
-
}, [multiRow, text, lineClamp, style, isPost]);
|
8667
|
-
return (React.createElement("div", { className: className, style: Object.assign({}, style) },
|
8668
|
-
React.createElement("div", { ref: multiRow, style: {
|
8669
|
-
overflow: 'hidden',
|
8670
|
-
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
8671
|
-
textOverflow: 'ellipsis',
|
8672
|
-
display: '-webkit-box',
|
8673
|
-
WebkitBoxOrient: 'vertical',
|
8674
|
-
wordBreak: 'break-word'
|
8675
|
-
}, dangerouslySetInnerHTML: { __html: text ? text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') : React.createElement(React.Fragment, null) } }),
|
8676
|
-
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'))));
|
8677
|
-
};
|
8678
|
-
var ExpandableText$1 = React.memo(ExpandableText);
|
8679
|
-
|
8680
8737
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8681
8738
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8682
8739
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle"]);
|
@@ -8726,7 +8783,7 @@
|
|
8726
8783
|
}
|
8727
8784
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8728
8785
|
const width = isPreview ? 375 : window.innerWidth;
|
8729
|
-
const productInfoText = () => {
|
8786
|
+
const productInfoText = ({ isPost }) => {
|
8730
8787
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8731
8788
|
React.createElement(ExpandableText$1, { 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) ||
|
8732
8789
|
`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
|
@@ -8773,8 +8830,8 @@ Made in Italy` })));
|
|
8773
8830
|
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 : '税费'))),
|
8774
8831
|
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'),
|
8775
8832
|
(!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')),
|
8776
|
-
productInfoText())),
|
8777
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText())));
|
8833
|
+
productInfoText({ isPost }))),
|
8834
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8778
8835
|
};
|
8779
8836
|
var CommodityDetailDiroNewComponent = React.memo(CommodityDetailDiroNew$1);
|
8780
8837
|
|
@@ -8782,7 +8839,7 @@ Made in Italy` })));
|
|
8782
8839
|
* @Author: binruan@chatlabs.com
|
8783
8840
|
* @Date: 2024-03-20 10:27:31
|
8784
8841
|
* @LastEditors: binruan@chatlabs.com
|
8785
|
-
* @LastEditTime: 2024-
|
8842
|
+
* @LastEditTime: 2024-04-02 15:12:53
|
8786
8843
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\material.tsx
|
8787
8844
|
*
|
8788
8845
|
*/
|
@@ -8824,6 +8881,17 @@ Made in Italy` })));
|
|
8824
8881
|
fontSize: 13,
|
8825
8882
|
textAlign: 'right'
|
8826
8883
|
}
|
8884
|
+
},
|
8885
|
+
buttonStyle: {
|
8886
|
+
backgroundColor: '#000',
|
8887
|
+
fontSize: 12,
|
8888
|
+
height: 52,
|
8889
|
+
fontWeight: 'bold',
|
8890
|
+
textAlign: 'center',
|
8891
|
+
color: '#fff',
|
8892
|
+
borderRadius: 25,
|
8893
|
+
marginTop: 16,
|
8894
|
+
marginBottom: 16
|
8827
8895
|
}
|
8828
8896
|
},
|
8829
8897
|
style: {}
|
@@ -9873,7 +9941,6 @@ Made in Italy` })));
|
|
9873
9941
|
AppointForm: AppointForm,
|
9874
9942
|
Commodity: Commodity,
|
9875
9943
|
CommodityDetail: CommodityDetail,
|
9876
|
-
CommodityDetailDiro: CommodityDetailDiro,
|
9877
9944
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
9878
9945
|
CommodityDiro: CommodityDiro,
|
9879
9946
|
CommodityDiroNew: CommodityDiroNew,
|
@@ -10939,9 +11006,7 @@ Made in Italy` })));
|
|
10939
11006
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
|
10940
11007
|
var _a, _b, _c, _d, _e, _f;
|
10941
11008
|
const Component = withBindDataSource(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
|
10942
|
-
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' }
|
10943
|
-
// ProductInfo
|
10944
|
-
data: rec, height: height, width: containerWidth })));
|
11009
|
+
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' } })));
|
10945
11010
|
});
|
10946
11011
|
}
|
10947
11012
|
return null;
|