@fonixtree/magic-design 2.0.32 → 2.0.35
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/es/common/AffiliateProductModal/index.js +582 -0
- package/es/common/AffiliateProductModal/index.less +146 -0
- package/es/common/ProductModal/index.js +1 -2
- package/es/common/ProductSource/index.js +42 -10
- package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-Balance2.svg +9 -0
- package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-Koin.svg +40 -0
- package/es/composite-comp/common/components/AffiliateProductItem/index.js +175 -0
- package/es/composite-comp/common/components/AffiliateProductItem/index.less +107 -0
- package/es/composite-comp/common/components/ProductItem/index.js +8 -6
- package/es/composite-comp/common/components/ProductItem/index.less +28 -22
- package/es/composite-comp/dito/components/AffiliateRecommend/defaultJSON.js +243 -0
- package/es/composite-comp/dito/components/AffiliateRecommend/index.js +90 -0
- package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +656 -0
- package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +76 -0
- package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.js +725 -0
- package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.less +124 -0
- package/es/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
- package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +102 -0
- package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
- package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +145 -0
- package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +16 -0
- package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/index.js +141 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +10 -9
- package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +431 -0
- package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.js +214 -0
- package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.less +15 -0
- package/es/constants/component-types.js +9 -3
- package/es/constants/index.js +4 -0
- package/es/core/Designer/ConfigPanel/index.js +7 -2
- package/es/core/Designer/LeftTitle/index.js +1 -1
- package/es/core/Renderer/index.js +20 -21
- package/es/meta-comp/components/Text/index.js +16 -0
- package/es/utils/businessUtil.js +6 -1
- package/lib/common/AffiliateProductModal/index.js +582 -0
- package/lib/common/AffiliateProductModal/index.less +146 -0
- package/lib/common/ProductModal/index.js +1 -2
- package/lib/common/ProductSource/index.js +42 -10
- package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-Balance2.svg +9 -0
- package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-Koin.svg +40 -0
- package/lib/composite-comp/common/components/AffiliateProductItem/index.js +175 -0
- package/lib/composite-comp/common/components/AffiliateProductItem/index.less +107 -0
- package/lib/composite-comp/common/components/ProductItem/index.js +8 -6
- package/lib/composite-comp/common/components/ProductItem/index.less +28 -22
- package/lib/composite-comp/dito/components/AffiliateRecommend/defaultJSON.js +243 -0
- package/lib/composite-comp/dito/components/AffiliateRecommend/index.js +90 -0
- package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +656 -0
- package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +76 -0
- package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.js +725 -0
- package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.less +124 -0
- package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
- package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +102 -0
- package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +145 -0
- package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +16 -0
- package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/index.js +141 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +10 -9
- package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +431 -0
- package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.js +214 -0
- package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.less +15 -0
- package/lib/constants/component-types.js +9 -3
- package/lib/constants/index.js +4 -0
- package/lib/core/Designer/ConfigPanel/index.js +7 -2
- package/lib/core/Designer/LeftTitle/index.js +1 -1
- package/lib/core/Renderer/index.js +20 -21
- package/lib/meta-comp/components/Text/index.js +16 -0
- package/lib/utils/businessUtil.js +6 -1
- package/package.json +1 -1
|
@@ -39,6 +39,8 @@ var _SignBoard = _interopRequireDefault(require("../composite-comp/dito/componen
|
|
|
39
39
|
|
|
40
40
|
var _Recommend = _interopRequireDefault(require("../composite-comp/dito/components/Recommend"));
|
|
41
41
|
|
|
42
|
+
var _AffiliateRecommend = _interopRequireDefault(require("../composite-comp/dito/components/AffiliateRecommend"));
|
|
43
|
+
|
|
42
44
|
var _MobileNavigation = _interopRequireDefault(require("../composite-comp/dito/components/MobileNavigation"));
|
|
43
45
|
|
|
44
46
|
var _PcNavigation = _interopRequireDefault(require("../composite-comp/dito/components/PcNavigation"));
|
|
@@ -77,6 +79,8 @@ var _SignBoardConfig = _interopRequireDefault(require("../composite-comp/dito/co
|
|
|
77
79
|
|
|
78
80
|
var _RecommendConfig = _interopRequireDefault(require("../composite-comp/dito/config-panels/RecommendConfig"));
|
|
79
81
|
|
|
82
|
+
var _AffiliateRecommendConfig = _interopRequireDefault(require("../composite-comp/dito/config-panels/AffiliateRecommendConfig"));
|
|
83
|
+
|
|
80
84
|
var _MobileNavigationConfig = _interopRequireDefault(require("../composite-comp/dito/config-panels/MobileNavigationConfig"));
|
|
81
85
|
|
|
82
86
|
var _PcNavigationConfig = _interopRequireDefault(require("../composite-comp/dito/config-panels/PcNavigationConfig"));
|
|
@@ -101,6 +105,8 @@ var _WalletSecondConfig = _interopRequireDefault(require("../composite-comp/bol/
|
|
|
101
105
|
|
|
102
106
|
var _RecommendSecondConfig = _interopRequireDefault(require("../composite-comp/dito/second-config-panels/RecommendSecondConfig"));
|
|
103
107
|
|
|
108
|
+
var _AffiliateRecommendSecondConfig = _interopRequireDefault(require("../composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig"));
|
|
109
|
+
|
|
104
110
|
var _MobileNavigationSecondConfig = _interopRequireDefault(require("../composite-comp/dito/second-config-panels/MobileNavigationSecondConfig"));
|
|
105
111
|
|
|
106
112
|
var _PcNavigationSecondConfig = _interopRequireDefault(require("../composite-comp/dito/second-config-panels/PcNavigationSecondConfig"));
|
|
@@ -113,17 +119,17 @@ var _a, _b, _c; // 组件
|
|
|
113
119
|
/**
|
|
114
120
|
* 渲染组件索引
|
|
115
121
|
*/
|
|
116
|
-
var componentMap = (_a = {}, _a[_Banner["default"].type] = _Banner["default"], _a[_Video["default"].type] = _Video["default"], _a[_Text["default"].type] = _Text["default"], _a[_FlashDeal["default"].type] = _FlashDeal["default"], _a[_SearchBar["default"].type] = _SearchBar["default"], _a[_SignBoard["default"].type] = _SignBoard["default"], _a[_ImageText["default"].type] = _ImageText["default"], _a[_Recommend["default"].type] = _Recommend["default"], _a[_MobileNavigation["default"].type] = _MobileNavigation["default"], _a[_PcNavigation["default"].type] = _PcNavigation["default"], _a[_Divider["default"].type] = _Divider["default"], _a[_ImageGallery["default"].type] = _ImageGallery["default"], _a[_Newsletter["default"].type] = _Newsletter["default"], _a[_Carousel["default"].type] = _Carousel["default"], _a[_Button["default"].type] = _Button["default"], _a[_Tag["default"].type] = _Tag["default"], _a[_Wallet["default"].type] = _Wallet["default"], _a[_CustomCode["default"].type] = _CustomCode["default"], _a[_Location["default"].type] = _Location["default"], _a);
|
|
122
|
+
var componentMap = (_a = {}, _a[_Banner["default"].type] = _Banner["default"], _a[_Video["default"].type] = _Video["default"], _a[_Text["default"].type] = _Text["default"], _a[_FlashDeal["default"].type] = _FlashDeal["default"], _a[_SearchBar["default"].type] = _SearchBar["default"], _a[_SignBoard["default"].type] = _SignBoard["default"], _a[_ImageText["default"].type] = _ImageText["default"], _a[_Recommend["default"].type] = _Recommend["default"], _a[_AffiliateRecommend["default"].type] = _AffiliateRecommend["default"], _a[_MobileNavigation["default"].type] = _MobileNavigation["default"], _a[_PcNavigation["default"].type] = _PcNavigation["default"], _a[_Divider["default"].type] = _Divider["default"], _a[_ImageGallery["default"].type] = _ImageGallery["default"], _a[_Newsletter["default"].type] = _Newsletter["default"], _a[_Carousel["default"].type] = _Carousel["default"], _a[_Button["default"].type] = _Button["default"], _a[_Tag["default"].type] = _Tag["default"], _a[_Wallet["default"].type] = _Wallet["default"], _a[_CustomCode["default"].type] = _CustomCode["default"], _a[_Location["default"].type] = _Location["default"], _a);
|
|
117
123
|
/**
|
|
118
124
|
* 一级配置面板索引
|
|
119
125
|
*/
|
|
120
126
|
|
|
121
127
|
exports.componentMap = componentMap;
|
|
122
|
-
var configPanelMap = (_b = {}, _b[_Banner["default"].type] = _BannerConfig["default"], _b[_Video["default"].type] = _VideoConfig["default"], _b[_Text["default"].type] = _TextCompConfig["default"], _b[_FlashDeal["default"].type] = _FlashDealConfig["default"], _b[_SearchBar["default"].type] = _SearchBarConfig["default"], _b[_SignBoard["default"].type] = _SignBoardConfig["default"], _b[_ImageText["default"].type] = _ImageTextConfig["default"], _b[_Recommend["default"].type] = _RecommendConfig["default"], _b[_MobileNavigation["default"].type] = _MobileNavigationConfig["default"], _b[_PcNavigation["default"].type] = _PcNavigationConfig["default"], _b[_Divider["default"].type] = _DividerConfig["default"], _b[_ImageGallery["default"].type] = _ImageGalleryConfig["default"], _b[_Newsletter["default"].type] = _NewsletterConfig["default"], _b[_Carousel["default"].type] = _CarouselConfig["default"], _b[_Button["default"].type] = _ButtonCompConfig["default"], _b[_Tag["default"].type] = _TagCompConfig["default"], _b[_Wallet["default"].type] = _WalletConfig["default"], _b[_CustomCode["default"].type] = _CustomCodeConfig["default"], _b[_Location["default"].type] = _LocationConfig["default"], _b);
|
|
128
|
+
var configPanelMap = (_b = {}, _b[_Banner["default"].type] = _BannerConfig["default"], _b[_Video["default"].type] = _VideoConfig["default"], _b[_Text["default"].type] = _TextCompConfig["default"], _b[_FlashDeal["default"].type] = _FlashDealConfig["default"], _b[_SearchBar["default"].type] = _SearchBarConfig["default"], _b[_SignBoard["default"].type] = _SignBoardConfig["default"], _b[_ImageText["default"].type] = _ImageTextConfig["default"], _b[_Recommend["default"].type] = _RecommendConfig["default"], _b[_AffiliateRecommend["default"].type] = _AffiliateRecommendConfig["default"], _b[_MobileNavigation["default"].type] = _MobileNavigationConfig["default"], _b[_PcNavigation["default"].type] = _PcNavigationConfig["default"], _b[_Divider["default"].type] = _DividerConfig["default"], _b[_ImageGallery["default"].type] = _ImageGalleryConfig["default"], _b[_Newsletter["default"].type] = _NewsletterConfig["default"], _b[_Carousel["default"].type] = _CarouselConfig["default"], _b[_Button["default"].type] = _ButtonCompConfig["default"], _b[_Tag["default"].type] = _TagCompConfig["default"], _b[_Wallet["default"].type] = _WalletConfig["default"], _b[_CustomCode["default"].type] = _CustomCodeConfig["default"], _b[_Location["default"].type] = _LocationConfig["default"], _b);
|
|
123
129
|
/**
|
|
124
130
|
* 二级配置面板索引
|
|
125
131
|
*/
|
|
126
132
|
|
|
127
133
|
exports.configPanelMap = configPanelMap;
|
|
128
|
-
var secondConfigPanelMap = (_c = {}, _c[_Banner["default"].type] = _BannerSecondConfig["default"], _c[_Video["default"].type] = _VideoSecondConfig["default"], _c[_Text["default"].type] = _TextSecondConfig["default"], _c[_ImageText["default"].type] = _ImageTextSecondConfig["default"], _c[_Recommend["default"].type] = _RecommendSecondConfig["default"], _c[_MobileNavigation["default"].type] = _MobileNavigationSecondConfig["default"], _c[_PcNavigation["default"].type] = _PcNavigationSecondConfig["default"], _c[_Carousel["default"].type] = _CarouselSecondConfig["default"], _c[_ImageGallery["default"].type] = _ImageGallerySecondConfig["default"], _c[_Tag["default"].type] = _TagSecondConfig["default"], _c[_Button["default"].type] = _ButtonSecondConfig["default"], _c[_Wallet["default"].type] = _WalletSecondConfig["default"], _c);
|
|
134
|
+
var secondConfigPanelMap = (_c = {}, _c[_Banner["default"].type] = _BannerSecondConfig["default"], _c[_Video["default"].type] = _VideoSecondConfig["default"], _c[_Text["default"].type] = _TextSecondConfig["default"], _c[_ImageText["default"].type] = _ImageTextSecondConfig["default"], _c[_Recommend["default"].type] = _RecommendSecondConfig["default"], _c[_AffiliateRecommend["default"].type] = _AffiliateRecommendSecondConfig["default"], _c[_MobileNavigation["default"].type] = _MobileNavigationSecondConfig["default"], _c[_PcNavigation["default"].type] = _PcNavigationSecondConfig["default"], _c[_Carousel["default"].type] = _CarouselSecondConfig["default"], _c[_ImageGallery["default"].type] = _ImageGallerySecondConfig["default"], _c[_Tag["default"].type] = _TagSecondConfig["default"], _c[_Button["default"].type] = _ButtonSecondConfig["default"], _c[_Wallet["default"].type] = _WalletSecondConfig["default"], _c);
|
|
129
135
|
exports.secondConfigPanelMap = secondConfigPanelMap;
|
package/lib/constants/index.js
CHANGED
|
@@ -113,6 +113,8 @@ var getSecondConfigName = function getSecondConfigName(selectedNode, clickedGrou
|
|
|
113
113
|
break;
|
|
114
114
|
|
|
115
115
|
case 'RECOMMEND':
|
|
116
|
+
case 'AFFILIATE_RECOMMEND':
|
|
117
|
+
// console.log('RECOMMEND ---panelProps.groupName.text', panelProps.groupName.text);
|
|
116
118
|
groupName = panelProps.groupName.text;
|
|
117
119
|
break;
|
|
118
120
|
|
|
@@ -374,8 +376,11 @@ function (_super) {
|
|
|
374
376
|
onClick: this.onSecConfigBack,
|
|
375
377
|
type: "icon"
|
|
376
378
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
377
|
-
className: "title"
|
|
378
|
-
|
|
379
|
+
className: "title",
|
|
380
|
+
dangerouslySetInnerHTML: {
|
|
381
|
+
__html: getSecondConfigName(selectedNode, clickedGroup)
|
|
382
|
+
}
|
|
383
|
+
})), this.getSecondConfigInstance()));
|
|
379
384
|
};
|
|
380
385
|
|
|
381
386
|
return ConfigPanel;
|
|
@@ -58,38 +58,36 @@ var Renderer = function Renderer(props) {
|
|
|
58
58
|
outputType = props.outputType,
|
|
59
59
|
noSetWindow = props.noSetWindow;
|
|
60
60
|
|
|
61
|
+
var _a = (0, _react.useState)([]),
|
|
62
|
+
floors = _a[0],
|
|
63
|
+
setFloors = _a[1];
|
|
64
|
+
|
|
61
65
|
if (!noSetWindow) {
|
|
62
66
|
setDesignConfig(props);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
window.magicDesignPageData = pageData;
|
|
66
|
-
var pageBackground = window.magicDesign.pageBackground;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
+
var pageBackground = window.magicDesign.pageBackground;
|
|
71
|
+
(0, _react.useEffect)(function () {
|
|
72
|
+
console.log('----pageData change', pageData);
|
|
73
|
+
var filterData = [];
|
|
70
74
|
|
|
71
75
|
if (pageData && pageData.childNodes && pageData.childNodes.length) {
|
|
72
|
-
|
|
76
|
+
filterData = pageData.childNodes.filter(function (node) {
|
|
73
77
|
return (0, _coreUtil.isActiveFloor)(node.activeTerminal);
|
|
74
78
|
});
|
|
75
|
-
}
|
|
79
|
+
} // 首页组建分批渲染按5个一组
|
|
76
80
|
|
|
77
|
-
return source;
|
|
78
|
-
};
|
|
79
81
|
|
|
82
|
+
setFloors(filterData.slice(0, 5));
|
|
83
|
+
setTimeout(function () {
|
|
84
|
+
setFloors(filterData.slice(0, 10));
|
|
85
|
+
setTimeout(function () {
|
|
86
|
+
setFloors(filterData);
|
|
87
|
+
}, 200);
|
|
88
|
+
}, 200);
|
|
89
|
+
}, [pageData]);
|
|
80
90
|
(0, _react.useEffect)(function () {
|
|
81
|
-
// const data = await fishFetch('/h5/ga/mediaid', {}, 'GET');
|
|
82
|
-
(0, _commonUtil.importAsync)('https://www.googletagmanager.com/gtag/js?id=G-7B9GSSLVX3', 'js').then(function () {
|
|
83
|
-
window.dataLayer = window.dataLayer || [];
|
|
84
|
-
|
|
85
|
-
function gtag() {
|
|
86
|
-
dataLayer.push(arguments);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
gtag('js', new Date());
|
|
90
|
-
gtag('config', 'G-7B9GSSLVX3');
|
|
91
|
-
window.gtag = gtag;
|
|
92
|
-
});
|
|
93
91
|
setTimeout(function () {
|
|
94
92
|
var _a;
|
|
95
93
|
|
|
@@ -103,10 +101,11 @@ var Renderer = function Renderer(props) {
|
|
|
103
101
|
className: "render_wrap",
|
|
104
102
|
magic_design: "",
|
|
105
103
|
style: {
|
|
104
|
+
height: '100%',
|
|
106
105
|
background: pageBackground,
|
|
107
106
|
overflow: 'auto'
|
|
108
107
|
}
|
|
109
|
-
},
|
|
108
|
+
}, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
|
|
110
109
|
var Clazz = _componentTypes.componentMap[nodeData.type];
|
|
111
110
|
|
|
112
111
|
if (!Clazz) {
|
|
@@ -102,6 +102,8 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
|
102
102
|
|
|
103
103
|
return r;
|
|
104
104
|
};
|
|
105
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
106
|
+
|
|
105
107
|
/* eslint-disable react/no-danger */
|
|
106
108
|
|
|
107
109
|
|
|
@@ -148,6 +150,16 @@ function (_super) {
|
|
|
148
150
|
placeholder: '请输入内容...'
|
|
149
151
|
});
|
|
150
152
|
|
|
153
|
+
var onInputChange = function onInputChange() {
|
|
154
|
+
_this.props.onTextInput(_this.quillRef.root.innerHTML);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
_this.quillRef.on('text-change', onInputChange);
|
|
158
|
+
|
|
159
|
+
_this.destroy = function () {
|
|
160
|
+
_this.quillRef.off('text-change', onInputChange);
|
|
161
|
+
};
|
|
162
|
+
|
|
151
163
|
_mobx.frameStore.setState({
|
|
152
164
|
textModalState: {
|
|
153
165
|
quillRef: null
|
|
@@ -209,6 +221,10 @@ function (_super) {
|
|
|
209
221
|
return true;
|
|
210
222
|
};
|
|
211
223
|
|
|
224
|
+
Text.prototype.componentWillUnmount = function () {
|
|
225
|
+
this.destroy && this.destroy();
|
|
226
|
+
};
|
|
227
|
+
|
|
212
228
|
Text.prototype.render = function () {
|
|
213
229
|
var _a = this.props,
|
|
214
230
|
data = _a.data,
|
|
@@ -33,7 +33,12 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
33
33
|
switch (type) {
|
|
34
34
|
// 商品详情
|
|
35
35
|
case _constants.urlTypeMap.PRODUCT_DETAIL_PAGE:
|
|
36
|
-
|
|
36
|
+
if (offerId) {
|
|
37
|
+
link = "/product/detail/" + offerId + "?productId=" + (productId !== null && productId !== void 0 ? productId : '');
|
|
38
|
+
} else {
|
|
39
|
+
link = "/product/detail/" + productId;
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
params = {
|
|
38
43
|
action: 'jump',
|
|
39
44
|
params: {
|