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/pb-ui.js
CHANGED
@@ -393,11 +393,24 @@
|
|
393
393
|
return fakeUserId;
|
394
394
|
};
|
395
395
|
|
396
|
-
|
396
|
+
/*
|
397
|
+
* @Author: binruan@chatlabs.com
|
398
|
+
* @Date: 2024-03-20 10:27:31
|
399
|
+
* @LastEditors: binruan@chatlabs.com
|
400
|
+
* @LastEditTime: 2024-03-25 18:23:54
|
401
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\useIconLink.ts
|
402
|
+
*
|
403
|
+
*/
|
404
|
+
function useIconLink(path, domain) {
|
397
405
|
const { appDomain } = useSxpDataSource();
|
398
406
|
return React.useMemo(() => {
|
399
|
-
|
400
|
-
|
407
|
+
if (domain) {
|
408
|
+
return `https://${domain}${path}`;
|
409
|
+
}
|
410
|
+
else {
|
411
|
+
return appDomain ? `https://${appDomain}${path}` : `${window.location.origin}${path}`;
|
412
|
+
}
|
413
|
+
}, [appDomain, path, domain]);
|
401
414
|
}
|
402
415
|
|
403
416
|
const SxpDataSourceContext = React.createContext({
|
@@ -575,7 +588,7 @@
|
|
575
588
|
setLoading(false);
|
576
589
|
});
|
577
590
|
}, [getRecommendVideos]);
|
578
|
-
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif');
|
591
|
+
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
579
592
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
580
593
|
rtcList,
|
581
594
|
setRtcList,
|
@@ -719,7 +732,11 @@
|
|
719
732
|
undoStack: [item],
|
720
733
|
redoStack: [],
|
721
734
|
popup: '',
|
722
|
-
setPopup: () => { }
|
735
|
+
setPopup: () => { },
|
736
|
+
popupAni: {
|
737
|
+
name: 'none',
|
738
|
+
duration: 0
|
739
|
+
}
|
723
740
|
});
|
724
741
|
const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
725
742
|
const [currentNode, setCurrentNode] = React.useState(null);
|
@@ -743,9 +760,22 @@
|
|
743
760
|
const [undoStack, setUndoStack] = React.useState([[item]]);
|
744
761
|
const [redoStack, setRedoStack] = React.useState([]);
|
745
762
|
const [popup, setPopup] = React.useState('');
|
763
|
+
const [popupAni, setPopupAni] = React.useState({
|
764
|
+
name: 'none',
|
765
|
+
duration: 0
|
766
|
+
});
|
746
767
|
typeof window !== 'undefined' &&
|
747
|
-
(window.sxpPopup = (type) => {
|
768
|
+
(window.sxpPopup = (type, aniType) => {
|
748
769
|
setPopup(type);
|
770
|
+
if (aniType && (aniType === null || aniType === void 0 ? void 0 : aniType.name) !== 'none') {
|
771
|
+
setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
|
772
|
+
}
|
773
|
+
else {
|
774
|
+
setPopupAni({
|
775
|
+
name: 'none',
|
776
|
+
duration: 0
|
777
|
+
});
|
778
|
+
}
|
749
779
|
});
|
750
780
|
typeof window !== 'undefined' &&
|
751
781
|
(window.getJointUtmLink = (url) => {
|
@@ -821,7 +851,8 @@
|
|
821
851
|
setUndoStack,
|
822
852
|
getCurPageConf,
|
823
853
|
popup,
|
824
|
-
setPopup
|
854
|
+
setPopup,
|
855
|
+
popupAni
|
825
856
|
} },
|
826
857
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
827
858
|
});
|
@@ -851,7 +882,7 @@
|
|
851
882
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
|
852
883
|
*
|
853
884
|
*/
|
854
|
-
var settingRender$
|
885
|
+
var settingRender$4 = [
|
855
886
|
{
|
856
887
|
type: 'Text',
|
857
888
|
label: '组件名称',
|
@@ -1040,7 +1071,7 @@
|
|
1040
1071
|
category: 'popup',
|
1041
1072
|
type: 'AppointForm',
|
1042
1073
|
related: {
|
1043
|
-
settingRender: settingRender$
|
1074
|
+
settingRender: settingRender$4,
|
1044
1075
|
bindableProps: [],
|
1045
1076
|
interactionRender: interactionRender$8
|
1046
1077
|
},
|
@@ -1066,6 +1097,190 @@
|
|
1066
1097
|
sort: 2
|
1067
1098
|
});
|
1068
1099
|
|
1100
|
+
/*
|
1101
|
+
* @Author: binruan@chatlabs.com
|
1102
|
+
* @Date: 2024-04-02 18:01:34
|
1103
|
+
* @LastEditors: binruan@chatlabs.com
|
1104
|
+
* @LastEditTime: 2024-04-02 18:01:41
|
1105
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiro\settingRender.tsx
|
1106
|
+
*
|
1107
|
+
*/
|
1108
|
+
/*
|
1109
|
+
* @Author: binruan@chatlabs.com
|
1110
|
+
* @Date: 2024-03-26 16:50:25
|
1111
|
+
* @LastEditors: binruan@chatlabs.com
|
1112
|
+
* @LastEditTime: 2024-03-28 18:42:26
|
1113
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
1114
|
+
*
|
1115
|
+
*/
|
1116
|
+
var settingRender$3 = [
|
1117
|
+
{
|
1118
|
+
title: '商品图片',
|
1119
|
+
child: [
|
1120
|
+
{
|
1121
|
+
type: 'Radius',
|
1122
|
+
label: '轮播指示器',
|
1123
|
+
options: [
|
1124
|
+
{
|
1125
|
+
label: '居左',
|
1126
|
+
value: 'left'
|
1127
|
+
},
|
1128
|
+
{
|
1129
|
+
label: '居中',
|
1130
|
+
value: 'center'
|
1131
|
+
}
|
1132
|
+
],
|
1133
|
+
name: ['props', 'swiper', 'dotsAlign']
|
1134
|
+
},
|
1135
|
+
{
|
1136
|
+
type: 'Number',
|
1137
|
+
name: ['props', 'swiper', 'delay'],
|
1138
|
+
addonAfter: 's'
|
1139
|
+
}
|
1140
|
+
]
|
1141
|
+
},
|
1142
|
+
{
|
1143
|
+
title: '商品文本',
|
1144
|
+
child: [
|
1145
|
+
{
|
1146
|
+
name: ['props', 'commodityStyles'],
|
1147
|
+
type: 'SelectLinkage',
|
1148
|
+
child: [
|
1149
|
+
{
|
1150
|
+
label: '字段',
|
1151
|
+
type: 'Select',
|
1152
|
+
options: [
|
1153
|
+
{
|
1154
|
+
label: '商品名称',
|
1155
|
+
value: 'title'
|
1156
|
+
},
|
1157
|
+
{
|
1158
|
+
label: '系列名称',
|
1159
|
+
value: 'collection'
|
1160
|
+
},
|
1161
|
+
{
|
1162
|
+
label: '价格',
|
1163
|
+
value: 'price'
|
1164
|
+
},
|
1165
|
+
{
|
1166
|
+
label: '商品描述',
|
1167
|
+
value: 'info'
|
1168
|
+
}
|
1169
|
+
],
|
1170
|
+
name: ['props', 'commodityStyles', 'field'],
|
1171
|
+
initialValue: 'title'
|
1172
|
+
},
|
1173
|
+
{
|
1174
|
+
type: 'Group',
|
1175
|
+
label: '标题字体',
|
1176
|
+
child: [
|
1177
|
+
{
|
1178
|
+
type: 'Color',
|
1179
|
+
name: ['color']
|
1180
|
+
},
|
1181
|
+
{
|
1182
|
+
type: 'Select',
|
1183
|
+
options: [{ label: '黑体', value: '黑体' }],
|
1184
|
+
name: ['fontFamily']
|
1185
|
+
},
|
1186
|
+
{
|
1187
|
+
type: 'Number',
|
1188
|
+
addonAfter: 'px',
|
1189
|
+
name: ['fontSize']
|
1190
|
+
}
|
1191
|
+
]
|
1192
|
+
},
|
1193
|
+
{
|
1194
|
+
label: '标题样式',
|
1195
|
+
type: 'TextStyle'
|
1196
|
+
},
|
1197
|
+
{
|
1198
|
+
label: '标题对齐',
|
1199
|
+
type: 'TextAlign'
|
1200
|
+
},
|
1201
|
+
{
|
1202
|
+
label: '默认行数',
|
1203
|
+
type: 'Number',
|
1204
|
+
name: ['lineClamp']
|
1205
|
+
}
|
1206
|
+
]
|
1207
|
+
}
|
1208
|
+
]
|
1209
|
+
},
|
1210
|
+
{
|
1211
|
+
title: '购买按钮样式',
|
1212
|
+
child: [
|
1213
|
+
{
|
1214
|
+
type: 'Color',
|
1215
|
+
label: '背景色',
|
1216
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
1217
|
+
initialValue: '#000'
|
1218
|
+
},
|
1219
|
+
{
|
1220
|
+
type: 'Group',
|
1221
|
+
label: '尺寸',
|
1222
|
+
child: [
|
1223
|
+
{
|
1224
|
+
type: 'Number',
|
1225
|
+
name: ['props', 'buttonStyle', 'height'],
|
1226
|
+
addonAfter: 'H'
|
1227
|
+
}
|
1228
|
+
]
|
1229
|
+
},
|
1230
|
+
{
|
1231
|
+
type: 'Group',
|
1232
|
+
label: '圆角',
|
1233
|
+
child: [
|
1234
|
+
{
|
1235
|
+
type: 'Slider',
|
1236
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
1237
|
+
max: 100
|
1238
|
+
},
|
1239
|
+
{
|
1240
|
+
type: 'Number',
|
1241
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
1242
|
+
addonAfter: 'px',
|
1243
|
+
max: 100
|
1244
|
+
}
|
1245
|
+
]
|
1246
|
+
},
|
1247
|
+
{
|
1248
|
+
type: 'TextMargin',
|
1249
|
+
name: ['props', 'buttonStyle']
|
1250
|
+
},
|
1251
|
+
{
|
1252
|
+
type: 'Group',
|
1253
|
+
label: '字体',
|
1254
|
+
child: [
|
1255
|
+
{
|
1256
|
+
type: 'Color',
|
1257
|
+
name: ['props', 'buttonStyle', 'color'],
|
1258
|
+
initialValue: '#fff'
|
1259
|
+
},
|
1260
|
+
{
|
1261
|
+
type: 'Select',
|
1262
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
1263
|
+
options: [{ label: '黑体', value: '黑体' }]
|
1264
|
+
},
|
1265
|
+
{
|
1266
|
+
type: 'Number',
|
1267
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
1268
|
+
addonAfter: 'px'
|
1269
|
+
}
|
1270
|
+
]
|
1271
|
+
},
|
1272
|
+
{
|
1273
|
+
type: 'TextStyle',
|
1274
|
+
name: ['props', 'buttonStyle']
|
1275
|
+
},
|
1276
|
+
{
|
1277
|
+
type: 'TextAlign',
|
1278
|
+
name: ['props', 'buttonStyle']
|
1279
|
+
}
|
1280
|
+
]
|
1281
|
+
}
|
1282
|
+
];
|
1283
|
+
|
1069
1284
|
/**
|
1070
1285
|
* SSR Window 4.0.2
|
1071
1286
|
* Better handling for window object in SSR environment
|
@@ -7949,19 +8164,146 @@
|
|
7949
8164
|
};
|
7950
8165
|
}
|
7951
8166
|
|
8167
|
+
/*
|
8168
|
+
* @Author: binruan@chatlabs.com
|
8169
|
+
* @Date: 2023-11-02 18:34:34
|
8170
|
+
* @LastEditors: binruan@chatlabs.com
|
8171
|
+
* @LastEditTime: 2024-04-02 10:33:15
|
8172
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8173
|
+
*
|
8174
|
+
*/
|
8175
|
+
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8176
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
|
8177
|
+
const { popupAni } = useEditor();
|
8178
|
+
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8179
|
+
const [isShow, setIsShow] = React.useState(false);
|
8180
|
+
const modalEleRef = React.useRef(null);
|
8181
|
+
React.useEffect(() => {
|
8182
|
+
const parentNode = document.getElementById('sxp-render');
|
8183
|
+
const node = document.getElementById('pb-modal');
|
8184
|
+
if (node) {
|
8185
|
+
modalEleRef.current = node;
|
8186
|
+
}
|
8187
|
+
else {
|
8188
|
+
modalEleRef.current = document.createElement('div');
|
8189
|
+
modalEleRef.current.setAttribute('id', 'pb-modal');
|
8190
|
+
parentNode === null || parentNode === void 0 ? void 0 : parentNode.appendChild(modalEleRef.current);
|
8191
|
+
}
|
8192
|
+
}, []);
|
8193
|
+
React.useEffect(() => {
|
8194
|
+
if (visible) {
|
8195
|
+
setIsShow(true);
|
8196
|
+
}
|
8197
|
+
else {
|
8198
|
+
setTimeout(() => {
|
8199
|
+
setIsShow(false);
|
8200
|
+
}, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
|
8201
|
+
}
|
8202
|
+
}, [visible, cssAni]);
|
8203
|
+
if (!modalEleRef.current)
|
8204
|
+
return null;
|
8205
|
+
const handleClose = lodash.debounce(() => {
|
8206
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8207
|
+
}, 300);
|
8208
|
+
return ReactDOM__namespace.createPortal(React.createElement("div", { className: 'modal-bg', style: Object.assign({ display: isShow ? 'flex' : 'none', backgroundColor: visible ? 'rgba(0, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0)' }, modalStyle), onClick: handleClose },
|
8209
|
+
React.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding, animationDuration: (cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration) / 1000 + 's' }, onClick: (e) => {
|
8210
|
+
e.stopPropagation();
|
8211
|
+
e.preventDefault();
|
8212
|
+
} },
|
8213
|
+
React.createElement("div", { onClick: onClose, className: 'modal-icon-wrapper' },
|
8214
|
+
React.createElement("img", { src: closeIcon, alt: 'close', className: 'modal-icon' })),
|
8215
|
+
children)), modalEleRef.current);
|
8216
|
+
};
|
8217
|
+
var Modal$1 = React.memo(Modal);
|
8218
|
+
|
8219
|
+
/*
|
8220
|
+
* @Author: binruan@chatlabs.com
|
8221
|
+
* @Date: 2023-12-26 16:11:34
|
8222
|
+
* @LastEditors: binruan@chatlabs.com
|
8223
|
+
* @LastEditTime: 2024-04-02 18:52:59
|
8224
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
8225
|
+
*
|
8226
|
+
*/
|
8227
|
+
const limitTextLastWholeWord = (originalText = '', limit) => {
|
8228
|
+
// 匹配到中文
|
8229
|
+
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
8230
|
+
if (chineseRegex.test(originalText)) {
|
8231
|
+
return originalText.slice(0, 54);
|
8232
|
+
}
|
8233
|
+
const words = originalText.split(' ');
|
8234
|
+
const newWords = [];
|
8235
|
+
for (let i = 0; i < words.length; i++) {
|
8236
|
+
newWords.push(words[i]);
|
8237
|
+
const tempText = newWords.join(' ');
|
8238
|
+
if (tempText.length >= limit)
|
8239
|
+
break;
|
8240
|
+
}
|
8241
|
+
// const _words = newWords.length === words.length ? newWords : newWords.slice(0, newWords.length - 1);
|
8242
|
+
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8243
|
+
return _words.join(' ') + ' ';
|
8244
|
+
};
|
8245
|
+
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
|
8246
|
+
const [isShowMore, setIsShowMore] = React.useState(true);
|
8247
|
+
const [isShow, setIsShow] = React.useState(false);
|
8248
|
+
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
8249
|
+
const multiRow = React.useRef(null);
|
8250
|
+
const handleClick = React.useCallback(() => {
|
8251
|
+
setIsShowMore(!isShowMore);
|
8252
|
+
}, [isShowMore]);
|
8253
|
+
React.useMemo(() => {
|
8254
|
+
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8255
|
+
}, [text, maxStr, isShowMore]);
|
8256
|
+
React.useEffect(() => {
|
8257
|
+
if (multiRow.current && isPost) {
|
8258
|
+
setIsShowMore(true);
|
8259
|
+
setTimeout(() => {
|
8260
|
+
var _a;
|
8261
|
+
setIsShow(false);
|
8262
|
+
try {
|
8263
|
+
const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
|
8264
|
+
const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
|
8265
|
+
const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
|
8266
|
+
const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
|
8267
|
+
const lineHeight = isNaN(lh) ? fs : lh;
|
8268
|
+
if (text && height > lineHeight * lineClamp) {
|
8269
|
+
setIsShowMore(false);
|
8270
|
+
setIsShow(true);
|
8271
|
+
}
|
8272
|
+
}
|
8273
|
+
catch (_b) { }
|
8274
|
+
}, 100);
|
8275
|
+
}
|
8276
|
+
}, [multiRow, text, lineClamp, style, isPost]);
|
8277
|
+
return (React.createElement("div", { className: className, style: Object.assign({}, style), hidden: !text || text === '' },
|
8278
|
+
React.createElement("div", { ref: multiRow, style: {
|
8279
|
+
overflow: 'hidden',
|
8280
|
+
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
8281
|
+
textOverflow: 'ellipsis',
|
8282
|
+
display: '-webkit-box',
|
8283
|
+
WebkitBoxOrient: 'vertical',
|
8284
|
+
wordBreak: 'break-word'
|
8285
|
+
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
8286
|
+
isShow && text && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick }, isShowMore ? unfoldText || 'show less' : foldText || 'show more'))));
|
8287
|
+
};
|
8288
|
+
var ExpandableText$1 = React.memo(ExpandableText);
|
8289
|
+
|
7952
8290
|
const CommodityDetail$1 = (_a) => {
|
7953
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
7954
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image"]);
|
8291
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8292
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle"]);
|
7955
8293
|
const { sxpParameter } = useSxpDataSource();
|
7956
8294
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
7957
8295
|
const { jumpToWeb, productView } = useEventReport();
|
7958
8296
|
const curTimeRef = React.useRef(null);
|
7959
|
-
const
|
7960
|
-
const
|
8297
|
+
const [showModal, setShowModal] = React.useState(false);
|
8298
|
+
const data = isPost ? rec : popupDetailData;
|
8299
|
+
const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8300
|
+
const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
|
7961
8301
|
const handleLink = () => {
|
7962
8302
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
7963
8303
|
jumpToWeb(popupDetailData, product, cta);
|
7964
|
-
|
8304
|
+
if (!isPost) {
|
8305
|
+
productView(data, product, cta, viewTime || curTimeRef.current);
|
8306
|
+
}
|
7965
8307
|
window.location.href = window.getJointUtmLink(product.link);
|
7966
8308
|
}
|
7967
8309
|
};
|
@@ -7987,11 +8329,33 @@
|
|
7987
8329
|
}
|
7988
8330
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
7989
8331
|
const width = isPreview ? 375 : window.innerWidth;
|
8332
|
+
const renderContent = ({ isPost }) => {
|
8333
|
+
var _a, _b, _c;
|
8334
|
+
return (React.createElement("div", { className: 'pb-commondity-content' },
|
8335
|
+
React.createElement("div", { className: 'pb-commondity-content-collection', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock'),
|
8336
|
+
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
8337
|
+
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
8338
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8339
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8340
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8341
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8342
|
+
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info })));
|
8343
|
+
};
|
8344
|
+
const renderBtn = () => {
|
8345
|
+
var _a;
|
8346
|
+
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website'))));
|
8347
|
+
};
|
7990
8348
|
return (React.createElement("div", { className: 'pb-commondity' },
|
7991
8349
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
7992
|
-
product && ((
|
7993
|
-
|
7994
|
-
|
8350
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8351
|
+
clickable: true,
|
8352
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
8353
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
8354
|
+
? 'commondityDetail-swiper-clickable-left'
|
8355
|
+
: 'commondityDetail-swiper-clickable-center'
|
8356
|
+
}, loop: true, autoplay: {
|
8357
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8358
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
7995
8359
|
return (React.createElement(SwiperSlide, { key: src },
|
7996
8360
|
React.createElement("div", { style: {
|
7997
8361
|
overflow: 'hidden',
|
@@ -8000,7 +8364,7 @@
|
|
8000
8364
|
} },
|
8001
8365
|
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8002
8366
|
}))),
|
8003
|
-
!((
|
8367
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8004
8368
|
position: 'relative',
|
8005
8369
|
height: 0,
|
8006
8370
|
width: '100%',
|
@@ -8013,17 +8377,12 @@
|
|
8013
8377
|
top: 0,
|
8014
8378
|
objectFit: 'cover',
|
8015
8379
|
width: '100%'
|
8016
|
-
}), src: (
|
8017
|
-
|
8018
|
-
|
8019
|
-
|
8020
|
-
|
8021
|
-
|
8022
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8023
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8024
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8025
|
-
18-karat gold, this necklace is embellished with hand-set diamonds.`))),
|
8026
|
-
(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'))));
|
8380
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8381
|
+
renderContent({ isPost })),
|
8382
|
+
renderBtn(),
|
8383
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
8384
|
+
renderContent({ isPost: false }),
|
8385
|
+
renderBtn())));
|
8027
8386
|
};
|
8028
8387
|
var CommodityDetailComponent = React.memo(CommodityDetail$1);
|
8029
8388
|
|
@@ -8031,7 +8390,7 @@
|
|
8031
8390
|
* @Author: binruan@chatlabs.com
|
8032
8391
|
* @Date: 2023-07-28 18:29:57
|
8033
8392
|
* @LastEditors: binruan@chatlabs.com
|
8034
|
-
* @LastEditTime: 2024-
|
8393
|
+
* @LastEditTime: 2024-04-02 18:13:10
|
8035
8394
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetail\material.tsx
|
8036
8395
|
*
|
8037
8396
|
*/
|
@@ -8040,8 +8399,42 @@
|
|
8040
8399
|
icon: '',
|
8041
8400
|
category: 'popup',
|
8042
8401
|
type: 'CommodityDetail',
|
8402
|
+
related: {
|
8403
|
+
settingRender: settingRender$3
|
8404
|
+
},
|
8043
8405
|
defaulSetting: {
|
8044
|
-
props: {
|
8406
|
+
props: {
|
8407
|
+
swiper: {
|
8408
|
+
dotsAlign: 'center',
|
8409
|
+
delay: 3
|
8410
|
+
},
|
8411
|
+
commodityStyles: {
|
8412
|
+
price: {
|
8413
|
+
color: '#000',
|
8414
|
+
fontSize: 18
|
8415
|
+
},
|
8416
|
+
title: {
|
8417
|
+
color: '#000',
|
8418
|
+
fontSize: 23
|
8419
|
+
},
|
8420
|
+
collection: {
|
8421
|
+
fontSize: 12,
|
8422
|
+
color: '#000'
|
8423
|
+
},
|
8424
|
+
info: {
|
8425
|
+
color: 'gray',
|
8426
|
+
fontSize: 12
|
8427
|
+
}
|
8428
|
+
},
|
8429
|
+
buttonStyle: {
|
8430
|
+
backgroundColor: '#000',
|
8431
|
+
fontSize: 12,
|
8432
|
+
height: 45,
|
8433
|
+
fontWeight: 'bold',
|
8434
|
+
textAlign: 'center',
|
8435
|
+
color: 'rgba(255, 255, 255, 0.9)'
|
8436
|
+
}
|
8437
|
+
},
|
8045
8438
|
style: {}
|
8046
8439
|
},
|
8047
8440
|
w: 100,
|
@@ -8069,7 +8462,7 @@
|
|
8069
8462
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Prompt\settingRender.tsx
|
8070
8463
|
*
|
8071
8464
|
*/
|
8072
|
-
var settingRender = [
|
8465
|
+
var settingRender$2 = [
|
8073
8466
|
{
|
8074
8467
|
type: 'Media',
|
8075
8468
|
label: '图标',
|
@@ -8088,7 +8481,7 @@
|
|
8088
8481
|
}
|
8089
8482
|
];
|
8090
8483
|
|
8091
|
-
var img$
|
8484
|
+
var img$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABHBJREFUeF7lmzuoFkcYhp/TihdIl0JBESubSCCCih4NXgJeUphCjyKmEEVtLRSjooWtShILRRJtgpCoeLzgLUZBQbTwAoooqLWoCWIXeZdd3bP++8/st7OX33+ac2Dn8r3Pvzv7zcy7A9RT5gDjgQnx3/T/iuA58Cz+m/7/StXhDVQ0gATOBhYCi4GxxnHeAKeAs8DfMSBjV52bhQTwBbApFj4YNMqPnV0GrgL7gJchxggFQMI3A5NDBOXRx+MYwn6Pul2rlAWwMv7VvykbiLH9TUAQjhnbYwUwA9gKLLIOHLjdGWAPcL1ovxYAG4G9wKiig1Vc/y2wBThQZJyiAA4Ba4sM0EDdw8CPvuMWAXAb+Mq344br3QGm+cTgC+B/n85aWMepz1kBOBknMy3U5wxJSdSSbrVcAPR+V9LRy0X5SW6+0A3AMuDPXlaeiv174K9OWvIAfA1cAMZ9JgBeA98Ct7J68gAMtyjJCfUbKFn6zgeA0tujoUZtWT9D2bS50x1wA2gqt6+al9YO09ODZAF8DrO+C+KIt0IagNbzIlTXktYVaKfr9+PNkSklchMtpXWHR/sJaQA7gJ8sUdXURuJ/AB7E4/0BLDeOvROQ3hEA/gFmGjusullWfDKeFcI1YFYawETgSdUqjP3niS8LYRLwNHkE1gM/GwOssplLfBkIG4BfEgBKE5dWqcTQt694da1td22YFikngGUJgH+B0UVaV1y3iHiFYpnA/wPGCICFXpX66xCfxD8oAKuA3wIpegToHW0tdYpXjKsFQLu7u60Rx+3exSCPG29HdVO3eI25TQB+BdaVAKCMSneRVpBJKfpMNiFesR4UgNOdlomeQF4AWj3quCpbfCE0JV7xDgvAXWCqp+B0tYfACkC7xXnFBaFJ8Yr5ngC8Mu78KHnS4+MqeRCaFq+4X5cB8MnmQoE7oQ3iPwCwPgJWEdZ2rjvNcj16BMpMghYxWsElS1pX0K45xNXedT2aBMu+BotCcAVlfZX69puuF70GQyRCoSFU/csnEKJEKFQqHApCXeIFIUqFQy6GykKoU7wARIuh6HVQwsmVffasEOoWLwfauASADkKU0oYqRSHULV465SsaSgAoqfk9lPq4H18ITYhXiJr7jiYAZGyUUzN0cUFoSrx0yrX6PH0ucEmTQmgCXdb5TYrX/uFcaa3rYCR7JzQpXro1vg5HRgCo+mhMEOT3/RKQYaGpkns0poD6+nA0+UX6+nhcEPreICEIfW2REQCZoc+30A9snTjlI57fyUzdzSYnU3RpP7414sDtNLl3NFG7jJK9YI52sepqnnYBUOe9ZJLOwnCapn0AqNO+NksnVHvJNO00SSeifO+ApH4vZIpdzdHZZ6QoALWXifqI8TTJNWGVua5drTV5pui8ji0A1JfM1Lta5CeWD3h7JzO0i6gVQNJv3342lwXbtx9OpkFoP0ET0LwKDZcyOF5s46ez2TtCxkt9OL0gBmJ1oMnJJcHnYo/wU9czXfR62TnAd7zWfj7/HrAAAKDnDZ8VAAAAAElFTkSuQmCC";
|
8092
8485
|
|
8093
8486
|
/*
|
8094
8487
|
* @Author: binruan@chatlabs.com
|
@@ -8132,7 +8525,7 @@
|
|
8132
8525
|
};
|
8133
8526
|
return (React.createElement("div", Object.assign({ className: `pb-prompt ${css.css(Object.assign({}, style))}` }, props),
|
8134
8527
|
React.createElement("div", { className: 'pb-prompt-icon' },
|
8135
|
-
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$
|
8528
|
+
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2 })),
|
8136
8529
|
React.createElement("div", { className: 'pb-prompt-content' }, content),
|
8137
8530
|
React.createElement("button", { className: 'pb-prompt-btn', onClick: handleOk }, btnText)));
|
8138
8531
|
};
|
@@ -8144,13 +8537,13 @@
|
|
8144
8537
|
category: 'popup',
|
8145
8538
|
type: 'Prompt',
|
8146
8539
|
related: {
|
8147
|
-
settingRender,
|
8540
|
+
settingRender: settingRender$2,
|
8148
8541
|
bindableProps: [],
|
8149
8542
|
interactionRender: interactionRender$7
|
8150
8543
|
},
|
8151
8544
|
defaulSetting: {
|
8152
8545
|
props: {
|
8153
|
-
icon: img$
|
8546
|
+
icon: img$2,
|
8154
8547
|
content: 'You have successfully completed the appointment!',
|
8155
8548
|
btnText: 'OK'
|
8156
8549
|
},
|
@@ -8161,301 +8554,189 @@
|
|
8161
8554
|
sort: 3
|
8162
8555
|
});
|
8163
8556
|
|
8164
|
-
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=";
|
8165
|
-
|
8166
|
-
const CommodityDetailDiro$1 = (_a) => {
|
8167
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
8168
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image"]);
|
8169
|
-
const [spread, setSpread] = React.useState(true);
|
8170
|
-
const { sxpParameter } = useSxpDataSource();
|
8171
|
-
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
8172
|
-
const { jumpToWeb, productView } = useEventReport();
|
8173
|
-
const scrollRef = React.useRef(null);
|
8174
|
-
const touchRef = React.useRef(null);
|
8175
|
-
const touchMoveRef = React.useRef(null);
|
8176
|
-
const [stopSlide, setStopSlide] = React.useState(false);
|
8177
|
-
const [isBottom, setIsBottom] = React.useState(false);
|
8178
|
-
const [isTop, setIsTop] = React.useState(true);
|
8179
|
-
const curTimeRef = React.useRef(null);
|
8180
|
-
const data = isPost ? rec : popupDetailData;
|
8181
|
-
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;
|
8182
|
-
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;
|
8183
|
-
const handleLink = () => {
|
8184
|
-
if (product === null || product === void 0 ? void 0 : product.link) {
|
8185
|
-
jumpToWeb(data, product, cta);
|
8186
|
-
if (!isPost) {
|
8187
|
-
productView(data, product, cta, viewTime || curTimeRef.current);
|
8188
|
-
}
|
8189
|
-
window.location.href = window.getJointUtmLink(product.link);
|
8190
|
-
}
|
8191
|
-
};
|
8192
|
-
React.useEffect(() => {
|
8193
|
-
const initTime = () => {
|
8194
|
-
curTimeRef.current = new Date();
|
8195
|
-
};
|
8196
|
-
initTime();
|
8197
|
-
window.addEventListener('pageshow', initTime);
|
8198
|
-
return () => {
|
8199
|
-
window.removeEventListener('pageshow', initTime);
|
8200
|
-
};
|
8201
|
-
}, []);
|
8202
|
-
const priceText = React.useMemo(() => {
|
8203
|
-
var _a, _b, _c, _d, _e;
|
8204
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
8205
|
-
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', {
|
8206
|
-
minimumFractionDigits: 0
|
8207
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
8208
|
-
}
|
8209
|
-
else {
|
8210
|
-
return '$7,000';
|
8211
|
-
}
|
8212
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8213
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8214
|
-
const handleClickCollapse = () => {
|
8215
|
-
setSpread(!spread);
|
8216
|
-
};
|
8217
|
-
React.useEffect(() => {
|
8218
|
-
var _a, _b;
|
8219
|
-
console.log((_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight, window.innerHeight);
|
8220
|
-
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) {
|
8221
|
-
setStopSlide(true);
|
8222
|
-
}
|
8223
|
-
}, [scrollRef]);
|
8224
|
-
React.useEffect(() => {
|
8225
|
-
const handleScroll = () => {
|
8226
|
-
if (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) {
|
8227
|
-
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
|
8228
|
-
const isBottom = scrollTop + clientHeight === scrollHeight;
|
8229
|
-
if (isBottom) {
|
8230
|
-
setIsBottom(true);
|
8231
|
-
}
|
8232
|
-
else {
|
8233
|
-
setIsBottom(false);
|
8234
|
-
}
|
8235
|
-
if (scrollTop === 0) {
|
8236
|
-
setIsTop(true);
|
8237
|
-
}
|
8238
|
-
else {
|
8239
|
-
setIsTop(false);
|
8240
|
-
}
|
8241
|
-
}
|
8242
|
-
};
|
8243
|
-
if (scrollRef.current) {
|
8244
|
-
scrollRef.current.addEventListener('scroll', handleScroll);
|
8245
|
-
}
|
8246
|
-
return () => {
|
8247
|
-
if (scrollRef.current) {
|
8248
|
-
scrollRef.current.removeEventListener('scroll', handleScroll);
|
8249
|
-
}
|
8250
|
-
};
|
8251
|
-
}, [scrollRef]);
|
8252
|
-
const handleTouchStart = (event) => {
|
8253
|
-
event.stopPropagation();
|
8254
|
-
touchRef.current = event.touches[0].clientY;
|
8255
|
-
touchMoveRef.current = true;
|
8256
|
-
};
|
8257
|
-
const handleTouchMove = (event) => {
|
8258
|
-
var _a, _b, _c, _d;
|
8259
|
-
if (touchMoveRef.current) {
|
8260
|
-
touchMoveRef.current = false;
|
8261
|
-
const currentY = event.touches[0].clientY;
|
8262
|
-
const diff = touchRef.current - currentY;
|
8263
|
-
if (diff > 0 && (isBottom || !stopSlide)) {
|
8264
|
-
(_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();
|
8265
|
-
}
|
8266
|
-
else if (diff < 0 && (isTop || !stopSlide)) {
|
8267
|
-
(_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();
|
8268
|
-
}
|
8269
|
-
}
|
8270
|
-
};
|
8271
|
-
return (React.createElement("div", { className: 'pb-commondityDiro' },
|
8272
|
-
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props, { onTouchStart: handleTouchStart, onTouchMove: (e) => {
|
8273
|
-
e.stopPropagation();
|
8274
|
-
handleTouchMove(e);
|
8275
|
-
} }),
|
8276
|
-
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: {
|
8277
|
-
delay: 3000
|
8278
|
-
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8279
|
-
return (React.createElement(SwiperSlide, { key: src },
|
8280
|
-
React.createElement("div", { style: {
|
8281
|
-
overflow: 'hidden',
|
8282
|
-
width,
|
8283
|
-
height: width
|
8284
|
-
} },
|
8285
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
8286
|
-
}))),
|
8287
|
-
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8288
|
-
position: 'relative',
|
8289
|
-
height: 0,
|
8290
|
-
width: '100%',
|
8291
|
-
paddingBottom: '100%',
|
8292
|
-
overflow: 'hidden'
|
8293
|
-
}) },
|
8294
|
-
React.createElement("img", { className: css.css({
|
8295
|
-
position: 'absolute',
|
8296
|
-
left: 0,
|
8297
|
-
top: 0,
|
8298
|
-
objectFit: 'cover',
|
8299
|
-
width: '100%'
|
8300
|
-
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8301
|
-
React.createElement("div", { className: 'pb-commondityDiro-content' },
|
8302
|
-
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'),
|
8303
|
-
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'),
|
8304
|
-
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'),
|
8305
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-line' }),
|
8306
|
-
React.createElement("div", { className: 'pb-commondityDiro-content-price' }, priceText)),
|
8307
|
-
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) === '') },
|
8308
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse', onClick: handleClickCollapse },
|
8309
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse-title' }, "DESCRIPTION"),
|
8310
|
-
React.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: img$2, alt: '' })),
|
8311
|
-
React.createElement("div", { className: 'pb-commondityDiro-desc-info', hidden: !spread }, (product === null || product === void 0 ? void 0 : product.info) ||
|
8312
|
-
'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.')),
|
8313
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement(React.Fragment, null,
|
8314
|
-
React.createElement("div", { className: 'pb-commondityDiro-h90' }),
|
8315
|
-
React.createElement("div", { className: 'pb-commondityDiro-bottom' },
|
8316
|
-
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')))))));
|
8317
|
-
};
|
8318
|
-
var CommodityDetailDiroComponent = React.memo(CommodityDetailDiro$1);
|
8319
|
-
|
8320
8557
|
/*
|
8321
8558
|
* @Author: binruan@chatlabs.com
|
8322
|
-
* @Date:
|
8559
|
+
* @Date: 2024-03-26 16:50:25
|
8323
8560
|
* @LastEditors: binruan@chatlabs.com
|
8324
|
-
* @LastEditTime: 2024-
|
8325
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\
|
8561
|
+
* @LastEditTime: 2024-03-28 18:42:26
|
8562
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
8326
8563
|
*
|
8327
8564
|
*/
|
8328
|
-
|
8329
|
-
|
8330
|
-
|
8331
|
-
|
8332
|
-
|
8333
|
-
|
8334
|
-
|
8335
|
-
|
8565
|
+
var settingRender$1 = [
|
8566
|
+
{
|
8567
|
+
title: '商品图片',
|
8568
|
+
child: [
|
8569
|
+
{
|
8570
|
+
type: 'Radius',
|
8571
|
+
label: '轮播指示器',
|
8572
|
+
options: [
|
8573
|
+
{
|
8574
|
+
label: '居左',
|
8575
|
+
value: 'left'
|
8576
|
+
},
|
8577
|
+
{
|
8578
|
+
label: '居中',
|
8579
|
+
value: 'center'
|
8580
|
+
}
|
8581
|
+
],
|
8582
|
+
name: ['props', 'swiper', 'dotsAlign']
|
8583
|
+
},
|
8584
|
+
{
|
8585
|
+
type: 'Number',
|
8586
|
+
name: ['props', 'swiper', 'delay'],
|
8587
|
+
addonAfter: 's'
|
8588
|
+
}
|
8589
|
+
]
|
8336
8590
|
},
|
8337
|
-
|
8338
|
-
|
8339
|
-
|
8340
|
-
|
8341
|
-
|
8342
|
-
|
8343
|
-
|
8344
|
-
|
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
|
-
|
8591
|
+
{
|
8592
|
+
title: '商品文本',
|
8593
|
+
child: [
|
8594
|
+
{
|
8595
|
+
name: ['props', 'commodityStyles'],
|
8596
|
+
type: 'SelectLinkage',
|
8597
|
+
child: [
|
8598
|
+
{
|
8599
|
+
label: '字段',
|
8600
|
+
type: 'Select',
|
8601
|
+
options: [
|
8602
|
+
{
|
8603
|
+
label: '商品名称',
|
8604
|
+
value: 'title'
|
8605
|
+
},
|
8606
|
+
{
|
8607
|
+
label: '系列名称',
|
8608
|
+
value: 'collection'
|
8609
|
+
},
|
8610
|
+
{
|
8611
|
+
label: '价格',
|
8612
|
+
value: 'price'
|
8613
|
+
},
|
8614
|
+
{
|
8615
|
+
label: '税费说明',
|
8616
|
+
value: 'taxInfo'
|
8617
|
+
},
|
8618
|
+
{
|
8619
|
+
label: '商品描述',
|
8620
|
+
value: 'info'
|
8621
|
+
}
|
8622
|
+
],
|
8623
|
+
name: ['props', 'commodityStyles', 'field'],
|
8624
|
+
initialValue: 'title'
|
8625
|
+
},
|
8626
|
+
{
|
8627
|
+
type: 'Group',
|
8628
|
+
label: '标题字体',
|
8629
|
+
child: [
|
8630
|
+
{
|
8631
|
+
type: 'Color',
|
8632
|
+
name: ['color']
|
8633
|
+
},
|
8634
|
+
{
|
8635
|
+
type: 'Select',
|
8636
|
+
options: [{ label: '黑体', value: '黑体' }],
|
8637
|
+
name: ['fontFamily']
|
8638
|
+
},
|
8639
|
+
{
|
8640
|
+
type: 'Number',
|
8641
|
+
addonAfter: 'px',
|
8642
|
+
name: ['fontSize']
|
8643
|
+
}
|
8644
|
+
]
|
8645
|
+
},
|
8646
|
+
{
|
8647
|
+
label: '标题样式',
|
8648
|
+
type: 'TextStyle'
|
8649
|
+
},
|
8650
|
+
{
|
8651
|
+
label: '标题对齐',
|
8652
|
+
type: 'TextAlign'
|
8653
|
+
},
|
8654
|
+
{
|
8655
|
+
label: '默认行数',
|
8656
|
+
type: 'Number',
|
8657
|
+
name: ['lineClamp']
|
8658
|
+
}
|
8659
|
+
]
|
8660
|
+
}
|
8661
|
+
]
|
8662
|
+
},
|
8663
|
+
{
|
8664
|
+
title: '购买按钮样式',
|
8665
|
+
child: [
|
8666
|
+
{
|
8667
|
+
type: 'Color',
|
8668
|
+
label: '背景色',
|
8669
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
8670
|
+
initialValue: '#000'
|
8671
|
+
},
|
8672
|
+
{
|
8673
|
+
type: 'Group',
|
8674
|
+
label: '尺寸',
|
8675
|
+
child: [
|
8676
|
+
{
|
8677
|
+
type: 'Number',
|
8678
|
+
name: ['props', 'buttonStyle', 'height'],
|
8679
|
+
addonAfter: 'H'
|
8680
|
+
}
|
8681
|
+
]
|
8682
|
+
},
|
8683
|
+
{
|
8684
|
+
type: 'Group',
|
8685
|
+
label: '圆角',
|
8686
|
+
child: [
|
8687
|
+
{
|
8688
|
+
type: 'Slider',
|
8689
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
8690
|
+
max: 100
|
8691
|
+
},
|
8692
|
+
{
|
8693
|
+
type: 'Number',
|
8694
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
8695
|
+
addonAfter: 'px',
|
8696
|
+
max: 100
|
8697
|
+
}
|
8698
|
+
]
|
8699
|
+
},
|
8700
|
+
{
|
8701
|
+
type: 'TextMargin',
|
8702
|
+
name: ['props', 'buttonStyle']
|
8703
|
+
},
|
8704
|
+
{
|
8705
|
+
type: 'Group',
|
8706
|
+
label: '字体',
|
8707
|
+
child: [
|
8708
|
+
{
|
8709
|
+
type: 'Color',
|
8710
|
+
name: ['props', 'buttonStyle', 'color'],
|
8711
|
+
initialValue: '#fff'
|
8712
|
+
},
|
8713
|
+
{
|
8714
|
+
type: 'Select',
|
8715
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
8716
|
+
options: [{ label: '黑体', value: '黑体' }]
|
8717
|
+
},
|
8718
|
+
{
|
8719
|
+
type: 'Number',
|
8720
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
8721
|
+
addonAfter: 'px'
|
8722
|
+
}
|
8723
|
+
]
|
8724
|
+
},
|
8725
|
+
{
|
8726
|
+
type: 'TextStyle',
|
8727
|
+
name: ['props', 'buttonStyle']
|
8728
|
+
},
|
8729
|
+
{
|
8730
|
+
type: 'TextAlign',
|
8731
|
+
name: ['props', 'buttonStyle']
|
8732
|
+
}
|
8733
|
+
]
|
8413
8734
|
}
|
8414
|
-
|
8415
|
-
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8416
|
-
return _words.join(' ') + ' ';
|
8417
|
-
};
|
8418
|
-
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText }) => {
|
8419
|
-
const [isShowMore, setIsShowMore] = React.useState(true);
|
8420
|
-
const [isShow, setIsShow] = React.useState(false);
|
8421
|
-
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
8422
|
-
const multiRow = React.useRef(null);
|
8423
|
-
const handleClick = React.useCallback(() => {
|
8424
|
-
setIsShowMore(!isShowMore);
|
8425
|
-
}, [isShowMore]);
|
8426
|
-
React.useMemo(() => {
|
8427
|
-
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8428
|
-
}, [text, maxStr, isShowMore]);
|
8429
|
-
React.useEffect(() => {
|
8430
|
-
if (multiRow.current) {
|
8431
|
-
setIsShowMore(true);
|
8432
|
-
setTimeout(() => {
|
8433
|
-
setIsShow(false);
|
8434
|
-
const height = parseInt(getComputedStyle(multiRow.current).height);
|
8435
|
-
const lineHeight = parseInt(getComputedStyle(multiRow === null || multiRow === void 0 ? void 0 : multiRow.current).lineHeight);
|
8436
|
-
if (text && height > lineHeight * lineClamp) {
|
8437
|
-
setIsShowMore(false);
|
8438
|
-
setIsShow(true);
|
8439
|
-
}
|
8440
|
-
}, 100);
|
8441
|
-
}
|
8442
|
-
}, [multiRow, text, lineClamp, style]);
|
8443
|
-
return (React.createElement("div", { className: className, style: Object.assign({}, style) },
|
8444
|
-
React.createElement("div", { ref: multiRow, style: {
|
8445
|
-
overflow: 'hidden',
|
8446
|
-
WebkitLineClamp: !isShowMore ? lineClamp : '',
|
8447
|
-
textOverflow: 'ellipsis',
|
8448
|
-
display: '-webkit-box',
|
8449
|
-
WebkitBoxOrient: 'vertical',
|
8450
|
-
wordBreak: 'break-word'
|
8451
|
-
} }, text),
|
8452
|
-
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'))));
|
8453
|
-
};
|
8454
|
-
var ExpandableText$1 = React.memo(ExpandableText);
|
8735
|
+
];
|
8455
8736
|
|
8456
8737
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8457
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
8458
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText"]);
|
8738
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8739
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle"]);
|
8459
8740
|
React.useState(true);
|
8460
8741
|
const { sxpParameter } = useSxpDataSource();
|
8461
8742
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
@@ -8502,14 +8783,22 @@
|
|
8502
8783
|
}
|
8503
8784
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8504
8785
|
const width = isPreview ? 375 : window.innerWidth;
|
8786
|
+
const productInfoText = ({ isPost }) => {
|
8787
|
+
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8788
|
+
React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
8789
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8790
|
+
Made in Italy` })));
|
8791
|
+
};
|
8505
8792
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8506
8793
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
|
8507
8794
|
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: {
|
8508
8795
|
clickable: true,
|
8509
8796
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8510
|
-
clickableClass:
|
8797
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
8798
|
+
? 'commondityDiroNew-swiper-clickable-left'
|
8799
|
+
: 'commondityDiroNew-swiper-clickable-center'
|
8511
8800
|
}, loop: true, autoplay: {
|
8512
|
-
delay:
|
8801
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8513
8802
|
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8514
8803
|
return (React.createElement(SwiperSlide, { key: src },
|
8515
8804
|
React.createElement("div", { style: {
|
@@ -8535,35 +8824,289 @@
|
|
8535
8824
|
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8536
8825
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8537
8826
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8538
|
-
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'),
|
8539
|
-
React.createElement("div", { className: '
|
8540
|
-
|
8541
|
-
|
8542
|
-
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.
|
8543
|
-
|
8544
|
-
|
8545
|
-
|
8546
|
-
Made in Italy`))))),
|
8547
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
8548
|
-
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) ||
|
8549
|
-
`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
|
8550
|
-
Made in Italy`))));
|
8827
|
+
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'),
|
8828
|
+
React.createElement("div", { className: '' },
|
8829
|
+
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),
|
8830
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
|
8831
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin'),
|
8832
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Shop now')),
|
8833
|
+
productInfoText({ isPost }))),
|
8834
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8551
8835
|
};
|
8552
|
-
var
|
8836
|
+
var CommodityDetailDiroNewComponent = React.memo(CommodityDetailDiroNew$1);
|
8553
8837
|
|
8554
|
-
|
8838
|
+
/*
|
8839
|
+
* @Author: binruan@chatlabs.com
|
8840
|
+
* @Date: 2024-03-20 10:27:31
|
8841
|
+
* @LastEditors: binruan@chatlabs.com
|
8842
|
+
* @LastEditTime: 2024-04-02 15:12:53
|
8843
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\material.tsx
|
8844
|
+
*
|
8845
|
+
*/
|
8846
|
+
const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
8555
8847
|
displayName: '商品详情',
|
8556
8848
|
icon: '',
|
8557
8849
|
category: 'popup',
|
8558
8850
|
type: 'CommodityDetailDiroNew',
|
8851
|
+
related: {
|
8852
|
+
settingRender: settingRender$1
|
8853
|
+
},
|
8559
8854
|
defaulSetting: {
|
8560
|
-
props: {
|
8855
|
+
props: {
|
8856
|
+
swiper: {
|
8857
|
+
dotsAlign: 'left',
|
8858
|
+
delay: 3
|
8859
|
+
},
|
8860
|
+
commodityStyles: {
|
8861
|
+
price: {
|
8862
|
+
color: '#000',
|
8863
|
+
fontWeight: 'bold',
|
8864
|
+
fontSize: 18
|
8865
|
+
},
|
8866
|
+
title: {
|
8867
|
+
color: '#000',
|
8868
|
+
fontSize: 13
|
8869
|
+
},
|
8870
|
+
collection: {
|
8871
|
+
color: '#757575',
|
8872
|
+
fontSize: 13
|
8873
|
+
},
|
8874
|
+
info: {
|
8875
|
+
color: '#757575',
|
8876
|
+
fontSize: 13
|
8877
|
+
},
|
8878
|
+
taxInfo: {
|
8879
|
+
color: '#000',
|
8880
|
+
fontWeight: 'bold',
|
8881
|
+
fontSize: 13,
|
8882
|
+
textAlign: 'right'
|
8883
|
+
}
|
8884
|
+
},
|
8885
|
+
buttonStyle: {
|
8886
|
+
backgroundColor: '#000',
|
8887
|
+
fontSize: 12,
|
8888
|
+
height: 52,
|
8889
|
+
fontWeight: 'bold',
|
8890
|
+
textAlign: 'center',
|
8891
|
+
color: '#fff',
|
8892
|
+
borderRadius: 25,
|
8893
|
+
marginTop: 16,
|
8894
|
+
marginBottom: 16
|
8895
|
+
}
|
8896
|
+
},
|
8561
8897
|
style: {}
|
8562
8898
|
},
|
8563
|
-
w: 100,
|
8564
|
-
h: 40,
|
8565
|
-
sort: 1
|
8566
|
-
});
|
8899
|
+
w: 100,
|
8900
|
+
h: 40,
|
8901
|
+
sort: 1
|
8902
|
+
});
|
8903
|
+
|
8904
|
+
/*
|
8905
|
+
* @Author: binruan@chatlabs.com
|
8906
|
+
* @Date: 2024-03-26 16:50:25
|
8907
|
+
* @LastEditors: binruan@chatlabs.com
|
8908
|
+
* @LastEditTime: 2024-03-29 17:03:07
|
8909
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
8910
|
+
*
|
8911
|
+
*/
|
8912
|
+
var settingRender = [
|
8913
|
+
{
|
8914
|
+
title: '主题样式',
|
8915
|
+
child: [
|
8916
|
+
{
|
8917
|
+
type: 'Group',
|
8918
|
+
label: '尺寸',
|
8919
|
+
child: [
|
8920
|
+
{
|
8921
|
+
type: 'Number',
|
8922
|
+
name: ['style', 'width'],
|
8923
|
+
addonAfter: 'W'
|
8924
|
+
},
|
8925
|
+
{
|
8926
|
+
type: 'Number',
|
8927
|
+
name: ['style', 'height'],
|
8928
|
+
addonAfter: 'H'
|
8929
|
+
}
|
8930
|
+
]
|
8931
|
+
},
|
8932
|
+
{
|
8933
|
+
type: 'Group',
|
8934
|
+
label: '圆角',
|
8935
|
+
child: [
|
8936
|
+
{
|
8937
|
+
type: 'Slider',
|
8938
|
+
name: ['style', 'borderRadius'],
|
8939
|
+
max: 100
|
8940
|
+
},
|
8941
|
+
{
|
8942
|
+
type: 'Number',
|
8943
|
+
name: ['style', 'borderRadius'],
|
8944
|
+
addonAfter: 'px',
|
8945
|
+
max: 100
|
8946
|
+
}
|
8947
|
+
]
|
8948
|
+
},
|
8949
|
+
{
|
8950
|
+
type: 'Color',
|
8951
|
+
label: '背景色',
|
8952
|
+
name: ['style', 'backgroundColor']
|
8953
|
+
},
|
8954
|
+
{
|
8955
|
+
label: '内边距',
|
8956
|
+
type: 'Number',
|
8957
|
+
name: ['style', 'padding'],
|
8958
|
+
addonAfter: 'px'
|
8959
|
+
},
|
8960
|
+
{
|
8961
|
+
label: '与Post描述边距',
|
8962
|
+
type: 'Number',
|
8963
|
+
name: ['style', 'marginBottom'],
|
8964
|
+
addonAfter: 'px'
|
8965
|
+
}
|
8966
|
+
]
|
8967
|
+
},
|
8968
|
+
{
|
8969
|
+
title: '商品图片',
|
8970
|
+
child: [
|
8971
|
+
{
|
8972
|
+
type: 'Group',
|
8973
|
+
label: '尺寸',
|
8974
|
+
child: [
|
8975
|
+
{
|
8976
|
+
type: 'Number',
|
8977
|
+
name: ['props', 'ctaTempStyles', 'img', 'width'],
|
8978
|
+
addonAfter: 'W'
|
8979
|
+
},
|
8980
|
+
{
|
8981
|
+
type: 'Number',
|
8982
|
+
name: ['props', 'ctaTempStyles', 'img', 'height'],
|
8983
|
+
addonAfter: 'H'
|
8984
|
+
}
|
8985
|
+
]
|
8986
|
+
},
|
8987
|
+
{
|
8988
|
+
type: 'Group',
|
8989
|
+
label: '圆角',
|
8990
|
+
child: [
|
8991
|
+
{
|
8992
|
+
type: 'Slider',
|
8993
|
+
name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
|
8994
|
+
max: 100
|
8995
|
+
},
|
8996
|
+
{
|
8997
|
+
type: 'Number',
|
8998
|
+
name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
|
8999
|
+
addonAfter: 'px',
|
9000
|
+
max: 100
|
9001
|
+
}
|
9002
|
+
]
|
9003
|
+
},
|
9004
|
+
{
|
9005
|
+
type: 'Number',
|
9006
|
+
label: '与右侧边距',
|
9007
|
+
addonAfter: 'px',
|
9008
|
+
name: ['props', 'ctaTempStyles', 'img', 'marginRight']
|
9009
|
+
}
|
9010
|
+
]
|
9011
|
+
},
|
9012
|
+
{
|
9013
|
+
title: '商品标题文本',
|
9014
|
+
type: 'commodityTitle',
|
9015
|
+
child: [
|
9016
|
+
{
|
9017
|
+
type: 'Group',
|
9018
|
+
label: '字体',
|
9019
|
+
child: [
|
9020
|
+
{
|
9021
|
+
type: 'Color',
|
9022
|
+
name: ['props', 'ctaTempStyles', 'title', 'color']
|
9023
|
+
},
|
9024
|
+
{
|
9025
|
+
type: 'Select',
|
9026
|
+
options: [{ label: '黑体', value: '黑体' }],
|
9027
|
+
name: ['props', 'ctaTempStyles', 'title', 'fontFamily']
|
9028
|
+
},
|
9029
|
+
{
|
9030
|
+
type: 'Number',
|
9031
|
+
addonAfter: 'px',
|
9032
|
+
name: ['props', 'ctaTempStyles', 'title', 'fontSize']
|
9033
|
+
}
|
9034
|
+
]
|
9035
|
+
},
|
9036
|
+
{
|
9037
|
+
label: '样式',
|
9038
|
+
type: 'TextStyle',
|
9039
|
+
name: ['props', 'ctaTempStyles', 'title']
|
9040
|
+
},
|
9041
|
+
{
|
9042
|
+
label: '对齐',
|
9043
|
+
type: 'TextAlign',
|
9044
|
+
name: ['props', 'ctaTempStyles', 'title']
|
9045
|
+
},
|
9046
|
+
{
|
9047
|
+
label: '间距',
|
9048
|
+
type: 'TextSpace',
|
9049
|
+
name: ['props', 'ctaTempStyles', 'title']
|
9050
|
+
}
|
9051
|
+
]
|
9052
|
+
},
|
9053
|
+
{
|
9054
|
+
title: 'CTA标题',
|
9055
|
+
child: [
|
9056
|
+
{
|
9057
|
+
type: 'Group',
|
9058
|
+
label: '尺寸',
|
9059
|
+
child: [
|
9060
|
+
{
|
9061
|
+
type: 'Number',
|
9062
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'width'],
|
9063
|
+
addonAfter: 'W'
|
9064
|
+
},
|
9065
|
+
{
|
9066
|
+
type: 'Number',
|
9067
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'height'],
|
9068
|
+
addonAfter: 'H'
|
9069
|
+
}
|
9070
|
+
]
|
9071
|
+
},
|
9072
|
+
{
|
9073
|
+
type: 'Color',
|
9074
|
+
label: '背景色',
|
9075
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'backgroundColor']
|
9076
|
+
},
|
9077
|
+
{
|
9078
|
+
type: 'Group',
|
9079
|
+
label: '字体',
|
9080
|
+
child: [
|
9081
|
+
{
|
9082
|
+
type: 'Color',
|
9083
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'color']
|
9084
|
+
},
|
9085
|
+
{
|
9086
|
+
type: 'Select',
|
9087
|
+
options: [{ label: '黑体', value: '黑体' }],
|
9088
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontFamily']
|
9089
|
+
},
|
9090
|
+
{
|
9091
|
+
type: 'Number',
|
9092
|
+
addonAfter: 'px',
|
9093
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontSize']
|
9094
|
+
}
|
9095
|
+
]
|
9096
|
+
},
|
9097
|
+
{
|
9098
|
+
label: '样式',
|
9099
|
+
type: 'TextStyle',
|
9100
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
9101
|
+
},
|
9102
|
+
{
|
9103
|
+
label: '对齐',
|
9104
|
+
type: 'TextAlign',
|
9105
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
9106
|
+
}
|
9107
|
+
]
|
9108
|
+
}
|
9109
|
+
];
|
8567
9110
|
|
8568
9111
|
var interactionRender$6 = [
|
8569
9112
|
{
|
@@ -8605,9 +9148,10 @@ Made in Italy`))));
|
|
8605
9148
|
}
|
8606
9149
|
|
8607
9150
|
const EventProvider = (_a) => {
|
8608
|
-
var { rec, children, className, onClick } = _a; __rest(_a, ["rec", "children", "className", "onClick"]);
|
9151
|
+
var { rec, children, className, onClick, style } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style"]);
|
8609
9152
|
const ref = React.useRef(null);
|
8610
9153
|
const isOnScreen = useOnScreen(ref);
|
9154
|
+
const { popupAni } = useEditor();
|
8611
9155
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
8612
9156
|
React.useEffect(() => {
|
8613
9157
|
var _a, _b;
|
@@ -8628,8 +9172,8 @@ Made in Italy`))));
|
|
8628
9172
|
}, rec, item);
|
8629
9173
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
8630
9174
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
8631
|
-
},
|
8632
|
-
return (React.createElement("div", { ref: ref, className: className, onClick: handleClick }, children));
|
9175
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9176
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
8633
9177
|
};
|
8634
9178
|
var EventProvider$1 = React.memo(EventProvider);
|
8635
9179
|
|
@@ -8637,20 +9181,12 @@ Made in Italy`))));
|
|
8637
9181
|
|
8638
9182
|
const Commodity$1 = (_a) => {
|
8639
9183
|
var _b, _c, _d, _e, _f, _g, _h;
|
8640
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9184
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8641
9185
|
const { sxpParameter } = useSxpDataSource();
|
8642
9186
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8643
9187
|
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;
|
8644
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8645
|
-
React.createElement("div", { className: css.css({
|
8646
|
-
width: '60px',
|
8647
|
-
height: '60px',
|
8648
|
-
marginRight: '8px',
|
8649
|
-
borderRadius: '3px',
|
8650
|
-
overflow: 'hidden',
|
8651
|
-
flexShrink: 0,
|
8652
|
-
backgroundColor: '#f2f2f2'
|
8653
|
-
}) },
|
9188
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9189
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8654
9190
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8655
9191
|
React.createElement("div", { className: css.css({
|
8656
9192
|
color: '#fff',
|
@@ -8660,20 +9196,19 @@ Made in Italy`))));
|
|
8660
9196
|
width: '100%',
|
8661
9197
|
overflow: 'hidden'
|
8662
9198
|
}) },
|
8663
|
-
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'),
|
8664
|
-
React.createElement("div", { className: css.css({
|
8665
|
-
background: 'rgba(0,0,0,.5)',
|
8666
|
-
fontSize: '10px',
|
8667
|
-
padding: '2px 7px',
|
8668
|
-
width: 'auto',
|
8669
|
-
textAlign: 'center',
|
8670
|
-
textOverflow: 'ellipsis',
|
8671
|
-
overflow: 'hidden',
|
8672
|
-
whiteSpace: 'nowrap'
|
8673
|
-
}) }, (_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'))));
|
9199
|
+
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'),
|
9200
|
+
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'))));
|
8674
9201
|
};
|
8675
9202
|
var CommodityComponent = React.memo(Commodity$1);
|
8676
9203
|
|
9204
|
+
/*
|
9205
|
+
* @Author: binruan@chatlabs.com
|
9206
|
+
* @Date: 2023-07-28 18:29:57
|
9207
|
+
* @LastEditors: binruan@chatlabs.com
|
9208
|
+
* @LastEditTime: 2024-03-29 16:39:54
|
9209
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Commodity\material.tsx
|
9210
|
+
*
|
9211
|
+
*/
|
8677
9212
|
const Commodity = createMaterial(CommodityComponent, {
|
8678
9213
|
displayName: '推荐单商品-透明底',
|
8679
9214
|
icon: '',
|
@@ -8681,15 +9216,39 @@ Made in Italy`))));
|
|
8681
9216
|
type: 'Commodity',
|
8682
9217
|
related: {
|
8683
9218
|
interactionRender: interactionRender$6,
|
8684
|
-
bindableProps: []
|
9219
|
+
bindableProps: [],
|
9220
|
+
settingRender
|
8685
9221
|
},
|
8686
9222
|
defaulSetting: {
|
8687
|
-
props: {
|
9223
|
+
props: {
|
9224
|
+
ctaTempStyles: {
|
9225
|
+
img: {
|
9226
|
+
borderRadius: 3,
|
9227
|
+
width: 60,
|
9228
|
+
height: 60,
|
9229
|
+
marginRight: 8
|
9230
|
+
},
|
9231
|
+
title: {
|
9232
|
+
fontSize: 12,
|
9233
|
+
color: '#fff',
|
9234
|
+
textAlign: 'left'
|
9235
|
+
},
|
9236
|
+
ctaTitle: {
|
9237
|
+
fontSize: 10,
|
9238
|
+
color: '#fff',
|
9239
|
+
textAlign: 'center',
|
9240
|
+
width: 130,
|
9241
|
+
height: 20,
|
9242
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
9243
|
+
}
|
9244
|
+
}
|
9245
|
+
},
|
8688
9246
|
style: {
|
8689
|
-
padding:
|
8690
|
-
|
8691
|
-
|
8692
|
-
borderRadius:
|
9247
|
+
padding: 7,
|
9248
|
+
width: 236,
|
9249
|
+
height: 74,
|
9250
|
+
borderRadius: 3,
|
9251
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8693
9252
|
}
|
8694
9253
|
},
|
8695
9254
|
w: 100,
|
@@ -8711,30 +9270,24 @@ Made in Italy`))));
|
|
8711
9270
|
|
8712
9271
|
const Appoint$1 = (_a) => {
|
8713
9272
|
var _b, _c, _d, _e;
|
8714
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9273
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8715
9274
|
const { sxpParameter } = useSxpDataSource();
|
8716
9275
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
8717
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8718
|
-
React.createElement("div", { className: css.css({
|
8719
|
-
width: '30px',
|
8720
|
-
height: '30px',
|
8721
|
-
marginRight: '8px',
|
8722
|
-
borderRadius: '3px',
|
8723
|
-
overflow: 'hidden',
|
8724
|
-
flexShrink: 0,
|
8725
|
-
backgroundColor: '#f2f2f2'
|
8726
|
-
}) },
|
9276
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
9277
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8727
9278
|
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: '' })),
|
8728
|
-
React.createElement("div", { className: css.css({
|
8729
|
-
color: '#fff',
|
8730
|
-
width: '100%',
|
8731
|
-
overflow: 'hidden',
|
8732
|
-
fontSize: '12px',
|
8733
|
-
textOverflow: 'ellipsis'
|
8734
|
-
}) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
9279
|
+
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')));
|
8735
9280
|
};
|
8736
9281
|
var AppointComponent = React.memo(Appoint$1);
|
8737
9282
|
|
9283
|
+
/*
|
9284
|
+
* @Author: binruan@chatlabs.com
|
9285
|
+
* @Date: 2023-07-28 18:29:57
|
9286
|
+
* @LastEditors: binruan@chatlabs.com
|
9287
|
+
* @LastEditTime: 2024-03-29 17:03:49
|
9288
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Appoint\material.tsx
|
9289
|
+
*
|
9290
|
+
*/
|
8738
9291
|
const Appoint = createMaterial(AppointComponent, {
|
8739
9292
|
displayName: '预约表单',
|
8740
9293
|
icon: '',
|
@@ -8742,18 +9295,33 @@ Made in Italy`))));
|
|
8742
9295
|
type: 'Appoint',
|
8743
9296
|
related: {
|
8744
9297
|
interactionRender: interactionRender$5,
|
9298
|
+
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
8745
9299
|
bindableProps: []
|
8746
9300
|
},
|
8747
9301
|
defaulSetting: {
|
8748
9302
|
props: {
|
8749
|
-
|
9303
|
+
ctaTempStyles: {
|
9304
|
+
img: {
|
9305
|
+
borderRadius: 3,
|
9306
|
+
width: 30,
|
9307
|
+
height: 30,
|
9308
|
+
marginRight: 8
|
9309
|
+
},
|
9310
|
+
ctaTitle: {
|
9311
|
+
fontSize: 12,
|
9312
|
+
color: '#fff',
|
9313
|
+
textAlign: 'left',
|
9314
|
+
width: 130,
|
9315
|
+
height: 20
|
9316
|
+
}
|
9317
|
+
}
|
8750
9318
|
},
|
8751
9319
|
style: {
|
8752
|
-
padding:
|
8753
|
-
|
8754
|
-
|
8755
|
-
|
8756
|
-
|
9320
|
+
padding: 7,
|
9321
|
+
width: 236,
|
9322
|
+
height: 44,
|
9323
|
+
borderRadius: 3,
|
9324
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8757
9325
|
}
|
8758
9326
|
},
|
8759
9327
|
w: 100,
|
@@ -8765,7 +9333,7 @@ Made in Italy`))));
|
|
8765
9333
|
|
8766
9334
|
const Link$1 = (_a) => {
|
8767
9335
|
var _b, _c, _d, _e, _f;
|
8768
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9336
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8769
9337
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
8770
9338
|
const { jumpToWeb } = useEventReport();
|
8771
9339
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
@@ -8776,45 +9344,60 @@ Made in Italy`))));
|
|
8776
9344
|
window.location.href = window.getJointUtmLink(cta.link);
|
8777
9345
|
}
|
8778
9346
|
};
|
8779
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8780
|
-
React.createElement("div", { className: css.css({
|
8781
|
-
width: '60px',
|
8782
|
-
height: '60px',
|
8783
|
-
marginRight: '8px',
|
8784
|
-
borderRadius: '3px',
|
8785
|
-
backgroundColor: '#f2f2f2',
|
8786
|
-
overflow: 'hidden',
|
8787
|
-
flexShrink: 0
|
8788
|
-
}) },
|
9347
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9348
|
+
React.createElement("div", { className: css.css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8789
9349
|
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: '' })),
|
8790
9350
|
React.createElement("div", { className: css.css({
|
8791
|
-
color: '#fff',
|
8792
9351
|
display: 'flex',
|
8793
9352
|
alignItems: 'center',
|
8794
9353
|
width: '100%',
|
8795
9354
|
overflow: 'hidden'
|
8796
9355
|
}) },
|
8797
|
-
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'))));
|
9356
|
+
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'))));
|
8798
9357
|
};
|
8799
9358
|
var LinkComponent = React.memo(Link$1);
|
8800
9359
|
|
9360
|
+
/*
|
9361
|
+
* @Author: binruan@chatlabs.com
|
9362
|
+
* @Date: 2023-07-28 18:29:57
|
9363
|
+
* @LastEditors: binruan@chatlabs.com
|
9364
|
+
* @LastEditTime: 2024-03-29 17:04:57
|
9365
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\material.tsx
|
9366
|
+
*
|
9367
|
+
*/
|
8801
9368
|
const Link = createMaterial(LinkComponent, {
|
8802
9369
|
displayName: '跳转指引',
|
8803
9370
|
icon: '',
|
8804
9371
|
category: 'template',
|
8805
9372
|
type: 'Link',
|
8806
9373
|
related: {
|
9374
|
+
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
8807
9375
|
bindableProps: []
|
8808
9376
|
},
|
8809
9377
|
defaulSetting: {
|
8810
9378
|
props: {
|
8811
|
-
|
9379
|
+
ctaTempStyles: {
|
9380
|
+
img: {
|
9381
|
+
borderRadius: 3,
|
9382
|
+
width: 60,
|
9383
|
+
height: 60,
|
9384
|
+
marginRight: 8
|
9385
|
+
},
|
9386
|
+
ctaTitle: {
|
9387
|
+
fontSize: 12,
|
9388
|
+
color: '#fff',
|
9389
|
+
textAlign: 'left',
|
9390
|
+
width: 130,
|
9391
|
+
height: 20
|
9392
|
+
}
|
9393
|
+
}
|
8812
9394
|
},
|
8813
9395
|
style: {
|
8814
|
-
padding:
|
8815
|
-
|
8816
|
-
|
8817
|
-
borderRadius:
|
9396
|
+
padding: 7,
|
9397
|
+
width: 236,
|
9398
|
+
height: 74,
|
9399
|
+
borderRadius: 3,
|
9400
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8818
9401
|
}
|
8819
9402
|
},
|
8820
9403
|
w: 100,
|
@@ -8838,20 +9421,12 @@ Made in Italy`))));
|
|
8838
9421
|
|
8839
9422
|
const CommodityDiro$1 = (_a) => {
|
8840
9423
|
var _b, _c, _d, _e, _f, _g, _h;
|
8841
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9424
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8842
9425
|
const { sxpParameter } = useSxpDataSource();
|
8843
9426
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8844
9427
|
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;
|
8845
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8846
|
-
React.createElement("div", { className: css.css({
|
8847
|
-
width: '60px',
|
8848
|
-
height: '60px',
|
8849
|
-
marginRight: '8px',
|
8850
|
-
borderRadius: '3px',
|
8851
|
-
overflow: 'hidden',
|
8852
|
-
flexShrink: 0,
|
8853
|
-
backgroundColor: '#f2f2f2'
|
8854
|
-
}) },
|
9428
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9429
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8855
9430
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8856
9431
|
React.createElement("div", { className: css.css({
|
8857
9432
|
color: '#fff',
|
@@ -8861,22 +9436,19 @@ Made in Italy`))));
|
|
8861
9436
|
width: '100%',
|
8862
9437
|
overflow: 'hidden'
|
8863
9438
|
}) },
|
8864
|
-
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'),
|
8865
|
-
React.createElement("div", { className: css.css({
|
8866
|
-
background: 'rgba(0,0,0,1)',
|
8867
|
-
fontSize: '10px',
|
8868
|
-
padding: '2px 7px',
|
8869
|
-
textAlign: 'center',
|
8870
|
-
textOverflow: 'ellipsis',
|
8871
|
-
overflow: 'hidden',
|
8872
|
-
borderRadius: '25px',
|
8873
|
-
width: 'fit-content',
|
8874
|
-
maxWidth: '100%',
|
8875
|
-
whiteSpace: 'nowrap'
|
8876
|
-
}) }, (_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'))));
|
9439
|
+
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'),
|
9440
|
+
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'))));
|
8877
9441
|
};
|
8878
9442
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
8879
9443
|
|
9444
|
+
/*
|
9445
|
+
* @Author: binruan@chatlabs.com
|
9446
|
+
* @Date: 2023-07-28 18:29:57
|
9447
|
+
* @LastEditors: binruan@chatlabs.com
|
9448
|
+
* @LastEditTime: 2024-03-29 16:07:28
|
9449
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\CommodityDiro\material.tsx
|
9450
|
+
*
|
9451
|
+
*/
|
8880
9452
|
const CommodityDiro = createMaterial(CommodityDiroComponent, {
|
8881
9453
|
displayName: '推荐单商品-白底圆角按钮',
|
8882
9454
|
icon: '',
|
@@ -8884,15 +9456,39 @@ Made in Italy`))));
|
|
8884
9456
|
type: 'CommodityDiro',
|
8885
9457
|
related: {
|
8886
9458
|
interactionRender: interactionRender$4,
|
9459
|
+
settingRender,
|
8887
9460
|
bindableProps: []
|
8888
9461
|
},
|
8889
9462
|
defaulSetting: {
|
8890
|
-
props: {
|
9463
|
+
props: {
|
9464
|
+
ctaTempStyles: {
|
9465
|
+
img: {
|
9466
|
+
borderRadius: 3,
|
9467
|
+
width: 60,
|
9468
|
+
height: 60,
|
9469
|
+
marginRight: 8
|
9470
|
+
},
|
9471
|
+
title: {
|
9472
|
+
fontSize: 12,
|
9473
|
+
color: '#000',
|
9474
|
+
textAlign: 'left'
|
9475
|
+
},
|
9476
|
+
ctaTitle: {
|
9477
|
+
fontSize: 10,
|
9478
|
+
color: '#fff',
|
9479
|
+
textAlign: 'center',
|
9480
|
+
width: 80,
|
9481
|
+
height: 20,
|
9482
|
+
backgroundColor: 'rgba(0,0,0,1)'
|
9483
|
+
}
|
9484
|
+
}
|
9485
|
+
},
|
8891
9486
|
style: {
|
8892
|
-
padding:
|
8893
|
-
|
8894
|
-
|
8895
|
-
|
9487
|
+
padding: 7,
|
9488
|
+
width: 236,
|
9489
|
+
height: 74,
|
9490
|
+
borderRadius: 3,
|
9491
|
+
backgroundColor: '#fff'
|
8896
9492
|
}
|
8897
9493
|
},
|
8898
9494
|
w: 100,
|
@@ -8916,20 +9512,12 @@ Made in Italy`))));
|
|
8916
9512
|
|
8917
9513
|
const CommodityDiroNew$1 = (_a) => {
|
8918
9514
|
var _b, _c, _d, _e, _f, _g, _h;
|
8919
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9515
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8920
9516
|
const { sxpParameter } = useSxpDataSource();
|
8921
9517
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8922
9518
|
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;
|
8923
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign(
|
8924
|
-
React.createElement("div", { className: css.css({
|
8925
|
-
width: '78px',
|
8926
|
-
height: '78px',
|
8927
|
-
marginRight: '16px',
|
8928
|
-
borderRadius: '8px',
|
8929
|
-
overflow: 'hidden',
|
8930
|
-
flexShrink: 0,
|
8931
|
-
backgroundColor: '#f2f2f2'
|
8932
|
-
}) },
|
9519
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9520
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8933
9521
|
React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8934
9522
|
React.createElement("div", { className: css.css({
|
8935
9523
|
color: '#fff',
|
@@ -8939,22 +9527,19 @@ Made in Italy`))));
|
|
8939
9527
|
width: '100%',
|
8940
9528
|
overflow: 'hidden'
|
8941
9529
|
}) },
|
8942
|
-
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'),
|
8943
|
-
React.createElement("div", { className: css.css({
|
8944
|
-
fontSize: '13px',
|
8945
|
-
fontWeight: 'bold',
|
8946
|
-
textOverflow: 'ellipsis',
|
8947
|
-
overflow: 'hidden',
|
8948
|
-
width: 'fit-content',
|
8949
|
-
maxWidth: '100%',
|
8950
|
-
whiteSpace: 'nowrap',
|
8951
|
-
textDecoration: 'underline',
|
8952
|
-
color: '#000',
|
8953
|
-
lineHeight: '20px'
|
8954
|
-
}) }, (_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'))));
|
9530
|
+
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'),
|
9531
|
+
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'))));
|
8955
9532
|
};
|
8956
9533
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
8957
9534
|
|
9535
|
+
/*
|
9536
|
+
* @Author: binruan@chatlabs.com
|
9537
|
+
* @Date: 2023-07-28 18:29:57
|
9538
|
+
* @LastEditors: binruan@chatlabs.com
|
9539
|
+
* @LastEditTime: 2024-03-29 11:56:56
|
9540
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\CommodityDiroNew\material.tsx
|
9541
|
+
*
|
9542
|
+
*/
|
8958
9543
|
const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
|
8959
9544
|
displayName: '推荐单商品-白底下划线按钮',
|
8960
9545
|
icon: '',
|
@@ -8962,15 +9547,40 @@ Made in Italy`))));
|
|
8962
9547
|
type: 'CommodityDiroNew',
|
8963
9548
|
related: {
|
8964
9549
|
interactionRender: interactionRender$3,
|
8965
|
-
bindableProps: []
|
9550
|
+
bindableProps: [],
|
9551
|
+
settingRender
|
8966
9552
|
},
|
8967
9553
|
defaulSetting: {
|
8968
|
-
props: {
|
9554
|
+
props: {
|
9555
|
+
ctaTempStyles: {
|
9556
|
+
img: {
|
9557
|
+
borderRadius: 8,
|
9558
|
+
width: 78,
|
9559
|
+
height: 78,
|
9560
|
+
marginRight: 16
|
9561
|
+
},
|
9562
|
+
title: {
|
9563
|
+
fontSize: 12,
|
9564
|
+
color: '#000',
|
9565
|
+
textAlign: 'left'
|
9566
|
+
},
|
9567
|
+
ctaTitle: {
|
9568
|
+
textDecoration: 'underline',
|
9569
|
+
fontSize: 12,
|
9570
|
+
fontWeight: 'bold',
|
9571
|
+
color: '#000',
|
9572
|
+
textAlign: 'left',
|
9573
|
+
width: 150,
|
9574
|
+
height: 20
|
9575
|
+
}
|
9576
|
+
}
|
9577
|
+
},
|
8969
9578
|
style: {
|
8970
|
-
|
8971
|
-
|
8972
|
-
|
8973
|
-
|
9579
|
+
borderRadius: 4,
|
9580
|
+
width: 260,
|
9581
|
+
height: 86,
|
9582
|
+
padding: 4,
|
9583
|
+
backgroundColor: 'rgba(255,255,255,0.75)'
|
8974
9584
|
}
|
8975
9585
|
},
|
8976
9586
|
w: 100,
|
@@ -9023,8 +9633,9 @@ Made in Italy`))));
|
|
9023
9633
|
|
9024
9634
|
const MultiCommodityDiro$1 = (_a) => {
|
9025
9635
|
var _b, _c;
|
9026
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9636
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9027
9637
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9638
|
+
const { popupAni } = useEditor();
|
9028
9639
|
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]);
|
9029
9640
|
const handleClick = lodash.throttle((item) => {
|
9030
9641
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9033,19 +9644,11 @@ Made in Italy`))));
|
|
9033
9644
|
}, recData, item);
|
9034
9645
|
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 }) }));
|
9035
9646
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9036
|
-
},
|
9647
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9037
9648
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9038
9649
|
var _a, _b, _c, _d, _e, _f;
|
9039
|
-
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(
|
9040
|
-
React.createElement("div", { className: css.css({
|
9041
|
-
width: '60px',
|
9042
|
-
height: '60px',
|
9043
|
-
marginRight: '8px',
|
9044
|
-
borderRadius: '3px',
|
9045
|
-
overflow: 'hidden',
|
9046
|
-
flexShrink: 0,
|
9047
|
-
backgroundColor: '#f2f2f2'
|
9048
|
-
}) },
|
9650
|
+
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) }),
|
9651
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9049
9652
|
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 })),
|
9050
9653
|
React.createElement("div", { className: css.css({
|
9051
9654
|
color: '#000',
|
@@ -9055,24 +9658,20 @@ Made in Italy`))));
|
|
9055
9658
|
width: '100%',
|
9056
9659
|
overflow: 'hidden'
|
9057
9660
|
}) },
|
9058
|
-
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'),
|
9059
|
-
React.createElement("div", { className: css.css({
|
9060
|
-
background: 'rgba(0,0,0,1)',
|
9061
|
-
fontSize: '10px',
|
9062
|
-
padding: '2px 7px',
|
9063
|
-
textAlign: 'center',
|
9064
|
-
textOverflow: 'ellipsis',
|
9065
|
-
overflow: 'hidden',
|
9066
|
-
borderRadius: '25px',
|
9067
|
-
width: 'fit-content',
|
9068
|
-
maxWidth: '100%',
|
9069
|
-
color: '#fff',
|
9070
|
-
whiteSpace: 'nowrap'
|
9071
|
-
}) }, (_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'))));
|
9661
|
+
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'),
|
9662
|
+
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'))));
|
9072
9663
|
})));
|
9073
9664
|
};
|
9074
9665
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
9075
9666
|
|
9667
|
+
/*
|
9668
|
+
* @Author: binruan@chatlabs.com
|
9669
|
+
* @Date: 2023-07-28 18:29:57
|
9670
|
+
* @LastEditors: binruan@chatlabs.com
|
9671
|
+
* @LastEditTime: 2024-03-29 16:27:22
|
9672
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiro\material.tsx
|
9673
|
+
*
|
9674
|
+
*/
|
9076
9675
|
const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
9077
9676
|
displayName: '推荐多商品-白底圆角按钮',
|
9078
9677
|
icon: '',
|
@@ -9080,15 +9679,39 @@ Made in Italy`))));
|
|
9080
9679
|
type: 'MultiCommodityDiro',
|
9081
9680
|
related: {
|
9082
9681
|
interactionRender: interactionRender$2,
|
9083
|
-
bindableProps: []
|
9682
|
+
bindableProps: [],
|
9683
|
+
settingRender
|
9084
9684
|
},
|
9085
9685
|
defaulSetting: {
|
9086
|
-
props: {
|
9686
|
+
props: {
|
9687
|
+
ctaTempStyles: {
|
9688
|
+
img: {
|
9689
|
+
borderRadius: 3,
|
9690
|
+
width: 60,
|
9691
|
+
height: 60,
|
9692
|
+
marginRight: 8
|
9693
|
+
},
|
9694
|
+
title: {
|
9695
|
+
fontSize: 12,
|
9696
|
+
color: '#000',
|
9697
|
+
textAlign: 'left'
|
9698
|
+
},
|
9699
|
+
ctaTitle: {
|
9700
|
+
fontSize: 10,
|
9701
|
+
color: '#fff',
|
9702
|
+
textAlign: 'center',
|
9703
|
+
width: 80,
|
9704
|
+
height: 20,
|
9705
|
+
backgroundColor: 'rgba(0,0,0,1)'
|
9706
|
+
}
|
9707
|
+
}
|
9708
|
+
},
|
9087
9709
|
style: {
|
9088
|
-
padding:
|
9089
|
-
|
9090
|
-
|
9091
|
-
borderRadius:
|
9710
|
+
padding: 7,
|
9711
|
+
width: 236,
|
9712
|
+
height: 74,
|
9713
|
+
borderRadius: 3,
|
9714
|
+
backgroundColor: '#fff'
|
9092
9715
|
}
|
9093
9716
|
},
|
9094
9717
|
w: 100,
|
@@ -9112,9 +9735,10 @@ Made in Italy`))));
|
|
9112
9735
|
|
9113
9736
|
const MultiCommodity$1 = (_a) => {
|
9114
9737
|
var _b, _c;
|
9115
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9738
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9116
9739
|
const { sxpParameter } = useSxpDataSource();
|
9117
9740
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9741
|
+
const { popupAni } = useEditor();
|
9118
9742
|
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]);
|
9119
9743
|
const handleClick = lodash.throttle((item) => {
|
9120
9744
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9123,19 +9747,11 @@ Made in Italy`))));
|
|
9123
9747
|
}, recData, item);
|
9124
9748
|
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 }) }));
|
9125
9749
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9126
|
-
},
|
9750
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9127
9751
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9128
9752
|
var _a, _b, _c, _d, _e, _f;
|
9129
|
-
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(
|
9130
|
-
React.createElement("div", { className: css.css({
|
9131
|
-
width: '60px',
|
9132
|
-
height: '60px',
|
9133
|
-
marginRight: '8px',
|
9134
|
-
borderRadius: '3px',
|
9135
|
-
overflow: 'hidden',
|
9136
|
-
flexShrink: 0,
|
9137
|
-
backgroundColor: '#f2f2f2'
|
9138
|
-
}) },
|
9753
|
+
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) }),
|
9754
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9139
9755
|
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 })),
|
9140
9756
|
React.createElement("div", { className: css.css({
|
9141
9757
|
color: '#fff',
|
@@ -9145,21 +9761,20 @@ Made in Italy`))));
|
|
9145
9761
|
width: '100%',
|
9146
9762
|
overflow: 'hidden'
|
9147
9763
|
}) },
|
9148
|
-
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'),
|
9149
|
-
React.createElement("div", { className: css.css({
|
9150
|
-
background: 'rgba(0,0,0,.5)',
|
9151
|
-
fontSize: '10px',
|
9152
|
-
padding: '2px 7px',
|
9153
|
-
width: 'auto',
|
9154
|
-
textAlign: 'center',
|
9155
|
-
textOverflow: 'ellipsis',
|
9156
|
-
overflow: 'hidden',
|
9157
|
-
whiteSpace: 'nowrap'
|
9158
|
-
}) }, (_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'))));
|
9764
|
+
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'),
|
9765
|
+
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'))));
|
9159
9766
|
})));
|
9160
9767
|
};
|
9161
9768
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
9162
9769
|
|
9770
|
+
/*
|
9771
|
+
* @Author: binruan@chatlabs.com
|
9772
|
+
* @Date: 2023-07-28 18:29:57
|
9773
|
+
* @LastEditors: binruan@chatlabs.com
|
9774
|
+
* @LastEditTime: 2024-03-29 16:43:35
|
9775
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodity\material.tsx
|
9776
|
+
*
|
9777
|
+
*/
|
9163
9778
|
const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
9164
9779
|
displayName: '推荐多商品-透明底',
|
9165
9780
|
icon: '',
|
@@ -9167,15 +9782,39 @@ Made in Italy`))));
|
|
9167
9782
|
type: 'MultiCommodity',
|
9168
9783
|
related: {
|
9169
9784
|
interactionRender: interactionRender$1,
|
9785
|
+
settingRender,
|
9170
9786
|
bindableProps: []
|
9171
9787
|
},
|
9172
9788
|
defaulSetting: {
|
9173
|
-
props: {
|
9789
|
+
props: {
|
9790
|
+
ctaTempStyles: {
|
9791
|
+
img: {
|
9792
|
+
borderRadius: 3,
|
9793
|
+
width: 60,
|
9794
|
+
height: 60,
|
9795
|
+
marginRight: 8
|
9796
|
+
},
|
9797
|
+
title: {
|
9798
|
+
fontSize: 12,
|
9799
|
+
color: '#fff',
|
9800
|
+
textAlign: 'left'
|
9801
|
+
},
|
9802
|
+
ctaTitle: {
|
9803
|
+
fontSize: 10,
|
9804
|
+
color: '#fff',
|
9805
|
+
textAlign: 'center',
|
9806
|
+
width: 130,
|
9807
|
+
height: 20,
|
9808
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
9809
|
+
}
|
9810
|
+
}
|
9811
|
+
},
|
9174
9812
|
style: {
|
9175
|
-
padding:
|
9176
|
-
|
9177
|
-
|
9178
|
-
borderRadius:
|
9813
|
+
padding: 7,
|
9814
|
+
width: 236,
|
9815
|
+
height: 74,
|
9816
|
+
borderRadius: 3,
|
9817
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
9179
9818
|
}
|
9180
9819
|
},
|
9181
9820
|
w: 100,
|
@@ -9199,8 +9838,9 @@ Made in Italy`))));
|
|
9199
9838
|
|
9200
9839
|
const MultiCommodityDiroNew$1 = (_a) => {
|
9201
9840
|
var _b, _c;
|
9202
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9841
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9203
9842
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9843
|
+
const { popupAni } = useEditor();
|
9204
9844
|
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]);
|
9205
9845
|
const handleClick = lodash.throttle((item) => {
|
9206
9846
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9209,19 +9849,11 @@ Made in Italy`))));
|
|
9209
9849
|
}, recData, item);
|
9210
9850
|
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 }) }));
|
9211
9851
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9212
|
-
},
|
9852
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9213
9853
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9214
9854
|
var _a, _b, _c, _d, _e, _f;
|
9215
|
-
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(
|
9216
|
-
React.createElement("div", { className: css.css({
|
9217
|
-
width: '78px',
|
9218
|
-
height: '78px',
|
9219
|
-
marginRight: '16px',
|
9220
|
-
borderRadius: '8px',
|
9221
|
-
overflow: 'hidden',
|
9222
|
-
flexShrink: 0,
|
9223
|
-
backgroundColor: '#f2f2f2'
|
9224
|
-
}) },
|
9855
|
+
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) }),
|
9856
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9225
9857
|
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 })),
|
9226
9858
|
React.createElement("div", { className: css.css({
|
9227
9859
|
color: '#fff',
|
@@ -9232,22 +9864,20 @@ Made in Italy`))));
|
|
9232
9864
|
overflow: 'hidden',
|
9233
9865
|
lineHeight: '20px'
|
9234
9866
|
}) },
|
9235
|
-
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'),
|
9236
|
-
React.createElement("div", { className: css.css({
|
9237
|
-
fontSize: '13px',
|
9238
|
-
fontWeight: 'bold',
|
9239
|
-
textOverflow: 'ellipsis',
|
9240
|
-
overflow: 'hidden',
|
9241
|
-
width: 'fit-content',
|
9242
|
-
maxWidth: '100%',
|
9243
|
-
whiteSpace: 'nowrap',
|
9244
|
-
textDecoration: 'underline',
|
9245
|
-
color: '#000'
|
9246
|
-
}) }, (_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'))));
|
9867
|
+
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'),
|
9868
|
+
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'))));
|
9247
9869
|
})));
|
9248
9870
|
};
|
9249
9871
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
9250
9872
|
|
9873
|
+
/*
|
9874
|
+
* @Author: binruan@chatlabs.com
|
9875
|
+
* @Date: 2023-07-28 18:29:57
|
9876
|
+
* @LastEditors: binruan@chatlabs.com
|
9877
|
+
* @LastEditTime: 2024-03-29 15:40:54
|
9878
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiroNew\material.tsx
|
9879
|
+
*
|
9880
|
+
*/
|
9251
9881
|
const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
9252
9882
|
displayName: '推荐多商品-白底下划线按钮',
|
9253
9883
|
icon: '',
|
@@ -9255,15 +9885,40 @@ Made in Italy`))));
|
|
9255
9885
|
type: 'MultiCommodityDiroNew',
|
9256
9886
|
related: {
|
9257
9887
|
interactionRender,
|
9258
|
-
bindableProps: []
|
9888
|
+
bindableProps: [],
|
9889
|
+
settingRender
|
9259
9890
|
},
|
9260
9891
|
defaulSetting: {
|
9261
|
-
props: {
|
9892
|
+
props: {
|
9893
|
+
ctaTempStyles: {
|
9894
|
+
img: {
|
9895
|
+
borderRadius: 8,
|
9896
|
+
width: 78,
|
9897
|
+
height: 78,
|
9898
|
+
marginRight: 16
|
9899
|
+
},
|
9900
|
+
title: {
|
9901
|
+
fontSize: 12,
|
9902
|
+
color: '#000',
|
9903
|
+
textAlign: 'left'
|
9904
|
+
},
|
9905
|
+
ctaTitle: {
|
9906
|
+
textDecoration: 'underline',
|
9907
|
+
fontSize: 12,
|
9908
|
+
fontWeight: 'bold',
|
9909
|
+
color: '#000',
|
9910
|
+
textAlign: 'left',
|
9911
|
+
width: 150,
|
9912
|
+
height: 20
|
9913
|
+
}
|
9914
|
+
}
|
9915
|
+
},
|
9262
9916
|
style: {
|
9263
|
-
|
9264
|
-
|
9265
|
-
|
9266
|
-
|
9917
|
+
borderRadius: 4,
|
9918
|
+
width: 260,
|
9919
|
+
height: 86,
|
9920
|
+
padding: 4,
|
9921
|
+
backgroundColor: 'rgba(255,255,255,0.75)'
|
9267
9922
|
}
|
9268
9923
|
},
|
9269
9924
|
w: 100,
|
@@ -9286,7 +9941,6 @@ Made in Italy`))));
|
|
9286
9941
|
AppointForm: AppointForm,
|
9287
9942
|
Commodity: Commodity,
|
9288
9943
|
CommodityDetail: CommodityDetail,
|
9289
|
-
CommodityDetailDiro: CommodityDetailDiro,
|
9290
9944
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
9291
9945
|
CommodityDiro: CommodityDiro,
|
9292
9946
|
CommodityDiroNew: CommodityDiroNew,
|
@@ -9373,8 +10027,10 @@ Made in Italy`))));
|
|
9373
10027
|
videoRef.current.muted = muted;
|
9374
10028
|
}, [muted]);
|
9375
10029
|
const handleVideoStart = React.useCallback(() => {
|
9376
|
-
var _a;
|
9377
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
10030
|
+
var _a, _b;
|
10031
|
+
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)
|
10032
|
+
return;
|
10033
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
9378
10034
|
}, []);
|
9379
10035
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
9380
10036
|
const handlePlaying = React.useCallback(() => {
|
@@ -9431,37 +10087,38 @@ Made in Italy`))));
|
|
9431
10087
|
});
|
9432
10088
|
}
|
9433
10089
|
setTimeout(() => {
|
9434
|
-
var _a;
|
9435
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
10090
|
+
var _a, _b;
|
10091
|
+
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)
|
10092
|
+
return;
|
10093
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
9436
10094
|
}, 0);
|
9437
10095
|
}, [index, bffEventReport, data, isLoad]);
|
9438
10096
|
const handleClickVideo = React.useCallback((type) => () => {
|
9439
|
-
var _a, _b, _c, _d, _e, _f
|
10097
|
+
var _a, _b, _c, _d, _e, _f;
|
10098
|
+
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)
|
10099
|
+
return;
|
9440
10100
|
if (!isLoad)
|
9441
10101
|
return;
|
9442
|
-
|
9443
|
-
((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
9444
|
-
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
9445
|
-
const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
|
10102
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
9446
10103
|
switch (type) {
|
9447
10104
|
case 'start':
|
9448
10105
|
if (!isPause)
|
9449
10106
|
return;
|
9450
|
-
(
|
10107
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
9451
10108
|
setIsPauseVideo(false);
|
9452
10109
|
break;
|
9453
10110
|
case 'pause':
|
9454
10111
|
if (isPause)
|
9455
10112
|
return;
|
9456
|
-
(
|
10113
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
9457
10114
|
setIsPauseVideo(true);
|
9458
10115
|
break;
|
9459
10116
|
default:
|
9460
10117
|
if (isPause) {
|
9461
|
-
(
|
10118
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
9462
10119
|
}
|
9463
10120
|
else {
|
9464
|
-
(
|
10121
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
9465
10122
|
}
|
9466
10123
|
setIsPauseVideo(!isPause);
|
9467
10124
|
break;
|
@@ -9492,14 +10149,16 @@ Made in Italy`))));
|
|
9492
10149
|
}
|
9493
10150
|
}, [data, index, bffEventReport]);
|
9494
10151
|
React.useEffect(() => {
|
9495
|
-
var _a, _b, _c;
|
10152
|
+
var _a, _b, _c, _d, _e, _f;
|
9496
10153
|
if (data.length <= 0)
|
9497
10154
|
return;
|
9498
10155
|
if (!videoRef.current)
|
9499
10156
|
return;
|
10157
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
9500
10158
|
setIsPauseVideo(false);
|
9501
10159
|
if (!isActive) {
|
9502
|
-
(
|
10160
|
+
if (!isPause && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.readyState) >= 2)
|
10161
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
9503
10162
|
return;
|
9504
10163
|
}
|
9505
10164
|
if (!videoRef.current.src) {
|
@@ -9522,10 +10181,12 @@ Made in Italy`))));
|
|
9522
10181
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
9523
10182
|
}
|
9524
10183
|
else {
|
10184
|
+
if (((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.readyState) < 2)
|
10185
|
+
return;
|
9525
10186
|
videoRef.current.play();
|
9526
10187
|
}
|
9527
|
-
(
|
9528
|
-
(
|
10188
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('canplay', handleLoadedMetadata);
|
10189
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
9529
10190
|
return () => {
|
9530
10191
|
var _a, _b;
|
9531
10192
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
|
@@ -9536,15 +10197,17 @@ Made in Italy`))));
|
|
9536
10197
|
打开/关闭hashtag暂停/播放视频
|
9537
10198
|
*/
|
9538
10199
|
React.useEffect(() => {
|
9539
|
-
var _a, _b, _c;
|
9540
|
-
|
10200
|
+
var _a, _b, _c, _d;
|
10201
|
+
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)
|
10202
|
+
return;
|
10203
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
9541
10204
|
if (!isActive)
|
9542
10205
|
return;
|
9543
10206
|
if (!isPause && openHashtag) {
|
9544
|
-
(
|
10207
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
9545
10208
|
}
|
9546
10209
|
else if (!openHashtag) {
|
9547
|
-
(
|
10210
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
9548
10211
|
}
|
9549
10212
|
}, [openHashtag, isActive]);
|
9550
10213
|
React.useEffect(() => {
|
@@ -9657,22 +10320,26 @@ Made in Italy`))));
|
|
9657
10320
|
* @Author: lewinlu@chatlabs.com
|
9658
10321
|
* @Date: 2024-01-03 14:39:09
|
9659
10322
|
* @LastEditors: binruan@chatlabs.com
|
9660
|
-
* @LastEditTime: 2024-03-
|
10323
|
+
* @LastEditTime: 2024-03-25 15:08:11
|
9661
10324
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
9662
10325
|
*/
|
9663
10326
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
9664
10327
|
const { isActive } = useSwiperSlide();
|
9665
10328
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
10329
|
+
const [isLoad, setIsLoad] = React.useState(false);
|
9666
10330
|
React.useEffect(() => {
|
9667
|
-
if (
|
9668
|
-
|
9669
|
-
|
9670
|
-
|
10331
|
+
if (isLoad && isActive) {
|
10332
|
+
if (openHashtag) {
|
10333
|
+
onReportViewImageEnd(rec);
|
10334
|
+
}
|
10335
|
+
else {
|
10336
|
+
onViewImageStartEvent(index);
|
10337
|
+
}
|
9671
10338
|
}
|
9672
10339
|
else {
|
9673
|
-
|
10340
|
+
setIsLoad(true);
|
9674
10341
|
}
|
9675
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent]);
|
10342
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
9676
10343
|
if (!isActive) {
|
9677
10344
|
return React.createElement("img", { src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: { width, height, objectFit: 'cover' } });
|
9678
10345
|
}
|
@@ -9683,75 +10350,17 @@ Made in Italy`))));
|
|
9683
10350
|
};
|
9684
10351
|
var PictureGroup$1 = React.memo(PictureGroup);
|
9685
10352
|
|
9686
|
-
/*
|
9687
|
-
* @Author: binruan@chatlabs.com
|
9688
|
-
* @Date: 2023-11-02 18:34:34
|
9689
|
-
* @LastEditors: binruan@chatlabs.com
|
9690
|
-
* @LastEditTime: 2024-03-12 12:08:55
|
9691
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ProductInfo\index.tsx
|
9692
|
-
*
|
9693
|
-
*/
|
9694
|
-
const ProductInfo = ({ data, height, width, viewTime, tipText }) => {
|
9695
|
-
var _a, _b;
|
9696
|
-
const product = data === null || data === void 0 ? void 0 : data.product;
|
9697
|
-
const cta = (_a = data === null || data === void 0 ? void 0 : data.product) === null || _a === void 0 ? void 0 : _a.bindCta;
|
9698
|
-
const [showModal, setShowModal] = React.useState(false);
|
9699
|
-
const { jumpToWeb } = useEventReport();
|
9700
|
-
const priceText = React.useMemo(() => {
|
9701
|
-
var _a, _b, _c, _d, _e;
|
9702
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
9703
|
-
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', {
|
9704
|
-
minimumFractionDigits: 0
|
9705
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
9706
|
-
}
|
9707
|
-
else {
|
9708
|
-
return '$7,000';
|
9709
|
-
}
|
9710
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9711
|
-
const handleLInk = (link) => {
|
9712
|
-
if (link) {
|
9713
|
-
jumpToWeb(data, product, cta);
|
9714
|
-
window.location.href = window.getJointUtmLink(link);
|
9715
|
-
}
|
9716
|
-
};
|
9717
|
-
return (React.createElement("div", { style: { height, width: '100%' } },
|
9718
|
-
React.createElement(Swiper, { height: height * 0.5, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
9719
|
-
delay: 3000
|
9720
|
-
} }, (_b = product === null || product === void 0 ? void 0 : product.homePage) === null || _b === void 0 ? void 0 : _b.map((src) => {
|
9721
|
-
return (React.createElement(SwiperSlide, { key: src },
|
9722
|
-
React.createElement("div", { style: {
|
9723
|
-
overflow: 'hidden',
|
9724
|
-
width,
|
9725
|
-
height: height * 0.5
|
9726
|
-
} },
|
9727
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
9728
|
-
})),
|
9729
|
-
React.createElement("div", { className: 'product-info' },
|
9730
|
-
React.createElement("div", { className: 'collection' }, product === null || product === void 0 ? void 0 : product.collection),
|
9731
|
-
React.createElement("div", { className: 'title' }, product === null || product === void 0 ? void 0 : product.title),
|
9732
|
-
React.createElement("div", { className: 'price' }, priceText),
|
9733
|
-
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 }),
|
9734
|
-
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)),
|
9735
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
9736
|
-
React.createElement("div", { className: 'modal-collection' }, product === null || product === void 0 ? void 0 : product.collection),
|
9737
|
-
React.createElement("div", { className: 'modal-title' }, product === null || product === void 0 ? void 0 : product.title),
|
9738
|
-
React.createElement("div", { className: 'modal-price' }, priceText),
|
9739
|
-
React.createElement("div", { className: 'modal-info' }, product === null || product === void 0 ? void 0 : product.info),
|
9740
|
-
(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)))));
|
9741
|
-
};
|
9742
|
-
var ProductInfo$1 = React.memo(ProductInfo);
|
9743
|
-
|
9744
10353
|
/*
|
9745
10354
|
* @Author: binruan@chatlabs.com
|
9746
10355
|
* @Date: 2024-01-15 19:03:09
|
9747
10356
|
* @LastEditors: binruan@chatlabs.com
|
9748
|
-
* @LastEditTime: 2024-03-
|
10357
|
+
* @LastEditTime: 2024-03-25 10:42:07
|
9749
10358
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
9750
10359
|
*
|
9751
10360
|
*/
|
9752
10361
|
const Hashtag = ({ tags, itemId, itemType, index, rec }) => {
|
9753
10362
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
9754
|
-
const { setWaterFallData, setOpenHashtag,
|
10363
|
+
const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
|
9755
10364
|
const handleClickTag = (data) => {
|
9756
10365
|
if (!waterFallData) {
|
9757
10366
|
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(index);
|
@@ -10212,17 +10821,29 @@ Made in Italy`))));
|
|
10212
10821
|
};
|
10213
10822
|
var WaterFall$1 = React.memo(WaterFall);
|
10214
10823
|
|
10824
|
+
const Nudge = ({ nudge }) => {
|
10825
|
+
return (React.createElement("div", { hidden: !(nudge === null || nudge === void 0 ? void 0 : nudge.isOpen), className: 'clc-sxp-bottom-nudge', style: {
|
10826
|
+
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
10827
|
+
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
10828
|
+
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
10829
|
+
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
10830
|
+
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
10831
|
+
} },
|
10832
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
10833
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)));
|
10834
|
+
};
|
10835
|
+
|
10215
10836
|
/*
|
10216
10837
|
* @Author: binruan@chatlabs.com
|
10217
10838
|
* @Date: 2024-01-15 19:03:09
|
10218
10839
|
* @LastEditors: binruan@chatlabs.com
|
10219
|
-
* @LastEditTime: 2024-
|
10840
|
+
* @LastEditTime: 2024-04-02 10:42:58
|
10220
10841
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
10221
10842
|
*
|
10222
10843
|
*/
|
10223
|
-
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, _schema }) => {
|
10844
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema }) => {
|
10224
10845
|
var _a, _b, _c, _d;
|
10225
|
-
useEditor();
|
10846
|
+
const { schema } = useEditor();
|
10226
10847
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
10227
10848
|
const viewImageStartTime = React.useRef(0);
|
10228
10849
|
const [isInit, setIsInit] = React.useState(false);
|
@@ -10374,49 +10995,37 @@ Made in Italy`))));
|
|
10374
10995
|
return null;
|
10375
10996
|
}, [globalConfig]);
|
10376
10997
|
const renderContent = React.useCallback((rec, index) => {
|
10377
|
-
var _a, _b;
|
10998
|
+
var _a, _b, _c, _d;
|
10378
10999
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
10379
11000
|
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex }));
|
10380
11001
|
}
|
10381
11002
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
10382
11003
|
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 }));
|
10383
11004
|
}
|
10384
|
-
if (rec.product) {
|
10385
|
-
|
10386
|
-
|
10387
|
-
|
10388
|
-
|
10389
|
-
|
10390
|
-
// <CommodityDetailDiro
|
10391
|
-
// key={rec.product.itemId}
|
10392
|
-
// viewTime={viewTime.current}
|
10393
|
-
// rec={rec}
|
10394
|
-
// isPost={true}
|
10395
|
-
// style={{ height: '100%', overflow: 'auto' }}
|
10396
|
-
// />
|
10397
|
-
// );
|
10398
|
-
case 'CommodityDetail':
|
10399
|
-
return (React.createElement(ProductInfo$1, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
10400
|
-
default:
|
10401
|
-
return (React.createElement(ProductInfo$1, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
10402
|
-
}
|
11005
|
+
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) {
|
11006
|
+
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
|
11007
|
+
var _a, _b, _c, _d, _e, _f;
|
11008
|
+
const Component = withBindDataSource(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
|
11009
|
+
return (React.createElement(Component, Object.assign({ key: index, textStyle: (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.textStyle, bindDatas: (_d = (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.bindDatas) !== null && _d !== void 0 ? _d : [] }, (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.props, { event: ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: { height: '100%', overflow: 'auto' } })));
|
11010
|
+
});
|
10403
11011
|
}
|
10404
11012
|
return null;
|
10405
|
-
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText]);
|
11013
|
+
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText, resolver, schema]);
|
10406
11014
|
const renderBottom = React.useCallback((rec, index) => {
|
10407
11015
|
var _a, _b, _c, _d, _e, _f, _g;
|
10408
11016
|
if (rec.video) {
|
10409
11017
|
return (React.createElement(React.Fragment, null,
|
10410
11018
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
10411
11019
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
11020
|
+
React.createElement(Nudge, { nudge: nudge }),
|
10412
11021
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
10413
11022
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
10414
11023
|
React.createElement("div", { className: 'clc-sxp-bottom-text' },
|
10415
|
-
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 })),
|
11024
|
+
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 })),
|
10416
11025
|
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 }))));
|
10417
11026
|
}
|
10418
11027
|
return null;
|
10419
|
-
}, [descStyle, activeIndex, tempMap, resolver, tipText]);
|
11028
|
+
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge]);
|
10420
11029
|
const renderLikeButton = React.useCallback((rec) => {
|
10421
11030
|
var _a, _b;
|
10422
11031
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
@@ -10495,6 +11104,11 @@ Made in Italy`))));
|
|
10495
11104
|
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
|
10496
11105
|
}
|
10497
11106
|
};
|
11107
|
+
React.useEffect(() => {
|
11108
|
+
const item = data[activeIndex];
|
11109
|
+
if (openHashtag)
|
11110
|
+
handleReportProductView(item);
|
11111
|
+
}, [openHashtag, data, activeIndex]);
|
10498
11112
|
const handleViewImageStartEvent = (activeIndex) => {
|
10499
11113
|
var _a, _b, _c, _d, _e, _f;
|
10500
11114
|
const item = data[activeIndex];
|
@@ -10601,12 +11215,12 @@ Made in Italy`))));
|
|
10601
11215
|
* @Author: binruan@chatlabs.com
|
10602
11216
|
* @Date: 2023-10-31 10:56:01
|
10603
11217
|
* @LastEditors: binruan@chatlabs.com
|
10604
|
-
* @LastEditTime: 2024-
|
11218
|
+
* @LastEditTime: 2024-04-02 10:31:51
|
10605
11219
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
10606
11220
|
*
|
10607
11221
|
*/
|
10608
11222
|
const Popup = () => {
|
10609
|
-
const { schema, resolver, popup } = useEditor();
|
11223
|
+
const { schema, resolver, popup, popupAni } = useEditor();
|
10610
11224
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
10611
11225
|
const { productView } = useEventReport();
|
10612
11226
|
const [visible, setVisible] = React.useState(false);
|
@@ -10629,7 +11243,7 @@ Made in Italy`))));
|
|
10629
11243
|
}, [popup]);
|
10630
11244
|
const handleClose = () => {
|
10631
11245
|
var _a, _b, _c;
|
10632
|
-
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current <
|
11246
|
+
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < (popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration)) {
|
10633
11247
|
return;
|
10634
11248
|
}
|
10635
11249
|
setVisible(false);
|
@@ -10642,7 +11256,7 @@ Made in Italy`))));
|
|
10642
11256
|
setTimeout(() => {
|
10643
11257
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
10644
11258
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
10645
|
-
},
|
11259
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
10646
11260
|
};
|
10647
11261
|
const renderPopupDetail = React.useMemo(() => {
|
10648
11262
|
var _a, _b, _c;
|
@@ -10664,7 +11278,7 @@ Made in Italy`))));
|
|
10664
11278
|
* @Author: binruan@chatlabs.com
|
10665
11279
|
* @Date: 2024-01-15 19:03:09
|
10666
11280
|
* @LastEditors: binruan@chatlabs.com
|
10667
|
-
* @LastEditTime: 2024-03-
|
11281
|
+
* @LastEditTime: 2024-03-25 17:24:59
|
10668
11282
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
10669
11283
|
*
|
10670
11284
|
*/
|
@@ -10680,7 +11294,7 @@ Made in Italy`))));
|
|
10680
11294
|
Object.values(_materials_).forEach((v) => {
|
10681
11295
|
RESOLVER[v.extend.type] = v;
|
10682
11296
|
});
|
10683
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage }) => {
|
11297
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
|
10684
11298
|
var _a, _b, _c, _d, _e, _f;
|
10685
11299
|
const utmVal = React.useMemo(() => {
|
10686
11300
|
var _a;
|
@@ -10688,7 +11302,7 @@ Made in Italy`))));
|
|
10688
11302
|
return searchParams;
|
10689
11303
|
}, []);
|
10690
11304
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
10691
|
-
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 }) => {
|
11305
|
+
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 }) => {
|
10692
11306
|
var _a;
|
10693
11307
|
return (React.createElement(React.Fragment, null,
|
10694
11308
|
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 })),
|