@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.
Files changed (69) hide show
  1. package/es/common/AffiliateProductModal/index.js +582 -0
  2. package/es/common/AffiliateProductModal/index.less +146 -0
  3. package/es/common/ProductModal/index.js +1 -2
  4. package/es/common/ProductSource/index.js +42 -10
  5. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-Balance2.svg +9 -0
  6. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-Koin.svg +40 -0
  7. package/es/composite-comp/common/components/AffiliateProductItem/index.js +175 -0
  8. package/es/composite-comp/common/components/AffiliateProductItem/index.less +107 -0
  9. package/es/composite-comp/common/components/ProductItem/index.js +8 -6
  10. package/es/composite-comp/common/components/ProductItem/index.less +28 -22
  11. package/es/composite-comp/dito/components/AffiliateRecommend/defaultJSON.js +243 -0
  12. package/es/composite-comp/dito/components/AffiliateRecommend/index.js +90 -0
  13. package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +656 -0
  14. package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +76 -0
  15. package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.js +725 -0
  16. package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.less +124 -0
  17. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
  18. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +102 -0
  19. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  20. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +145 -0
  21. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +16 -0
  22. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  23. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/index.js +141 -0
  24. package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +10 -9
  25. package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +431 -0
  26. package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.js +214 -0
  27. package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.less +15 -0
  28. package/es/constants/component-types.js +9 -3
  29. package/es/constants/index.js +4 -0
  30. package/es/core/Designer/ConfigPanel/index.js +7 -2
  31. package/es/core/Designer/LeftTitle/index.js +1 -1
  32. package/es/core/Renderer/index.js +20 -21
  33. package/es/meta-comp/components/Text/index.js +16 -0
  34. package/es/utils/businessUtil.js +6 -1
  35. package/lib/common/AffiliateProductModal/index.js +582 -0
  36. package/lib/common/AffiliateProductModal/index.less +146 -0
  37. package/lib/common/ProductModal/index.js +1 -2
  38. package/lib/common/ProductSource/index.js +42 -10
  39. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-Balance2.svg +9 -0
  40. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-Koin.svg +40 -0
  41. package/lib/composite-comp/common/components/AffiliateProductItem/index.js +175 -0
  42. package/lib/composite-comp/common/components/AffiliateProductItem/index.less +107 -0
  43. package/lib/composite-comp/common/components/ProductItem/index.js +8 -6
  44. package/lib/composite-comp/common/components/ProductItem/index.less +28 -22
  45. package/lib/composite-comp/dito/components/AffiliateRecommend/defaultJSON.js +243 -0
  46. package/lib/composite-comp/dito/components/AffiliateRecommend/index.js +90 -0
  47. package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +656 -0
  48. package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +76 -0
  49. package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.js +725 -0
  50. package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.less +124 -0
  51. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
  52. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +102 -0
  53. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  54. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +145 -0
  55. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +16 -0
  56. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  57. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/index.js +141 -0
  58. package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +10 -9
  59. package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +431 -0
  60. package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.js +214 -0
  61. package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.less +15 -0
  62. package/lib/constants/component-types.js +9 -3
  63. package/lib/constants/index.js +4 -0
  64. package/lib/core/Designer/ConfigPanel/index.js +7 -2
  65. package/lib/core/Designer/LeftTitle/index.js +1 -1
  66. package/lib/core/Renderer/index.js +20 -21
  67. package/lib/meta-comp/components/Text/index.js +16 -0
  68. package/lib/utils/businessUtil.js +6 -1
  69. package/package.json +1 -1
@@ -7,13 +7,7 @@
7
7
  cursor: pointer;
8
8
  position: relative;
9
9
 
10
- .sold-count {
11
- color: #7b7b7b;
12
- font-size: 12px;
13
- position: absolute;
14
- right: 8px;
15
- bottom: 8px;
16
- }
10
+
17
11
 
18
12
  .img-wrap {
19
13
  position: relative;
@@ -59,28 +53,40 @@
59
53
  text-overflow: ellipsis;
60
54
  }
61
55
 
62
- .old-price-wrap {
56
+ .price-sold-wrap {
63
57
  display: flex;
64
58
  margin-top: 0px;
65
- align-items: baseline;
59
+ align-items: center;
66
60
  white-space: nowrap;
67
61
  overflow: hidden;
68
62
  text-overflow: ellipsis;
69
-
70
- .discount {
71
- margin-right: 3px;
72
- font-family: 'Montserrat';
73
- font-style: normal;
74
- font-weight: 700;
75
- font-size: 8px;
76
- line-height: 15px;
77
- color: #fff;
78
- padding: 0 4px;
79
- background-color: #CE1126;
63
+ flex-wrap: wrap;
64
+ line-height: 15px;
65
+ .old-price-wrap {
66
+ display: flex;
67
+ line-height: 13px;
68
+ .discount {
69
+ margin-right: 3px;
70
+ font-family: 'Montserrat';
71
+ font-style: normal;
72
+ font-weight: 700;
73
+ font-size: 8px;
74
+ line-height: 15px;
75
+ color: #fff;
76
+ padding: 0 4px;
77
+ background-color: #CE1126;
78
+ }
79
+ .old-price {
80
+ text-decoration: line-through;
81
+ width: fit-content;
82
+ }
80
83
  }
81
84
 
82
- .old-price {
83
- text-decoration: line-through;
85
+ .sold-count {
86
+ color: #7b7b7b;
87
+ font-size: 12px;
88
+ text-align: right ;
89
+ flex-grow: 1;
84
90
  }
85
91
  }
86
92
 
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.recommendGroupSourceJSON = exports.getDefaultJSON = void 0;
7
+
8
+ var _uuid = require("uuid");
9
+
10
+ var recommendGroupSourceJSON = function recommendGroupSourceJSON(parentId, logo, text) {
11
+ var groupId = (0, _uuid.v4)();
12
+ var imageId = (0, _uuid.v4)();
13
+ var groupNameId = (0, _uuid.v4)();
14
+ return {
15
+ id: groupId,
16
+ parentId: parentId,
17
+ image: {
18
+ parentId: groupId,
19
+ id: imageId,
20
+ open: true,
21
+ type: 'IMAGE',
22
+ content: {
23
+ h5Name: '',
24
+ pcName: '',
25
+ h5ImgSrc: logo,
26
+ pcImgSrc: logo,
27
+ clickUrl: ''
28
+ },
29
+ hover: {
30
+ open: false,
31
+ backgroundType: 'enlarge',
32
+ magnification: 1.5,
33
+ pcImgHoverUrl: '',
34
+ h5ImgHoverUrl: ''
35
+ }
36
+ },
37
+ groupName: {
38
+ parentId: groupId,
39
+ id: groupNameId,
40
+ open: true,
41
+ type: 'TEXT',
42
+ specialContent: [],
43
+ text: text,
44
+ content: {
45
+ sizeType: 'Customize font styles',
46
+ fontFamily: 'Open Sans',
47
+ fontWeight: 400,
48
+ fontSize: 14,
49
+ color: '#8493AF'
50
+ },
51
+ underline: {
52
+ open: false,
53
+ textDecorationColor: '',
54
+ textDecorationStyle: 'solid'
55
+ },
56
+ vertical: {}
57
+ },
58
+ seeAll: {
59
+ parentId: groupId,
60
+ id: (0, _uuid.v4)(),
61
+ open: true,
62
+ type: 'BUTTON',
63
+ text: 'See All',
64
+ content: {
65
+ url: '',
66
+ backgroundColor: '#fff'
67
+ },
68
+ buttonText: {
69
+ sizeType: 'Customize font styles',
70
+ fontFamily: 'Open Sans',
71
+ fontWeight: 400,
72
+ fontSize: 12,
73
+ fontStyle: 'normal',
74
+ color: '#232F46'
75
+ },
76
+ buttonBorder: {
77
+ open: true,
78
+ borderColor: '',
79
+ borderRadius: 0
80
+ },
81
+ spacing: {
82
+ pc: {
83
+ paddingTop: 0,
84
+ paddingBottom: 0,
85
+ paddingLeft: 0,
86
+ paddingRight: 0
87
+ },
88
+ mobile: {
89
+ paddingTop: 0,
90
+ paddingBottom: 0,
91
+ paddingLeft: 0,
92
+ paddingRight: 0
93
+ }
94
+ },
95
+ buttonIcon: {
96
+ iconUrl: '/get/resource/platform/conf/20220923/picture/Frame24271573200432656932864.png',
97
+ layout: 'left'
98
+ },
99
+ hover: null
100
+ },
101
+ prodIds: '',
102
+ intelligentType: 'Hot',
103
+ intelligentValue: [],
104
+ maxProdNum: 10,
105
+ hover: {
106
+ open: false,
107
+ image: {
108
+ parentId: groupId,
109
+ id: imageId,
110
+ open: false,
111
+ type: 'IMAGE',
112
+ content: {
113
+ h5Name: '',
114
+ pcName: '',
115
+ h5ImgSrc: logo,
116
+ pcImgSrc: logo,
117
+ clickUrl: ''
118
+ },
119
+ hover: {
120
+ open: false,
121
+ backgroundType: 'enlarge',
122
+ magnification: 1.5,
123
+ pcImgHoverUrl: '',
124
+ h5ImgHoverUrl: ''
125
+ }
126
+ },
127
+ groupName: {
128
+ parentId: groupId,
129
+ id: groupNameId,
130
+ open: false,
131
+ type: 'TEXT',
132
+ specialContent: [],
133
+ text: text,
134
+ content: {
135
+ sizeType: 'Customize font styles',
136
+ fontFamily: 'Open Sans',
137
+ fontWeight: 600,
138
+ fontSize: 14,
139
+ color: '#CE1126'
140
+ },
141
+ underline: {
142
+ open: false,
143
+ textDecorationColor: '',
144
+ textDecorationStyle: 'solid'
145
+ },
146
+ vertical: {}
147
+ }
148
+ }
149
+ };
150
+ };
151
+
152
+ exports.recommendGroupSourceJSON = recommendGroupSourceJSON;
153
+
154
+ var getDefaultJSON = function getDefaultJSON() {
155
+ var groupId = (0, _uuid.v4)();
156
+ return {
157
+ id: groupId,
158
+ type: 'AFFILIATE_RECOMMEND',
159
+ groupSource: [recommendGroupSourceJSON(groupId, '', 'Tab1'), recommendGroupSourceJSON(groupId, '', 'Tab2')],
160
+ content: {
161
+ productName: {
162
+ id: (0, _uuid.v4)(),
163
+ open: true,
164
+ type: 'TEXT',
165
+ specialContent: [],
166
+ text: 'Flash Deal',
167
+ content: {
168
+ sizeType: 'Customize font styles',
169
+ fontFamily: 'Open Sans',
170
+ fontWeight: 400,
171
+ fontSize: 10,
172
+ color: '#282828'
173
+ },
174
+ underline: {
175
+ open: false,
176
+ textDecorationColor: '',
177
+ textDecorationStyle: 'solid'
178
+ },
179
+ vertical: {
180
+ open: false,
181
+ lineHeight: 18
182
+ }
183
+ },
184
+ salesPrice: {
185
+ id: (0, _uuid.v4)(),
186
+ open: true,
187
+ type: 'TEXT',
188
+ specialContent: [],
189
+ text: 'Flash Deal',
190
+ content: {
191
+ sizeType: 'Customize font styles',
192
+ fontFamily: 'Open Sans',
193
+ fontWeight: 800,
194
+ fontSize: 18,
195
+ color: '#333'
196
+ },
197
+ underline: {
198
+ open: false,
199
+ textDecorationColor: '',
200
+ textDecorationStyle: 'solid'
201
+ },
202
+ vertical: {
203
+ open: false,
204
+ lineHeight: 18
205
+ }
206
+ }
207
+ },
208
+ spacing: {
209
+ pc: {
210
+ paddingTop: 0,
211
+ paddingBottom: 0,
212
+ paddingLeft: 0,
213
+ paddingRight: 0,
214
+ marginBottom: window.magicDesign.compSpacing * 1.5
215
+ },
216
+ mobile: {
217
+ paddingTop: 0,
218
+ paddingBottom: 0,
219
+ paddingLeft: 0,
220
+ paddingRight: 0,
221
+ marginBottom: window.magicDesign.compSpacing
222
+ }
223
+ },
224
+ customize: {
225
+ layout: {
226
+ pcLayout: 'layout1',
227
+ h5Layout: 'layout1'
228
+ },
229
+ align: 'left',
230
+ pcRowNum: 6,
231
+ pcMaxRowNum: 6,
232
+ pcMinRowNum: 5
233
+ },
234
+ background: {
235
+ opacity: 100,
236
+ color: '#fff',
237
+ image: '',
238
+ bgType: 'color'
239
+ }
240
+ };
241
+ };
242
+
243
+ exports.getDefaultJSON = getDefaultJSON;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _mobile = _interopRequireDefault(require("./mobile"));
11
+
12
+ var _pc = _interopRequireDefault(require("./pc"));
13
+
14
+ var _defaultJSON = require("./defaultJSON");
15
+
16
+ var _coreUtil = require("../../../../utils/coreUtil");
17
+
18
+ var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
27
+
28
+ var __extends = void 0 && (void 0).__extends || function () {
29
+ var _extendStatics = function extendStatics(d, b) {
30
+ _extendStatics = Object.setPrototypeOf || {
31
+ __proto__: []
32
+ } instanceof Array && function (d, b) {
33
+ d.__proto__ = b;
34
+ } || function (d, b) {
35
+ for (var p in b) {
36
+ if (b.hasOwnProperty(p)) d[p] = b[p];
37
+ }
38
+ };
39
+
40
+ return _extendStatics(d, b);
41
+ };
42
+
43
+ return function (d, b) {
44
+ _extendStatics(d, b);
45
+
46
+ function __() {
47
+ this.constructor = d;
48
+ }
49
+
50
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
51
+ };
52
+ }();
53
+
54
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
55
+ var c = arguments.length,
56
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
57
+ d;
58
+ if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
59
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
60
+ }
61
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
62
+ };
63
+
64
+ var AffiliateRecommend =
65
+ /** @class */
66
+ function (_super) {
67
+ __extends(AffiliateRecommend, _super);
68
+
69
+ function AffiliateRecommend() {
70
+ return _super !== null && _super.apply(this, arguments) || this;
71
+ }
72
+
73
+ AffiliateRecommend.prototype.render = function () {
74
+ var nodeData = this.props.nodeData;
75
+ return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ? /*#__PURE__*/_react["default"].createElement(_pc["default"], {
76
+ panelProps: nodeData
77
+ }) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
78
+ panelProps: nodeData
79
+ }));
80
+ };
81
+
82
+ AffiliateRecommend.defaultProps = {};
83
+ AffiliateRecommend.type = 'AFFILIATE_RECOMMEND';
84
+ AffiliateRecommend.getDefaultJSON = _defaultJSON.getDefaultJSON;
85
+ AffiliateRecommend = __decorate([_compositeDecorator["default"]], AffiliateRecommend);
86
+ return AffiliateRecommend;
87
+ }(_react.Component);
88
+
89
+ var _default = AffiliateRecommend;
90
+ exports["default"] = _default;