pb-sxp-ui 1.0.2 → 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 +1302 -688
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +28 -133
- package/dist/index.js +1302 -688
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +1302 -688
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.d.ts +1 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
- package/es/core/components/SxpPageRender/ExpandableText.js +17 -10
- package/es/core/components/SxpPageRender/Hashtag/index.js +1 -1
- package/es/core/components/SxpPageRender/Modal/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/Modal/index.js +7 -4
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/es/core/components/SxpPageRender/Nudge/index.js +13 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +11 -7
- package/es/core/components/SxpPageRender/Popup/index.js +3 -3
- package/es/core/components/SxpPageRender/VideoWidget/index.js +30 -21
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +4 -3
- package/es/core/components/SxpPageRender/index.d.ts +20 -1
- package/es/core/components/SxpPageRender/index.js +19 -16
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/components/SxpPageRender/useIconLink.d.ts +1 -1
- package/es/core/components/SxpPageRender/useIconLink.js +8 -3
- package/es/core/context/EditorContext.d.ts +5 -0
- package/es/core/context/EditorContext.js +21 -3
- package/es/core/context/SxpDataSourceProvider.js +1 -1
- package/es/core/create.d.ts +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.d.ts +13 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +46 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +171 -0
- package/es/materials/sxp/popup/index.d.ts +0 -1
- package/es/materials/sxp/popup/index.js +0 -1
- package/es/materials/sxp/template/Appoint/index.d.ts +2 -0
- package/es/materials/sxp/template/Appoint/index.js +4 -18
- package/es/materials/sxp/template/Appoint/material.js +22 -6
- package/es/materials/sxp/template/Commodity/index.d.ts +2 -0
- package/es/materials/sxp/template/Commodity/index.js +5 -22
- package/es/materials/sxp/template/Commodity/material.js +31 -6
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +5 -24
- package/es/materials/sxp/template/CommodityDiro/material.js +30 -5
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +5 -24
- package/es/materials/sxp/template/CommodityDiroNew/material.js +32 -6
- package/es/materials/sxp/template/Link/index.d.ts +2 -0
- package/es/materials/sxp/template/Link/index.js +4 -13
- package/es/materials/sxp/template/Link/material.js +22 -5
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +8 -24
- package/es/materials/sxp/template/MultiCommodity/material.js +30 -5
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +8 -27
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +8 -25
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
- package/es/materials/sxp/template/components/EventProvider.d.ts +2 -1
- package/es/materials/sxp/template/components/EventProvider.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +108 -0
- package/es/materials/sxp/template/components/settingRender.js +198 -0
- package/es/materials/sxp/template/components/typing.d.ts +6 -0
- package/es/materials/sxp/template/components/typing.js +1 -0
- package/lib/core/components/SxpPageCore/index.d.ts +1 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +17 -10
- package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -1
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +7 -4
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/lib/core/components/SxpPageRender/Nudge/index.js +16 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +10 -6
- package/lib/core/components/SxpPageRender/Popup/index.js +3 -3
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +30 -21
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
- package/lib/core/components/SxpPageRender/index.d.ts +20 -1
- package/lib/core/components/SxpPageRender/index.js +19 -16
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/components/SxpPageRender/useIconLink.d.ts +1 -1
- package/lib/core/components/SxpPageRender/useIconLink.js +8 -3
- package/lib/core/context/EditorContext.d.ts +5 -0
- package/lib/core/context/EditorContext.js +21 -3
- package/lib/core/context/SxpDataSourceProvider.js +1 -1
- package/lib/core/create.d.ts +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.d.ts +13 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +46 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +173 -0
- package/lib/materials/sxp/popup/index.d.ts +0 -1
- package/lib/materials/sxp/popup/index.js +0 -1
- package/lib/materials/sxp/template/Appoint/index.d.ts +2 -0
- package/lib/materials/sxp/template/Appoint/index.js +4 -18
- package/lib/materials/sxp/template/Appoint/material.js +22 -6
- package/lib/materials/sxp/template/Commodity/index.d.ts +2 -0
- package/lib/materials/sxp/template/Commodity/index.js +5 -22
- package/lib/materials/sxp/template/Commodity/material.js +31 -6
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +5 -24
- package/lib/materials/sxp/template/CommodityDiro/material.js +30 -5
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +5 -24
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +32 -6
- package/lib/materials/sxp/template/Link/index.d.ts +2 -0
- package/lib/materials/sxp/template/Link/index.js +4 -13
- package/lib/materials/sxp/template/Link/material.js +22 -5
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +7 -23
- package/lib/materials/sxp/template/MultiCommodity/material.js +30 -5
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +7 -26
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -24
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
- package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -1
- package/lib/materials/sxp/template/components/EventProvider.js +4 -3
- package/lib/materials/sxp/template/components/settingRender.d.ts +108 -0
- package/lib/materials/sxp/template/components/settingRender.js +200 -0
- package/lib/materials/sxp/template/components/typing.d.ts +6 -0
- package/lib/materials/sxp/template/components/typing.js +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -401,11 +401,24 @@ const storeAndLoadFeUserId = () => {
|
|
401
401
|
return fakeUserId;
|
402
402
|
};
|
403
403
|
|
404
|
-
|
404
|
+
/*
|
405
|
+
* @Author: binruan@chatlabs.com
|
406
|
+
* @Date: 2024-03-20 10:27:31
|
407
|
+
* @LastEditors: binruan@chatlabs.com
|
408
|
+
* @LastEditTime: 2024-03-25 18:23:54
|
409
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\useIconLink.ts
|
410
|
+
*
|
411
|
+
*/
|
412
|
+
function useIconLink(path, domain) {
|
405
413
|
const { appDomain } = useSxpDataSource();
|
406
414
|
return React.useMemo(() => {
|
407
|
-
|
408
|
-
|
415
|
+
if (domain) {
|
416
|
+
return `https://${domain}${path}`;
|
417
|
+
}
|
418
|
+
else {
|
419
|
+
return appDomain ? `https://${appDomain}${path}` : `${window.location.origin}${path}`;
|
420
|
+
}
|
421
|
+
}, [appDomain, path, domain]);
|
409
422
|
}
|
410
423
|
|
411
424
|
const SxpDataSourceContext = React.createContext({
|
@@ -583,7 +596,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
583
596
|
setLoading(false);
|
584
597
|
});
|
585
598
|
}, [getRecommendVideos]);
|
586
|
-
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif');
|
599
|
+
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
587
600
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
588
601
|
rtcList,
|
589
602
|
setRtcList,
|
@@ -727,7 +740,11 @@ const EditorContext = React.createContext({
|
|
727
740
|
undoStack: [item],
|
728
741
|
redoStack: [],
|
729
742
|
popup: '',
|
730
|
-
setPopup: () => { }
|
743
|
+
setPopup: () => { },
|
744
|
+
popupAni: {
|
745
|
+
name: 'none',
|
746
|
+
duration: 0
|
747
|
+
}
|
731
748
|
});
|
732
749
|
const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
733
750
|
const [currentNode, setCurrentNode] = React.useState(null);
|
@@ -751,9 +768,22 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
|
|
751
768
|
const [undoStack, setUndoStack] = React.useState([[item]]);
|
752
769
|
const [redoStack, setRedoStack] = React.useState([]);
|
753
770
|
const [popup, setPopup] = React.useState('');
|
771
|
+
const [popupAni, setPopupAni] = React.useState({
|
772
|
+
name: 'none',
|
773
|
+
duration: 0
|
774
|
+
});
|
754
775
|
typeof window !== 'undefined' &&
|
755
|
-
(window.sxpPopup = (type) => {
|
776
|
+
(window.sxpPopup = (type, aniType) => {
|
756
777
|
setPopup(type);
|
778
|
+
if (aniType && (aniType === null || aniType === void 0 ? void 0 : aniType.name) !== 'none') {
|
779
|
+
setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
|
780
|
+
}
|
781
|
+
else {
|
782
|
+
setPopupAni({
|
783
|
+
name: 'none',
|
784
|
+
duration: 0
|
785
|
+
});
|
786
|
+
}
|
757
787
|
});
|
758
788
|
typeof window !== 'undefined' &&
|
759
789
|
(window.getJointUtmLink = (url) => {
|
@@ -829,7 +859,8 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
|
|
829
859
|
setUndoStack,
|
830
860
|
getCurPageConf,
|
831
861
|
popup,
|
832
|
-
setPopup
|
862
|
+
setPopup,
|
863
|
+
popupAni
|
833
864
|
} },
|
834
865
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
835
866
|
});
|
@@ -859,7 +890,7 @@ var interactionRender$8 = [
|
|
859
890
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
|
860
891
|
*
|
861
892
|
*/
|
862
|
-
var settingRender$
|
893
|
+
var settingRender$4 = [
|
863
894
|
{
|
864
895
|
type: 'Text',
|
865
896
|
label: '组件名称',
|
@@ -1048,7 +1079,7 @@ const AppointForm = createMaterial(AppointFormComponent, {
|
|
1048
1079
|
category: 'popup',
|
1049
1080
|
type: 'AppointForm',
|
1050
1081
|
related: {
|
1051
|
-
settingRender: settingRender$
|
1082
|
+
settingRender: settingRender$4,
|
1052
1083
|
bindableProps: [],
|
1053
1084
|
interactionRender: interactionRender$8
|
1054
1085
|
},
|
@@ -1074,6 +1105,190 @@ const AppointForm = createMaterial(AppointFormComponent, {
|
|
1074
1105
|
sort: 2
|
1075
1106
|
});
|
1076
1107
|
|
1108
|
+
/*
|
1109
|
+
* @Author: binruan@chatlabs.com
|
1110
|
+
* @Date: 2024-04-02 18:01:34
|
1111
|
+
* @LastEditors: binruan@chatlabs.com
|
1112
|
+
* @LastEditTime: 2024-04-02 18:01:41
|
1113
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiro\settingRender.tsx
|
1114
|
+
*
|
1115
|
+
*/
|
1116
|
+
/*
|
1117
|
+
* @Author: binruan@chatlabs.com
|
1118
|
+
* @Date: 2024-03-26 16:50:25
|
1119
|
+
* @LastEditors: binruan@chatlabs.com
|
1120
|
+
* @LastEditTime: 2024-03-28 18:42:26
|
1121
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
1122
|
+
*
|
1123
|
+
*/
|
1124
|
+
var settingRender$3 = [
|
1125
|
+
{
|
1126
|
+
title: '商品图片',
|
1127
|
+
child: [
|
1128
|
+
{
|
1129
|
+
type: 'Radius',
|
1130
|
+
label: '轮播指示器',
|
1131
|
+
options: [
|
1132
|
+
{
|
1133
|
+
label: '居左',
|
1134
|
+
value: 'left'
|
1135
|
+
},
|
1136
|
+
{
|
1137
|
+
label: '居中',
|
1138
|
+
value: 'center'
|
1139
|
+
}
|
1140
|
+
],
|
1141
|
+
name: ['props', 'swiper', 'dotsAlign']
|
1142
|
+
},
|
1143
|
+
{
|
1144
|
+
type: 'Number',
|
1145
|
+
name: ['props', 'swiper', 'delay'],
|
1146
|
+
addonAfter: 's'
|
1147
|
+
}
|
1148
|
+
]
|
1149
|
+
},
|
1150
|
+
{
|
1151
|
+
title: '商品文本',
|
1152
|
+
child: [
|
1153
|
+
{
|
1154
|
+
name: ['props', 'commodityStyles'],
|
1155
|
+
type: 'SelectLinkage',
|
1156
|
+
child: [
|
1157
|
+
{
|
1158
|
+
label: '字段',
|
1159
|
+
type: 'Select',
|
1160
|
+
options: [
|
1161
|
+
{
|
1162
|
+
label: '商品名称',
|
1163
|
+
value: 'title'
|
1164
|
+
},
|
1165
|
+
{
|
1166
|
+
label: '系列名称',
|
1167
|
+
value: 'collection'
|
1168
|
+
},
|
1169
|
+
{
|
1170
|
+
label: '价格',
|
1171
|
+
value: 'price'
|
1172
|
+
},
|
1173
|
+
{
|
1174
|
+
label: '商品描述',
|
1175
|
+
value: 'info'
|
1176
|
+
}
|
1177
|
+
],
|
1178
|
+
name: ['props', 'commodityStyles', 'field'],
|
1179
|
+
initialValue: 'title'
|
1180
|
+
},
|
1181
|
+
{
|
1182
|
+
type: 'Group',
|
1183
|
+
label: '标题字体',
|
1184
|
+
child: [
|
1185
|
+
{
|
1186
|
+
type: 'Color',
|
1187
|
+
name: ['color']
|
1188
|
+
},
|
1189
|
+
{
|
1190
|
+
type: 'Select',
|
1191
|
+
options: [{ label: '黑体', value: '黑体' }],
|
1192
|
+
name: ['fontFamily']
|
1193
|
+
},
|
1194
|
+
{
|
1195
|
+
type: 'Number',
|
1196
|
+
addonAfter: 'px',
|
1197
|
+
name: ['fontSize']
|
1198
|
+
}
|
1199
|
+
]
|
1200
|
+
},
|
1201
|
+
{
|
1202
|
+
label: '标题样式',
|
1203
|
+
type: 'TextStyle'
|
1204
|
+
},
|
1205
|
+
{
|
1206
|
+
label: '标题对齐',
|
1207
|
+
type: 'TextAlign'
|
1208
|
+
},
|
1209
|
+
{
|
1210
|
+
label: '默认行数',
|
1211
|
+
type: 'Number',
|
1212
|
+
name: ['lineClamp']
|
1213
|
+
}
|
1214
|
+
]
|
1215
|
+
}
|
1216
|
+
]
|
1217
|
+
},
|
1218
|
+
{
|
1219
|
+
title: '购买按钮样式',
|
1220
|
+
child: [
|
1221
|
+
{
|
1222
|
+
type: 'Color',
|
1223
|
+
label: '背景色',
|
1224
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
1225
|
+
initialValue: '#000'
|
1226
|
+
},
|
1227
|
+
{
|
1228
|
+
type: 'Group',
|
1229
|
+
label: '尺寸',
|
1230
|
+
child: [
|
1231
|
+
{
|
1232
|
+
type: 'Number',
|
1233
|
+
name: ['props', 'buttonStyle', 'height'],
|
1234
|
+
addonAfter: 'H'
|
1235
|
+
}
|
1236
|
+
]
|
1237
|
+
},
|
1238
|
+
{
|
1239
|
+
type: 'Group',
|
1240
|
+
label: '圆角',
|
1241
|
+
child: [
|
1242
|
+
{
|
1243
|
+
type: 'Slider',
|
1244
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
1245
|
+
max: 100
|
1246
|
+
},
|
1247
|
+
{
|
1248
|
+
type: 'Number',
|
1249
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
1250
|
+
addonAfter: 'px',
|
1251
|
+
max: 100
|
1252
|
+
}
|
1253
|
+
]
|
1254
|
+
},
|
1255
|
+
{
|
1256
|
+
type: 'TextMargin',
|
1257
|
+
name: ['props', 'buttonStyle']
|
1258
|
+
},
|
1259
|
+
{
|
1260
|
+
type: 'Group',
|
1261
|
+
label: '字体',
|
1262
|
+
child: [
|
1263
|
+
{
|
1264
|
+
type: 'Color',
|
1265
|
+
name: ['props', 'buttonStyle', 'color'],
|
1266
|
+
initialValue: '#fff'
|
1267
|
+
},
|
1268
|
+
{
|
1269
|
+
type: 'Select',
|
1270
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
1271
|
+
options: [{ label: '黑体', value: '黑体' }]
|
1272
|
+
},
|
1273
|
+
{
|
1274
|
+
type: 'Number',
|
1275
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
1276
|
+
addonAfter: 'px'
|
1277
|
+
}
|
1278
|
+
]
|
1279
|
+
},
|
1280
|
+
{
|
1281
|
+
type: 'TextStyle',
|
1282
|
+
name: ['props', 'buttonStyle']
|
1283
|
+
},
|
1284
|
+
{
|
1285
|
+
type: 'TextAlign',
|
1286
|
+
name: ['props', 'buttonStyle']
|
1287
|
+
}
|
1288
|
+
]
|
1289
|
+
}
|
1290
|
+
];
|
1291
|
+
|
1077
1292
|
/**
|
1078
1293
|
* SSR Window 4.0.2
|
1079
1294
|
* Better handling for window object in SSR environment
|
@@ -7957,19 +8172,146 @@ function useEventReport() {
|
|
7957
8172
|
};
|
7958
8173
|
}
|
7959
8174
|
|
8175
|
+
/*
|
8176
|
+
* @Author: binruan@chatlabs.com
|
8177
|
+
* @Date: 2023-11-02 18:34:34
|
8178
|
+
* @LastEditors: binruan@chatlabs.com
|
8179
|
+
* @LastEditTime: 2024-04-02 10:33:15
|
8180
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8181
|
+
*
|
8182
|
+
*/
|
8183
|
+
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8184
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
|
8185
|
+
const { popupAni } = useEditor();
|
8186
|
+
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8187
|
+
const [isShow, setIsShow] = React.useState(false);
|
8188
|
+
const modalEleRef = React.useRef(null);
|
8189
|
+
React.useEffect(() => {
|
8190
|
+
const parentNode = document.getElementById('sxp-render');
|
8191
|
+
const node = document.getElementById('pb-modal');
|
8192
|
+
if (node) {
|
8193
|
+
modalEleRef.current = node;
|
8194
|
+
}
|
8195
|
+
else {
|
8196
|
+
modalEleRef.current = document.createElement('div');
|
8197
|
+
modalEleRef.current.setAttribute('id', 'pb-modal');
|
8198
|
+
parentNode === null || parentNode === void 0 ? void 0 : parentNode.appendChild(modalEleRef.current);
|
8199
|
+
}
|
8200
|
+
}, []);
|
8201
|
+
React.useEffect(() => {
|
8202
|
+
if (visible) {
|
8203
|
+
setIsShow(true);
|
8204
|
+
}
|
8205
|
+
else {
|
8206
|
+
setTimeout(() => {
|
8207
|
+
setIsShow(false);
|
8208
|
+
}, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
|
8209
|
+
}
|
8210
|
+
}, [visible, cssAni]);
|
8211
|
+
if (!modalEleRef.current)
|
8212
|
+
return null;
|
8213
|
+
const handleClose = lodash.debounce(() => {
|
8214
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8215
|
+
}, 300);
|
8216
|
+
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 },
|
8217
|
+
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) => {
|
8218
|
+
e.stopPropagation();
|
8219
|
+
e.preventDefault();
|
8220
|
+
} },
|
8221
|
+
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8222
|
+
React.createElement("img", { src: closeIcon, alt: 'close', className: 'modal-icon' })),
|
8223
|
+
children)), modalEleRef.current);
|
8224
|
+
};
|
8225
|
+
var Modal$1 = React.memo(Modal);
|
8226
|
+
|
8227
|
+
/*
|
8228
|
+
* @Author: binruan@chatlabs.com
|
8229
|
+
* @Date: 2023-12-26 16:11:34
|
8230
|
+
* @LastEditors: binruan@chatlabs.com
|
8231
|
+
* @LastEditTime: 2024-04-02 18:52:59
|
8232
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
8233
|
+
*
|
8234
|
+
*/
|
8235
|
+
const limitTextLastWholeWord = (originalText = '', limit) => {
|
8236
|
+
// 匹配到中文
|
8237
|
+
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
8238
|
+
if (chineseRegex.test(originalText)) {
|
8239
|
+
return originalText.slice(0, 54);
|
8240
|
+
}
|
8241
|
+
const words = originalText.split(' ');
|
8242
|
+
const newWords = [];
|
8243
|
+
for (let i = 0; i < words.length; i++) {
|
8244
|
+
newWords.push(words[i]);
|
8245
|
+
const tempText = newWords.join(' ');
|
8246
|
+
if (tempText.length >= limit)
|
8247
|
+
break;
|
8248
|
+
}
|
8249
|
+
// const _words = newWords.length === words.length ? newWords : newWords.slice(0, newWords.length - 1);
|
8250
|
+
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8251
|
+
return _words.join(' ') + ' ';
|
8252
|
+
};
|
8253
|
+
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
|
8254
|
+
const [isShowMore, setIsShowMore] = React.useState(true);
|
8255
|
+
const [isShow, setIsShow] = React.useState(false);
|
8256
|
+
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
8257
|
+
const multiRow = React.useRef(null);
|
8258
|
+
const handleClick = React.useCallback(() => {
|
8259
|
+
setIsShowMore(!isShowMore);
|
8260
|
+
}, [isShowMore]);
|
8261
|
+
React.useMemo(() => {
|
8262
|
+
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8263
|
+
}, [text, maxStr, isShowMore]);
|
8264
|
+
React.useEffect(() => {
|
8265
|
+
if (multiRow.current && isPost) {
|
8266
|
+
setIsShowMore(true);
|
8267
|
+
setTimeout(() => {
|
8268
|
+
var _a;
|
8269
|
+
setIsShow(false);
|
8270
|
+
try {
|
8271
|
+
const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
|
8272
|
+
const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
|
8273
|
+
const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
|
8274
|
+
const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
|
8275
|
+
const lineHeight = isNaN(lh) ? fs : lh;
|
8276
|
+
if (text && height > lineHeight * lineClamp) {
|
8277
|
+
setIsShowMore(false);
|
8278
|
+
setIsShow(true);
|
8279
|
+
}
|
8280
|
+
}
|
8281
|
+
catch (_b) { }
|
8282
|
+
}, 100);
|
8283
|
+
}
|
8284
|
+
}, [multiRow, text, lineClamp, style, isPost]);
|
8285
|
+
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
8286
|
+
React.createElement("div", { ref: multiRow, style: {
|
8287
|
+
overflow: 'hidden',
|
8288
|
+
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
8289
|
+
textOverflow: 'ellipsis',
|
8290
|
+
display: '-webkit-box',
|
8291
|
+
WebkitBoxOrient: 'vertical',
|
8292
|
+
wordBreak: 'break-word'
|
8293
|
+
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
8294
|
+
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'))));
|
8295
|
+
};
|
8296
|
+
var ExpandableText$1 = React.memo(ExpandableText);
|
8297
|
+
|
7960
8298
|
const CommodityDetail$1 = (_a) => {
|
7961
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
7962
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image"]);
|
8299
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8300
|
+
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"]);
|
7963
8301
|
const { sxpParameter } = useSxpDataSource();
|
7964
8302
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
7965
8303
|
const { jumpToWeb, productView } = useEventReport();
|
7966
8304
|
const curTimeRef = React.useRef(null);
|
7967
|
-
const
|
7968
|
-
const
|
8305
|
+
const [showModal, setShowModal] = React.useState(false);
|
8306
|
+
const data = isPost ? rec : popupDetailData;
|
8307
|
+
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;
|
8308
|
+
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;
|
7969
8309
|
const handleLink = () => {
|
7970
8310
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
7971
8311
|
jumpToWeb(popupDetailData, product, cta);
|
7972
|
-
|
8312
|
+
if (!isPost) {
|
8313
|
+
productView(data, product, cta, viewTime || curTimeRef.current);
|
8314
|
+
}
|
7973
8315
|
window.location.href = window.getJointUtmLink(product.link);
|
7974
8316
|
}
|
7975
8317
|
};
|
@@ -7995,11 +8337,33 @@ const CommodityDetail$1 = (_a) => {
|
|
7995
8337
|
}
|
7996
8338
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
7997
8339
|
const width = isPreview ? 375 : window.innerWidth;
|
8340
|
+
const renderContent = ({ isPost }) => {
|
8341
|
+
var _a, _b, _c;
|
8342
|
+
return (React.createElement("div", { className: 'pb-commondity-content' },
|
8343
|
+
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'),
|
8344
|
+
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'),
|
8345
|
+
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
8346
|
+
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
|
8347
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8348
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8349
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8350
|
+
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 })));
|
8351
|
+
};
|
8352
|
+
const renderBtn = () => {
|
8353
|
+
var _a;
|
8354
|
+
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'))));
|
8355
|
+
};
|
7998
8356
|
return (React.createElement("div", { className: 'pb-commondity' },
|
7999
8357
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8000
|
-
product && ((
|
8001
|
-
|
8002
|
-
|
8358
|
+
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: {
|
8359
|
+
clickable: true,
|
8360
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
8361
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
8362
|
+
? 'commondityDetail-swiper-clickable-left'
|
8363
|
+
: 'commondityDetail-swiper-clickable-center'
|
8364
|
+
}, loop: true, autoplay: {
|
8365
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8366
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8003
8367
|
return (React.createElement(SwiperSlide, { key: src },
|
8004
8368
|
React.createElement("div", { style: {
|
8005
8369
|
overflow: 'hidden',
|
@@ -8008,7 +8372,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8008
8372
|
} },
|
8009
8373
|
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8010
8374
|
}))),
|
8011
|
-
!((
|
8375
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8012
8376
|
position: 'relative',
|
8013
8377
|
height: 0,
|
8014
8378
|
width: '100%',
|
@@ -8021,17 +8385,12 @@ const CommodityDetail$1 = (_a) => {
|
|
8021
8385
|
top: 0,
|
8022
8386
|
objectFit: 'cover',
|
8023
8387
|
width: '100%'
|
8024
|
-
}), src: (
|
8025
|
-
|
8026
|
-
|
8027
|
-
|
8028
|
-
|
8029
|
-
|
8030
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8031
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8032
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8033
|
-
18-karat gold, this necklace is embellished with hand-set diamonds.`))),
|
8034
|
-
(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'))));
|
8388
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8389
|
+
renderContent({ isPost })),
|
8390
|
+
renderBtn(),
|
8391
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
8392
|
+
renderContent({ isPost: false }),
|
8393
|
+
renderBtn())));
|
8035
8394
|
};
|
8036
8395
|
var CommodityDetailComponent = React.memo(CommodityDetail$1);
|
8037
8396
|
|
@@ -8039,7 +8398,7 @@ var CommodityDetailComponent = React.memo(CommodityDetail$1);
|
|
8039
8398
|
* @Author: binruan@chatlabs.com
|
8040
8399
|
* @Date: 2023-07-28 18:29:57
|
8041
8400
|
* @LastEditors: binruan@chatlabs.com
|
8042
|
-
* @LastEditTime: 2024-
|
8401
|
+
* @LastEditTime: 2024-04-02 18:13:10
|
8043
8402
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
|
8044
8403
|
*
|
8045
8404
|
*/
|
@@ -8048,8 +8407,42 @@ const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
|
8048
8407
|
icon: '',
|
8049
8408
|
category: 'popup',
|
8050
8409
|
type: 'CommodityDetail',
|
8410
|
+
related: {
|
8411
|
+
settingRender: settingRender$3
|
8412
|
+
},
|
8051
8413
|
defaulSetting: {
|
8052
|
-
props: {
|
8414
|
+
props: {
|
8415
|
+
swiper: {
|
8416
|
+
dotsAlign: 'center',
|
8417
|
+
delay: 3
|
8418
|
+
},
|
8419
|
+
commodityStyles: {
|
8420
|
+
price: {
|
8421
|
+
color: '#000',
|
8422
|
+
fontSize: 18
|
8423
|
+
},
|
8424
|
+
title: {
|
8425
|
+
color: '#000',
|
8426
|
+
fontSize: 23
|
8427
|
+
},
|
8428
|
+
collection: {
|
8429
|
+
fontSize: 12,
|
8430
|
+
color: '#000'
|
8431
|
+
},
|
8432
|
+
info: {
|
8433
|
+
color: 'gray',
|
8434
|
+
fontSize: 12
|
8435
|
+
}
|
8436
|
+
},
|
8437
|
+
buttonStyle: {
|
8438
|
+
backgroundColor: '#000',
|
8439
|
+
fontSize: 12,
|
8440
|
+
height: 45,
|
8441
|
+
fontWeight: 'bold',
|
8442
|
+
textAlign: 'center',
|
8443
|
+
color: 'rgba(255, 255, 255, 0.9)'
|
8444
|
+
}
|
8445
|
+
},
|
8053
8446
|
style: {}
|
8054
8447
|
},
|
8055
8448
|
w: 100,
|
@@ -8077,7 +8470,7 @@ var interactionRender$7 = [
|
|
8077
8470
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Prompt\settingRender.tsx
|
8078
8471
|
*
|
8079
8472
|
*/
|
8080
|
-
var settingRender = [
|
8473
|
+
var settingRender$2 = [
|
8081
8474
|
{
|
8082
8475
|
type: 'Media',
|
8083
8476
|
label: '图标',
|
@@ -8096,7 +8489,7 @@ var settingRender = [
|
|
8096
8489
|
}
|
8097
8490
|
];
|
8098
8491
|
|
8099
|
-
var img$
|
8492
|
+
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";
|
8100
8493
|
|
8101
8494
|
/*
|
8102
8495
|
* @Author: binruan@chatlabs.com
|
@@ -8140,7 +8533,7 @@ const Prompt$1 = (_a) => {
|
|
8140
8533
|
};
|
8141
8534
|
return (React.createElement("div", Object.assign({ className: `pb-prompt ${css.css(Object.assign({}, style))}` }, props),
|
8142
8535
|
React.createElement("div", { className: 'pb-prompt-icon' },
|
8143
|
-
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$
|
8536
|
+
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2 })),
|
8144
8537
|
React.createElement("div", { className: 'pb-prompt-content' }, content),
|
8145
8538
|
React.createElement("button", { className: 'pb-prompt-btn', onClick: handleOk }, btnText)));
|
8146
8539
|
};
|
@@ -8152,13 +8545,13 @@ const Prompt = createMaterial(PromptComponent, {
|
|
8152
8545
|
category: 'popup',
|
8153
8546
|
type: 'Prompt',
|
8154
8547
|
related: {
|
8155
|
-
settingRender,
|
8548
|
+
settingRender: settingRender$2,
|
8156
8549
|
bindableProps: [],
|
8157
8550
|
interactionRender: interactionRender$7
|
8158
8551
|
},
|
8159
8552
|
defaulSetting: {
|
8160
8553
|
props: {
|
8161
|
-
icon: img$
|
8554
|
+
icon: img$2,
|
8162
8555
|
content: 'You have successfully completed the appointment!',
|
8163
8556
|
btnText: 'OK'
|
8164
8557
|
},
|
@@ -8169,301 +8562,189 @@ const Prompt = createMaterial(PromptComponent, {
|
|
8169
8562
|
sort: 3
|
8170
8563
|
});
|
8171
8564
|
|
8172
|
-
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=";
|
8173
|
-
|
8174
|
-
const CommodityDetailDiro$1 = (_a) => {
|
8175
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
8176
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image"]);
|
8177
|
-
const [spread, setSpread] = React.useState(true);
|
8178
|
-
const { sxpParameter } = useSxpDataSource();
|
8179
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
8180
|
-
const { jumpToWeb, productView } = useEventReport();
|
8181
|
-
const scrollRef = React.useRef(null);
|
8182
|
-
const touchRef = React.useRef(null);
|
8183
|
-
const touchMoveRef = React.useRef(null);
|
8184
|
-
const [stopSlide, setStopSlide] = React.useState(false);
|
8185
|
-
const [isBottom, setIsBottom] = React.useState(false);
|
8186
|
-
const [isTop, setIsTop] = React.useState(true);
|
8187
|
-
const curTimeRef = React.useRef(null);
|
8188
|
-
const data = isPost ? rec : popupDetailData;
|
8189
|
-
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;
|
8190
|
-
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;
|
8191
|
-
const handleLink = () => {
|
8192
|
-
if (product === null || product === void 0 ? void 0 : product.link) {
|
8193
|
-
jumpToWeb(data, product, cta);
|
8194
|
-
if (!isPost) {
|
8195
|
-
productView(data, product, cta, viewTime || curTimeRef.current);
|
8196
|
-
}
|
8197
|
-
window.location.href = window.getJointUtmLink(product.link);
|
8198
|
-
}
|
8199
|
-
};
|
8200
|
-
React.useEffect(() => {
|
8201
|
-
const initTime = () => {
|
8202
|
-
curTimeRef.current = new Date();
|
8203
|
-
};
|
8204
|
-
initTime();
|
8205
|
-
window.addEventListener('pageshow', initTime);
|
8206
|
-
return () => {
|
8207
|
-
window.removeEventListener('pageshow', initTime);
|
8208
|
-
};
|
8209
|
-
}, []);
|
8210
|
-
const priceText = React.useMemo(() => {
|
8211
|
-
var _a, _b, _c, _d, _e;
|
8212
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
8213
|
-
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', {
|
8214
|
-
minimumFractionDigits: 0
|
8215
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
8216
|
-
}
|
8217
|
-
else {
|
8218
|
-
return '$7,000';
|
8219
|
-
}
|
8220
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8221
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8222
|
-
const handleClickCollapse = () => {
|
8223
|
-
setSpread(!spread);
|
8224
|
-
};
|
8225
|
-
React.useEffect(() => {
|
8226
|
-
var _a, _b;
|
8227
|
-
console.log((_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight, window.innerHeight);
|
8228
|
-
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) {
|
8229
|
-
setStopSlide(true);
|
8230
|
-
}
|
8231
|
-
}, [scrollRef]);
|
8232
|
-
React.useEffect(() => {
|
8233
|
-
const handleScroll = () => {
|
8234
|
-
if (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) {
|
8235
|
-
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
|
8236
|
-
const isBottom = scrollTop + clientHeight === scrollHeight;
|
8237
|
-
if (isBottom) {
|
8238
|
-
setIsBottom(true);
|
8239
|
-
}
|
8240
|
-
else {
|
8241
|
-
setIsBottom(false);
|
8242
|
-
}
|
8243
|
-
if (scrollTop === 0) {
|
8244
|
-
setIsTop(true);
|
8245
|
-
}
|
8246
|
-
else {
|
8247
|
-
setIsTop(false);
|
8248
|
-
}
|
8249
|
-
}
|
8250
|
-
};
|
8251
|
-
if (scrollRef.current) {
|
8252
|
-
scrollRef.current.addEventListener('scroll', handleScroll);
|
8253
|
-
}
|
8254
|
-
return () => {
|
8255
|
-
if (scrollRef.current) {
|
8256
|
-
scrollRef.current.removeEventListener('scroll', handleScroll);
|
8257
|
-
}
|
8258
|
-
};
|
8259
|
-
}, [scrollRef]);
|
8260
|
-
const handleTouchStart = (event) => {
|
8261
|
-
event.stopPropagation();
|
8262
|
-
touchRef.current = event.touches[0].clientY;
|
8263
|
-
touchMoveRef.current = true;
|
8264
|
-
};
|
8265
|
-
const handleTouchMove = (event) => {
|
8266
|
-
var _a, _b, _c, _d;
|
8267
|
-
if (touchMoveRef.current) {
|
8268
|
-
touchMoveRef.current = false;
|
8269
|
-
const currentY = event.touches[0].clientY;
|
8270
|
-
const diff = touchRef.current - currentY;
|
8271
|
-
if (diff > 0 && (isBottom || !stopSlide)) {
|
8272
|
-
(_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();
|
8273
|
-
}
|
8274
|
-
else if (diff < 0 && (isTop || !stopSlide)) {
|
8275
|
-
(_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();
|
8276
|
-
}
|
8277
|
-
}
|
8278
|
-
};
|
8279
|
-
return (React.createElement("div", { className: 'pb-commondityDiro' },
|
8280
|
-
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props, { onTouchStart: handleTouchStart, onTouchMove: (e) => {
|
8281
|
-
e.stopPropagation();
|
8282
|
-
handleTouchMove(e);
|
8283
|
-
} }),
|
8284
|
-
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: {
|
8285
|
-
delay: 3000
|
8286
|
-
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8287
|
-
return (React.createElement(SwiperSlide, { key: src },
|
8288
|
-
React.createElement("div", { style: {
|
8289
|
-
overflow: 'hidden',
|
8290
|
-
width,
|
8291
|
-
height: width
|
8292
|
-
} },
|
8293
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8294
|
-
}))),
|
8295
|
-
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8296
|
-
position: 'relative',
|
8297
|
-
height: 0,
|
8298
|
-
width: '100%',
|
8299
|
-
paddingBottom: '100%',
|
8300
|
-
overflow: 'hidden'
|
8301
|
-
}) },
|
8302
|
-
React.createElement("img", { className: css.css({
|
8303
|
-
position: 'absolute',
|
8304
|
-
left: 0,
|
8305
|
-
top: 0,
|
8306
|
-
objectFit: 'cover',
|
8307
|
-
width: '100%'
|
8308
|
-
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8309
|
-
React.createElement("div", { className: 'pb-commondityDiro-content' },
|
8310
|
-
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'),
|
8311
|
-
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'),
|
8312
|
-
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'),
|
8313
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-line' }),
|
8314
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-price' }, priceText)),
|
8315
|
-
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) === '') },
|
8316
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse', onClick: handleClickCollapse },
|
8317
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse-title' }, "DESCRIPTION"),
|
8318
|
-
React.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: img$2, alt: '' })),
|
8319
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-info', hidden: !spread }, (product === null || product === void 0 ? void 0 : product.info) ||
|
8320
|
-
'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.')),
|
8321
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement(React.Fragment, null,
|
8322
|
-
React.createElement("div", { className: 'pb-commondityDiro-h90' }),
|
8323
|
-
React.createElement("div", { className: 'pb-commondityDiro-bottom' },
|
8324
|
-
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')))))));
|
8325
|
-
};
|
8326
|
-
var CommodityDetailDiroComponent = React.memo(CommodityDetailDiro$1);
|
8327
|
-
|
8328
8565
|
/*
|
8329
8566
|
* @Author: binruan@chatlabs.com
|
8330
|
-
* @Date:
|
8567
|
+
* @Date: 2024-03-26 16:50:25
|
8331
8568
|
* @LastEditors: binruan@chatlabs.com
|
8332
|
-
* @LastEditTime: 2024-
|
8333
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\
|
8569
|
+
* @LastEditTime: 2024-03-28 18:42:26
|
8570
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
8334
8571
|
*
|
8335
8572
|
*/
|
8336
|
-
|
8337
|
-
|
8338
|
-
|
8339
|
-
|
8340
|
-
|
8341
|
-
|
8342
|
-
|
8343
|
-
|
8573
|
+
var settingRender$1 = [
|
8574
|
+
{
|
8575
|
+
title: '商品图片',
|
8576
|
+
child: [
|
8577
|
+
{
|
8578
|
+
type: 'Radius',
|
8579
|
+
label: '轮播指示器',
|
8580
|
+
options: [
|
8581
|
+
{
|
8582
|
+
label: '居左',
|
8583
|
+
value: 'left'
|
8584
|
+
},
|
8585
|
+
{
|
8586
|
+
label: '居中',
|
8587
|
+
value: 'center'
|
8588
|
+
}
|
8589
|
+
],
|
8590
|
+
name: ['props', 'swiper', 'dotsAlign']
|
8591
|
+
},
|
8592
|
+
{
|
8593
|
+
type: 'Number',
|
8594
|
+
name: ['props', 'swiper', 'delay'],
|
8595
|
+
addonAfter: 's'
|
8596
|
+
}
|
8597
|
+
]
|
8344
8598
|
},
|
8345
|
-
|
8346
|
-
|
8347
|
-
|
8348
|
-
|
8349
|
-
|
8350
|
-
|
8351
|
-
|
8352
|
-
|
8353
|
-
|
8354
|
-
|
8355
|
-
|
8356
|
-
|
8357
|
-
|
8358
|
-
|
8359
|
-
|
8360
|
-
|
8361
|
-
|
8362
|
-
|
8363
|
-
|
8364
|
-
|
8365
|
-
|
8366
|
-
|
8367
|
-
|
8368
|
-
|
8369
|
-
|
8370
|
-
|
8371
|
-
|
8372
|
-
|
8373
|
-
|
8374
|
-
|
8375
|
-
|
8376
|
-
|
8377
|
-
|
8378
|
-
|
8379
|
-
|
8380
|
-
|
8381
|
-
|
8382
|
-
|
8383
|
-
|
8384
|
-
|
8385
|
-
|
8386
|
-
|
8387
|
-
|
8388
|
-
|
8389
|
-
|
8390
|
-
|
8391
|
-
|
8392
|
-
|
8393
|
-
|
8394
|
-
|
8395
|
-
|
8396
|
-
|
8397
|
-
}
|
8398
|
-
|
8399
|
-
|
8400
|
-
|
8401
|
-
|
8402
|
-
|
8403
|
-
|
8404
|
-
|
8405
|
-
|
8406
|
-
|
8407
|
-
|
8408
|
-
|
8409
|
-
|
8410
|
-
|
8411
|
-
|
8412
|
-
|
8413
|
-
|
8414
|
-
|
8415
|
-
|
8416
|
-
|
8417
|
-
|
8418
|
-
|
8419
|
-
|
8420
|
-
|
8599
|
+
{
|
8600
|
+
title: '商品文本',
|
8601
|
+
child: [
|
8602
|
+
{
|
8603
|
+
name: ['props', 'commodityStyles'],
|
8604
|
+
type: 'SelectLinkage',
|
8605
|
+
child: [
|
8606
|
+
{
|
8607
|
+
label: '字段',
|
8608
|
+
type: 'Select',
|
8609
|
+
options: [
|
8610
|
+
{
|
8611
|
+
label: '商品名称',
|
8612
|
+
value: 'title'
|
8613
|
+
},
|
8614
|
+
{
|
8615
|
+
label: '系列名称',
|
8616
|
+
value: 'collection'
|
8617
|
+
},
|
8618
|
+
{
|
8619
|
+
label: '价格',
|
8620
|
+
value: 'price'
|
8621
|
+
},
|
8622
|
+
{
|
8623
|
+
label: '税费说明',
|
8624
|
+
value: 'taxInfo'
|
8625
|
+
},
|
8626
|
+
{
|
8627
|
+
label: '商品描述',
|
8628
|
+
value: 'info'
|
8629
|
+
}
|
8630
|
+
],
|
8631
|
+
name: ['props', 'commodityStyles', 'field'],
|
8632
|
+
initialValue: 'title'
|
8633
|
+
},
|
8634
|
+
{
|
8635
|
+
type: 'Group',
|
8636
|
+
label: '标题字体',
|
8637
|
+
child: [
|
8638
|
+
{
|
8639
|
+
type: 'Color',
|
8640
|
+
name: ['color']
|
8641
|
+
},
|
8642
|
+
{
|
8643
|
+
type: 'Select',
|
8644
|
+
options: [{ label: '黑体', value: '黑体' }],
|
8645
|
+
name: ['fontFamily']
|
8646
|
+
},
|
8647
|
+
{
|
8648
|
+
type: 'Number',
|
8649
|
+
addonAfter: 'px',
|
8650
|
+
name: ['fontSize']
|
8651
|
+
}
|
8652
|
+
]
|
8653
|
+
},
|
8654
|
+
{
|
8655
|
+
label: '标题样式',
|
8656
|
+
type: 'TextStyle'
|
8657
|
+
},
|
8658
|
+
{
|
8659
|
+
label: '标题对齐',
|
8660
|
+
type: 'TextAlign'
|
8661
|
+
},
|
8662
|
+
{
|
8663
|
+
label: '默认行数',
|
8664
|
+
type: 'Number',
|
8665
|
+
name: ['lineClamp']
|
8666
|
+
}
|
8667
|
+
]
|
8668
|
+
}
|
8669
|
+
]
|
8670
|
+
},
|
8671
|
+
{
|
8672
|
+
title: '购买按钮样式',
|
8673
|
+
child: [
|
8674
|
+
{
|
8675
|
+
type: 'Color',
|
8676
|
+
label: '背景色',
|
8677
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
8678
|
+
initialValue: '#000'
|
8679
|
+
},
|
8680
|
+
{
|
8681
|
+
type: 'Group',
|
8682
|
+
label: '尺寸',
|
8683
|
+
child: [
|
8684
|
+
{
|
8685
|
+
type: 'Number',
|
8686
|
+
name: ['props', 'buttonStyle', 'height'],
|
8687
|
+
addonAfter: 'H'
|
8688
|
+
}
|
8689
|
+
]
|
8690
|
+
},
|
8691
|
+
{
|
8692
|
+
type: 'Group',
|
8693
|
+
label: '圆角',
|
8694
|
+
child: [
|
8695
|
+
{
|
8696
|
+
type: 'Slider',
|
8697
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
8698
|
+
max: 100
|
8699
|
+
},
|
8700
|
+
{
|
8701
|
+
type: 'Number',
|
8702
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
8703
|
+
addonAfter: 'px',
|
8704
|
+
max: 100
|
8705
|
+
}
|
8706
|
+
]
|
8707
|
+
},
|
8708
|
+
{
|
8709
|
+
type: 'TextMargin',
|
8710
|
+
name: ['props', 'buttonStyle']
|
8711
|
+
},
|
8712
|
+
{
|
8713
|
+
type: 'Group',
|
8714
|
+
label: '字体',
|
8715
|
+
child: [
|
8716
|
+
{
|
8717
|
+
type: 'Color',
|
8718
|
+
name: ['props', 'buttonStyle', 'color'],
|
8719
|
+
initialValue: '#fff'
|
8720
|
+
},
|
8721
|
+
{
|
8722
|
+
type: 'Select',
|
8723
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
8724
|
+
options: [{ label: '黑体', value: '黑体' }]
|
8725
|
+
},
|
8726
|
+
{
|
8727
|
+
type: 'Number',
|
8728
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
8729
|
+
addonAfter: 'px'
|
8730
|
+
}
|
8731
|
+
]
|
8732
|
+
},
|
8733
|
+
{
|
8734
|
+
type: 'TextStyle',
|
8735
|
+
name: ['props', 'buttonStyle']
|
8736
|
+
},
|
8737
|
+
{
|
8738
|
+
type: 'TextAlign',
|
8739
|
+
name: ['props', 'buttonStyle']
|
8740
|
+
}
|
8741
|
+
]
|
8421
8742
|
}
|
8422
|
-
|
8423
|
-
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8424
|
-
return _words.join(' ') + ' ';
|
8425
|
-
};
|
8426
|
-
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText }) => {
|
8427
|
-
const [isShowMore, setIsShowMore] = React.useState(true);
|
8428
|
-
const [isShow, setIsShow] = React.useState(false);
|
8429
|
-
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
8430
|
-
const multiRow = React.useRef(null);
|
8431
|
-
const handleClick = React.useCallback(() => {
|
8432
|
-
setIsShowMore(!isShowMore);
|
8433
|
-
}, [isShowMore]);
|
8434
|
-
React.useMemo(() => {
|
8435
|
-
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8436
|
-
}, [text, maxStr, isShowMore]);
|
8437
|
-
React.useEffect(() => {
|
8438
|
-
if (multiRow.current) {
|
8439
|
-
setIsShowMore(true);
|
8440
|
-
setTimeout(() => {
|
8441
|
-
setIsShow(false);
|
8442
|
-
const height = parseInt(getComputedStyle(multiRow.current).height);
|
8443
|
-
const lineHeight = parseInt(getComputedStyle(multiRow === null || multiRow === void 0 ? void 0 : multiRow.current).lineHeight);
|
8444
|
-
if (text && height > lineHeight * lineClamp) {
|
8445
|
-
setIsShowMore(false);
|
8446
|
-
setIsShow(true);
|
8447
|
-
}
|
8448
|
-
}, 100);
|
8449
|
-
}
|
8450
|
-
}, [multiRow, text, lineClamp, style]);
|
8451
|
-
return (React.createElement("div", { className: className, style: Object.assign({}, style) },
|
8452
|
-
React.createElement("div", { ref: multiRow, style: {
|
8453
|
-
overflow: 'hidden',
|
8454
|
-
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
8455
|
-
textOverflow: 'ellipsis',
|
8456
|
-
display: '-webkit-box',
|
8457
|
-
WebkitBoxOrient: 'vertical',
|
8458
|
-
wordBreak: 'break-word'
|
8459
|
-
} }, text),
|
8460
|
-
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'))));
|
8461
|
-
};
|
8462
|
-
var ExpandableText$1 = React.memo(ExpandableText);
|
8743
|
+
];
|
8463
8744
|
|
8464
8745
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8465
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
8466
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText"]);
|
8746
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8747
|
+
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"]);
|
8467
8748
|
React.useState(true);
|
8468
8749
|
const { sxpParameter } = useSxpDataSource();
|
8469
8750
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
@@ -8510,14 +8791,22 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8510
8791
|
}
|
8511
8792
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8512
8793
|
const width = isPreview ? 375 : window.innerWidth;
|
8794
|
+
const productInfoText = ({ isPost }) => {
|
8795
|
+
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8796
|
+
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) ||
|
8797
|
+
`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
|
8798
|
+
Made in Italy` })));
|
8799
|
+
};
|
8513
8800
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8514
8801
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
|
8515
8802
|
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: {
|
8516
8803
|
clickable: true,
|
8517
8804
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8518
|
-
clickableClass:
|
8805
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
8806
|
+
? 'commondityDiroNew-swiper-clickable-left'
|
8807
|
+
: 'commondityDiroNew-swiper-clickable-center'
|
8519
8808
|
}, loop: true, autoplay: {
|
8520
|
-
delay:
|
8809
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8521
8810
|
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8522
8811
|
return (React.createElement(SwiperSlide, { key: src },
|
8523
8812
|
React.createElement("div", { style: {
|
@@ -8543,35 +8832,289 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8543
8832
|
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8544
8833
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8545
8834
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8546
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
|
8547
|
-
React.createElement("div", { className: '
|
8548
|
-
|
8549
|
-
|
8550
|
-
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.
|
8551
|
-
|
8552
|
-
|
8553
|
-
|
8554
|
-
Made in Italy`))))),
|
8555
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
8556
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-info', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') }, (product === null || product === void 0 ? void 0 : product.info) ||
|
8557
|
-
`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
|
8558
|
-
Made in Italy`))));
|
8835
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
|
8836
|
+
React.createElement("div", { className: '' },
|
8837
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
8838
|
+
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 : '税费'))),
|
8839
|
+
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'),
|
8840
|
+
(!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')),
|
8841
|
+
productInfoText({ isPost }))),
|
8842
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8559
8843
|
};
|
8560
|
-
var
|
8844
|
+
var CommodityDetailDiroNewComponent = React.memo(CommodityDetailDiroNew$1);
|
8561
8845
|
|
8562
|
-
|
8846
|
+
/*
|
8847
|
+
* @Author: binruan@chatlabs.com
|
8848
|
+
* @Date: 2024-03-20 10:27:31
|
8849
|
+
* @LastEditors: binruan@chatlabs.com
|
8850
|
+
* @LastEditTime: 2024-04-02 15:12:53
|
8851
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\material.tsx
|
8852
|
+
*
|
8853
|
+
*/
|
8854
|
+
const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
8563
8855
|
displayName: '商品详情',
|
8564
8856
|
icon: '',
|
8565
8857
|
category: 'popup',
|
8566
8858
|
type: 'CommodityDetailDiroNew',
|
8859
|
+
related: {
|
8860
|
+
settingRender: settingRender$1
|
8861
|
+
},
|
8567
8862
|
defaulSetting: {
|
8568
|
-
props: {
|
8863
|
+
props: {
|
8864
|
+
swiper: {
|
8865
|
+
dotsAlign: 'left',
|
8866
|
+
delay: 3
|
8867
|
+
},
|
8868
|
+
commodityStyles: {
|
8869
|
+
price: {
|
8870
|
+
color: '#000',
|
8871
|
+
fontWeight: 'bold',
|
8872
|
+
fontSize: 18
|
8873
|
+
},
|
8874
|
+
title: {
|
8875
|
+
color: '#000',
|
8876
|
+
fontSize: 13
|
8877
|
+
},
|
8878
|
+
collection: {
|
8879
|
+
color: '#757575',
|
8880
|
+
fontSize: 13
|
8881
|
+
},
|
8882
|
+
info: {
|
8883
|
+
color: '#757575',
|
8884
|
+
fontSize: 13
|
8885
|
+
},
|
8886
|
+
taxInfo: {
|
8887
|
+
color: '#000',
|
8888
|
+
fontWeight: 'bold',
|
8889
|
+
fontSize: 13,
|
8890
|
+
textAlign: 'right'
|
8891
|
+
}
|
8892
|
+
},
|
8893
|
+
buttonStyle: {
|
8894
|
+
backgroundColor: '#000',
|
8895
|
+
fontSize: 12,
|
8896
|
+
height: 52,
|
8897
|
+
fontWeight: 'bold',
|
8898
|
+
textAlign: 'center',
|
8899
|
+
color: '#fff',
|
8900
|
+
borderRadius: 25,
|
8901
|
+
marginTop: 16,
|
8902
|
+
marginBottom: 16
|
8903
|
+
}
|
8904
|
+
},
|
8569
8905
|
style: {}
|
8570
8906
|
},
|
8571
|
-
w: 100,
|
8572
|
-
h: 40,
|
8573
|
-
sort: 1
|
8574
|
-
});
|
8907
|
+
w: 100,
|
8908
|
+
h: 40,
|
8909
|
+
sort: 1
|
8910
|
+
});
|
8911
|
+
|
8912
|
+
/*
|
8913
|
+
* @Author: binruan@chatlabs.com
|
8914
|
+
* @Date: 2024-03-26 16:50:25
|
8915
|
+
* @LastEditors: binruan@chatlabs.com
|
8916
|
+
* @LastEditTime: 2024-03-29 17:03:07
|
8917
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
8918
|
+
*
|
8919
|
+
*/
|
8920
|
+
var settingRender = [
|
8921
|
+
{
|
8922
|
+
title: '主题样式',
|
8923
|
+
child: [
|
8924
|
+
{
|
8925
|
+
type: 'Group',
|
8926
|
+
label: '尺寸',
|
8927
|
+
child: [
|
8928
|
+
{
|
8929
|
+
type: 'Number',
|
8930
|
+
name: ['style', 'width'],
|
8931
|
+
addonAfter: 'W'
|
8932
|
+
},
|
8933
|
+
{
|
8934
|
+
type: 'Number',
|
8935
|
+
name: ['style', 'height'],
|
8936
|
+
addonAfter: 'H'
|
8937
|
+
}
|
8938
|
+
]
|
8939
|
+
},
|
8940
|
+
{
|
8941
|
+
type: 'Group',
|
8942
|
+
label: '圆角',
|
8943
|
+
child: [
|
8944
|
+
{
|
8945
|
+
type: 'Slider',
|
8946
|
+
name: ['style', 'borderRadius'],
|
8947
|
+
max: 100
|
8948
|
+
},
|
8949
|
+
{
|
8950
|
+
type: 'Number',
|
8951
|
+
name: ['style', 'borderRadius'],
|
8952
|
+
addonAfter: 'px',
|
8953
|
+
max: 100
|
8954
|
+
}
|
8955
|
+
]
|
8956
|
+
},
|
8957
|
+
{
|
8958
|
+
type: 'Color',
|
8959
|
+
label: '背景色',
|
8960
|
+
name: ['style', 'backgroundColor']
|
8961
|
+
},
|
8962
|
+
{
|
8963
|
+
label: '内边距',
|
8964
|
+
type: 'Number',
|
8965
|
+
name: ['style', 'padding'],
|
8966
|
+
addonAfter: 'px'
|
8967
|
+
},
|
8968
|
+
{
|
8969
|
+
label: '与Post描述边距',
|
8970
|
+
type: 'Number',
|
8971
|
+
name: ['style', 'marginBottom'],
|
8972
|
+
addonAfter: 'px'
|
8973
|
+
}
|
8974
|
+
]
|
8975
|
+
},
|
8976
|
+
{
|
8977
|
+
title: '商品图片',
|
8978
|
+
child: [
|
8979
|
+
{
|
8980
|
+
type: 'Group',
|
8981
|
+
label: '尺寸',
|
8982
|
+
child: [
|
8983
|
+
{
|
8984
|
+
type: 'Number',
|
8985
|
+
name: ['props', 'ctaTempStyles', 'img', 'width'],
|
8986
|
+
addonAfter: 'W'
|
8987
|
+
},
|
8988
|
+
{
|
8989
|
+
type: 'Number',
|
8990
|
+
name: ['props', 'ctaTempStyles', 'img', 'height'],
|
8991
|
+
addonAfter: 'H'
|
8992
|
+
}
|
8993
|
+
]
|
8994
|
+
},
|
8995
|
+
{
|
8996
|
+
type: 'Group',
|
8997
|
+
label: '圆角',
|
8998
|
+
child: [
|
8999
|
+
{
|
9000
|
+
type: 'Slider',
|
9001
|
+
name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
|
9002
|
+
max: 100
|
9003
|
+
},
|
9004
|
+
{
|
9005
|
+
type: 'Number',
|
9006
|
+
name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
|
9007
|
+
addonAfter: 'px',
|
9008
|
+
max: 100
|
9009
|
+
}
|
9010
|
+
]
|
9011
|
+
},
|
9012
|
+
{
|
9013
|
+
type: 'Number',
|
9014
|
+
label: '与右侧边距',
|
9015
|
+
addonAfter: 'px',
|
9016
|
+
name: ['props', 'ctaTempStyles', 'img', 'marginRight']
|
9017
|
+
}
|
9018
|
+
]
|
9019
|
+
},
|
9020
|
+
{
|
9021
|
+
title: '商品标题文本',
|
9022
|
+
type: 'commodityTitle',
|
9023
|
+
child: [
|
9024
|
+
{
|
9025
|
+
type: 'Group',
|
9026
|
+
label: '字体',
|
9027
|
+
child: [
|
9028
|
+
{
|
9029
|
+
type: 'Color',
|
9030
|
+
name: ['props', 'ctaTempStyles', 'title', 'color']
|
9031
|
+
},
|
9032
|
+
{
|
9033
|
+
type: 'Select',
|
9034
|
+
options: [{ label: '黑体', value: '黑体' }],
|
9035
|
+
name: ['props', 'ctaTempStyles', 'title', 'fontFamily']
|
9036
|
+
},
|
9037
|
+
{
|
9038
|
+
type: 'Number',
|
9039
|
+
addonAfter: 'px',
|
9040
|
+
name: ['props', 'ctaTempStyles', 'title', 'fontSize']
|
9041
|
+
}
|
9042
|
+
]
|
9043
|
+
},
|
9044
|
+
{
|
9045
|
+
label: '样式',
|
9046
|
+
type: 'TextStyle',
|
9047
|
+
name: ['props', 'ctaTempStyles', 'title']
|
9048
|
+
},
|
9049
|
+
{
|
9050
|
+
label: '对齐',
|
9051
|
+
type: 'TextAlign',
|
9052
|
+
name: ['props', 'ctaTempStyles', 'title']
|
9053
|
+
},
|
9054
|
+
{
|
9055
|
+
label: '间距',
|
9056
|
+
type: 'TextSpace',
|
9057
|
+
name: ['props', 'ctaTempStyles', 'title']
|
9058
|
+
}
|
9059
|
+
]
|
9060
|
+
},
|
9061
|
+
{
|
9062
|
+
title: 'CTA标题',
|
9063
|
+
child: [
|
9064
|
+
{
|
9065
|
+
type: 'Group',
|
9066
|
+
label: '尺寸',
|
9067
|
+
child: [
|
9068
|
+
{
|
9069
|
+
type: 'Number',
|
9070
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'width'],
|
9071
|
+
addonAfter: 'W'
|
9072
|
+
},
|
9073
|
+
{
|
9074
|
+
type: 'Number',
|
9075
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'height'],
|
9076
|
+
addonAfter: 'H'
|
9077
|
+
}
|
9078
|
+
]
|
9079
|
+
},
|
9080
|
+
{
|
9081
|
+
type: 'Color',
|
9082
|
+
label: '背景色',
|
9083
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'backgroundColor']
|
9084
|
+
},
|
9085
|
+
{
|
9086
|
+
type: 'Group',
|
9087
|
+
label: '字体',
|
9088
|
+
child: [
|
9089
|
+
{
|
9090
|
+
type: 'Color',
|
9091
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'color']
|
9092
|
+
},
|
9093
|
+
{
|
9094
|
+
type: 'Select',
|
9095
|
+
options: [{ label: '黑体', value: '黑体' }],
|
9096
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontFamily']
|
9097
|
+
},
|
9098
|
+
{
|
9099
|
+
type: 'Number',
|
9100
|
+
addonAfter: 'px',
|
9101
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontSize']
|
9102
|
+
}
|
9103
|
+
]
|
9104
|
+
},
|
9105
|
+
{
|
9106
|
+
label: '样式',
|
9107
|
+
type: 'TextStyle',
|
9108
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
9109
|
+
},
|
9110
|
+
{
|
9111
|
+
label: '对齐',
|
9112
|
+
type: 'TextAlign',
|
9113
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
9114
|
+
}
|
9115
|
+
]
|
9116
|
+
}
|
9117
|
+
];
|
8575
9118
|
|
8576
9119
|
var interactionRender$6 = [
|
8577
9120
|
{
|
@@ -8613,9 +9156,10 @@ function useOnScreen(ref) {
|
|
8613
9156
|
}
|
8614
9157
|
|
8615
9158
|
const EventProvider = (_a) => {
|
8616
|
-
var { rec, children, className, onClick } = _a; __rest(_a, ["rec", "children", "className", "onClick"]);
|
9159
|
+
var { rec, children, className, onClick, style } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style"]);
|
8617
9160
|
const ref = React.useRef(null);
|
8618
9161
|
const isOnScreen = useOnScreen(ref);
|
9162
|
+
const { popupAni } = useEditor();
|
8619
9163
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
8620
9164
|
React.useEffect(() => {
|
8621
9165
|
var _a, _b;
|
@@ -8636,8 +9180,8 @@ const EventProvider = (_a) => {
|
|
8636
9180
|
}, rec, item);
|
8637
9181
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
8638
9182
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
8639
|
-
},
|
8640
|
-
return (React.createElement("div", { ref: ref, className: className, onClick: handleClick }, children));
|
9183
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9184
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
8641
9185
|
};
|
8642
9186
|
var EventProvider$1 = React.memo(EventProvider);
|
8643
9187
|
|
@@ -8645,20 +9189,12 @@ var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
|
8645
9189
|
|
8646
9190
|
const Commodity$1 = (_a) => {
|
8647
9191
|
var _b, _c, _d, _e, _f, _g, _h;
|
8648
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9192
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8649
9193
|
const { sxpParameter } = useSxpDataSource();
|
8650
9194
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8651
9195
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
8652
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8653
|
-
React.createElement("div", { className: css.css({
|
8654
|
-
width: '60px',
|
8655
|
-
height: '60px',
|
8656
|
-
marginRight: '8px',
|
8657
|
-
borderRadius: '3px',
|
8658
|
-
overflow: 'hidden',
|
8659
|
-
flexShrink: 0,
|
8660
|
-
backgroundColor: '#f2f2f2'
|
8661
|
-
}) },
|
9196
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9197
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8662
9198
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8663
9199
|
React.createElement("div", { className: css.css({
|
8664
9200
|
color: '#fff',
|
@@ -8668,20 +9204,19 @@ const Commodity$1 = (_a) => {
|
|
8668
9204
|
width: '100%',
|
8669
9205
|
overflow: 'hidden'
|
8670
9206
|
}) },
|
8671
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'] }, (_f = product === null || product === void 0 ? void 0 : product.title) !== null && _f !== void 0 ? _f : 'Product Name'),
|
8672
|
-
React.createElement("div", { className: css.css({
|
8673
|
-
background: 'rgba(0,0,0,.5)',
|
8674
|
-
fontSize: '10px',
|
8675
|
-
padding: '2px 7px',
|
8676
|
-
width: 'auto',
|
8677
|
-
textAlign: 'center',
|
8678
|
-
textOverflow: 'ellipsis',
|
8679
|
-
overflow: 'hidden',
|
8680
|
-
whiteSpace: 'nowrap'
|
8681
|
-
}) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now'))));
|
9207
|
+
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_f = product === null || product === void 0 ? void 0 : product.title) !== null && _f !== void 0 ? _f : 'Product Name'),
|
9208
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now'))));
|
8682
9209
|
};
|
8683
9210
|
var CommodityComponent = React.memo(Commodity$1);
|
8684
9211
|
|
9212
|
+
/*
|
9213
|
+
* @Author: binruan@chatlabs.com
|
9214
|
+
* @Date: 2023-07-28 18:29:57
|
9215
|
+
* @LastEditors: binruan@chatlabs.com
|
9216
|
+
* @LastEditTime: 2024-03-29 16:39:54
|
9217
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Commodity\material.tsx
|
9218
|
+
*
|
9219
|
+
*/
|
8685
9220
|
const Commodity = createMaterial(CommodityComponent, {
|
8686
9221
|
displayName: '推荐单商品-透明底',
|
8687
9222
|
icon: '',
|
@@ -8689,15 +9224,39 @@ const Commodity = createMaterial(CommodityComponent, {
|
|
8689
9224
|
type: 'Commodity',
|
8690
9225
|
related: {
|
8691
9226
|
interactionRender: interactionRender$6,
|
8692
|
-
bindableProps: []
|
9227
|
+
bindableProps: [],
|
9228
|
+
settingRender
|
8693
9229
|
},
|
8694
9230
|
defaulSetting: {
|
8695
|
-
props: {
|
9231
|
+
props: {
|
9232
|
+
ctaTempStyles: {
|
9233
|
+
img: {
|
9234
|
+
borderRadius: 3,
|
9235
|
+
width: 60,
|
9236
|
+
height: 60,
|
9237
|
+
marginRight: 8
|
9238
|
+
},
|
9239
|
+
title: {
|
9240
|
+
fontSize: 12,
|
9241
|
+
color: '#fff',
|
9242
|
+
textAlign: 'left'
|
9243
|
+
},
|
9244
|
+
ctaTitle: {
|
9245
|
+
fontSize: 10,
|
9246
|
+
color: '#fff',
|
9247
|
+
textAlign: 'center',
|
9248
|
+
width: 130,
|
9249
|
+
height: 20,
|
9250
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
9251
|
+
}
|
9252
|
+
}
|
9253
|
+
},
|
8696
9254
|
style: {
|
8697
|
-
padding:
|
8698
|
-
|
8699
|
-
|
8700
|
-
borderRadius:
|
9255
|
+
padding: 7,
|
9256
|
+
width: 236,
|
9257
|
+
height: 74,
|
9258
|
+
borderRadius: 3,
|
9259
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8701
9260
|
}
|
8702
9261
|
},
|
8703
9262
|
w: 100,
|
@@ -8719,30 +9278,24 @@ var interactionRender$5 = [
|
|
8719
9278
|
|
8720
9279
|
const Appoint$1 = (_a) => {
|
8721
9280
|
var _b, _c, _d, _e;
|
8722
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9281
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8723
9282
|
const { sxpParameter } = useSxpDataSource();
|
8724
9283
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
8725
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8726
|
-
React.createElement("div", { className: css.css({
|
8727
|
-
width: '30px',
|
8728
|
-
height: '30px',
|
8729
|
-
marginRight: '8px',
|
8730
|
-
borderRadius: '3px',
|
8731
|
-
overflow: 'hidden',
|
8732
|
-
flexShrink: 0,
|
8733
|
-
backgroundColor: '#f2f2f2'
|
8734
|
-
}) },
|
9284
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
9285
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8735
9286
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
|
8736
|
-
React.createElement("div", { className: css.css({
|
8737
|
-
color: '#fff',
|
8738
|
-
width: '100%',
|
8739
|
-
overflow: 'hidden',
|
8740
|
-
fontSize: '12px',
|
8741
|
-
textOverflow: 'ellipsis'
|
8742
|
-
}) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
9287
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
8743
9288
|
};
|
8744
9289
|
var AppointComponent = React.memo(Appoint$1);
|
8745
9290
|
|
9291
|
+
/*
|
9292
|
+
* @Author: binruan@chatlabs.com
|
9293
|
+
* @Date: 2023-07-28 18:29:57
|
9294
|
+
* @LastEditors: binruan@chatlabs.com
|
9295
|
+
* @LastEditTime: 2024-03-29 17:03:49
|
9296
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Appoint\material.tsx
|
9297
|
+
*
|
9298
|
+
*/
|
8746
9299
|
const Appoint = createMaterial(AppointComponent, {
|
8747
9300
|
displayName: '预约表单',
|
8748
9301
|
icon: '',
|
@@ -8750,18 +9303,33 @@ const Appoint = createMaterial(AppointComponent, {
|
|
8750
9303
|
type: 'Appoint',
|
8751
9304
|
related: {
|
8752
9305
|
interactionRender: interactionRender$5,
|
9306
|
+
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
8753
9307
|
bindableProps: []
|
8754
9308
|
},
|
8755
9309
|
defaulSetting: {
|
8756
9310
|
props: {
|
8757
|
-
|
9311
|
+
ctaTempStyles: {
|
9312
|
+
img: {
|
9313
|
+
borderRadius: 3,
|
9314
|
+
width: 30,
|
9315
|
+
height: 30,
|
9316
|
+
marginRight: 8
|
9317
|
+
},
|
9318
|
+
ctaTitle: {
|
9319
|
+
fontSize: 12,
|
9320
|
+
color: '#fff',
|
9321
|
+
textAlign: 'left',
|
9322
|
+
width: 130,
|
9323
|
+
height: 20
|
9324
|
+
}
|
9325
|
+
}
|
8758
9326
|
},
|
8759
9327
|
style: {
|
8760
|
-
padding:
|
8761
|
-
|
8762
|
-
|
8763
|
-
|
8764
|
-
|
9328
|
+
padding: 7,
|
9329
|
+
width: 236,
|
9330
|
+
height: 44,
|
9331
|
+
borderRadius: 3,
|
9332
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8765
9333
|
}
|
8766
9334
|
},
|
8767
9335
|
w: 100,
|
@@ -8773,7 +9341,7 @@ var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
|
8773
9341
|
|
8774
9342
|
const Link$1 = (_a) => {
|
8775
9343
|
var _b, _c, _d, _e, _f;
|
8776
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9344
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8777
9345
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
8778
9346
|
const { jumpToWeb } = useEventReport();
|
8779
9347
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
@@ -8784,45 +9352,60 @@ const Link$1 = (_a) => {
|
|
8784
9352
|
window.location.href = window.getJointUtmLink(cta.link);
|
8785
9353
|
}
|
8786
9354
|
};
|
8787
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8788
|
-
React.createElement("div", { className: css.css({
|
8789
|
-
width: '60px',
|
8790
|
-
height: '60px',
|
8791
|
-
marginRight: '8px',
|
8792
|
-
borderRadius: '3px',
|
8793
|
-
backgroundColor: '#f2f2f2',
|
8794
|
-
overflow: 'hidden',
|
8795
|
-
flexShrink: 0
|
8796
|
-
}) },
|
9355
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9356
|
+
React.createElement("div", { className: css.css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8797
9357
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), 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, alt: '' })),
|
8798
9358
|
React.createElement("div", { className: css.css({
|
8799
|
-
color: '#fff',
|
8800
9359
|
display: 'flex',
|
8801
9360
|
alignItems: 'center',
|
8802
9361
|
width: '100%',
|
8803
9362
|
overflow: 'hidden'
|
8804
9363
|
}) },
|
8805
|
-
React.createElement("div", { className: styles$5['tow-line-ellipsis'] }, (_f = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _f !== void 0 ? _f : 'Product Name'))));
|
9364
|
+
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (_f = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _f !== void 0 ? _f : 'Product Name'))));
|
8806
9365
|
};
|
8807
9366
|
var LinkComponent = React.memo(Link$1);
|
8808
9367
|
|
9368
|
+
/*
|
9369
|
+
* @Author: binruan@chatlabs.com
|
9370
|
+
* @Date: 2023-07-28 18:29:57
|
9371
|
+
* @LastEditors: binruan@chatlabs.com
|
9372
|
+
* @LastEditTime: 2024-03-29 17:04:57
|
9373
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\material.tsx
|
9374
|
+
*
|
9375
|
+
*/
|
8809
9376
|
const Link = createMaterial(LinkComponent, {
|
8810
9377
|
displayName: '跳转指引',
|
8811
9378
|
icon: '',
|
8812
9379
|
category: 'template',
|
8813
9380
|
type: 'Link',
|
8814
9381
|
related: {
|
9382
|
+
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
8815
9383
|
bindableProps: []
|
8816
9384
|
},
|
8817
9385
|
defaulSetting: {
|
8818
9386
|
props: {
|
8819
|
-
|
9387
|
+
ctaTempStyles: {
|
9388
|
+
img: {
|
9389
|
+
borderRadius: 3,
|
9390
|
+
width: 60,
|
9391
|
+
height: 60,
|
9392
|
+
marginRight: 8
|
9393
|
+
},
|
9394
|
+
ctaTitle: {
|
9395
|
+
fontSize: 12,
|
9396
|
+
color: '#fff',
|
9397
|
+
textAlign: 'left',
|
9398
|
+
width: 130,
|
9399
|
+
height: 20
|
9400
|
+
}
|
9401
|
+
}
|
8820
9402
|
},
|
8821
9403
|
style: {
|
8822
|
-
padding:
|
8823
|
-
|
8824
|
-
|
8825
|
-
borderRadius:
|
9404
|
+
padding: 7,
|
9405
|
+
width: 236,
|
9406
|
+
height: 74,
|
9407
|
+
borderRadius: 3,
|
9408
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8826
9409
|
}
|
8827
9410
|
},
|
8828
9411
|
w: 100,
|
@@ -8846,20 +9429,12 @@ var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
|
8846
9429
|
|
8847
9430
|
const CommodityDiro$1 = (_a) => {
|
8848
9431
|
var _b, _c, _d, _e, _f, _g, _h;
|
8849
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9432
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8850
9433
|
const { sxpParameter } = useSxpDataSource();
|
8851
9434
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8852
9435
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
8853
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8854
|
-
React.createElement("div", { className: css.css({
|
8855
|
-
width: '60px',
|
8856
|
-
height: '60px',
|
8857
|
-
marginRight: '8px',
|
8858
|
-
borderRadius: '3px',
|
8859
|
-
overflow: 'hidden',
|
8860
|
-
flexShrink: 0,
|
8861
|
-
backgroundColor: '#f2f2f2'
|
8862
|
-
}) },
|
9436
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9437
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8863
9438
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8864
9439
|
React.createElement("div", { className: css.css({
|
8865
9440
|
color: '#fff',
|
@@ -8869,22 +9444,19 @@ const CommodityDiro$1 = (_a) => {
|
|
8869
9444
|
width: '100%',
|
8870
9445
|
overflow: 'hidden'
|
8871
9446
|
}) },
|
8872
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'] }, (_f = product === null || product === void 0 ? void 0 : product.title) !== null && _f !== void 0 ? _f : 'Product Name'),
|
8873
|
-
React.createElement("div", { className: css.css({
|
8874
|
-
background: 'rgba(0,0,0,1)',
|
8875
|
-
fontSize: '10px',
|
8876
|
-
padding: '2px 7px',
|
8877
|
-
textAlign: 'center',
|
8878
|
-
textOverflow: 'ellipsis',
|
8879
|
-
overflow: 'hidden',
|
8880
|
-
borderRadius: '25px',
|
8881
|
-
width: 'fit-content',
|
8882
|
-
maxWidth: '100%',
|
8883
|
-
whiteSpace: 'nowrap'
|
8884
|
-
}) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now'))));
|
9447
|
+
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_f = product === null || product === void 0 ? void 0 : product.title) !== null && _f !== void 0 ? _f : 'Product Name'),
|
9448
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now'))));
|
8885
9449
|
};
|
8886
9450
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
8887
9451
|
|
9452
|
+
/*
|
9453
|
+
* @Author: binruan@chatlabs.com
|
9454
|
+
* @Date: 2023-07-28 18:29:57
|
9455
|
+
* @LastEditors: binruan@chatlabs.com
|
9456
|
+
* @LastEditTime: 2024-03-29 16:07:28
|
9457
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\CommodityDiro\material.tsx
|
9458
|
+
*
|
9459
|
+
*/
|
8888
9460
|
const CommodityDiro = createMaterial(CommodityDiroComponent, {
|
8889
9461
|
displayName: '推荐单商品-白底圆角按钮',
|
8890
9462
|
icon: '',
|
@@ -8892,15 +9464,39 @@ const CommodityDiro = createMaterial(CommodityDiroComponent, {
|
|
8892
9464
|
type: 'CommodityDiro',
|
8893
9465
|
related: {
|
8894
9466
|
interactionRender: interactionRender$4,
|
9467
|
+
settingRender,
|
8895
9468
|
bindableProps: []
|
8896
9469
|
},
|
8897
9470
|
defaulSetting: {
|
8898
|
-
props: {
|
9471
|
+
props: {
|
9472
|
+
ctaTempStyles: {
|
9473
|
+
img: {
|
9474
|
+
borderRadius: 3,
|
9475
|
+
width: 60,
|
9476
|
+
height: 60,
|
9477
|
+
marginRight: 8
|
9478
|
+
},
|
9479
|
+
title: {
|
9480
|
+
fontSize: 12,
|
9481
|
+
color: '#000',
|
9482
|
+
textAlign: 'left'
|
9483
|
+
},
|
9484
|
+
ctaTitle: {
|
9485
|
+
fontSize: 10,
|
9486
|
+
color: '#fff',
|
9487
|
+
textAlign: 'center',
|
9488
|
+
width: 80,
|
9489
|
+
height: 20,
|
9490
|
+
backgroundColor: 'rgba(0,0,0,1)'
|
9491
|
+
}
|
9492
|
+
}
|
9493
|
+
},
|
8899
9494
|
style: {
|
8900
|
-
padding:
|
8901
|
-
|
8902
|
-
|
8903
|
-
|
9495
|
+
padding: 7,
|
9496
|
+
width: 236,
|
9497
|
+
height: 74,
|
9498
|
+
borderRadius: 3,
|
9499
|
+
backgroundColor: '#fff'
|
8904
9500
|
}
|
8905
9501
|
},
|
8906
9502
|
w: 100,
|
@@ -8924,20 +9520,12 @@ var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
|
8924
9520
|
|
8925
9521
|
const CommodityDiroNew$1 = (_a) => {
|
8926
9522
|
var _b, _c, _d, _e, _f, _g, _h;
|
8927
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9523
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8928
9524
|
const { sxpParameter } = useSxpDataSource();
|
8929
9525
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8930
9526
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
8931
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8932
|
-
React.createElement("div", { className: css.css({
|
8933
|
-
width: '78px',
|
8934
|
-
height: '78px',
|
8935
|
-
marginRight: '16px',
|
8936
|
-
borderRadius: '8px',
|
8937
|
-
overflow: 'hidden',
|
8938
|
-
flexShrink: 0,
|
8939
|
-
backgroundColor: '#f2f2f2'
|
8940
|
-
}) },
|
9527
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9528
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8941
9529
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8942
9530
|
React.createElement("div", { className: css.css({
|
8943
9531
|
color: '#fff',
|
@@ -8947,22 +9535,19 @@ const CommodityDiroNew$1 = (_a) => {
|
|
8947
9535
|
width: '100%',
|
8948
9536
|
overflow: 'hidden'
|
8949
9537
|
}) },
|
8950
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'] }, (_f = product === null || product === void 0 ? void 0 : product.title) !== null && _f !== void 0 ? _f : 'Product Name'),
|
8951
|
-
React.createElement("div", { className: css.css({
|
8952
|
-
fontSize: '13px',
|
8953
|
-
fontWeight: 'bold',
|
8954
|
-
textOverflow: 'ellipsis',
|
8955
|
-
overflow: 'hidden',
|
8956
|
-
width: 'fit-content',
|
8957
|
-
maxWidth: '100%',
|
8958
|
-
whiteSpace: 'nowrap',
|
8959
|
-
textDecoration: 'underline',
|
8960
|
-
color: '#000',
|
8961
|
-
lineHeight: '20px'
|
8962
|
-
}) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop now'))));
|
9538
|
+
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_f = product === null || product === void 0 ? void 0 : product.title) !== null && _f !== void 0 ? _f : 'Product Name'),
|
9539
|
+
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop now'))));
|
8963
9540
|
};
|
8964
9541
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
8965
9542
|
|
9543
|
+
/*
|
9544
|
+
* @Author: binruan@chatlabs.com
|
9545
|
+
* @Date: 2023-07-28 18:29:57
|
9546
|
+
* @LastEditors: binruan@chatlabs.com
|
9547
|
+
* @LastEditTime: 2024-03-29 11:56:56
|
9548
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\CommodityDiroNew\material.tsx
|
9549
|
+
*
|
9550
|
+
*/
|
8966
9551
|
const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
|
8967
9552
|
displayName: '推荐单商品-白底下划线按钮',
|
8968
9553
|
icon: '',
|
@@ -8970,15 +9555,40 @@ const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
|
|
8970
9555
|
type: 'CommodityDiroNew',
|
8971
9556
|
related: {
|
8972
9557
|
interactionRender: interactionRender$3,
|
8973
|
-
bindableProps: []
|
9558
|
+
bindableProps: [],
|
9559
|
+
settingRender
|
8974
9560
|
},
|
8975
9561
|
defaulSetting: {
|
8976
|
-
props: {
|
9562
|
+
props: {
|
9563
|
+
ctaTempStyles: {
|
9564
|
+
img: {
|
9565
|
+
borderRadius: 8,
|
9566
|
+
width: 78,
|
9567
|
+
height: 78,
|
9568
|
+
marginRight: 16
|
9569
|
+
},
|
9570
|
+
title: {
|
9571
|
+
fontSize: 12,
|
9572
|
+
color: '#000',
|
9573
|
+
textAlign: 'left'
|
9574
|
+
},
|
9575
|
+
ctaTitle: {
|
9576
|
+
textDecoration: 'underline',
|
9577
|
+
fontSize: 12,
|
9578
|
+
fontWeight: 'bold',
|
9579
|
+
color: '#000',
|
9580
|
+
textAlign: 'left',
|
9581
|
+
width: 150,
|
9582
|
+
height: 20
|
9583
|
+
}
|
9584
|
+
}
|
9585
|
+
},
|
8977
9586
|
style: {
|
8978
|
-
|
8979
|
-
|
8980
|
-
|
8981
|
-
|
9587
|
+
borderRadius: 4,
|
9588
|
+
width: 260,
|
9589
|
+
height: 86,
|
9590
|
+
padding: 4,
|
9591
|
+
backgroundColor: 'rgba(255,255,255,0.75)'
|
8982
9592
|
}
|
8983
9593
|
},
|
8984
9594
|
w: 100,
|
@@ -9031,8 +9641,9 @@ var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
9031
9641
|
|
9032
9642
|
const MultiCommodityDiro$1 = (_a) => {
|
9033
9643
|
var _b, _c;
|
9034
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9644
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9035
9645
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9646
|
+
const { popupAni } = useEditor();
|
9036
9647
|
const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
9037
9648
|
const handleClick = lodash.throttle((item) => {
|
9038
9649
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9041,19 +9652,11 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9041
9652
|
}, recData, item);
|
9042
9653
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
9043
9654
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9044
|
-
},
|
9655
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9045
9656
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9046
9657
|
var _a, _b, _c, _d, _e, _f;
|
9047
|
-
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(
|
9048
|
-
React.createElement("div", { className: css.css({
|
9049
|
-
width: '60px',
|
9050
|
-
height: '60px',
|
9051
|
-
marginRight: '8px',
|
9052
|
-
borderRadius: '3px',
|
9053
|
-
overflow: 'hidden',
|
9054
|
-
flexShrink: 0,
|
9055
|
-
backgroundColor: '#f2f2f2'
|
9056
|
-
}) },
|
9658
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
|
9659
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9057
9660
|
React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
9058
9661
|
React.createElement("div", { className: css.css({
|
9059
9662
|
color: '#000',
|
@@ -9063,24 +9666,20 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9063
9666
|
width: '100%',
|
9064
9667
|
overflow: 'hidden'
|
9065
9668
|
}) },
|
9066
|
-
React.createElement("div", { className: styles$2['two-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
9067
|
-
React.createElement("div", { className: css.css({
|
9068
|
-
background: 'rgba(0,0,0,1)',
|
9069
|
-
fontSize: '10px',
|
9070
|
-
padding: '2px 7px',
|
9071
|
-
textAlign: 'center',
|
9072
|
-
textOverflow: 'ellipsis',
|
9073
|
-
overflow: 'hidden',
|
9074
|
-
borderRadius: '25px',
|
9075
|
-
width: 'fit-content',
|
9076
|
-
maxWidth: '100%',
|
9077
|
-
color: '#fff',
|
9078
|
-
whiteSpace: 'nowrap'
|
9079
|
-
}) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now'))));
|
9669
|
+
React.createElement("div", { className: styles$2['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
9670
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now'))));
|
9080
9671
|
})));
|
9081
9672
|
};
|
9082
9673
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
9083
9674
|
|
9675
|
+
/*
|
9676
|
+
* @Author: binruan@chatlabs.com
|
9677
|
+
* @Date: 2023-07-28 18:29:57
|
9678
|
+
* @LastEditors: binruan@chatlabs.com
|
9679
|
+
* @LastEditTime: 2024-03-29 16:27:22
|
9680
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiro\material.tsx
|
9681
|
+
*
|
9682
|
+
*/
|
9084
9683
|
const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
9085
9684
|
displayName: '推荐多商品-白底圆角按钮',
|
9086
9685
|
icon: '',
|
@@ -9088,15 +9687,39 @@ const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
|
9088
9687
|
type: 'MultiCommodityDiro',
|
9089
9688
|
related: {
|
9090
9689
|
interactionRender: interactionRender$2,
|
9091
|
-
bindableProps: []
|
9690
|
+
bindableProps: [],
|
9691
|
+
settingRender
|
9092
9692
|
},
|
9093
9693
|
defaulSetting: {
|
9094
|
-
props: {
|
9694
|
+
props: {
|
9695
|
+
ctaTempStyles: {
|
9696
|
+
img: {
|
9697
|
+
borderRadius: 3,
|
9698
|
+
width: 60,
|
9699
|
+
height: 60,
|
9700
|
+
marginRight: 8
|
9701
|
+
},
|
9702
|
+
title: {
|
9703
|
+
fontSize: 12,
|
9704
|
+
color: '#000',
|
9705
|
+
textAlign: 'left'
|
9706
|
+
},
|
9707
|
+
ctaTitle: {
|
9708
|
+
fontSize: 10,
|
9709
|
+
color: '#fff',
|
9710
|
+
textAlign: 'center',
|
9711
|
+
width: 80,
|
9712
|
+
height: 20,
|
9713
|
+
backgroundColor: 'rgba(0,0,0,1)'
|
9714
|
+
}
|
9715
|
+
}
|
9716
|
+
},
|
9095
9717
|
style: {
|
9096
|
-
padding:
|
9097
|
-
|
9098
|
-
|
9099
|
-
borderRadius:
|
9718
|
+
padding: 7,
|
9719
|
+
width: 236,
|
9720
|
+
height: 74,
|
9721
|
+
borderRadius: 3,
|
9722
|
+
backgroundColor: '#fff'
|
9100
9723
|
}
|
9101
9724
|
},
|
9102
9725
|
w: 100,
|
@@ -9120,9 +9743,10 @@ var styles$1 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
9120
9743
|
|
9121
9744
|
const MultiCommodity$1 = (_a) => {
|
9122
9745
|
var _b, _c;
|
9123
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9746
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9124
9747
|
const { sxpParameter } = useSxpDataSource();
|
9125
9748
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9749
|
+
const { popupAni } = useEditor();
|
9126
9750
|
const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
9127
9751
|
const handleClick = lodash.throttle((item) => {
|
9128
9752
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9131,19 +9755,11 @@ const MultiCommodity$1 = (_a) => {
|
|
9131
9755
|
}, recData, item);
|
9132
9756
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
9133
9757
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9134
|
-
},
|
9758
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9135
9759
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9136
9760
|
var _a, _b, _c, _d, _e, _f;
|
9137
|
-
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css.css(Object.assign(
|
9138
|
-
React.createElement("div", { className: css.css({
|
9139
|
-
width: '60px',
|
9140
|
-
height: '60px',
|
9141
|
-
marginRight: '8px',
|
9142
|
-
borderRadius: '3px',
|
9143
|
-
overflow: 'hidden',
|
9144
|
-
flexShrink: 0,
|
9145
|
-
backgroundColor: '#f2f2f2'
|
9146
|
-
}) },
|
9761
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css.css(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
|
9762
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9147
9763
|
React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
9148
9764
|
React.createElement("div", { className: css.css({
|
9149
9765
|
color: '#fff',
|
@@ -9153,21 +9769,20 @@ const MultiCommodity$1 = (_a) => {
|
|
9153
9769
|
width: '100%',
|
9154
9770
|
overflow: 'hidden'
|
9155
9771
|
}) },
|
9156
|
-
React.createElement("div", { className: styles$1['two-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
9157
|
-
React.createElement("div", { className: css.css({
|
9158
|
-
background: 'rgba(0,0,0,.5)',
|
9159
|
-
fontSize: '10px',
|
9160
|
-
padding: '2px 7px',
|
9161
|
-
width: 'auto',
|
9162
|
-
textAlign: 'center',
|
9163
|
-
textOverflow: 'ellipsis',
|
9164
|
-
overflow: 'hidden',
|
9165
|
-
whiteSpace: 'nowrap'
|
9166
|
-
}) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now'))));
|
9772
|
+
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
9773
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now'))));
|
9167
9774
|
})));
|
9168
9775
|
};
|
9169
9776
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
9170
9777
|
|
9778
|
+
/*
|
9779
|
+
* @Author: binruan@chatlabs.com
|
9780
|
+
* @Date: 2023-07-28 18:29:57
|
9781
|
+
* @LastEditors: binruan@chatlabs.com
|
9782
|
+
* @LastEditTime: 2024-03-29 16:43:35
|
9783
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodity\material.tsx
|
9784
|
+
*
|
9785
|
+
*/
|
9171
9786
|
const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
9172
9787
|
displayName: '推荐多商品-透明底',
|
9173
9788
|
icon: '',
|
@@ -9175,15 +9790,39 @@ const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
|
9175
9790
|
type: 'MultiCommodity',
|
9176
9791
|
related: {
|
9177
9792
|
interactionRender: interactionRender$1,
|
9793
|
+
settingRender,
|
9178
9794
|
bindableProps: []
|
9179
9795
|
},
|
9180
9796
|
defaulSetting: {
|
9181
|
-
props: {
|
9797
|
+
props: {
|
9798
|
+
ctaTempStyles: {
|
9799
|
+
img: {
|
9800
|
+
borderRadius: 3,
|
9801
|
+
width: 60,
|
9802
|
+
height: 60,
|
9803
|
+
marginRight: 8
|
9804
|
+
},
|
9805
|
+
title: {
|
9806
|
+
fontSize: 12,
|
9807
|
+
color: '#fff',
|
9808
|
+
textAlign: 'left'
|
9809
|
+
},
|
9810
|
+
ctaTitle: {
|
9811
|
+
fontSize: 10,
|
9812
|
+
color: '#fff',
|
9813
|
+
textAlign: 'center',
|
9814
|
+
width: 130,
|
9815
|
+
height: 20,
|
9816
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
9817
|
+
}
|
9818
|
+
}
|
9819
|
+
},
|
9182
9820
|
style: {
|
9183
|
-
padding:
|
9184
|
-
|
9185
|
-
|
9186
|
-
borderRadius:
|
9821
|
+
padding: 7,
|
9822
|
+
width: 236,
|
9823
|
+
height: 74,
|
9824
|
+
borderRadius: 3,
|
9825
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
9187
9826
|
}
|
9188
9827
|
},
|
9189
9828
|
w: 100,
|
@@ -9207,8 +9846,9 @@ var styles = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
9207
9846
|
|
9208
9847
|
const MultiCommodityDiroNew$1 = (_a) => {
|
9209
9848
|
var _b, _c;
|
9210
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9849
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9211
9850
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9851
|
+
const { popupAni } = useEditor();
|
9212
9852
|
const [products, setProducts] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
9213
9853
|
const handleClick = lodash.throttle((item) => {
|
9214
9854
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9217,19 +9857,11 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9217
9857
|
}, recData, item);
|
9218
9858
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
9219
9859
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9220
|
-
},
|
9860
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9221
9861
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9222
9862
|
var _a, _b, _c, _d, _e, _f;
|
9223
|
-
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(
|
9224
|
-
React.createElement("div", { className: css.css({
|
9225
|
-
width: '78px',
|
9226
|
-
height: '78px',
|
9227
|
-
marginRight: '16px',
|
9228
|
-
borderRadius: '8px',
|
9229
|
-
overflow: 'hidden',
|
9230
|
-
flexShrink: 0,
|
9231
|
-
backgroundColor: '#f2f2f2'
|
9232
|
-
}) },
|
9863
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
|
9864
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9233
9865
|
React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
9234
9866
|
React.createElement("div", { className: css.css({
|
9235
9867
|
color: '#fff',
|
@@ -9240,22 +9872,20 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9240
9872
|
overflow: 'hidden',
|
9241
9873
|
lineHeight: '20px'
|
9242
9874
|
}) },
|
9243
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
9244
|
-
React.createElement("div", { className: css.css({
|
9245
|
-
fontSize: '13px',
|
9246
|
-
fontWeight: 'bold',
|
9247
|
-
textOverflow: 'ellipsis',
|
9248
|
-
overflow: 'hidden',
|
9249
|
-
width: 'fit-content',
|
9250
|
-
maxWidth: '100%',
|
9251
|
-
whiteSpace: 'nowrap',
|
9252
|
-
textDecoration: 'underline',
|
9253
|
-
color: '#000'
|
9254
|
-
}) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop now'))));
|
9875
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
9876
|
+
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop now'))));
|
9255
9877
|
})));
|
9256
9878
|
};
|
9257
9879
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
9258
9880
|
|
9881
|
+
/*
|
9882
|
+
* @Author: binruan@chatlabs.com
|
9883
|
+
* @Date: 2023-07-28 18:29:57
|
9884
|
+
* @LastEditors: binruan@chatlabs.com
|
9885
|
+
* @LastEditTime: 2024-03-29 15:40:54
|
9886
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiroNew\material.tsx
|
9887
|
+
*
|
9888
|
+
*/
|
9259
9889
|
const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
9260
9890
|
displayName: '推荐多商品-白底下划线按钮',
|
9261
9891
|
icon: '',
|
@@ -9263,15 +9893,40 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
|
9263
9893
|
type: 'MultiCommodityDiroNew',
|
9264
9894
|
related: {
|
9265
9895
|
interactionRender,
|
9266
|
-
bindableProps: []
|
9896
|
+
bindableProps: [],
|
9897
|
+
settingRender
|
9267
9898
|
},
|
9268
9899
|
defaulSetting: {
|
9269
|
-
props: {
|
9900
|
+
props: {
|
9901
|
+
ctaTempStyles: {
|
9902
|
+
img: {
|
9903
|
+
borderRadius: 8,
|
9904
|
+
width: 78,
|
9905
|
+
height: 78,
|
9906
|
+
marginRight: 16
|
9907
|
+
},
|
9908
|
+
title: {
|
9909
|
+
fontSize: 12,
|
9910
|
+
color: '#000',
|
9911
|
+
textAlign: 'left'
|
9912
|
+
},
|
9913
|
+
ctaTitle: {
|
9914
|
+
textDecoration: 'underline',
|
9915
|
+
fontSize: 12,
|
9916
|
+
fontWeight: 'bold',
|
9917
|
+
color: '#000',
|
9918
|
+
textAlign: 'left',
|
9919
|
+
width: 150,
|
9920
|
+
height: 20
|
9921
|
+
}
|
9922
|
+
}
|
9923
|
+
},
|
9270
9924
|
style: {
|
9271
|
-
|
9272
|
-
|
9273
|
-
|
9274
|
-
|
9925
|
+
borderRadius: 4,
|
9926
|
+
width: 260,
|
9927
|
+
height: 86,
|
9928
|
+
padding: 4,
|
9929
|
+
backgroundColor: 'rgba(255,255,255,0.75)'
|
9275
9930
|
}
|
9276
9931
|
},
|
9277
9932
|
w: 100,
|
@@ -9294,7 +9949,6 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
9294
9949
|
AppointForm: AppointForm,
|
9295
9950
|
Commodity: Commodity,
|
9296
9951
|
CommodityDetail: CommodityDetail,
|
9297
|
-
CommodityDetailDiro: CommodityDetailDiro,
|
9298
9952
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
9299
9953
|
CommodityDiro: CommodityDiro,
|
9300
9954
|
CommodityDiroNew: CommodityDiroNew,
|
@@ -9381,8 +10035,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9381
10035
|
videoRef.current.muted = muted;
|
9382
10036
|
}, [muted]);
|
9383
10037
|
const handleVideoStart = React.useCallback(() => {
|
9384
|
-
var _a;
|
9385
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
10038
|
+
var _a, _b;
|
10039
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
10040
|
+
return;
|
10041
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
9386
10042
|
}, []);
|
9387
10043
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
9388
10044
|
const handlePlaying = React.useCallback(() => {
|
@@ -9439,37 +10095,38 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9439
10095
|
});
|
9440
10096
|
}
|
9441
10097
|
setTimeout(() => {
|
9442
|
-
var _a;
|
9443
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
10098
|
+
var _a, _b;
|
10099
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
10100
|
+
return;
|
10101
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
9444
10102
|
}, 0);
|
9445
10103
|
}, [index, bffEventReport, data, isLoad]);
|
9446
10104
|
const handleClickVideo = React.useCallback((type) => () => {
|
9447
|
-
var _a, _b, _c, _d, _e, _f
|
10105
|
+
var _a, _b, _c, _d, _e, _f;
|
10106
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
10107
|
+
return;
|
9448
10108
|
if (!isLoad)
|
9449
10109
|
return;
|
9450
|
-
|
9451
|
-
((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
9452
|
-
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
9453
|
-
const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
|
10110
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
9454
10111
|
switch (type) {
|
9455
10112
|
case 'start':
|
9456
10113
|
if (!isPause)
|
9457
10114
|
return;
|
9458
|
-
(
|
10115
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
9459
10116
|
setIsPauseVideo(false);
|
9460
10117
|
break;
|
9461
10118
|
case 'pause':
|
9462
10119
|
if (isPause)
|
9463
10120
|
return;
|
9464
|
-
(
|
10121
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
9465
10122
|
setIsPauseVideo(true);
|
9466
10123
|
break;
|
9467
10124
|
default:
|
9468
10125
|
if (isPause) {
|
9469
|
-
(
|
10126
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
9470
10127
|
}
|
9471
10128
|
else {
|
9472
|
-
(
|
10129
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
9473
10130
|
}
|
9474
10131
|
setIsPauseVideo(!isPause);
|
9475
10132
|
break;
|
@@ -9500,14 +10157,16 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9500
10157
|
}
|
9501
10158
|
}, [data, index, bffEventReport]);
|
9502
10159
|
React.useEffect(() => {
|
9503
|
-
var _a, _b, _c;
|
10160
|
+
var _a, _b, _c, _d, _e, _f;
|
9504
10161
|
if (data.length <= 0)
|
9505
10162
|
return;
|
9506
10163
|
if (!videoRef.current)
|
9507
10164
|
return;
|
10165
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
9508
10166
|
setIsPauseVideo(false);
|
9509
10167
|
if (!isActive) {
|
9510
|
-
(
|
10168
|
+
if (!isPause && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.readyState) >= 2)
|
10169
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
9511
10170
|
return;
|
9512
10171
|
}
|
9513
10172
|
if (!videoRef.current.src) {
|
@@ -9530,10 +10189,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9530
10189
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
9531
10190
|
}
|
9532
10191
|
else {
|
10192
|
+
if (((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.readyState) < 2)
|
10193
|
+
return;
|
9533
10194
|
videoRef.current.play();
|
9534
10195
|
}
|
9535
|
-
(
|
9536
|
-
(
|
10196
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('canplay', handleLoadedMetadata);
|
10197
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
9537
10198
|
return () => {
|
9538
10199
|
var _a, _b;
|
9539
10200
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
|
@@ -9544,15 +10205,17 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9544
10205
|
打开/关闭hashtag暂停/播放视频
|
9545
10206
|
*/
|
9546
10207
|
React.useEffect(() => {
|
9547
|
-
var _a, _b, _c;
|
9548
|
-
|
10208
|
+
var _a, _b, _c, _d;
|
10209
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState) < 2)
|
10210
|
+
return;
|
10211
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
9549
10212
|
if (!isActive)
|
9550
10213
|
return;
|
9551
10214
|
if (!isPause && openHashtag) {
|
9552
|
-
(
|
10215
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
9553
10216
|
}
|
9554
10217
|
else if (!openHashtag) {
|
9555
|
-
(
|
10218
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
9556
10219
|
}
|
9557
10220
|
}, [openHashtag, isActive]);
|
9558
10221
|
React.useEffect(() => {
|
@@ -9665,22 +10328,26 @@ const Picture = (props) => {
|
|
9665
10328
|
* @Author: lewinlu@chatlabs.com
|
9666
10329
|
* @Date: 2024-01-03 14:39:09
|
9667
10330
|
* @LastEditors: binruan@chatlabs.com
|
9668
|
-
* @LastEditTime: 2024-03-
|
10331
|
+
* @LastEditTime: 2024-03-25 15:08:11
|
9669
10332
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
9670
10333
|
*/
|
9671
10334
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
9672
10335
|
const { isActive } = useSwiperSlide();
|
9673
10336
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
10337
|
+
const [isLoad, setIsLoad] = React.useState(false);
|
9674
10338
|
React.useEffect(() => {
|
9675
|
-
if (
|
9676
|
-
|
9677
|
-
|
9678
|
-
|
10339
|
+
if (isLoad && isActive) {
|
10340
|
+
if (openHashtag) {
|
10341
|
+
onReportViewImageEnd(rec);
|
10342
|
+
}
|
10343
|
+
else {
|
10344
|
+
onViewImageStartEvent(index);
|
10345
|
+
}
|
9679
10346
|
}
|
9680
10347
|
else {
|
9681
|
-
|
10348
|
+
setIsLoad(true);
|
9682
10349
|
}
|
9683
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent]);
|
10350
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
9684
10351
|
if (!isActive) {
|
9685
10352
|
return React.createElement("img", { src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: { width, height, objectFit: 'cover' } });
|
9686
10353
|
}
|
@@ -9691,75 +10358,17 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
9691
10358
|
};
|
9692
10359
|
var PictureGroup$1 = React.memo(PictureGroup);
|
9693
10360
|
|
9694
|
-
/*
|
9695
|
-
* @Author: binruan@chatlabs.com
|
9696
|
-
* @Date: 2023-11-02 18:34:34
|
9697
|
-
* @LastEditors: binruan@chatlabs.com
|
9698
|
-
* @LastEditTime: 2024-03-12 12:08:55
|
9699
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ProductInfo\index.tsx
|
9700
|
-
*
|
9701
|
-
*/
|
9702
|
-
const ProductInfo = ({ data, height, width, viewTime, tipText }) => {
|
9703
|
-
var _a, _b;
|
9704
|
-
const product = data === null || data === void 0 ? void 0 : data.product;
|
9705
|
-
const cta = (_a = data === null || data === void 0 ? void 0 : data.product) === null || _a === void 0 ? void 0 : _a.bindCta;
|
9706
|
-
const [showModal, setShowModal] = React.useState(false);
|
9707
|
-
const { jumpToWeb } = useEventReport();
|
9708
|
-
const priceText = React.useMemo(() => {
|
9709
|
-
var _a, _b, _c, _d, _e;
|
9710
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
9711
|
-
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', {
|
9712
|
-
minimumFractionDigits: 0
|
9713
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
9714
|
-
}
|
9715
|
-
else {
|
9716
|
-
return '$7,000';
|
9717
|
-
}
|
9718
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9719
|
-
const handleLInk = (link) => {
|
9720
|
-
if (link) {
|
9721
|
-
jumpToWeb(data, product, cta);
|
9722
|
-
window.location.href = window.getJointUtmLink(link);
|
9723
|
-
}
|
9724
|
-
};
|
9725
|
-
return (React.createElement("div", { style: { height, width: '100%' } },
|
9726
|
-
React.createElement(Swiper, { height: height * 0.5, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
9727
|
-
delay: 3000
|
9728
|
-
} }, (_b = product === null || product === void 0 ? void 0 : product.homePage) === null || _b === void 0 ? void 0 : _b.map((src) => {
|
9729
|
-
return (React.createElement(SwiperSlide, { key: src },
|
9730
|
-
React.createElement("div", { style: {
|
9731
|
-
overflow: 'hidden',
|
9732
|
-
width,
|
9733
|
-
height: height * 0.5
|
9734
|
-
} },
|
9735
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
9736
|
-
})),
|
9737
|
-
React.createElement("div", { className: 'product-info' },
|
9738
|
-
React.createElement("div", { className: 'collection' }, product === null || product === void 0 ? void 0 : product.collection),
|
9739
|
-
React.createElement("div", { className: 'title' }, product === null || product === void 0 ? void 0 : product.title),
|
9740
|
-
React.createElement("div", { className: 'price' }, priceText),
|
9741
|
-
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), className: 'info', text: (product === null || product === void 0 ? void 0 : product.info) || '', maxStr: 79 }),
|
9742
|
-
React.createElement("a", { target: '_blank', className: 'pb-modal-btn', onClick: () => handleLInk(product === null || product === void 0 ? void 0 : product.link) }, cta === null || cta === void 0 ? void 0 : cta.enTitle)),
|
9743
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
9744
|
-
React.createElement("div", { className: 'modal-collection' }, product === null || product === void 0 ? void 0 : product.collection),
|
9745
|
-
React.createElement("div", { className: 'modal-title' }, product === null || product === void 0 ? void 0 : product.title),
|
9746
|
-
React.createElement("div", { className: 'modal-price' }, priceText),
|
9747
|
-
React.createElement("div", { className: 'modal-info' }, product === null || product === void 0 ? void 0 : product.info),
|
9748
|
-
(product === null || product === void 0 ? void 0 : product.link) && (React.createElement("a", { target: '_blank', className: 'pb-modal-btn', onClick: () => handleLInk(product === null || product === void 0 ? void 0 : product.link) }, cta === null || cta === void 0 ? void 0 : cta.enTitle)))));
|
9749
|
-
};
|
9750
|
-
var ProductInfo$1 = React.memo(ProductInfo);
|
9751
|
-
|
9752
10361
|
/*
|
9753
10362
|
* @Author: binruan@chatlabs.com
|
9754
10363
|
* @Date: 2024-01-15 19:03:09
|
9755
10364
|
* @LastEditors: binruan@chatlabs.com
|
9756
|
-
* @LastEditTime: 2024-03-
|
10365
|
+
* @LastEditTime: 2024-03-25 10:42:07
|
9757
10366
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
9758
10367
|
*
|
9759
10368
|
*/
|
9760
10369
|
const Hashtag = ({ tags, itemId, itemType, index, rec }) => {
|
9761
10370
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
9762
|
-
const { setWaterFallData, setOpenHashtag,
|
10371
|
+
const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
|
9763
10372
|
const handleClickTag = (data) => {
|
9764
10373
|
if (!waterFallData) {
|
9765
10374
|
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(index);
|
@@ -10220,17 +10829,29 @@ const WaterFall = () => {
|
|
10220
10829
|
};
|
10221
10830
|
var WaterFall$1 = React.memo(WaterFall);
|
10222
10831
|
|
10832
|
+
const Nudge = ({ nudge }) => {
|
10833
|
+
return (React.createElement("div", { hidden: !(nudge === null || nudge === void 0 ? void 0 : nudge.isOpen), className: 'clc-sxp-bottom-nudge', style: {
|
10834
|
+
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
10835
|
+
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
10836
|
+
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
10837
|
+
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
10838
|
+
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
10839
|
+
} },
|
10840
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
10841
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)));
|
10842
|
+
};
|
10843
|
+
|
10223
10844
|
/*
|
10224
10845
|
* @Author: binruan@chatlabs.com
|
10225
10846
|
* @Date: 2024-01-15 19:03:09
|
10226
10847
|
* @LastEditors: binruan@chatlabs.com
|
10227
|
-
* @LastEditTime: 2024-
|
10848
|
+
* @LastEditTime: 2024-04-02 10:42:58
|
10228
10849
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
10229
10850
|
*
|
10230
10851
|
*/
|
10231
|
-
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, _schema }) => {
|
10852
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema }) => {
|
10232
10853
|
var _a, _b, _c, _d;
|
10233
|
-
useEditor();
|
10854
|
+
const { schema } = useEditor();
|
10234
10855
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
10235
10856
|
const viewImageStartTime = React.useRef(0);
|
10236
10857
|
const [isInit, setIsInit] = React.useState(false);
|
@@ -10382,49 +11003,37 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
10382
11003
|
return null;
|
10383
11004
|
}, [globalConfig]);
|
10384
11005
|
const renderContent = React.useCallback((rec, index) => {
|
10385
|
-
var _a, _b;
|
11006
|
+
var _a, _b, _c, _d;
|
10386
11007
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
10387
11008
|
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex }));
|
10388
11009
|
}
|
10389
11010
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
10390
11011
|
return (React.createElement(PictureGroup$1, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent }));
|
10391
11012
|
}
|
10392
|
-
if (rec.product) {
|
10393
|
-
|
10394
|
-
|
10395
|
-
|
10396
|
-
|
10397
|
-
|
10398
|
-
// <CommodityDetailDiro
|
10399
|
-
// key={rec.product.itemId}
|
10400
|
-
// viewTime={viewTime.current}
|
10401
|
-
// rec={rec}
|
10402
|
-
// isPost={true}
|
10403
|
-
// style={{ height: '100%', overflow: 'auto' }}
|
10404
|
-
// />
|
10405
|
-
// );
|
10406
|
-
case 'CommodityDetail':
|
10407
|
-
return (React.createElement(ProductInfo$1, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
10408
|
-
default:
|
10409
|
-
return (React.createElement(ProductInfo$1, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
10410
|
-
}
|
11013
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
11014
|
+
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
|
11015
|
+
var _a, _b, _c, _d, _e, _f;
|
11016
|
+
const Component = withBindDataSource(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
|
11017
|
+
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' } })));
|
11018
|
+
});
|
10411
11019
|
}
|
10412
11020
|
return null;
|
10413
|
-
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText]);
|
11021
|
+
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText, resolver, schema]);
|
10414
11022
|
const renderBottom = React.useCallback((rec, index) => {
|
10415
11023
|
var _a, _b, _c, _d, _e, _f, _g;
|
10416
11024
|
if (rec.video) {
|
10417
11025
|
return (React.createElement(React.Fragment, null,
|
10418
11026
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
10419
11027
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
11028
|
+
React.createElement(Nudge, { nudge: nudge }),
|
10420
11029
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
10421
11030
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
10422
11031
|
React.createElement("div", { className: 'clc-sxp-bottom-text' },
|
10423
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
|
11032
|
+
React.createElement(ExpandableText$1, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
|
10424
11033
|
React.createElement(Hashtag$1, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec }))));
|
10425
11034
|
}
|
10426
11035
|
return null;
|
10427
|
-
}, [descStyle, activeIndex, tempMap, resolver, tipText]);
|
11036
|
+
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge]);
|
10428
11037
|
const renderLikeButton = React.useCallback((rec) => {
|
10429
11038
|
var _a, _b;
|
10430
11039
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
@@ -10503,6 +11112,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
10503
11112
|
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
|
10504
11113
|
}
|
10505
11114
|
};
|
11115
|
+
React.useEffect(() => {
|
11116
|
+
const item = data[activeIndex];
|
11117
|
+
if (openHashtag)
|
11118
|
+
handleReportProductView(item);
|
11119
|
+
}, [openHashtag, data, activeIndex]);
|
10506
11120
|
const handleViewImageStartEvent = (activeIndex) => {
|
10507
11121
|
var _a, _b, _c, _d, _e, _f;
|
10508
11122
|
const item = data[activeIndex];
|
@@ -10609,12 +11223,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
10609
11223
|
* @Author: binruan@chatlabs.com
|
10610
11224
|
* @Date: 2023-10-31 10:56:01
|
10611
11225
|
* @LastEditors: binruan@chatlabs.com
|
10612
|
-
* @LastEditTime: 2024-
|
11226
|
+
* @LastEditTime: 2024-04-02 10:31:51
|
10613
11227
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
10614
11228
|
*
|
10615
11229
|
*/
|
10616
11230
|
const Popup = () => {
|
10617
|
-
const { schema, resolver, popup } = useEditor();
|
11231
|
+
const { schema, resolver, popup, popupAni } = useEditor();
|
10618
11232
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
10619
11233
|
const { productView } = useEventReport();
|
10620
11234
|
const [visible, setVisible] = React.useState(false);
|
@@ -10637,7 +11251,7 @@ const Popup = () => {
|
|
10637
11251
|
}, [popup]);
|
10638
11252
|
const handleClose = () => {
|
10639
11253
|
var _a, _b, _c;
|
10640
|
-
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current <
|
11254
|
+
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < (popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration)) {
|
10641
11255
|
return;
|
10642
11256
|
}
|
10643
11257
|
setVisible(false);
|
@@ -10650,7 +11264,7 @@ const Popup = () => {
|
|
10650
11264
|
setTimeout(() => {
|
10651
11265
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
10652
11266
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
10653
|
-
},
|
11267
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
10654
11268
|
};
|
10655
11269
|
const renderPopupDetail = React.useMemo(() => {
|
10656
11270
|
var _a, _b, _c;
|
@@ -10672,7 +11286,7 @@ const Popup = () => {
|
|
10672
11286
|
* @Author: binruan@chatlabs.com
|
10673
11287
|
* @Date: 2024-01-15 19:03:09
|
10674
11288
|
* @LastEditors: binruan@chatlabs.com
|
10675
|
-
* @LastEditTime: 2024-03-
|
11289
|
+
* @LastEditTime: 2024-03-25 17:24:59
|
10676
11290
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
10677
11291
|
*
|
10678
11292
|
*/
|
@@ -10688,7 +11302,7 @@ const RESOLVER = {};
|
|
10688
11302
|
Object.values(_materials_).forEach((v) => {
|
10689
11303
|
RESOLVER[v.extend.type] = v;
|
10690
11304
|
});
|
10691
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage }) => {
|
11305
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
|
10692
11306
|
var _a, _b, _c, _d, _e, _f;
|
10693
11307
|
const utmVal = React.useMemo(() => {
|
10694
11308
|
var _a;
|
@@ -10696,7 +11310,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
10696
11310
|
return searchParams;
|
10697
11311
|
}, []);
|
10698
11312
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
10699
|
-
React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, render: ({ rtcList }) => {
|
11313
|
+
React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList }) => {
|
10700
11314
|
var _a;
|
10701
11315
|
return (React.createElement(React.Fragment, null,
|
10702
11316
|
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { data: rtcList, resolver: RESOLVER })),
|