pb-sxp-ui 1.0.1 → 1.0.2-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 +938 -389
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +24 -18
- package/dist/index.js +938 -389
- 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 +938 -389
- 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 +16 -9
- 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/CommodityDetailDiroNew/index.d.ts +13 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +35 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +175 -0
- 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 +16 -9
- 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/CommodityDetailDiroNew/index.d.ts +13 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +35 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +177 -0
- 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 +2 -2
package/dist/index.js
CHANGED
@@ -378,11 +378,24 @@ const storeAndLoadFeUserId = () => {
|
|
378
378
|
return fakeUserId;
|
379
379
|
};
|
380
380
|
|
381
|
-
|
381
|
+
/*
|
382
|
+
* @Author: binruan@chatlabs.com
|
383
|
+
* @Date: 2024-03-20 10:27:31
|
384
|
+
* @LastEditors: binruan@chatlabs.com
|
385
|
+
* @LastEditTime: 2024-03-25 18:23:54
|
386
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\useIconLink.ts
|
387
|
+
*
|
388
|
+
*/
|
389
|
+
function useIconLink(path, domain) {
|
382
390
|
const { appDomain } = useSxpDataSource();
|
383
391
|
return useMemo(() => {
|
384
|
-
|
385
|
-
|
392
|
+
if (domain) {
|
393
|
+
return `https://${domain}${path}`;
|
394
|
+
}
|
395
|
+
else {
|
396
|
+
return appDomain ? `https://${appDomain}${path}` : `${window.location.origin}${path}`;
|
397
|
+
}
|
398
|
+
}, [appDomain, path, domain]);
|
386
399
|
}
|
387
400
|
|
388
401
|
const SxpDataSourceContext = createContext({
|
@@ -560,7 +573,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
560
573
|
setLoading(false);
|
561
574
|
});
|
562
575
|
}, [getRecommendVideos]);
|
563
|
-
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif');
|
576
|
+
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
564
577
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
565
578
|
rtcList,
|
566
579
|
setRtcList,
|
@@ -704,7 +717,11 @@ const EditorContext = React.createContext({
|
|
704
717
|
undoStack: [item],
|
705
718
|
redoStack: [],
|
706
719
|
popup: '',
|
707
|
-
setPopup: () => { }
|
720
|
+
setPopup: () => { },
|
721
|
+
popupAni: {
|
722
|
+
name: 'none',
|
723
|
+
duration: 0
|
724
|
+
}
|
708
725
|
});
|
709
726
|
const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
710
727
|
const [currentNode, setCurrentNode] = useState(null);
|
@@ -728,9 +745,22 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
728
745
|
const [undoStack, setUndoStack] = useState([[item]]);
|
729
746
|
const [redoStack, setRedoStack] = useState([]);
|
730
747
|
const [popup, setPopup] = useState('');
|
748
|
+
const [popupAni, setPopupAni] = useState({
|
749
|
+
name: 'none',
|
750
|
+
duration: 0
|
751
|
+
});
|
731
752
|
typeof window !== 'undefined' &&
|
732
|
-
(window.sxpPopup = (type) => {
|
753
|
+
(window.sxpPopup = (type, aniType) => {
|
733
754
|
setPopup(type);
|
755
|
+
if (aniType && (aniType === null || aniType === void 0 ? void 0 : aniType.name) !== 'none') {
|
756
|
+
setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
|
757
|
+
}
|
758
|
+
else {
|
759
|
+
setPopupAni({
|
760
|
+
name: 'none',
|
761
|
+
duration: 0
|
762
|
+
});
|
763
|
+
}
|
734
764
|
});
|
735
765
|
typeof window !== 'undefined' &&
|
736
766
|
(window.getJointUtmLink = (url) => {
|
@@ -806,7 +836,8 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
806
836
|
setUndoStack,
|
807
837
|
getCurPageConf,
|
808
838
|
popup,
|
809
|
-
setPopup
|
839
|
+
setPopup,
|
840
|
+
popupAni
|
810
841
|
} },
|
811
842
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
812
843
|
});
|
@@ -836,7 +867,7 @@ var interactionRender$8 = [
|
|
836
867
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\AppointForm\settingRender.tsx
|
837
868
|
*
|
838
869
|
*/
|
839
|
-
var settingRender$
|
870
|
+
var settingRender$3 = [
|
840
871
|
{
|
841
872
|
type: 'Text',
|
842
873
|
label: '组件名称',
|
@@ -1025,7 +1056,7 @@ const AppointForm = createMaterial(AppointFormComponent, {
|
|
1025
1056
|
category: 'popup',
|
1026
1057
|
type: 'AppointForm',
|
1027
1058
|
related: {
|
1028
|
-
settingRender: settingRender$
|
1059
|
+
settingRender: settingRender$3,
|
1029
1060
|
bindableProps: [],
|
1030
1061
|
interactionRender: interactionRender$8
|
1031
1062
|
},
|
@@ -8054,7 +8085,7 @@ var interactionRender$7 = [
|
|
8054
8085
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\Prompt\settingRender.tsx
|
8055
8086
|
*
|
8056
8087
|
*/
|
8057
|
-
var settingRender = [
|
8088
|
+
var settingRender$2 = [
|
8058
8089
|
{
|
8059
8090
|
type: 'Media',
|
8060
8091
|
label: '图标',
|
@@ -8129,7 +8160,7 @@ const Prompt = createMaterial(PromptComponent, {
|
|
8129
8160
|
category: 'popup',
|
8130
8161
|
type: 'Prompt',
|
8131
8162
|
related: {
|
8132
|
-
settingRender,
|
8163
|
+
settingRender: settingRender$2,
|
8133
8164
|
bindableProps: [],
|
8134
8165
|
interactionRender: interactionRender$7
|
8135
8166
|
},
|
@@ -8324,16 +8355,202 @@ const CommodityDetailDiro = createMaterial(CommodityDetailDiroComponent, {
|
|
8324
8355
|
sort: 1
|
8325
8356
|
});
|
8326
8357
|
|
8358
|
+
/*
|
8359
|
+
* @Author: binruan@chatlabs.com
|
8360
|
+
* @Date: 2024-03-26 16:50:25
|
8361
|
+
* @LastEditors: binruan@chatlabs.com
|
8362
|
+
* @LastEditTime: 2024-03-28 18:42:26
|
8363
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\settingRender.tsx
|
8364
|
+
*
|
8365
|
+
*/
|
8366
|
+
var settingRender$1 = [
|
8367
|
+
{
|
8368
|
+
title: '商品图片',
|
8369
|
+
child: [
|
8370
|
+
{
|
8371
|
+
type: 'Radius',
|
8372
|
+
label: '轮播指示器',
|
8373
|
+
options: [
|
8374
|
+
{
|
8375
|
+
label: '居左',
|
8376
|
+
value: 'left'
|
8377
|
+
},
|
8378
|
+
{
|
8379
|
+
label: '居中',
|
8380
|
+
value: 'center'
|
8381
|
+
}
|
8382
|
+
],
|
8383
|
+
name: ['props', 'swiper', 'dotsAlign']
|
8384
|
+
},
|
8385
|
+
{
|
8386
|
+
type: 'Number',
|
8387
|
+
name: ['props', 'swiper', 'delay'],
|
8388
|
+
addonAfter: 's'
|
8389
|
+
}
|
8390
|
+
]
|
8391
|
+
},
|
8392
|
+
{
|
8393
|
+
title: '商品文本',
|
8394
|
+
child: [
|
8395
|
+
{
|
8396
|
+
name: ['props', 'commodityStyles'],
|
8397
|
+
type: 'SelectLinkage',
|
8398
|
+
child: [
|
8399
|
+
{
|
8400
|
+
label: '字段',
|
8401
|
+
type: 'Select',
|
8402
|
+
options: [
|
8403
|
+
{
|
8404
|
+
label: '商品名称',
|
8405
|
+
value: 'title'
|
8406
|
+
},
|
8407
|
+
{
|
8408
|
+
label: '系列名称',
|
8409
|
+
value: 'collection'
|
8410
|
+
},
|
8411
|
+
{
|
8412
|
+
label: '价格',
|
8413
|
+
value: 'price'
|
8414
|
+
},
|
8415
|
+
{
|
8416
|
+
label: '税费说明',
|
8417
|
+
value: 'taxInfo'
|
8418
|
+
},
|
8419
|
+
{
|
8420
|
+
label: '商品描述',
|
8421
|
+
value: 'info'
|
8422
|
+
}
|
8423
|
+
],
|
8424
|
+
name: ['props', 'commodityStyles', 'field'],
|
8425
|
+
initialValue: 'title'
|
8426
|
+
},
|
8427
|
+
{
|
8428
|
+
type: 'Group',
|
8429
|
+
label: '标题字体',
|
8430
|
+
child: [
|
8431
|
+
{
|
8432
|
+
type: 'Color',
|
8433
|
+
name: ['color']
|
8434
|
+
},
|
8435
|
+
{
|
8436
|
+
type: 'Select',
|
8437
|
+
options: [{ label: '黑体', value: '黑体' }],
|
8438
|
+
name: ['fontFamily']
|
8439
|
+
},
|
8440
|
+
{
|
8441
|
+
type: 'Number',
|
8442
|
+
addonAfter: 'px',
|
8443
|
+
name: ['fontSize']
|
8444
|
+
}
|
8445
|
+
]
|
8446
|
+
},
|
8447
|
+
{
|
8448
|
+
label: '标题样式',
|
8449
|
+
type: 'TextStyle'
|
8450
|
+
},
|
8451
|
+
{
|
8452
|
+
label: '标题对齐',
|
8453
|
+
type: 'TextAlign'
|
8454
|
+
},
|
8455
|
+
{
|
8456
|
+
label: '默认行数',
|
8457
|
+
type: 'Number',
|
8458
|
+
name: ['lineClamp']
|
8459
|
+
}
|
8460
|
+
]
|
8461
|
+
}
|
8462
|
+
]
|
8463
|
+
},
|
8464
|
+
{
|
8465
|
+
title: '购买按钮样式',
|
8466
|
+
child: [
|
8467
|
+
{
|
8468
|
+
type: 'Color',
|
8469
|
+
label: '背景色',
|
8470
|
+
name: ['props', 'buttonStyle', 'backgroundColor'],
|
8471
|
+
initialValue: '#000'
|
8472
|
+
},
|
8473
|
+
{
|
8474
|
+
type: 'Group',
|
8475
|
+
label: '尺寸',
|
8476
|
+
child: [
|
8477
|
+
{
|
8478
|
+
type: 'Number',
|
8479
|
+
name: ['props', 'buttonStyle', 'height'],
|
8480
|
+
addonAfter: 'H'
|
8481
|
+
}
|
8482
|
+
]
|
8483
|
+
},
|
8484
|
+
{
|
8485
|
+
type: 'Group',
|
8486
|
+
label: '圆角',
|
8487
|
+
child: [
|
8488
|
+
{
|
8489
|
+
type: 'Slider',
|
8490
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
8491
|
+
max: 100
|
8492
|
+
},
|
8493
|
+
{
|
8494
|
+
type: 'Number',
|
8495
|
+
name: ['props', 'buttonStyle', 'borderRadius'],
|
8496
|
+
addonAfter: 'px',
|
8497
|
+
max: 100
|
8498
|
+
}
|
8499
|
+
]
|
8500
|
+
},
|
8501
|
+
{
|
8502
|
+
type: 'Group',
|
8503
|
+
label: '字体',
|
8504
|
+
child: [
|
8505
|
+
{
|
8506
|
+
type: 'Color',
|
8507
|
+
name: ['props', 'buttonStyle', 'color'],
|
8508
|
+
initialValue: '#fff'
|
8509
|
+
},
|
8510
|
+
{
|
8511
|
+
type: 'Select',
|
8512
|
+
name: ['props', 'buttonStyle', 'fontFamily'],
|
8513
|
+
options: [{ label: '黑体', value: '黑体' }]
|
8514
|
+
},
|
8515
|
+
{
|
8516
|
+
type: 'Number',
|
8517
|
+
name: ['props', 'buttonStyle', 'fontSize'],
|
8518
|
+
addonAfter: 'px'
|
8519
|
+
}
|
8520
|
+
]
|
8521
|
+
},
|
8522
|
+
{
|
8523
|
+
type: 'TextStyle',
|
8524
|
+
name: ['props', 'buttonStyle']
|
8525
|
+
},
|
8526
|
+
{
|
8527
|
+
type: 'TextAlign',
|
8528
|
+
name: ['props', 'buttonStyle']
|
8529
|
+
},
|
8530
|
+
{
|
8531
|
+
type: 'TextSpace',
|
8532
|
+
name: ['props', 'buttonStyle']
|
8533
|
+
},
|
8534
|
+
{
|
8535
|
+
type: 'TextMargin',
|
8536
|
+
name: ['props', 'buttonStyle']
|
8537
|
+
}
|
8538
|
+
]
|
8539
|
+
}
|
8540
|
+
];
|
8541
|
+
|
8327
8542
|
/*
|
8328
8543
|
* @Author: binruan@chatlabs.com
|
8329
8544
|
* @Date: 2023-11-02 18:34:34
|
8330
8545
|
* @LastEditors: binruan@chatlabs.com
|
8331
|
-
* @LastEditTime: 2024-
|
8546
|
+
* @LastEditTime: 2024-04-02 10:33:15
|
8332
8547
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8333
8548
|
*
|
8334
8549
|
*/
|
8335
8550
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8336
|
-
const Modal = ({ visible, onClose, children, modalStyle, padding }) => {
|
8551
|
+
const Modal = ({ visible, onClose, children, modalStyle, padding, popupAniData }) => {
|
8552
|
+
const { popupAni } = useEditor();
|
8553
|
+
const cssAni = popupAniData !== null && popupAniData !== void 0 ? popupAniData : popupAni;
|
8337
8554
|
const [isShow, setIsShow] = useState(false);
|
8338
8555
|
const modalEleRef = useRef(null);
|
8339
8556
|
useEffect(() => {
|
@@ -8355,16 +8572,16 @@ const Modal = ({ visible, onClose, children, modalStyle, padding }) => {
|
|
8355
8572
|
else {
|
8356
8573
|
setTimeout(() => {
|
8357
8574
|
setIsShow(false);
|
8358
|
-
},
|
8575
|
+
}, cssAni === null || cssAni === void 0 ? void 0 : cssAni.duration);
|
8359
8576
|
}
|
8360
|
-
}, [visible]);
|
8577
|
+
}, [visible, cssAni]);
|
8361
8578
|
if (!modalEleRef.current)
|
8362
8579
|
return null;
|
8363
8580
|
const handleClose = debounce(() => {
|
8364
8581
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
8365
8582
|
}, 300);
|
8366
8583
|
return ReactDOM.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 },
|
8367
|
-
React.createElement("div", { className: `modal-container ${visible ? 'modal-popIn' : 'modal-popOut'}`, style: { padding }, onClick: (e) => {
|
8584
|
+
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) => {
|
8368
8585
|
e.stopPropagation();
|
8369
8586
|
e.preventDefault();
|
8370
8587
|
} },
|
@@ -8378,7 +8595,7 @@ var Modal$1 = memo(Modal);
|
|
8378
8595
|
* @Author: binruan@chatlabs.com
|
8379
8596
|
* @Date: 2023-12-26 16:11:34
|
8380
8597
|
* @LastEditors: binruan@chatlabs.com
|
8381
|
-
* @LastEditTime: 2024-
|
8598
|
+
* @LastEditTime: 2024-04-02 10:57:30
|
8382
8599
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ExpandableText.tsx
|
8383
8600
|
*
|
8384
8601
|
*/
|
@@ -8400,7 +8617,7 @@ const limitTextLastWholeWord = (originalText = '', limit) => {
|
|
8400
8617
|
const _words = newWords.length > 1 && newWords.length < words.length ? newWords.slice(0, newWords.length - 1) : newWords;
|
8401
8618
|
return _words.join(' ') + ' ';
|
8402
8619
|
};
|
8403
|
-
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText }) => {
|
8620
|
+
const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldText, unfoldText, isPost }) => {
|
8404
8621
|
const [isShowMore, setIsShowMore] = useState(true);
|
8405
8622
|
const [isShow, setIsShow] = useState(false);
|
8406
8623
|
const lineClamp = Number((style === null || style === void 0 ? void 0 : style.lineClamp) || 2);
|
@@ -8412,19 +8629,26 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
8412
8629
|
return !isShowMore && text.length > maxStr ? limitTextLastWholeWord(text, maxStr) + '...' : text;
|
8413
8630
|
}, [text, maxStr, isShowMore]);
|
8414
8631
|
useEffect(() => {
|
8415
|
-
if (multiRow.current) {
|
8632
|
+
if (multiRow.current && isPost) {
|
8416
8633
|
setIsShowMore(true);
|
8417
8634
|
setTimeout(() => {
|
8635
|
+
var _a;
|
8418
8636
|
setIsShow(false);
|
8419
|
-
|
8420
|
-
|
8421
|
-
|
8422
|
-
|
8423
|
-
|
8637
|
+
try {
|
8638
|
+
const cs = (_a = window === null || window === void 0 ? void 0 : window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, multiRow.current);
|
8639
|
+
const height = parseFloat(cs === null || cs === void 0 ? void 0 : cs.height);
|
8640
|
+
const lh = parseFloat(cs === null || cs === void 0 ? void 0 : cs.lineHeight);
|
8641
|
+
const fs = parseFloat(cs === null || cs === void 0 ? void 0 : cs.fontSize) + 4;
|
8642
|
+
const lineHeight = isNaN(lh) ? fs : lh;
|
8643
|
+
if (text && height > lineHeight * lineClamp) {
|
8644
|
+
setIsShowMore(false);
|
8645
|
+
setIsShow(true);
|
8646
|
+
}
|
8424
8647
|
}
|
8648
|
+
catch (_b) { }
|
8425
8649
|
}, 100);
|
8426
8650
|
}
|
8427
|
-
}, [multiRow, text, lineClamp, style]);
|
8651
|
+
}, [multiRow, text, lineClamp, style, isPost]);
|
8428
8652
|
return (React.createElement("div", { className: className, style: Object.assign({}, style) },
|
8429
8653
|
React.createElement("div", { ref: multiRow, style: {
|
8430
8654
|
overflow: 'hidden',
|
@@ -8433,14 +8657,14 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
8433
8657
|
display: '-webkit-box',
|
8434
8658
|
WebkitBoxOrient: 'vertical',
|
8435
8659
|
wordBreak: 'break-word'
|
8436
|
-
}
|
8660
|
+
}, dangerouslySetInnerHTML: { __html: text ? text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') : React.createElement(React.Fragment, null) } }),
|
8437
8661
|
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'))));
|
8438
8662
|
};
|
8439
8663
|
var ExpandableText$1 = memo(ExpandableText);
|
8440
8664
|
|
8441
8665
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8442
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
8443
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText"]);
|
8666
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8667
|
+
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"]);
|
8444
8668
|
useState(true);
|
8445
8669
|
const { sxpParameter } = useSxpDataSource();
|
8446
8670
|
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
@@ -8487,14 +8711,22 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8487
8711
|
}
|
8488
8712
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8489
8713
|
const width = isPreview ? 375 : window.innerWidth;
|
8714
|
+
const productInfoText = () => {
|
8715
|
+
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8716
|
+
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) ||
|
8717
|
+
`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
|
8718
|
+
Made in Italy` })));
|
8719
|
+
};
|
8490
8720
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8491
8721
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
|
8492
8722
|
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: {
|
8493
8723
|
clickable: true,
|
8494
8724
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8495
|
-
clickableClass:
|
8725
|
+
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
8726
|
+
? 'commondityDiroNew-swiper-clickable-left'
|
8727
|
+
: 'commondityDiroNew-swiper-clickable-center'
|
8496
8728
|
}, loop: true, autoplay: {
|
8497
|
-
delay:
|
8729
|
+
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8498
8730
|
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8499
8731
|
return (React.createElement(SwiperSlide, { key: src },
|
8500
8732
|
React.createElement("div", { style: {
|
@@ -8520,29 +8752,65 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8520
8752
|
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8521
8753
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8522
8754
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8523
|
-
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'),
|
8524
|
-
React.createElement("div", { className: '
|
8525
|
-
|
8526
|
-
|
8527
|
-
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.
|
8528
|
-
|
8529
|
-
|
8530
|
-
|
8531
|
-
Made in Italy`))))),
|
8532
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
8533
|
-
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) ||
|
8534
|
-
`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
|
8535
|
-
Made in Italy`))));
|
8755
|
+
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'),
|
8756
|
+
React.createElement("div", { className: '' },
|
8757
|
+
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),
|
8758
|
+
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 : '税费'))),
|
8759
|
+
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'),
|
8760
|
+
(!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')),
|
8761
|
+
productInfoText())),
|
8762
|
+
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText())));
|
8536
8763
|
};
|
8537
|
-
var
|
8764
|
+
var CommodityDetailDiroNewComponent = memo(CommodityDetailDiroNew$1);
|
8538
8765
|
|
8539
|
-
|
8766
|
+
/*
|
8767
|
+
* @Author: binruan@chatlabs.com
|
8768
|
+
* @Date: 2024-03-20 10:27:31
|
8769
|
+
* @LastEditors: binruan@chatlabs.com
|
8770
|
+
* @LastEditTime: 2024-03-28 16:05:12
|
8771
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityDetailDiroNew\material.tsx
|
8772
|
+
*
|
8773
|
+
*/
|
8774
|
+
const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
|
8540
8775
|
displayName: '商品详情',
|
8541
8776
|
icon: '',
|
8542
8777
|
category: 'popup',
|
8543
8778
|
type: 'CommodityDetailDiroNew',
|
8779
|
+
related: {
|
8780
|
+
settingRender: settingRender$1
|
8781
|
+
},
|
8544
8782
|
defaulSetting: {
|
8545
|
-
props: {
|
8783
|
+
props: {
|
8784
|
+
swiper: {
|
8785
|
+
dotsAlign: 'left',
|
8786
|
+
delay: 3
|
8787
|
+
},
|
8788
|
+
commodityStyles: {
|
8789
|
+
price: {
|
8790
|
+
color: '#000',
|
8791
|
+
fontWeight: 'bold',
|
8792
|
+
fontSize: 18
|
8793
|
+
},
|
8794
|
+
title: {
|
8795
|
+
color: '#000',
|
8796
|
+
fontSize: 13
|
8797
|
+
},
|
8798
|
+
collection: {
|
8799
|
+
color: '#757575',
|
8800
|
+
fontSize: 13
|
8801
|
+
},
|
8802
|
+
info: {
|
8803
|
+
color: '#757575',
|
8804
|
+
fontSize: 13
|
8805
|
+
},
|
8806
|
+
taxInfo: {
|
8807
|
+
color: '#000',
|
8808
|
+
fontWeight: 'bold',
|
8809
|
+
fontSize: 13,
|
8810
|
+
textAlign: 'right'
|
8811
|
+
}
|
8812
|
+
}
|
8813
|
+
},
|
8546
8814
|
style: {}
|
8547
8815
|
},
|
8548
8816
|
w: 100,
|
@@ -8550,6 +8818,213 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNew$2, {
|
|
8550
8818
|
sort: 1
|
8551
8819
|
});
|
8552
8820
|
|
8821
|
+
/*
|
8822
|
+
* @Author: binruan@chatlabs.com
|
8823
|
+
* @Date: 2024-03-26 16:50:25
|
8824
|
+
* @LastEditors: binruan@chatlabs.com
|
8825
|
+
* @LastEditTime: 2024-03-29 17:03:07
|
8826
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
|
8827
|
+
*
|
8828
|
+
*/
|
8829
|
+
var settingRender = [
|
8830
|
+
{
|
8831
|
+
title: '主题样式',
|
8832
|
+
child: [
|
8833
|
+
{
|
8834
|
+
type: 'Group',
|
8835
|
+
label: '尺寸',
|
8836
|
+
child: [
|
8837
|
+
{
|
8838
|
+
type: 'Number',
|
8839
|
+
name: ['style', 'width'],
|
8840
|
+
addonAfter: 'W'
|
8841
|
+
},
|
8842
|
+
{
|
8843
|
+
type: 'Number',
|
8844
|
+
name: ['style', 'height'],
|
8845
|
+
addonAfter: 'H'
|
8846
|
+
}
|
8847
|
+
]
|
8848
|
+
},
|
8849
|
+
{
|
8850
|
+
type: 'Group',
|
8851
|
+
label: '圆角',
|
8852
|
+
child: [
|
8853
|
+
{
|
8854
|
+
type: 'Slider',
|
8855
|
+
name: ['style', 'borderRadius'],
|
8856
|
+
max: 100
|
8857
|
+
},
|
8858
|
+
{
|
8859
|
+
type: 'Number',
|
8860
|
+
name: ['style', 'borderRadius'],
|
8861
|
+
addonAfter: 'px',
|
8862
|
+
max: 100
|
8863
|
+
}
|
8864
|
+
]
|
8865
|
+
},
|
8866
|
+
{
|
8867
|
+
type: 'Color',
|
8868
|
+
label: '背景色',
|
8869
|
+
name: ['style', 'backgroundColor']
|
8870
|
+
},
|
8871
|
+
{
|
8872
|
+
label: '内边距',
|
8873
|
+
type: 'Number',
|
8874
|
+
name: ['style', 'padding'],
|
8875
|
+
addonAfter: 'px'
|
8876
|
+
},
|
8877
|
+
{
|
8878
|
+
label: '与Post描述边距',
|
8879
|
+
type: 'Number',
|
8880
|
+
name: ['style', 'marginBottom'],
|
8881
|
+
addonAfter: 'px'
|
8882
|
+
}
|
8883
|
+
]
|
8884
|
+
},
|
8885
|
+
{
|
8886
|
+
title: '商品图片',
|
8887
|
+
child: [
|
8888
|
+
{
|
8889
|
+
type: 'Group',
|
8890
|
+
label: '尺寸',
|
8891
|
+
child: [
|
8892
|
+
{
|
8893
|
+
type: 'Number',
|
8894
|
+
name: ['props', 'ctaTempStyles', 'img', 'width'],
|
8895
|
+
addonAfter: 'W'
|
8896
|
+
},
|
8897
|
+
{
|
8898
|
+
type: 'Number',
|
8899
|
+
name: ['props', 'ctaTempStyles', 'img', 'height'],
|
8900
|
+
addonAfter: 'H'
|
8901
|
+
}
|
8902
|
+
]
|
8903
|
+
},
|
8904
|
+
{
|
8905
|
+
type: 'Group',
|
8906
|
+
label: '圆角',
|
8907
|
+
child: [
|
8908
|
+
{
|
8909
|
+
type: 'Slider',
|
8910
|
+
name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
|
8911
|
+
max: 100
|
8912
|
+
},
|
8913
|
+
{
|
8914
|
+
type: 'Number',
|
8915
|
+
name: ['props', 'ctaTempStyles', 'img', 'borderRadius'],
|
8916
|
+
addonAfter: 'px',
|
8917
|
+
max: 100
|
8918
|
+
}
|
8919
|
+
]
|
8920
|
+
},
|
8921
|
+
{
|
8922
|
+
type: 'Number',
|
8923
|
+
label: '与右侧边距',
|
8924
|
+
addonAfter: 'px',
|
8925
|
+
name: ['props', 'ctaTempStyles', 'img', 'marginRight']
|
8926
|
+
}
|
8927
|
+
]
|
8928
|
+
},
|
8929
|
+
{
|
8930
|
+
title: '商品标题文本',
|
8931
|
+
type: 'commodityTitle',
|
8932
|
+
child: [
|
8933
|
+
{
|
8934
|
+
type: 'Group',
|
8935
|
+
label: '字体',
|
8936
|
+
child: [
|
8937
|
+
{
|
8938
|
+
type: 'Color',
|
8939
|
+
name: ['props', 'ctaTempStyles', 'title', 'color']
|
8940
|
+
},
|
8941
|
+
{
|
8942
|
+
type: 'Select',
|
8943
|
+
options: [{ label: '黑体', value: '黑体' }],
|
8944
|
+
name: ['props', 'ctaTempStyles', 'title', 'fontFamily']
|
8945
|
+
},
|
8946
|
+
{
|
8947
|
+
type: 'Number',
|
8948
|
+
addonAfter: 'px',
|
8949
|
+
name: ['props', 'ctaTempStyles', 'title', 'fontSize']
|
8950
|
+
}
|
8951
|
+
]
|
8952
|
+
},
|
8953
|
+
{
|
8954
|
+
label: '样式',
|
8955
|
+
type: 'TextStyle',
|
8956
|
+
name: ['props', 'ctaTempStyles', 'title']
|
8957
|
+
},
|
8958
|
+
{
|
8959
|
+
label: '对齐',
|
8960
|
+
type: 'TextAlign',
|
8961
|
+
name: ['props', 'ctaTempStyles', 'title']
|
8962
|
+
},
|
8963
|
+
{
|
8964
|
+
label: '间距',
|
8965
|
+
type: 'TextSpace',
|
8966
|
+
name: ['props', 'ctaTempStyles', 'title']
|
8967
|
+
}
|
8968
|
+
]
|
8969
|
+
},
|
8970
|
+
{
|
8971
|
+
title: 'CTA标题',
|
8972
|
+
child: [
|
8973
|
+
{
|
8974
|
+
type: 'Group',
|
8975
|
+
label: '尺寸',
|
8976
|
+
child: [
|
8977
|
+
{
|
8978
|
+
type: 'Number',
|
8979
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'width'],
|
8980
|
+
addonAfter: 'W'
|
8981
|
+
},
|
8982
|
+
{
|
8983
|
+
type: 'Number',
|
8984
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'height'],
|
8985
|
+
addonAfter: 'H'
|
8986
|
+
}
|
8987
|
+
]
|
8988
|
+
},
|
8989
|
+
{
|
8990
|
+
type: 'Color',
|
8991
|
+
label: '背景色',
|
8992
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'backgroundColor']
|
8993
|
+
},
|
8994
|
+
{
|
8995
|
+
type: 'Group',
|
8996
|
+
label: '字体',
|
8997
|
+
child: [
|
8998
|
+
{
|
8999
|
+
type: 'Color',
|
9000
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'color']
|
9001
|
+
},
|
9002
|
+
{
|
9003
|
+
type: 'Select',
|
9004
|
+
options: [{ label: '黑体', value: '黑体' }],
|
9005
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontFamily']
|
9006
|
+
},
|
9007
|
+
{
|
9008
|
+
type: 'Number',
|
9009
|
+
addonAfter: 'px',
|
9010
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle', 'fontSize']
|
9011
|
+
}
|
9012
|
+
]
|
9013
|
+
},
|
9014
|
+
{
|
9015
|
+
label: '样式',
|
9016
|
+
type: 'TextStyle',
|
9017
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
9018
|
+
},
|
9019
|
+
{
|
9020
|
+
label: '对齐',
|
9021
|
+
type: 'TextAlign',
|
9022
|
+
name: ['props', 'ctaTempStyles', 'ctaTitle']
|
9023
|
+
}
|
9024
|
+
]
|
9025
|
+
}
|
9026
|
+
];
|
9027
|
+
|
8553
9028
|
var interactionRender$6 = [
|
8554
9029
|
{
|
8555
9030
|
title: '点击事件',
|
@@ -8590,9 +9065,10 @@ function useOnScreen(ref) {
|
|
8590
9065
|
}
|
8591
9066
|
|
8592
9067
|
const EventProvider = (_a) => {
|
8593
|
-
var { rec, children, className, onClick } = _a; __rest(_a, ["rec", "children", "className", "onClick"]);
|
9068
|
+
var { rec, children, className, onClick, style } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style"]);
|
8594
9069
|
const ref = useRef(null);
|
8595
9070
|
const isOnScreen = useOnScreen(ref);
|
9071
|
+
const { popupAni } = useEditor();
|
8596
9072
|
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
8597
9073
|
useEffect(() => {
|
8598
9074
|
var _a, _b;
|
@@ -8613,8 +9089,8 @@ const EventProvider = (_a) => {
|
|
8613
9089
|
}, rec, item);
|
8614
9090
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
8615
9091
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
8616
|
-
},
|
8617
|
-
return (React.createElement("div", { ref: ref, className: className, onClick: handleClick }, children));
|
9092
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9093
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
8618
9094
|
};
|
8619
9095
|
var EventProvider$1 = memo(EventProvider);
|
8620
9096
|
|
@@ -8622,20 +9098,12 @@ var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
|
8622
9098
|
|
8623
9099
|
const Commodity$1 = (_a) => {
|
8624
9100
|
var _b, _c, _d, _e, _f, _g, _h;
|
8625
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9101
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8626
9102
|
const { sxpParameter } = useSxpDataSource();
|
8627
9103
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8628
9104
|
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;
|
8629
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign(
|
8630
|
-
React.createElement("div", { className: css({
|
8631
|
-
width: '60px',
|
8632
|
-
height: '60px',
|
8633
|
-
marginRight: '8px',
|
8634
|
-
borderRadius: '3px',
|
8635
|
-
overflow: 'hidden',
|
8636
|
-
flexShrink: 0,
|
8637
|
-
backgroundColor: '#f2f2f2'
|
8638
|
-
}) },
|
9105
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9106
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8639
9107
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8640
9108
|
React.createElement("div", { className: css({
|
8641
9109
|
color: '#fff',
|
@@ -8645,20 +9113,19 @@ const Commodity$1 = (_a) => {
|
|
8645
9113
|
width: '100%',
|
8646
9114
|
overflow: 'hidden'
|
8647
9115
|
}) },
|
8648
|
-
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'),
|
8649
|
-
React.createElement("div", { className: css({
|
8650
|
-
background: 'rgba(0,0,0,.5)',
|
8651
|
-
fontSize: '10px',
|
8652
|
-
padding: '2px 7px',
|
8653
|
-
width: 'auto',
|
8654
|
-
textAlign: 'center',
|
8655
|
-
textOverflow: 'ellipsis',
|
8656
|
-
overflow: 'hidden',
|
8657
|
-
whiteSpace: 'nowrap'
|
8658
|
-
}) }, (_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'))));
|
9116
|
+
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'),
|
9117
|
+
React.createElement("div", { className: 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'))));
|
8659
9118
|
};
|
8660
9119
|
var CommodityComponent = memo(Commodity$1);
|
8661
9120
|
|
9121
|
+
/*
|
9122
|
+
* @Author: binruan@chatlabs.com
|
9123
|
+
* @Date: 2023-07-28 18:29:57
|
9124
|
+
* @LastEditors: binruan@chatlabs.com
|
9125
|
+
* @LastEditTime: 2024-03-29 16:39:54
|
9126
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Commodity\material.tsx
|
9127
|
+
*
|
9128
|
+
*/
|
8662
9129
|
const Commodity = createMaterial(CommodityComponent, {
|
8663
9130
|
displayName: '推荐单商品-透明底',
|
8664
9131
|
icon: '',
|
@@ -8666,15 +9133,39 @@ const Commodity = createMaterial(CommodityComponent, {
|
|
8666
9133
|
type: 'Commodity',
|
8667
9134
|
related: {
|
8668
9135
|
interactionRender: interactionRender$6,
|
8669
|
-
bindableProps: []
|
9136
|
+
bindableProps: [],
|
9137
|
+
settingRender
|
8670
9138
|
},
|
8671
9139
|
defaulSetting: {
|
8672
|
-
props: {
|
9140
|
+
props: {
|
9141
|
+
ctaTempStyles: {
|
9142
|
+
img: {
|
9143
|
+
borderRadius: 3,
|
9144
|
+
width: 60,
|
9145
|
+
height: 60,
|
9146
|
+
marginRight: 8
|
9147
|
+
},
|
9148
|
+
title: {
|
9149
|
+
fontSize: 12,
|
9150
|
+
color: '#fff',
|
9151
|
+
textAlign: 'left'
|
9152
|
+
},
|
9153
|
+
ctaTitle: {
|
9154
|
+
fontSize: 10,
|
9155
|
+
color: '#fff',
|
9156
|
+
textAlign: 'center',
|
9157
|
+
width: 130,
|
9158
|
+
height: 20,
|
9159
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
9160
|
+
}
|
9161
|
+
}
|
9162
|
+
},
|
8673
9163
|
style: {
|
8674
|
-
padding:
|
8675
|
-
|
8676
|
-
|
8677
|
-
borderRadius:
|
9164
|
+
padding: 7,
|
9165
|
+
width: 236,
|
9166
|
+
height: 74,
|
9167
|
+
borderRadius: 3,
|
9168
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8678
9169
|
}
|
8679
9170
|
},
|
8680
9171
|
w: 100,
|
@@ -8696,30 +9187,24 @@ var interactionRender$5 = [
|
|
8696
9187
|
|
8697
9188
|
const Appoint$1 = (_a) => {
|
8698
9189
|
var _b, _c, _d, _e;
|
8699
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9190
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8700
9191
|
const { sxpParameter } = useSxpDataSource();
|
8701
9192
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
8702
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign(
|
8703
|
-
React.createElement("div", { className: css({
|
8704
|
-
width: '30px',
|
8705
|
-
height: '30px',
|
8706
|
-
marginRight: '8px',
|
8707
|
-
borderRadius: '3px',
|
8708
|
-
overflow: 'hidden',
|
8709
|
-
flexShrink: 0,
|
8710
|
-
backgroundColor: '#f2f2f2'
|
8711
|
-
}) },
|
9193
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
9194
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8712
9195
|
React.createElement("img", { className: 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: '' })),
|
8713
|
-
React.createElement("div", { className: css({
|
8714
|
-
color: '#fff',
|
8715
|
-
width: '100%',
|
8716
|
-
overflow: 'hidden',
|
8717
|
-
fontSize: '12px',
|
8718
|
-
textOverflow: 'ellipsis'
|
8719
|
-
}) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
9196
|
+
React.createElement("div", { className: 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')));
|
8720
9197
|
};
|
8721
9198
|
var AppointComponent = memo(Appoint$1);
|
8722
9199
|
|
9200
|
+
/*
|
9201
|
+
* @Author: binruan@chatlabs.com
|
9202
|
+
* @Date: 2023-07-28 18:29:57
|
9203
|
+
* @LastEditors: binruan@chatlabs.com
|
9204
|
+
* @LastEditTime: 2024-03-29 17:03:49
|
9205
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Appoint\material.tsx
|
9206
|
+
*
|
9207
|
+
*/
|
8723
9208
|
const Appoint = createMaterial(AppointComponent, {
|
8724
9209
|
displayName: '预约表单',
|
8725
9210
|
icon: '',
|
@@ -8727,18 +9212,33 @@ const Appoint = createMaterial(AppointComponent, {
|
|
8727
9212
|
type: 'Appoint',
|
8728
9213
|
related: {
|
8729
9214
|
interactionRender: interactionRender$5,
|
9215
|
+
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
8730
9216
|
bindableProps: []
|
8731
9217
|
},
|
8732
9218
|
defaulSetting: {
|
8733
9219
|
props: {
|
8734
|
-
|
9220
|
+
ctaTempStyles: {
|
9221
|
+
img: {
|
9222
|
+
borderRadius: 3,
|
9223
|
+
width: 30,
|
9224
|
+
height: 30,
|
9225
|
+
marginRight: 8
|
9226
|
+
},
|
9227
|
+
ctaTitle: {
|
9228
|
+
fontSize: 12,
|
9229
|
+
color: '#fff',
|
9230
|
+
textAlign: 'left',
|
9231
|
+
width: 130,
|
9232
|
+
height: 20
|
9233
|
+
}
|
9234
|
+
}
|
8735
9235
|
},
|
8736
9236
|
style: {
|
8737
|
-
padding:
|
8738
|
-
|
8739
|
-
|
8740
|
-
|
8741
|
-
|
9237
|
+
padding: 7,
|
9238
|
+
width: 236,
|
9239
|
+
height: 44,
|
9240
|
+
borderRadius: 3,
|
9241
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8742
9242
|
}
|
8743
9243
|
},
|
8744
9244
|
w: 100,
|
@@ -8750,7 +9250,7 @@ var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
|
8750
9250
|
|
8751
9251
|
const Link$1 = (_a) => {
|
8752
9252
|
var _b, _c, _d, _e, _f;
|
8753
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9253
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8754
9254
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
8755
9255
|
const { jumpToWeb } = useEventReport();
|
8756
9256
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
@@ -8761,45 +9261,60 @@ const Link$1 = (_a) => {
|
|
8761
9261
|
window.location.href = window.getJointUtmLink(cta.link);
|
8762
9262
|
}
|
8763
9263
|
};
|
8764
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign(
|
8765
|
-
React.createElement("div", { className: css({
|
8766
|
-
width: '60px',
|
8767
|
-
height: '60px',
|
8768
|
-
marginRight: '8px',
|
8769
|
-
borderRadius: '3px',
|
8770
|
-
backgroundColor: '#f2f2f2',
|
8771
|
-
overflow: 'hidden',
|
8772
|
-
flexShrink: 0
|
8773
|
-
}) },
|
9264
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9265
|
+
React.createElement("div", { className: css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8774
9266
|
React.createElement("img", { className: 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: '' })),
|
8775
9267
|
React.createElement("div", { className: css({
|
8776
|
-
color: '#fff',
|
8777
9268
|
display: 'flex',
|
8778
9269
|
alignItems: 'center',
|
8779
9270
|
width: '100%',
|
8780
9271
|
overflow: 'hidden'
|
8781
9272
|
}) },
|
8782
|
-
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'))));
|
9273
|
+
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'))));
|
8783
9274
|
};
|
8784
9275
|
var LinkComponent = memo(Link$1);
|
8785
9276
|
|
9277
|
+
/*
|
9278
|
+
* @Author: binruan@chatlabs.com
|
9279
|
+
* @Date: 2023-07-28 18:29:57
|
9280
|
+
* @LastEditors: binruan@chatlabs.com
|
9281
|
+
* @LastEditTime: 2024-03-29 17:04:57
|
9282
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\Link\material.tsx
|
9283
|
+
*
|
9284
|
+
*/
|
8786
9285
|
const Link = createMaterial(LinkComponent, {
|
8787
9286
|
displayName: '跳转指引',
|
8788
9287
|
icon: '',
|
8789
9288
|
category: 'template',
|
8790
9289
|
type: 'Link',
|
8791
9290
|
related: {
|
9291
|
+
settingRender: settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle'),
|
8792
9292
|
bindableProps: []
|
8793
9293
|
},
|
8794
9294
|
defaulSetting: {
|
8795
9295
|
props: {
|
8796
|
-
|
9296
|
+
ctaTempStyles: {
|
9297
|
+
img: {
|
9298
|
+
borderRadius: 3,
|
9299
|
+
width: 60,
|
9300
|
+
height: 60,
|
9301
|
+
marginRight: 8
|
9302
|
+
},
|
9303
|
+
ctaTitle: {
|
9304
|
+
fontSize: 12,
|
9305
|
+
color: '#fff',
|
9306
|
+
textAlign: 'left',
|
9307
|
+
width: 130,
|
9308
|
+
height: 20
|
9309
|
+
}
|
9310
|
+
}
|
8797
9311
|
},
|
8798
9312
|
style: {
|
8799
|
-
padding:
|
8800
|
-
|
8801
|
-
|
8802
|
-
borderRadius:
|
9313
|
+
padding: 7,
|
9314
|
+
width: 236,
|
9315
|
+
height: 74,
|
9316
|
+
borderRadius: 3,
|
9317
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
8803
9318
|
}
|
8804
9319
|
},
|
8805
9320
|
w: 100,
|
@@ -8823,20 +9338,12 @@ var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
|
8823
9338
|
|
8824
9339
|
const CommodityDiro$1 = (_a) => {
|
8825
9340
|
var _b, _c, _d, _e, _f, _g, _h;
|
8826
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9341
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8827
9342
|
const { sxpParameter } = useSxpDataSource();
|
8828
9343
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8829
9344
|
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;
|
8830
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign(
|
8831
|
-
React.createElement("div", { className: css({
|
8832
|
-
width: '60px',
|
8833
|
-
height: '60px',
|
8834
|
-
marginRight: '8px',
|
8835
|
-
borderRadius: '3px',
|
8836
|
-
overflow: 'hidden',
|
8837
|
-
flexShrink: 0,
|
8838
|
-
backgroundColor: '#f2f2f2'
|
8839
|
-
}) },
|
9345
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9346
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8840
9347
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8841
9348
|
React.createElement("div", { className: css({
|
8842
9349
|
color: '#fff',
|
@@ -8846,22 +9353,19 @@ const CommodityDiro$1 = (_a) => {
|
|
8846
9353
|
width: '100%',
|
8847
9354
|
overflow: 'hidden'
|
8848
9355
|
}) },
|
8849
|
-
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'),
|
8850
|
-
React.createElement("div", { className: css({
|
8851
|
-
background: 'rgba(0,0,0,1)',
|
8852
|
-
fontSize: '10px',
|
8853
|
-
padding: '2px 7px',
|
8854
|
-
textAlign: 'center',
|
8855
|
-
textOverflow: 'ellipsis',
|
8856
|
-
overflow: 'hidden',
|
8857
|
-
borderRadius: '25px',
|
8858
|
-
width: 'fit-content',
|
8859
|
-
maxWidth: '100%',
|
8860
|
-
whiteSpace: 'nowrap'
|
8861
|
-
}) }, (_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'))));
|
9356
|
+
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'),
|
9357
|
+
React.createElement("div", { className: 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'))));
|
8862
9358
|
};
|
8863
9359
|
var CommodityDiroComponent = memo(CommodityDiro$1);
|
8864
9360
|
|
9361
|
+
/*
|
9362
|
+
* @Author: binruan@chatlabs.com
|
9363
|
+
* @Date: 2023-07-28 18:29:57
|
9364
|
+
* @LastEditors: binruan@chatlabs.com
|
9365
|
+
* @LastEditTime: 2024-03-29 16:07:28
|
9366
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\CommodityDiro\material.tsx
|
9367
|
+
*
|
9368
|
+
*/
|
8865
9369
|
const CommodityDiro = createMaterial(CommodityDiroComponent, {
|
8866
9370
|
displayName: '推荐单商品-白底圆角按钮',
|
8867
9371
|
icon: '',
|
@@ -8869,15 +9373,39 @@ const CommodityDiro = createMaterial(CommodityDiroComponent, {
|
|
8869
9373
|
type: 'CommodityDiro',
|
8870
9374
|
related: {
|
8871
9375
|
interactionRender: interactionRender$4,
|
9376
|
+
settingRender,
|
8872
9377
|
bindableProps: []
|
8873
9378
|
},
|
8874
9379
|
defaulSetting: {
|
8875
|
-
props: {
|
9380
|
+
props: {
|
9381
|
+
ctaTempStyles: {
|
9382
|
+
img: {
|
9383
|
+
borderRadius: 3,
|
9384
|
+
width: 60,
|
9385
|
+
height: 60,
|
9386
|
+
marginRight: 8
|
9387
|
+
},
|
9388
|
+
title: {
|
9389
|
+
fontSize: 12,
|
9390
|
+
color: '#000',
|
9391
|
+
textAlign: 'left'
|
9392
|
+
},
|
9393
|
+
ctaTitle: {
|
9394
|
+
fontSize: 10,
|
9395
|
+
color: '#fff',
|
9396
|
+
textAlign: 'center',
|
9397
|
+
width: 80,
|
9398
|
+
height: 20,
|
9399
|
+
backgroundColor: 'rgba(0,0,0,1)'
|
9400
|
+
}
|
9401
|
+
}
|
9402
|
+
},
|
8876
9403
|
style: {
|
8877
|
-
padding:
|
8878
|
-
|
8879
|
-
|
8880
|
-
|
9404
|
+
padding: 7,
|
9405
|
+
width: 236,
|
9406
|
+
height: 74,
|
9407
|
+
borderRadius: 3,
|
9408
|
+
backgroundColor: '#fff'
|
8881
9409
|
}
|
8882
9410
|
},
|
8883
9411
|
w: 100,
|
@@ -8901,20 +9429,12 @@ var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
|
8901
9429
|
|
8902
9430
|
const CommodityDiroNew$1 = (_a) => {
|
8903
9431
|
var _b, _c, _d, _e, _f, _g, _h;
|
8904
|
-
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
9432
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
|
8905
9433
|
const { sxpParameter } = useSxpDataSource();
|
8906
9434
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
8907
9435
|
const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
8908
|
-
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign(
|
8909
|
-
React.createElement("div", { className: css({
|
8910
|
-
width: '78px',
|
8911
|
-
height: '78px',
|
8912
|
-
marginRight: '16px',
|
8913
|
-
borderRadius: '8px',
|
8914
|
-
overflow: 'hidden',
|
8915
|
-
flexShrink: 0,
|
8916
|
-
backgroundColor: '#f2f2f2'
|
8917
|
-
}) },
|
9436
|
+
return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9437
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
8918
9438
|
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
|
8919
9439
|
React.createElement("div", { className: css({
|
8920
9440
|
color: '#fff',
|
@@ -8924,22 +9444,19 @@ const CommodityDiroNew$1 = (_a) => {
|
|
8924
9444
|
width: '100%',
|
8925
9445
|
overflow: 'hidden'
|
8926
9446
|
}) },
|
8927
|
-
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'),
|
8928
|
-
React.createElement("div", { className: css({
|
8929
|
-
fontSize: '13px',
|
8930
|
-
fontWeight: 'bold',
|
8931
|
-
textOverflow: 'ellipsis',
|
8932
|
-
overflow: 'hidden',
|
8933
|
-
width: 'fit-content',
|
8934
|
-
maxWidth: '100%',
|
8935
|
-
whiteSpace: 'nowrap',
|
8936
|
-
textDecoration: 'underline',
|
8937
|
-
color: '#000',
|
8938
|
-
lineHeight: '20px'
|
8939
|
-
}) }, (_h = (_g = product === null || product === void 0 ? void 0 : product.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop now'))));
|
9447
|
+
React.createElement("div", { className: styles$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'),
|
9448
|
+
React.createElement("div", { className: 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'))));
|
8940
9449
|
};
|
8941
9450
|
var CommodityDiroNewComponent = memo(CommodityDiroNew$1);
|
8942
9451
|
|
9452
|
+
/*
|
9453
|
+
* @Author: binruan@chatlabs.com
|
9454
|
+
* @Date: 2023-07-28 18:29:57
|
9455
|
+
* @LastEditors: binruan@chatlabs.com
|
9456
|
+
* @LastEditTime: 2024-03-29 11:56:56
|
9457
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\CommodityDiroNew\material.tsx
|
9458
|
+
*
|
9459
|
+
*/
|
8943
9460
|
const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
|
8944
9461
|
displayName: '推荐单商品-白底下划线按钮',
|
8945
9462
|
icon: '',
|
@@ -8947,15 +9464,40 @@ const CommodityDiroNew = createMaterial(CommodityDiroNewComponent, {
|
|
8947
9464
|
type: 'CommodityDiroNew',
|
8948
9465
|
related: {
|
8949
9466
|
interactionRender: interactionRender$3,
|
8950
|
-
bindableProps: []
|
9467
|
+
bindableProps: [],
|
9468
|
+
settingRender
|
8951
9469
|
},
|
8952
9470
|
defaulSetting: {
|
8953
|
-
props: {
|
9471
|
+
props: {
|
9472
|
+
ctaTempStyles: {
|
9473
|
+
img: {
|
9474
|
+
borderRadius: 8,
|
9475
|
+
width: 78,
|
9476
|
+
height: 78,
|
9477
|
+
marginRight: 16
|
9478
|
+
},
|
9479
|
+
title: {
|
9480
|
+
fontSize: 12,
|
9481
|
+
color: '#000',
|
9482
|
+
textAlign: 'left'
|
9483
|
+
},
|
9484
|
+
ctaTitle: {
|
9485
|
+
textDecoration: 'underline',
|
9486
|
+
fontSize: 12,
|
9487
|
+
fontWeight: 'bold',
|
9488
|
+
color: '#000',
|
9489
|
+
textAlign: 'left',
|
9490
|
+
width: 150,
|
9491
|
+
height: 20
|
9492
|
+
}
|
9493
|
+
}
|
9494
|
+
},
|
8954
9495
|
style: {
|
8955
|
-
|
8956
|
-
|
8957
|
-
|
8958
|
-
|
9496
|
+
borderRadius: 4,
|
9497
|
+
width: 260,
|
9498
|
+
height: 86,
|
9499
|
+
padding: 4,
|
9500
|
+
backgroundColor: 'rgba(255,255,255,0.75)'
|
8959
9501
|
}
|
8960
9502
|
},
|
8961
9503
|
w: 100,
|
@@ -9008,8 +9550,9 @@ var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
9008
9550
|
|
9009
9551
|
const MultiCommodityDiro$1 = (_a) => {
|
9010
9552
|
var _b, _c;
|
9011
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9553
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9012
9554
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9555
|
+
const { popupAni } = useEditor();
|
9013
9556
|
const [products, setProducts] = 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]);
|
9014
9557
|
const handleClick = throttle((item) => {
|
9015
9558
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9018,19 +9561,11 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9018
9561
|
}, recData, item);
|
9019
9562
|
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 }) }));
|
9020
9563
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9021
|
-
},
|
9564
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9022
9565
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9023
9566
|
var _a, _b, _c, _d, _e, _f;
|
9024
|
-
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(Object.assign(
|
9025
|
-
React.createElement("div", { className: css({
|
9026
|
-
width: '60px',
|
9027
|
-
height: '60px',
|
9028
|
-
marginRight: '8px',
|
9029
|
-
borderRadius: '3px',
|
9030
|
-
overflow: 'hidden',
|
9031
|
-
flexShrink: 0,
|
9032
|
-
backgroundColor: '#f2f2f2'
|
9033
|
-
}) },
|
9567
|
+
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(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
|
9568
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9034
9569
|
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 })),
|
9035
9570
|
React.createElement("div", { className: css({
|
9036
9571
|
color: '#000',
|
@@ -9040,24 +9575,20 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9040
9575
|
width: '100%',
|
9041
9576
|
overflow: 'hidden'
|
9042
9577
|
}) },
|
9043
|
-
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'),
|
9044
|
-
React.createElement("div", { className: css({
|
9045
|
-
background: 'rgba(0,0,0,1)',
|
9046
|
-
fontSize: '10px',
|
9047
|
-
padding: '2px 7px',
|
9048
|
-
textAlign: 'center',
|
9049
|
-
textOverflow: 'ellipsis',
|
9050
|
-
overflow: 'hidden',
|
9051
|
-
borderRadius: '25px',
|
9052
|
-
width: 'fit-content',
|
9053
|
-
maxWidth: '100%',
|
9054
|
-
color: '#fff',
|
9055
|
-
whiteSpace: 'nowrap'
|
9056
|
-
}) }, (_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'))));
|
9578
|
+
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'),
|
9579
|
+
React.createElement("div", { className: 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'))));
|
9057
9580
|
})));
|
9058
9581
|
};
|
9059
9582
|
var MultiCommodityDiroComponent = memo(MultiCommodityDiro$1);
|
9060
9583
|
|
9584
|
+
/*
|
9585
|
+
* @Author: binruan@chatlabs.com
|
9586
|
+
* @Date: 2023-07-28 18:29:57
|
9587
|
+
* @LastEditors: binruan@chatlabs.com
|
9588
|
+
* @LastEditTime: 2024-03-29 16:27:22
|
9589
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiro\material.tsx
|
9590
|
+
*
|
9591
|
+
*/
|
9061
9592
|
const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
9062
9593
|
displayName: '推荐多商品-白底圆角按钮',
|
9063
9594
|
icon: '',
|
@@ -9065,15 +9596,39 @@ const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
|
9065
9596
|
type: 'MultiCommodityDiro',
|
9066
9597
|
related: {
|
9067
9598
|
interactionRender: interactionRender$2,
|
9068
|
-
bindableProps: []
|
9599
|
+
bindableProps: [],
|
9600
|
+
settingRender
|
9069
9601
|
},
|
9070
9602
|
defaulSetting: {
|
9071
|
-
props: {
|
9603
|
+
props: {
|
9604
|
+
ctaTempStyles: {
|
9605
|
+
img: {
|
9606
|
+
borderRadius: 3,
|
9607
|
+
width: 60,
|
9608
|
+
height: 60,
|
9609
|
+
marginRight: 8
|
9610
|
+
},
|
9611
|
+
title: {
|
9612
|
+
fontSize: 12,
|
9613
|
+
color: '#000',
|
9614
|
+
textAlign: 'left'
|
9615
|
+
},
|
9616
|
+
ctaTitle: {
|
9617
|
+
fontSize: 10,
|
9618
|
+
color: '#fff',
|
9619
|
+
textAlign: 'center',
|
9620
|
+
width: 80,
|
9621
|
+
height: 20,
|
9622
|
+
backgroundColor: 'rgba(0,0,0,1)'
|
9623
|
+
}
|
9624
|
+
}
|
9625
|
+
},
|
9072
9626
|
style: {
|
9073
|
-
padding:
|
9074
|
-
|
9075
|
-
|
9076
|
-
borderRadius:
|
9627
|
+
padding: 7,
|
9628
|
+
width: 236,
|
9629
|
+
height: 74,
|
9630
|
+
borderRadius: 3,
|
9631
|
+
backgroundColor: '#fff'
|
9077
9632
|
}
|
9078
9633
|
},
|
9079
9634
|
w: 100,
|
@@ -9097,9 +9652,10 @@ var styles$1 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
9097
9652
|
|
9098
9653
|
const MultiCommodity$1 = (_a) => {
|
9099
9654
|
var _b, _c;
|
9100
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9655
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9101
9656
|
const { sxpParameter } = useSxpDataSource();
|
9102
9657
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
9658
|
+
const { popupAni } = useEditor();
|
9103
9659
|
const [products, setProducts] = 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]);
|
9104
9660
|
const handleClick = throttle((item) => {
|
9105
9661
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9108,19 +9664,11 @@ const MultiCommodity$1 = (_a) => {
|
|
9108
9664
|
}, recData, item);
|
9109
9665
|
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 }) }));
|
9110
9666
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9111
|
-
},
|
9667
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9112
9668
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9113
9669
|
var _a, _b, _c, _d, _e, _f;
|
9114
|
-
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(
|
9115
|
-
React.createElement("div", { className: css({
|
9116
|
-
width: '60px',
|
9117
|
-
height: '60px',
|
9118
|
-
marginRight: '8px',
|
9119
|
-
borderRadius: '3px',
|
9120
|
-
overflow: 'hidden',
|
9121
|
-
flexShrink: 0,
|
9122
|
-
backgroundColor: '#f2f2f2'
|
9123
|
-
}) },
|
9670
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
|
9671
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9124
9672
|
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 })),
|
9125
9673
|
React.createElement("div", { className: css({
|
9126
9674
|
color: '#fff',
|
@@ -9130,21 +9678,20 @@ const MultiCommodity$1 = (_a) => {
|
|
9130
9678
|
width: '100%',
|
9131
9679
|
overflow: 'hidden'
|
9132
9680
|
}) },
|
9133
|
-
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'),
|
9134
|
-
React.createElement("div", { className: css({
|
9135
|
-
background: 'rgba(0,0,0,.5)',
|
9136
|
-
fontSize: '10px',
|
9137
|
-
padding: '2px 7px',
|
9138
|
-
width: 'auto',
|
9139
|
-
textAlign: 'center',
|
9140
|
-
textOverflow: 'ellipsis',
|
9141
|
-
overflow: 'hidden',
|
9142
|
-
whiteSpace: 'nowrap'
|
9143
|
-
}) }, (_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'))));
|
9681
|
+
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'),
|
9682
|
+
React.createElement("div", { className: 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'))));
|
9144
9683
|
})));
|
9145
9684
|
};
|
9146
9685
|
var MultiCommodityComponent = memo(MultiCommodity$1);
|
9147
9686
|
|
9687
|
+
/*
|
9688
|
+
* @Author: binruan@chatlabs.com
|
9689
|
+
* @Date: 2023-07-28 18:29:57
|
9690
|
+
* @LastEditors: binruan@chatlabs.com
|
9691
|
+
* @LastEditTime: 2024-03-29 16:43:35
|
9692
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodity\material.tsx
|
9693
|
+
*
|
9694
|
+
*/
|
9148
9695
|
const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
9149
9696
|
displayName: '推荐多商品-透明底',
|
9150
9697
|
icon: '',
|
@@ -9152,15 +9699,39 @@ const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
|
9152
9699
|
type: 'MultiCommodity',
|
9153
9700
|
related: {
|
9154
9701
|
interactionRender: interactionRender$1,
|
9702
|
+
settingRender,
|
9155
9703
|
bindableProps: []
|
9156
9704
|
},
|
9157
9705
|
defaulSetting: {
|
9158
|
-
props: {
|
9706
|
+
props: {
|
9707
|
+
ctaTempStyles: {
|
9708
|
+
img: {
|
9709
|
+
borderRadius: 3,
|
9710
|
+
width: 60,
|
9711
|
+
height: 60,
|
9712
|
+
marginRight: 8
|
9713
|
+
},
|
9714
|
+
title: {
|
9715
|
+
fontSize: 12,
|
9716
|
+
color: '#fff',
|
9717
|
+
textAlign: 'left'
|
9718
|
+
},
|
9719
|
+
ctaTitle: {
|
9720
|
+
fontSize: 10,
|
9721
|
+
color: '#fff',
|
9722
|
+
textAlign: 'center',
|
9723
|
+
width: 130,
|
9724
|
+
height: 20,
|
9725
|
+
backgroundColor: 'rgba(0,0,0,.5)'
|
9726
|
+
}
|
9727
|
+
}
|
9728
|
+
},
|
9159
9729
|
style: {
|
9160
|
-
padding:
|
9161
|
-
|
9162
|
-
|
9163
|
-
borderRadius:
|
9730
|
+
padding: 7,
|
9731
|
+
width: 236,
|
9732
|
+
height: 74,
|
9733
|
+
borderRadius: 3,
|
9734
|
+
backgroundColor: 'rgba(0,0,0,.3)'
|
9164
9735
|
}
|
9165
9736
|
},
|
9166
9737
|
w: 100,
|
@@ -9184,8 +9755,9 @@ var styles = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
9184
9755
|
|
9185
9756
|
const MultiCommodityDiroNew$1 = (_a) => {
|
9186
9757
|
var _b, _c;
|
9187
|
-
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
9758
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
|
9188
9759
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
9760
|
+
const { popupAni } = useEditor();
|
9189
9761
|
const [products, setProducts] = 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]);
|
9190
9762
|
const handleClick = throttle((item) => {
|
9191
9763
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
@@ -9194,19 +9766,11 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9194
9766
|
}, recData, item);
|
9195
9767
|
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 }) }));
|
9196
9768
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9197
|
-
},
|
9769
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
9198
9770
|
return (React.createElement(Scroll$1, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9199
9771
|
var _a, _b, _c, _d, _e, _f;
|
9200
|
-
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(Object.assign(
|
9201
|
-
React.createElement("div", { className: css({
|
9202
|
-
width: '78px',
|
9203
|
-
height: '78px',
|
9204
|
-
marginRight: '16px',
|
9205
|
-
borderRadius: '8px',
|
9206
|
-
overflow: 'hidden',
|
9207
|
-
flexShrink: 0,
|
9208
|
-
backgroundColor: '#f2f2f2'
|
9209
|
-
}) },
|
9772
|
+
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(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
|
9773
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9210
9774
|
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 })),
|
9211
9775
|
React.createElement("div", { className: css({
|
9212
9776
|
color: '#fff',
|
@@ -9217,22 +9781,20 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
9217
9781
|
overflow: 'hidden',
|
9218
9782
|
lineHeight: '20px'
|
9219
9783
|
}) },
|
9220
|
-
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'),
|
9221
|
-
React.createElement("div", { className: css({
|
9222
|
-
fontSize: '13px',
|
9223
|
-
fontWeight: 'bold',
|
9224
|
-
textOverflow: 'ellipsis',
|
9225
|
-
overflow: 'hidden',
|
9226
|
-
width: 'fit-content',
|
9227
|
-
maxWidth: '100%',
|
9228
|
-
whiteSpace: 'nowrap',
|
9229
|
-
textDecoration: 'underline',
|
9230
|
-
color: '#000'
|
9231
|
-
}) }, (_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'))));
|
9784
|
+
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'),
|
9785
|
+
React.createElement("div", { className: 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'))));
|
9232
9786
|
})));
|
9233
9787
|
};
|
9234
9788
|
var MultiCommodityDiroNewComponent = memo(MultiCommodityDiroNew$1);
|
9235
9789
|
|
9790
|
+
/*
|
9791
|
+
* @Author: binruan@chatlabs.com
|
9792
|
+
* @Date: 2023-07-28 18:29:57
|
9793
|
+
* @LastEditors: binruan@chatlabs.com
|
9794
|
+
* @LastEditTime: 2024-03-29 15:40:54
|
9795
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\MultiCommodityDiroNew\material.tsx
|
9796
|
+
*
|
9797
|
+
*/
|
9236
9798
|
const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
9237
9799
|
displayName: '推荐多商品-白底下划线按钮',
|
9238
9800
|
icon: '',
|
@@ -9240,15 +9802,40 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
|
9240
9802
|
type: 'MultiCommodityDiroNew',
|
9241
9803
|
related: {
|
9242
9804
|
interactionRender,
|
9243
|
-
bindableProps: []
|
9805
|
+
bindableProps: [],
|
9806
|
+
settingRender
|
9244
9807
|
},
|
9245
9808
|
defaulSetting: {
|
9246
|
-
props: {
|
9809
|
+
props: {
|
9810
|
+
ctaTempStyles: {
|
9811
|
+
img: {
|
9812
|
+
borderRadius: 8,
|
9813
|
+
width: 78,
|
9814
|
+
height: 78,
|
9815
|
+
marginRight: 16
|
9816
|
+
},
|
9817
|
+
title: {
|
9818
|
+
fontSize: 12,
|
9819
|
+
color: '#000',
|
9820
|
+
textAlign: 'left'
|
9821
|
+
},
|
9822
|
+
ctaTitle: {
|
9823
|
+
textDecoration: 'underline',
|
9824
|
+
fontSize: 12,
|
9825
|
+
fontWeight: 'bold',
|
9826
|
+
color: '#000',
|
9827
|
+
textAlign: 'left',
|
9828
|
+
width: 150,
|
9829
|
+
height: 20
|
9830
|
+
}
|
9831
|
+
}
|
9832
|
+
},
|
9247
9833
|
style: {
|
9248
|
-
|
9249
|
-
|
9250
|
-
|
9251
|
-
|
9834
|
+
borderRadius: 4,
|
9835
|
+
width: 260,
|
9836
|
+
height: 86,
|
9837
|
+
padding: 4,
|
9838
|
+
backgroundColor: 'rgba(255,255,255,0.75)'
|
9252
9839
|
}
|
9253
9840
|
},
|
9254
9841
|
w: 100,
|
@@ -9358,8 +9945,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9358
9945
|
videoRef.current.muted = muted;
|
9359
9946
|
}, [muted]);
|
9360
9947
|
const handleVideoStart = useCallback(() => {
|
9361
|
-
var _a;
|
9362
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
9948
|
+
var _a, _b;
|
9949
|
+
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)
|
9950
|
+
return;
|
9951
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
9363
9952
|
}, []);
|
9364
9953
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
9365
9954
|
const handlePlaying = useCallback(() => {
|
@@ -9416,37 +10005,38 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9416
10005
|
});
|
9417
10006
|
}
|
9418
10007
|
setTimeout(() => {
|
9419
|
-
var _a;
|
9420
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
10008
|
+
var _a, _b;
|
10009
|
+
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)
|
10010
|
+
return;
|
10011
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
9421
10012
|
}, 0);
|
9422
10013
|
}, [index, bffEventReport, data, isLoad]);
|
9423
10014
|
const handleClickVideo = useCallback((type) => () => {
|
9424
|
-
var _a, _b, _c, _d, _e, _f
|
10015
|
+
var _a, _b, _c, _d, _e, _f;
|
10016
|
+
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)
|
10017
|
+
return;
|
9425
10018
|
if (!isLoad)
|
9426
10019
|
return;
|
9427
|
-
|
9428
|
-
((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
9429
|
-
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
9430
|
-
const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
|
10020
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
9431
10021
|
switch (type) {
|
9432
10022
|
case 'start':
|
9433
10023
|
if (!isPause)
|
9434
10024
|
return;
|
9435
|
-
(
|
10025
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
9436
10026
|
setIsPauseVideo(false);
|
9437
10027
|
break;
|
9438
10028
|
case 'pause':
|
9439
10029
|
if (isPause)
|
9440
10030
|
return;
|
9441
|
-
(
|
10031
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
|
9442
10032
|
setIsPauseVideo(true);
|
9443
10033
|
break;
|
9444
10034
|
default:
|
9445
10035
|
if (isPause) {
|
9446
|
-
(
|
10036
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
9447
10037
|
}
|
9448
10038
|
else {
|
9449
|
-
(
|
10039
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
9450
10040
|
}
|
9451
10041
|
setIsPauseVideo(!isPause);
|
9452
10042
|
break;
|
@@ -9477,14 +10067,16 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9477
10067
|
}
|
9478
10068
|
}, [data, index, bffEventReport]);
|
9479
10069
|
useEffect(() => {
|
9480
|
-
var _a, _b, _c;
|
10070
|
+
var _a, _b, _c, _d, _e, _f;
|
9481
10071
|
if (data.length <= 0)
|
9482
10072
|
return;
|
9483
10073
|
if (!videoRef.current)
|
9484
10074
|
return;
|
10075
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
9485
10076
|
setIsPauseVideo(false);
|
9486
10077
|
if (!isActive) {
|
9487
|
-
(
|
10078
|
+
if (!isPause && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.readyState) >= 2)
|
10079
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
9488
10080
|
return;
|
9489
10081
|
}
|
9490
10082
|
if (!videoRef.current.src) {
|
@@ -9507,10 +10099,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9507
10099
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
9508
10100
|
}
|
9509
10101
|
else {
|
10102
|
+
if (((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.readyState) < 2)
|
10103
|
+
return;
|
9510
10104
|
videoRef.current.play();
|
9511
10105
|
}
|
9512
|
-
(
|
9513
|
-
(
|
10106
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('canplay', handleLoadedMetadata);
|
10107
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
9514
10108
|
return () => {
|
9515
10109
|
var _a, _b;
|
9516
10110
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
|
@@ -9521,15 +10115,17 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
9521
10115
|
打开/关闭hashtag暂停/播放视频
|
9522
10116
|
*/
|
9523
10117
|
useEffect(() => {
|
9524
|
-
var _a, _b, _c;
|
9525
|
-
|
10118
|
+
var _a, _b, _c, _d;
|
10119
|
+
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)
|
10120
|
+
return;
|
10121
|
+
const isPause = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.paused;
|
9526
10122
|
if (!isActive)
|
9527
10123
|
return;
|
9528
10124
|
if (!isPause && openHashtag) {
|
9529
|
-
(
|
10125
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
9530
10126
|
}
|
9531
10127
|
else if (!openHashtag) {
|
9532
|
-
(
|
10128
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
9533
10129
|
}
|
9534
10130
|
}, [openHashtag, isActive]);
|
9535
10131
|
useEffect(() => {
|
@@ -9642,22 +10238,26 @@ const Picture = (props) => {
|
|
9642
10238
|
* @Author: lewinlu@chatlabs.com
|
9643
10239
|
* @Date: 2024-01-03 14:39:09
|
9644
10240
|
* @LastEditors: binruan@chatlabs.com
|
9645
|
-
* @LastEditTime: 2024-03-
|
10241
|
+
* @LastEditTime: 2024-03-25 15:08:11
|
9646
10242
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
9647
10243
|
*/
|
9648
10244
|
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
9649
10245
|
const { isActive } = useSwiperSlide();
|
9650
10246
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
10247
|
+
const [isLoad, setIsLoad] = useState(false);
|
9651
10248
|
useEffect(() => {
|
9652
|
-
if (
|
9653
|
-
|
9654
|
-
|
9655
|
-
|
10249
|
+
if (isLoad && isActive) {
|
10250
|
+
if (openHashtag) {
|
10251
|
+
onReportViewImageEnd(rec);
|
10252
|
+
}
|
10253
|
+
else {
|
10254
|
+
onViewImageStartEvent(index);
|
10255
|
+
}
|
9656
10256
|
}
|
9657
10257
|
else {
|
9658
|
-
|
10258
|
+
setIsLoad(true);
|
9659
10259
|
}
|
9660
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent]);
|
10260
|
+
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
9661
10261
|
if (!isActive) {
|
9662
10262
|
return React.createElement("img", { src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: { width, height, objectFit: 'cover' } });
|
9663
10263
|
}
|
@@ -9668,75 +10268,17 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
9668
10268
|
};
|
9669
10269
|
var PictureGroup$1 = memo(PictureGroup);
|
9670
10270
|
|
9671
|
-
/*
|
9672
|
-
* @Author: binruan@chatlabs.com
|
9673
|
-
* @Date: 2023-11-02 18:34:34
|
9674
|
-
* @LastEditors: binruan@chatlabs.com
|
9675
|
-
* @LastEditTime: 2024-03-12 12:08:55
|
9676
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\ProductInfo\index.tsx
|
9677
|
-
*
|
9678
|
-
*/
|
9679
|
-
const ProductInfo = ({ data, height, width, viewTime, tipText }) => {
|
9680
|
-
var _a, _b;
|
9681
|
-
const product = data === null || data === void 0 ? void 0 : data.product;
|
9682
|
-
const cta = (_a = data === null || data === void 0 ? void 0 : data.product) === null || _a === void 0 ? void 0 : _a.bindCta;
|
9683
|
-
const [showModal, setShowModal] = useState(false);
|
9684
|
-
const { jumpToWeb } = useEventReport();
|
9685
|
-
const priceText = useMemo(() => {
|
9686
|
-
var _a, _b, _c, _d, _e;
|
9687
|
-
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
9688
|
-
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', {
|
9689
|
-
minimumFractionDigits: 0
|
9690
|
-
})) !== null && _e !== void 0 ? _e : ''}`;
|
9691
|
-
}
|
9692
|
-
else {
|
9693
|
-
return '$7,000';
|
9694
|
-
}
|
9695
|
-
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
9696
|
-
const handleLInk = (link) => {
|
9697
|
-
if (link) {
|
9698
|
-
jumpToWeb(data, product, cta);
|
9699
|
-
window.location.href = window.getJointUtmLink(link);
|
9700
|
-
}
|
9701
|
-
};
|
9702
|
-
return (React.createElement("div", { style: { height, width: '100%' } },
|
9703
|
-
React.createElement(Swiper, { height: height * 0.5, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
9704
|
-
delay: 3000
|
9705
|
-
} }, (_b = product === null || product === void 0 ? void 0 : product.homePage) === null || _b === void 0 ? void 0 : _b.map((src) => {
|
9706
|
-
return (React.createElement(SwiperSlide, { key: src },
|
9707
|
-
React.createElement("div", { style: {
|
9708
|
-
overflow: 'hidden',
|
9709
|
-
width,
|
9710
|
-
height: height * 0.5
|
9711
|
-
} },
|
9712
|
-
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
9713
|
-
})),
|
9714
|
-
React.createElement("div", { className: 'product-info' },
|
9715
|
-
React.createElement("div", { className: 'collection' }, product === null || product === void 0 ? void 0 : product.collection),
|
9716
|
-
React.createElement("div", { className: 'title' }, product === null || product === void 0 ? void 0 : product.title),
|
9717
|
-
React.createElement("div", { className: 'price' }, priceText),
|
9718
|
-
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 }),
|
9719
|
-
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)),
|
9720
|
-
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
9721
|
-
React.createElement("div", { className: 'modal-collection' }, product === null || product === void 0 ? void 0 : product.collection),
|
9722
|
-
React.createElement("div", { className: 'modal-title' }, product === null || product === void 0 ? void 0 : product.title),
|
9723
|
-
React.createElement("div", { className: 'modal-price' }, priceText),
|
9724
|
-
React.createElement("div", { className: 'modal-info' }, product === null || product === void 0 ? void 0 : product.info),
|
9725
|
-
(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)))));
|
9726
|
-
};
|
9727
|
-
var ProductInfo$1 = React.memo(ProductInfo);
|
9728
|
-
|
9729
10271
|
/*
|
9730
10272
|
* @Author: binruan@chatlabs.com
|
9731
10273
|
* @Date: 2024-01-15 19:03:09
|
9732
10274
|
* @LastEditors: binruan@chatlabs.com
|
9733
|
-
* @LastEditTime: 2024-03-
|
10275
|
+
* @LastEditTime: 2024-03-25 10:42:07
|
9734
10276
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
9735
10277
|
*
|
9736
10278
|
*/
|
9737
10279
|
const Hashtag = ({ tags, itemId, itemType, index, rec }) => {
|
9738
10280
|
const [isShowMore, setIsShowMore] = useState(false);
|
9739
|
-
const { setWaterFallData, setOpenHashtag,
|
10281
|
+
const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
|
9740
10282
|
const handleClickTag = (data) => {
|
9741
10283
|
if (!waterFallData) {
|
9742
10284
|
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(index);
|
@@ -10197,17 +10739,29 @@ const WaterFall = () => {
|
|
10197
10739
|
};
|
10198
10740
|
var WaterFall$1 = memo(WaterFall);
|
10199
10741
|
|
10742
|
+
const Nudge = ({ nudge }) => {
|
10743
|
+
return (React.createElement("div", { hidden: !(nudge === null || nudge === void 0 ? void 0 : nudge.isOpen), className: 'clc-sxp-bottom-nudge', style: {
|
10744
|
+
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
10745
|
+
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
10746
|
+
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
10747
|
+
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
10748
|
+
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
10749
|
+
} },
|
10750
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
10751
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)));
|
10752
|
+
};
|
10753
|
+
|
10200
10754
|
/*
|
10201
10755
|
* @Author: binruan@chatlabs.com
|
10202
10756
|
* @Date: 2024-01-15 19:03:09
|
10203
10757
|
* @LastEditors: binruan@chatlabs.com
|
10204
|
-
* @LastEditTime: 2024-
|
10758
|
+
* @LastEditTime: 2024-04-02 10:42:58
|
10205
10759
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
10206
10760
|
*
|
10207
10761
|
*/
|
10208
|
-
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, _schema }) => {
|
10762
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema }) => {
|
10209
10763
|
var _a, _b, _c, _d;
|
10210
|
-
useEditor();
|
10764
|
+
const { schema } = useEditor();
|
10211
10765
|
const [activeIndex, setActiveIndex] = useState(0);
|
10212
10766
|
const viewImageStartTime = useRef(0);
|
10213
10767
|
const [isInit, setIsInit] = useState(false);
|
@@ -10359,49 +10913,39 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
10359
10913
|
return null;
|
10360
10914
|
}, [globalConfig]);
|
10361
10915
|
const renderContent = useCallback((rec, index) => {
|
10362
|
-
var _a, _b;
|
10916
|
+
var _a, _b, _c, _d;
|
10363
10917
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
10364
10918
|
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex }));
|
10365
10919
|
}
|
10366
10920
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
10367
10921
|
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 }));
|
10368
10922
|
}
|
10369
|
-
if (rec.product) {
|
10370
|
-
|
10371
|
-
|
10372
|
-
|
10373
|
-
|
10374
|
-
|
10375
|
-
|
10376
|
-
|
10377
|
-
// viewTime={viewTime.current}
|
10378
|
-
// rec={rec}
|
10379
|
-
// isPost={true}
|
10380
|
-
// style={{ height: '100%', overflow: 'auto' }}
|
10381
|
-
// />
|
10382
|
-
// );
|
10383
|
-
case 'CommodityDetail':
|
10384
|
-
return (React.createElement(ProductInfo$1, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
10385
|
-
default:
|
10386
|
-
return (React.createElement(ProductInfo$1, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
10387
|
-
}
|
10923
|
+
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) {
|
10924
|
+
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
|
10925
|
+
var _a, _b, _c, _d, _e, _f;
|
10926
|
+
const Component = withBindDataSource(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
|
10927
|
+
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' },
|
10928
|
+
// ProductInfo
|
10929
|
+
data: rec, height: height, width: containerWidth })));
|
10930
|
+
});
|
10388
10931
|
}
|
10389
10932
|
return null;
|
10390
|
-
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText]);
|
10933
|
+
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText, resolver, schema]);
|
10391
10934
|
const renderBottom = useCallback((rec, index) => {
|
10392
10935
|
var _a, _b, _c, _d, _e, _f, _g;
|
10393
10936
|
if (rec.video) {
|
10394
10937
|
return (React.createElement(React.Fragment, null,
|
10395
10938
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
10396
10939
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
10940
|
+
React.createElement(Nudge, { nudge: nudge }),
|
10397
10941
|
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
10398
10942
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
10399
10943
|
React.createElement("div", { className: 'clc-sxp-bottom-text' },
|
10400
|
-
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 })),
|
10944
|
+
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 })),
|
10401
10945
|
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 }))));
|
10402
10946
|
}
|
10403
10947
|
return null;
|
10404
|
-
}, [descStyle, activeIndex, tempMap, resolver, tipText]);
|
10948
|
+
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge]);
|
10405
10949
|
const renderLikeButton = useCallback((rec) => {
|
10406
10950
|
var _a, _b;
|
10407
10951
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
@@ -10480,6 +11024,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
10480
11024
|
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
|
10481
11025
|
}
|
10482
11026
|
};
|
11027
|
+
useEffect(() => {
|
11028
|
+
const item = data[activeIndex];
|
11029
|
+
if (openHashtag)
|
11030
|
+
handleReportProductView(item);
|
11031
|
+
}, [openHashtag, data, activeIndex]);
|
10483
11032
|
const handleViewImageStartEvent = (activeIndex) => {
|
10484
11033
|
var _a, _b, _c, _d, _e, _f;
|
10485
11034
|
const item = data[activeIndex];
|
@@ -10586,12 +11135,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
10586
11135
|
* @Author: binruan@chatlabs.com
|
10587
11136
|
* @Date: 2023-10-31 10:56:01
|
10588
11137
|
* @LastEditors: binruan@chatlabs.com
|
10589
|
-
* @LastEditTime: 2024-
|
11138
|
+
* @LastEditTime: 2024-04-02 10:31:51
|
10590
11139
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
10591
11140
|
*
|
10592
11141
|
*/
|
10593
11142
|
const Popup = () => {
|
10594
|
-
const { schema, resolver, popup } = useEditor();
|
11143
|
+
const { schema, resolver, popup, popupAni } = useEditor();
|
10595
11144
|
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
10596
11145
|
const { productView } = useEventReport();
|
10597
11146
|
const [visible, setVisible] = useState(false);
|
@@ -10614,7 +11163,7 @@ const Popup = () => {
|
|
10614
11163
|
}, [popup]);
|
10615
11164
|
const handleClose = () => {
|
10616
11165
|
var _a, _b, _c;
|
10617
|
-
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current <
|
11166
|
+
if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < (popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration)) {
|
10618
11167
|
return;
|
10619
11168
|
}
|
10620
11169
|
setVisible(false);
|
@@ -10627,7 +11176,7 @@ const Popup = () => {
|
|
10627
11176
|
setTimeout(() => {
|
10628
11177
|
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
10629
11178
|
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
10630
|
-
},
|
11179
|
+
}, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
|
10631
11180
|
};
|
10632
11181
|
const renderPopupDetail = useMemo(() => {
|
10633
11182
|
var _a, _b, _c;
|
@@ -10649,7 +11198,7 @@ const Popup = () => {
|
|
10649
11198
|
* @Author: binruan@chatlabs.com
|
10650
11199
|
* @Date: 2024-01-15 19:03:09
|
10651
11200
|
* @LastEditors: binruan@chatlabs.com
|
10652
|
-
* @LastEditTime: 2024-03-
|
11201
|
+
* @LastEditTime: 2024-03-25 17:24:59
|
10653
11202
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
10654
11203
|
*
|
10655
11204
|
*/
|
@@ -10665,7 +11214,7 @@ const RESOLVER = {};
|
|
10665
11214
|
Object.values(_materials_).forEach((v) => {
|
10666
11215
|
RESOLVER[v.extend.type] = v;
|
10667
11216
|
});
|
10668
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage }) => {
|
11217
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain }) => {
|
10669
11218
|
var _a, _b, _c, _d, _e, _f;
|
10670
11219
|
const utmVal = useMemo(() => {
|
10671
11220
|
var _a;
|
@@ -10673,7 +11222,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
10673
11222
|
return searchParams;
|
10674
11223
|
}, []);
|
10675
11224
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
10676
|
-
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 }) => {
|
11225
|
+
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 }) => {
|
10677
11226
|
var _a;
|
10678
11227
|
return (React.createElement(React.Fragment, null,
|
10679
11228
|
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 })),
|