@fonixtree/magic-design 0.0.51 → 0.0.53
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/LinkModal/CustomTable/index.js +2 -1
- package/es/common/LinkModal/ProductDetailPage/index.js +3 -3
- package/es/common/MagicLink/index.js +89 -0
- package/es/common/MagicLink/index.less +0 -0
- package/es/composite-comp/dito/components/Recommend/pc/index.js +111 -10
- package/es/composite-comp/dito/components/Recommend/pc/index.less +40 -9
- package/es/utils/coreUtil.js +3 -1
- package/lib/common/LinkModal/CustomTable/index.js +2 -1
- package/lib/common/LinkModal/ProductDetailPage/index.js +3 -3
- package/lib/common/MagicLink/index.js +89 -0
- package/lib/common/MagicLink/index.less +0 -0
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +111 -10
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +40 -9
- package/lib/utils/coreUtil.js +3 -1
- package/package.json +1 -86
- package/README.md +0 -320
|
@@ -232,7 +232,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
232
232
|
|
|
233
233
|
var _j = (0, _react.useState)({
|
|
234
234
|
pageSize: 20,
|
|
235
|
-
|
|
235
|
+
pageIndex: 1
|
|
236
236
|
}),
|
|
237
237
|
paginationParams = _j[0],
|
|
238
238
|
setPaginationParams = _j[1];
|
|
@@ -399,7 +399,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
399
399
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
400
400
|
onClick: function onClick() {
|
|
401
401
|
setLoading(true);
|
|
402
|
-
paginationParams.
|
|
402
|
+
paginationParams.pageIndex = 1;
|
|
403
403
|
|
|
404
404
|
var total = paginationParams.total,
|
|
405
405
|
params = __rest(paginationParams, ["total"]);
|
|
@@ -468,7 +468,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
468
468
|
pagination: __assign(__assign({}, paginationParams), {
|
|
469
469
|
onChange: function onChange(page) {
|
|
470
470
|
setLoading(true);
|
|
471
|
-
paginationParams.
|
|
471
|
+
paginationParams.pageIndex = page;
|
|
472
472
|
|
|
473
473
|
var total = paginationParams.total,
|
|
474
474
|
params = __rest(paginationParams, ["total"]);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.onAClick = exports.getLinkUrl = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _businessUtil = require("src/components/utils/businessUtil");
|
|
11
|
+
|
|
12
|
+
var _coreUtil = require("src/components/utils/coreUtil");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
17
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
18
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
19
|
+
__proto__: []
|
|
20
|
+
} instanceof Array && function (d, b) {
|
|
21
|
+
d.__proto__ = b;
|
|
22
|
+
} || function (d, b) {
|
|
23
|
+
for (var p in b) {
|
|
24
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return _extendStatics(d, b);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return function (d, b) {
|
|
32
|
+
_extendStatics(d, b);
|
|
33
|
+
|
|
34
|
+
function __() {
|
|
35
|
+
this.constructor = d;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
39
|
+
};
|
|
40
|
+
}();
|
|
41
|
+
|
|
42
|
+
var onAClick = function onAClick(e, url) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
|
|
45
|
+
if (window.magicDesign.mode === 'renderer') {
|
|
46
|
+
(0, _coreUtil.clickUrl)(url);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.onAClick = onAClick;
|
|
51
|
+
|
|
52
|
+
var getLinkUrl = function getLinkUrl(url) {
|
|
53
|
+
var h5Link = (0, _businessUtil.parseUrl)(url).h5Link;
|
|
54
|
+
return h5Link;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.getLinkUrl = getLinkUrl;
|
|
58
|
+
|
|
59
|
+
var MagicLink =
|
|
60
|
+
/** @class */
|
|
61
|
+
function (_super) {
|
|
62
|
+
__extends(MagicLink, _super);
|
|
63
|
+
|
|
64
|
+
function MagicLink() {
|
|
65
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
66
|
+
|
|
67
|
+
_this.state = {};
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
MagicLink.prototype.render = function () {
|
|
72
|
+
var _a = this.props,
|
|
73
|
+
url = _a.url,
|
|
74
|
+
children = _a.children;
|
|
75
|
+
var href = getLinkUrl(url);
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
77
|
+
href: href,
|
|
78
|
+
onClick: function onClick(e) {
|
|
79
|
+
return onAClick(e, url);
|
|
80
|
+
}
|
|
81
|
+
}, children);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
MagicLink.defaultProps = {};
|
|
85
|
+
return MagicLink;
|
|
86
|
+
}(_react["default"].Component);
|
|
87
|
+
|
|
88
|
+
var _default = MagicLink;
|
|
89
|
+
exports["default"] = _default;
|
|
File without changes
|
|
@@ -13,6 +13,8 @@ require("./index.less");
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
+
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
17
|
+
|
|
16
18
|
var _mobx = require("../../../../../mobx");
|
|
17
19
|
|
|
18
20
|
var _ProductItem = _interopRequireDefault(require("../../../../common/components/ProductItem"));
|
|
@@ -25,6 +27,8 @@ var _commonUtil = require("../../../../../utils/commonUtil");
|
|
|
25
27
|
|
|
26
28
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
27
29
|
|
|
30
|
+
var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
|
|
31
|
+
|
|
28
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
33
|
|
|
30
34
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -231,13 +235,21 @@ var LAYOUT_IMAGE_SIZE = {
|
|
|
231
235
|
w: '100%',
|
|
232
236
|
h: 180
|
|
233
237
|
},
|
|
234
|
-
|
|
238
|
+
layout2_col6: {
|
|
235
239
|
w: 160,
|
|
236
240
|
h: 160
|
|
237
241
|
},
|
|
238
|
-
|
|
239
|
-
w:
|
|
240
|
-
h:
|
|
242
|
+
layout2_col5: {
|
|
243
|
+
w: 200,
|
|
244
|
+
h: 200
|
|
245
|
+
},
|
|
246
|
+
layout3_col6: {
|
|
247
|
+
w: 160,
|
|
248
|
+
h: 160
|
|
249
|
+
},
|
|
250
|
+
layout3_col5: {
|
|
251
|
+
w: 200,
|
|
252
|
+
h: 200
|
|
241
253
|
}
|
|
242
254
|
};
|
|
243
255
|
|
|
@@ -254,14 +266,27 @@ function (_super) {
|
|
|
254
266
|
_this._cache = (0, _coreUtil.isDesignMode)() ? {} : (0, _commonUtil.ensure)(function () {
|
|
255
267
|
return (0, _storeUtil.getMagicStore)("recommend_" + _this.props.panelProps.id);
|
|
256
268
|
}, {});
|
|
269
|
+
_this.scrollRef = /*#__PURE__*/_react["default"].createRef();
|
|
257
270
|
_this.state = __assign({
|
|
258
271
|
tabIndex: 0,
|
|
259
272
|
tabLeft: 0,
|
|
260
273
|
tabWidth: 0,
|
|
261
274
|
groupSource: [],
|
|
262
|
-
hideTabs: false
|
|
275
|
+
hideTabs: false,
|
|
276
|
+
scrollToLeftDisabled: true,
|
|
277
|
+
scrollToRightDisabled: true
|
|
263
278
|
}, _this._cache);
|
|
264
279
|
|
|
280
|
+
_this.setScrollDisabled = function (scrollDom) {
|
|
281
|
+
var scrollToLeftDisabled = scrollDom.scrollLeft === 0;
|
|
282
|
+
var scrollToRightDisabled = scrollDom.clientWidth + scrollDom.scrollLeft >= scrollDom.scrollWidth;
|
|
283
|
+
|
|
284
|
+
_this.setState({
|
|
285
|
+
scrollToLeftDisabled: scrollToLeftDisabled,
|
|
286
|
+
scrollToRightDisabled: scrollToRightDisabled
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
|
|
265
290
|
_this.initTab = function (index, hideTabs) {
|
|
266
291
|
var selectedTabDom = document.querySelector(".tab-select-wrap .tabTitle:nth-child(" + (index + 1) + ")");
|
|
267
292
|
var tabLeft = 0;
|
|
@@ -462,6 +487,34 @@ function (_super) {
|
|
|
462
487
|
});
|
|
463
488
|
|
|
464
489
|
_this.getProductList(index);
|
|
490
|
+
|
|
491
|
+
setTimeout(function () {
|
|
492
|
+
var scrollDom = _this.scrollRef.current;
|
|
493
|
+
|
|
494
|
+
if (scrollDom) {
|
|
495
|
+
_this.setScrollDisabled(scrollDom);
|
|
496
|
+
|
|
497
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
498
|
+
_this.setScrollDisabled(scrollDom);
|
|
499
|
+
}, 500);
|
|
500
|
+
}
|
|
501
|
+
}, 0);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
_this.scrollToRight = function () {
|
|
505
|
+
var scrollDom = _this.scrollRef.current;
|
|
506
|
+
|
|
507
|
+
if (scrollDom.clientWidth + scrollDom.scrollLeft < scrollDom.scrollWidth) {
|
|
508
|
+
scrollDom.scrollTo(scrollDom.scrollLeft + scrollDom.clientWidth, 0);
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
_this.scrollToLeft = function () {
|
|
513
|
+
var scrollDom = _this.scrollRef.current;
|
|
514
|
+
|
|
515
|
+
if (scrollDom.scrollLeft > 0) {
|
|
516
|
+
scrollDom.scrollTo(scrollDom.scrollLeft - scrollDom.clientWidth, 0);
|
|
517
|
+
}
|
|
465
518
|
};
|
|
466
519
|
|
|
467
520
|
return _this;
|
|
@@ -483,6 +536,17 @@ function (_super) {
|
|
|
483
536
|
|
|
484
537
|
_this.getProductList(0);
|
|
485
538
|
});
|
|
539
|
+
setTimeout(function () {
|
|
540
|
+
var scrollDom = _this.scrollRef.current;
|
|
541
|
+
|
|
542
|
+
if (scrollDom) {
|
|
543
|
+
_this.setScrollDisabled(scrollDom);
|
|
544
|
+
|
|
545
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
546
|
+
_this.setScrollDisabled(scrollDom);
|
|
547
|
+
}, 500);
|
|
548
|
+
}
|
|
549
|
+
}, 0);
|
|
486
550
|
};
|
|
487
551
|
|
|
488
552
|
RecommendMobile.prototype.componentWillReceiveProps = function () {
|
|
@@ -528,6 +592,17 @@ function (_super) {
|
|
|
528
592
|
|
|
529
593
|
if (curLayout !== this.preLayout) {
|
|
530
594
|
this.resetLayout();
|
|
595
|
+
setTimeout(function () {
|
|
596
|
+
var scrollDom = _this.scrollRef.current;
|
|
597
|
+
|
|
598
|
+
if (scrollDom) {
|
|
599
|
+
_this.setScrollDisabled(scrollDom);
|
|
600
|
+
|
|
601
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
602
|
+
_this.setScrollDisabled(scrollDom);
|
|
603
|
+
}, 500);
|
|
604
|
+
}
|
|
605
|
+
}, 0);
|
|
531
606
|
}
|
|
532
607
|
|
|
533
608
|
this.preLayout = curLayout;
|
|
@@ -542,7 +617,9 @@ function (_super) {
|
|
|
542
617
|
tabLeft = _a.tabLeft,
|
|
543
618
|
tabWidth = _a.tabWidth,
|
|
544
619
|
groupSource = _a.groupSource,
|
|
545
|
-
hideTabs = _a.hideTabs
|
|
620
|
+
hideTabs = _a.hideTabs,
|
|
621
|
+
scrollToLeftDisabled = _a.scrollToLeftDisabled,
|
|
622
|
+
scrollToRightDisabled = _a.scrollToRightDisabled;
|
|
546
623
|
var bgStyle = this.getBackgroundStyle();
|
|
547
624
|
var products = this.state["products" + tabIndex] || [];
|
|
548
625
|
var isDivide = groupSource.length <= 3;
|
|
@@ -553,10 +630,10 @@ function (_super) {
|
|
|
553
630
|
}, '');
|
|
554
631
|
|
|
555
632
|
var imgHeight = (0, _commonUtil.ensure)(function () {
|
|
556
|
-
return LAYOUT_IMAGE_SIZE[layout].h;
|
|
633
|
+
return layout === 'layout1' ? LAYOUT_IMAGE_SIZE[layout].h : LAYOUT_IMAGE_SIZE[layout + "_col" + panelProps.customize.pcRowNum].h;
|
|
557
634
|
}, 140);
|
|
558
635
|
var imgWidth = (0, _commonUtil.ensure)(function () {
|
|
559
|
-
return LAYOUT_IMAGE_SIZE[layout].w;
|
|
636
|
+
return layout === 'layout1' ? LAYOUT_IMAGE_SIZE[layout].w : LAYOUT_IMAGE_SIZE[layout + "_col" + panelProps.customize.pcRowNum].w;
|
|
560
637
|
}, 140);
|
|
561
638
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
562
639
|
className: "m-recommend-pc",
|
|
@@ -598,8 +675,22 @@ function (_super) {
|
|
|
598
675
|
transform: "translateX(" + tabLeft + "px)",
|
|
599
676
|
background: this.getTabBarActiveColor(panelProps)
|
|
600
677
|
}
|
|
601
|
-
})),
|
|
678
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
679
|
+
className: "tab-content"
|
|
680
|
+
}, layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
681
|
+
className: "arrow-icon left",
|
|
682
|
+
onClick: function onClick() {
|
|
683
|
+
return _this.scrollToLeft();
|
|
684
|
+
}
|
|
685
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
686
|
+
color: scrollToLeftDisabled ? '#BDC1C8' : '#232F46',
|
|
687
|
+
size: 20,
|
|
688
|
+
type: "icon-outlined-left"
|
|
689
|
+
})), layout === 'layout1' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
690
|
+
className: "tab-list"
|
|
691
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
602
692
|
key: "macyContainer",
|
|
693
|
+
ref: this.scrollRef,
|
|
603
694
|
className: "macyContainer"
|
|
604
695
|
}, products.map(function (item) {
|
|
605
696
|
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
@@ -621,6 +712,7 @@ function (_super) {
|
|
|
621
712
|
data: _seeAll
|
|
622
713
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
623
714
|
key: "scrollContainer",
|
|
715
|
+
ref: this.scrollRef,
|
|
624
716
|
className: (0, _classnames["default"])('scrollContainer', {
|
|
625
717
|
pl_100: layout === 'layout3'
|
|
626
718
|
})
|
|
@@ -642,7 +734,16 @@ function (_super) {
|
|
|
642
734
|
}), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
643
735
|
className: "btnSeeAll",
|
|
644
736
|
data: _seeAll
|
|
645
|
-
}))
|
|
737
|
+
})), layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
738
|
+
className: "arrow-icon right",
|
|
739
|
+
onClick: function onClick() {
|
|
740
|
+
return _this.scrollToRight();
|
|
741
|
+
}
|
|
742
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
743
|
+
color: scrollToRightDisabled ? '#BDC1C8' : '#232F46',
|
|
744
|
+
size: 20,
|
|
745
|
+
type: "icon-outlined-right"
|
|
746
|
+
}))));
|
|
646
747
|
};
|
|
647
748
|
|
|
648
749
|
RecommendMobile.defaultProps = {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
.m-recommend-pc {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
+
position: relative;
|
|
4
5
|
|
|
5
6
|
.ant-tabs-nav-operations {
|
|
6
7
|
display: none !important;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
::-webkit-scrollbar {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
10
|
+
// ::-webkit-scrollbar {
|
|
11
|
+
// width: 0;
|
|
12
|
+
// height: 0;
|
|
13
|
+
// display: none;
|
|
14
|
+
// }
|
|
15
15
|
|
|
16
16
|
.tab-select-wrap {
|
|
17
17
|
display: flex;
|
|
@@ -49,16 +49,47 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.tab-content {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
align-items: center;
|
|
56
|
+
|
|
57
|
+
.tab-list {
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.arrow-icon {
|
|
63
|
+
display: block;
|
|
64
|
+
width: 36px;
|
|
65
|
+
height: 36px;
|
|
66
|
+
line-height: 42px;
|
|
67
|
+
text-align: center;
|
|
68
|
+
background: #FFFFFF;
|
|
69
|
+
box-shadow: -1px -1px 4px rgba(45, 48, 64, 0.08), 1px 1px 4px rgba(45, 48, 64, 0.08);
|
|
70
|
+
border-radius: 100px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
|
|
73
|
+
&.left {
|
|
74
|
+
margin-right: 40px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.right {
|
|
78
|
+
margin-left: 40px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
52
82
|
.macyContainer {
|
|
53
83
|
display: flex;
|
|
54
|
-
margin: 0
|
|
84
|
+
margin: 0;
|
|
55
85
|
}
|
|
56
86
|
|
|
57
87
|
.scrollContainer {
|
|
58
88
|
display: flex;
|
|
59
89
|
flex-direction: row;
|
|
60
90
|
align-items: center;
|
|
61
|
-
|
|
91
|
+
flex: 1;
|
|
92
|
+
margin: 0;
|
|
62
93
|
overflow-x: auto;
|
|
63
94
|
padding-bottom: 15px;
|
|
64
95
|
|
|
@@ -67,7 +98,7 @@
|
|
|
67
98
|
}
|
|
68
99
|
|
|
69
100
|
.productCard {
|
|
70
|
-
margin-right:
|
|
101
|
+
margin-right: 20px;
|
|
71
102
|
}
|
|
72
103
|
}
|
|
73
104
|
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -87,7 +87,9 @@ var clickUrl = function clickUrl(url) {
|
|
|
87
87
|
if (url.startsWith('/')) {
|
|
88
88
|
(0, _commonUtil.navigateTo)(url);
|
|
89
89
|
} else {
|
|
90
|
-
location.href = url;
|
|
90
|
+
// location.href = url;
|
|
91
|
+
var newUrl = isPc() ? pcLink : h5Link;
|
|
92
|
+
(0, _commonUtil.navigateTo)(newUrl);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
return;
|
|
@@ -232,7 +232,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
232
232
|
|
|
233
233
|
var _j = (0, _react.useState)({
|
|
234
234
|
pageSize: 20,
|
|
235
|
-
|
|
235
|
+
pageIndex: 1
|
|
236
236
|
}),
|
|
237
237
|
paginationParams = _j[0],
|
|
238
238
|
setPaginationParams = _j[1];
|
|
@@ -399,7 +399,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
399
399
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
400
400
|
onClick: function onClick() {
|
|
401
401
|
setLoading(true);
|
|
402
|
-
paginationParams.
|
|
402
|
+
paginationParams.pageIndex = 1;
|
|
403
403
|
|
|
404
404
|
var total = paginationParams.total,
|
|
405
405
|
params = __rest(paginationParams, ["total"]);
|
|
@@ -468,7 +468,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
468
468
|
pagination: __assign(__assign({}, paginationParams), {
|
|
469
469
|
onChange: function onChange(page) {
|
|
470
470
|
setLoading(true);
|
|
471
|
-
paginationParams.
|
|
471
|
+
paginationParams.pageIndex = page;
|
|
472
472
|
|
|
473
473
|
var total = paginationParams.total,
|
|
474
474
|
params = __rest(paginationParams, ["total"]);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.onAClick = exports.getLinkUrl = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _businessUtil = require("src/components/utils/businessUtil");
|
|
11
|
+
|
|
12
|
+
var _coreUtil = require("src/components/utils/coreUtil");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
17
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
18
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
19
|
+
__proto__: []
|
|
20
|
+
} instanceof Array && function (d, b) {
|
|
21
|
+
d.__proto__ = b;
|
|
22
|
+
} || function (d, b) {
|
|
23
|
+
for (var p in b) {
|
|
24
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return _extendStatics(d, b);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return function (d, b) {
|
|
32
|
+
_extendStatics(d, b);
|
|
33
|
+
|
|
34
|
+
function __() {
|
|
35
|
+
this.constructor = d;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
39
|
+
};
|
|
40
|
+
}();
|
|
41
|
+
|
|
42
|
+
var onAClick = function onAClick(e, url) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
|
|
45
|
+
if (window.magicDesign.mode === 'renderer') {
|
|
46
|
+
(0, _coreUtil.clickUrl)(url);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.onAClick = onAClick;
|
|
51
|
+
|
|
52
|
+
var getLinkUrl = function getLinkUrl(url) {
|
|
53
|
+
var h5Link = (0, _businessUtil.parseUrl)(url).h5Link;
|
|
54
|
+
return h5Link;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.getLinkUrl = getLinkUrl;
|
|
58
|
+
|
|
59
|
+
var MagicLink =
|
|
60
|
+
/** @class */
|
|
61
|
+
function (_super) {
|
|
62
|
+
__extends(MagicLink, _super);
|
|
63
|
+
|
|
64
|
+
function MagicLink() {
|
|
65
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
66
|
+
|
|
67
|
+
_this.state = {};
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
MagicLink.prototype.render = function () {
|
|
72
|
+
var _a = this.props,
|
|
73
|
+
url = _a.url,
|
|
74
|
+
children = _a.children;
|
|
75
|
+
var href = getLinkUrl(url);
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
77
|
+
href: href,
|
|
78
|
+
onClick: function onClick(e) {
|
|
79
|
+
return onAClick(e, url);
|
|
80
|
+
}
|
|
81
|
+
}, children);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
MagicLink.defaultProps = {};
|
|
85
|
+
return MagicLink;
|
|
86
|
+
}(_react["default"].Component);
|
|
87
|
+
|
|
88
|
+
var _default = MagicLink;
|
|
89
|
+
exports["default"] = _default;
|
|
File without changes
|
|
@@ -13,6 +13,8 @@ require("./index.less");
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
+
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
17
|
+
|
|
16
18
|
var _mobx = require("../../../../../mobx");
|
|
17
19
|
|
|
18
20
|
var _ProductItem = _interopRequireDefault(require("../../../../common/components/ProductItem"));
|
|
@@ -25,6 +27,8 @@ var _commonUtil = require("../../../../../utils/commonUtil");
|
|
|
25
27
|
|
|
26
28
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
27
29
|
|
|
30
|
+
var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
|
|
31
|
+
|
|
28
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
33
|
|
|
30
34
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -231,13 +235,21 @@ var LAYOUT_IMAGE_SIZE = {
|
|
|
231
235
|
w: '100%',
|
|
232
236
|
h: 180
|
|
233
237
|
},
|
|
234
|
-
|
|
238
|
+
layout2_col6: {
|
|
235
239
|
w: 160,
|
|
236
240
|
h: 160
|
|
237
241
|
},
|
|
238
|
-
|
|
239
|
-
w:
|
|
240
|
-
h:
|
|
242
|
+
layout2_col5: {
|
|
243
|
+
w: 200,
|
|
244
|
+
h: 200
|
|
245
|
+
},
|
|
246
|
+
layout3_col6: {
|
|
247
|
+
w: 160,
|
|
248
|
+
h: 160
|
|
249
|
+
},
|
|
250
|
+
layout3_col5: {
|
|
251
|
+
w: 200,
|
|
252
|
+
h: 200
|
|
241
253
|
}
|
|
242
254
|
};
|
|
243
255
|
|
|
@@ -254,14 +266,27 @@ function (_super) {
|
|
|
254
266
|
_this._cache = (0, _coreUtil.isDesignMode)() ? {} : (0, _commonUtil.ensure)(function () {
|
|
255
267
|
return (0, _storeUtil.getMagicStore)("recommend_" + _this.props.panelProps.id);
|
|
256
268
|
}, {});
|
|
269
|
+
_this.scrollRef = /*#__PURE__*/_react["default"].createRef();
|
|
257
270
|
_this.state = __assign({
|
|
258
271
|
tabIndex: 0,
|
|
259
272
|
tabLeft: 0,
|
|
260
273
|
tabWidth: 0,
|
|
261
274
|
groupSource: [],
|
|
262
|
-
hideTabs: false
|
|
275
|
+
hideTabs: false,
|
|
276
|
+
scrollToLeftDisabled: true,
|
|
277
|
+
scrollToRightDisabled: true
|
|
263
278
|
}, _this._cache);
|
|
264
279
|
|
|
280
|
+
_this.setScrollDisabled = function (scrollDom) {
|
|
281
|
+
var scrollToLeftDisabled = scrollDom.scrollLeft === 0;
|
|
282
|
+
var scrollToRightDisabled = scrollDom.clientWidth + scrollDom.scrollLeft >= scrollDom.scrollWidth;
|
|
283
|
+
|
|
284
|
+
_this.setState({
|
|
285
|
+
scrollToLeftDisabled: scrollToLeftDisabled,
|
|
286
|
+
scrollToRightDisabled: scrollToRightDisabled
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
|
|
265
290
|
_this.initTab = function (index, hideTabs) {
|
|
266
291
|
var selectedTabDom = document.querySelector(".tab-select-wrap .tabTitle:nth-child(" + (index + 1) + ")");
|
|
267
292
|
var tabLeft = 0;
|
|
@@ -462,6 +487,34 @@ function (_super) {
|
|
|
462
487
|
});
|
|
463
488
|
|
|
464
489
|
_this.getProductList(index);
|
|
490
|
+
|
|
491
|
+
setTimeout(function () {
|
|
492
|
+
var scrollDom = _this.scrollRef.current;
|
|
493
|
+
|
|
494
|
+
if (scrollDom) {
|
|
495
|
+
_this.setScrollDisabled(scrollDom);
|
|
496
|
+
|
|
497
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
498
|
+
_this.setScrollDisabled(scrollDom);
|
|
499
|
+
}, 500);
|
|
500
|
+
}
|
|
501
|
+
}, 0);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
_this.scrollToRight = function () {
|
|
505
|
+
var scrollDom = _this.scrollRef.current;
|
|
506
|
+
|
|
507
|
+
if (scrollDom.clientWidth + scrollDom.scrollLeft < scrollDom.scrollWidth) {
|
|
508
|
+
scrollDom.scrollTo(scrollDom.scrollLeft + scrollDom.clientWidth, 0);
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
_this.scrollToLeft = function () {
|
|
513
|
+
var scrollDom = _this.scrollRef.current;
|
|
514
|
+
|
|
515
|
+
if (scrollDom.scrollLeft > 0) {
|
|
516
|
+
scrollDom.scrollTo(scrollDom.scrollLeft - scrollDom.clientWidth, 0);
|
|
517
|
+
}
|
|
465
518
|
};
|
|
466
519
|
|
|
467
520
|
return _this;
|
|
@@ -483,6 +536,17 @@ function (_super) {
|
|
|
483
536
|
|
|
484
537
|
_this.getProductList(0);
|
|
485
538
|
});
|
|
539
|
+
setTimeout(function () {
|
|
540
|
+
var scrollDom = _this.scrollRef.current;
|
|
541
|
+
|
|
542
|
+
if (scrollDom) {
|
|
543
|
+
_this.setScrollDisabled(scrollDom);
|
|
544
|
+
|
|
545
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
546
|
+
_this.setScrollDisabled(scrollDom);
|
|
547
|
+
}, 500);
|
|
548
|
+
}
|
|
549
|
+
}, 0);
|
|
486
550
|
};
|
|
487
551
|
|
|
488
552
|
RecommendMobile.prototype.componentWillReceiveProps = function () {
|
|
@@ -528,6 +592,17 @@ function (_super) {
|
|
|
528
592
|
|
|
529
593
|
if (curLayout !== this.preLayout) {
|
|
530
594
|
this.resetLayout();
|
|
595
|
+
setTimeout(function () {
|
|
596
|
+
var scrollDom = _this.scrollRef.current;
|
|
597
|
+
|
|
598
|
+
if (scrollDom) {
|
|
599
|
+
_this.setScrollDisabled(scrollDom);
|
|
600
|
+
|
|
601
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
602
|
+
_this.setScrollDisabled(scrollDom);
|
|
603
|
+
}, 500);
|
|
604
|
+
}
|
|
605
|
+
}, 0);
|
|
531
606
|
}
|
|
532
607
|
|
|
533
608
|
this.preLayout = curLayout;
|
|
@@ -542,7 +617,9 @@ function (_super) {
|
|
|
542
617
|
tabLeft = _a.tabLeft,
|
|
543
618
|
tabWidth = _a.tabWidth,
|
|
544
619
|
groupSource = _a.groupSource,
|
|
545
|
-
hideTabs = _a.hideTabs
|
|
620
|
+
hideTabs = _a.hideTabs,
|
|
621
|
+
scrollToLeftDisabled = _a.scrollToLeftDisabled,
|
|
622
|
+
scrollToRightDisabled = _a.scrollToRightDisabled;
|
|
546
623
|
var bgStyle = this.getBackgroundStyle();
|
|
547
624
|
var products = this.state["products" + tabIndex] || [];
|
|
548
625
|
var isDivide = groupSource.length <= 3;
|
|
@@ -553,10 +630,10 @@ function (_super) {
|
|
|
553
630
|
}, '');
|
|
554
631
|
|
|
555
632
|
var imgHeight = (0, _commonUtil.ensure)(function () {
|
|
556
|
-
return LAYOUT_IMAGE_SIZE[layout].h;
|
|
633
|
+
return layout === 'layout1' ? LAYOUT_IMAGE_SIZE[layout].h : LAYOUT_IMAGE_SIZE[layout + "_col" + panelProps.customize.pcRowNum].h;
|
|
557
634
|
}, 140);
|
|
558
635
|
var imgWidth = (0, _commonUtil.ensure)(function () {
|
|
559
|
-
return LAYOUT_IMAGE_SIZE[layout].w;
|
|
636
|
+
return layout === 'layout1' ? LAYOUT_IMAGE_SIZE[layout].w : LAYOUT_IMAGE_SIZE[layout + "_col" + panelProps.customize.pcRowNum].w;
|
|
560
637
|
}, 140);
|
|
561
638
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
562
639
|
className: "m-recommend-pc",
|
|
@@ -598,8 +675,22 @@ function (_super) {
|
|
|
598
675
|
transform: "translateX(" + tabLeft + "px)",
|
|
599
676
|
background: this.getTabBarActiveColor(panelProps)
|
|
600
677
|
}
|
|
601
|
-
})),
|
|
678
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
679
|
+
className: "tab-content"
|
|
680
|
+
}, layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
681
|
+
className: "arrow-icon left",
|
|
682
|
+
onClick: function onClick() {
|
|
683
|
+
return _this.scrollToLeft();
|
|
684
|
+
}
|
|
685
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
686
|
+
color: scrollToLeftDisabled ? '#BDC1C8' : '#232F46',
|
|
687
|
+
size: 20,
|
|
688
|
+
type: "icon-outlined-left"
|
|
689
|
+
})), layout === 'layout1' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
690
|
+
className: "tab-list"
|
|
691
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
602
692
|
key: "macyContainer",
|
|
693
|
+
ref: this.scrollRef,
|
|
603
694
|
className: "macyContainer"
|
|
604
695
|
}, products.map(function (item) {
|
|
605
696
|
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
@@ -621,6 +712,7 @@ function (_super) {
|
|
|
621
712
|
data: _seeAll
|
|
622
713
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
623
714
|
key: "scrollContainer",
|
|
715
|
+
ref: this.scrollRef,
|
|
624
716
|
className: (0, _classnames["default"])('scrollContainer', {
|
|
625
717
|
pl_100: layout === 'layout3'
|
|
626
718
|
})
|
|
@@ -642,7 +734,16 @@ function (_super) {
|
|
|
642
734
|
}), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
643
735
|
className: "btnSeeAll",
|
|
644
736
|
data: _seeAll
|
|
645
|
-
}))
|
|
737
|
+
})), layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
738
|
+
className: "arrow-icon right",
|
|
739
|
+
onClick: function onClick() {
|
|
740
|
+
return _this.scrollToRight();
|
|
741
|
+
}
|
|
742
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
743
|
+
color: scrollToRightDisabled ? '#BDC1C8' : '#232F46',
|
|
744
|
+
size: 20,
|
|
745
|
+
type: "icon-outlined-right"
|
|
746
|
+
}))));
|
|
646
747
|
};
|
|
647
748
|
|
|
648
749
|
RecommendMobile.defaultProps = {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
.m-recommend-pc {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
+
position: relative;
|
|
4
5
|
|
|
5
6
|
.ant-tabs-nav-operations {
|
|
6
7
|
display: none !important;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
::-webkit-scrollbar {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
10
|
+
// ::-webkit-scrollbar {
|
|
11
|
+
// width: 0;
|
|
12
|
+
// height: 0;
|
|
13
|
+
// display: none;
|
|
14
|
+
// }
|
|
15
15
|
|
|
16
16
|
.tab-select-wrap {
|
|
17
17
|
display: flex;
|
|
@@ -49,16 +49,47 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.tab-content {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
align-items: center;
|
|
56
|
+
|
|
57
|
+
.tab-list {
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.arrow-icon {
|
|
63
|
+
display: block;
|
|
64
|
+
width: 36px;
|
|
65
|
+
height: 36px;
|
|
66
|
+
line-height: 42px;
|
|
67
|
+
text-align: center;
|
|
68
|
+
background: #FFFFFF;
|
|
69
|
+
box-shadow: -1px -1px 4px rgba(45, 48, 64, 0.08), 1px 1px 4px rgba(45, 48, 64, 0.08);
|
|
70
|
+
border-radius: 100px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
|
|
73
|
+
&.left {
|
|
74
|
+
margin-right: 40px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.right {
|
|
78
|
+
margin-left: 40px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
52
82
|
.macyContainer {
|
|
53
83
|
display: flex;
|
|
54
|
-
margin: 0
|
|
84
|
+
margin: 0;
|
|
55
85
|
}
|
|
56
86
|
|
|
57
87
|
.scrollContainer {
|
|
58
88
|
display: flex;
|
|
59
89
|
flex-direction: row;
|
|
60
90
|
align-items: center;
|
|
61
|
-
|
|
91
|
+
flex: 1;
|
|
92
|
+
margin: 0;
|
|
62
93
|
overflow-x: auto;
|
|
63
94
|
padding-bottom: 15px;
|
|
64
95
|
|
|
@@ -67,7 +98,7 @@
|
|
|
67
98
|
}
|
|
68
99
|
|
|
69
100
|
.productCard {
|
|
70
|
-
margin-right:
|
|
101
|
+
margin-right: 20px;
|
|
71
102
|
}
|
|
72
103
|
}
|
|
73
104
|
|
package/lib/utils/coreUtil.js
CHANGED
|
@@ -87,7 +87,9 @@ var clickUrl = function clickUrl(url) {
|
|
|
87
87
|
if (url.startsWith('/')) {
|
|
88
88
|
(0, _commonUtil.navigateTo)(url);
|
|
89
89
|
} else {
|
|
90
|
-
location.href = url;
|
|
90
|
+
// location.href = url;
|
|
91
|
+
var newUrl = isPc() ? pcLink : h5Link;
|
|
92
|
+
(0, _commonUtil.navigateTo)(newUrl);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonixtree/magic-design",
|
|
3
3
|
"author": "Cylon Team",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.53",
|
|
5
5
|
"description": "Magic Design",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -34,91 +34,6 @@
|
|
|
34
34
|
"replace": "^1.2.1",
|
|
35
35
|
"slick-carousel": "^1.8.1"
|
|
36
36
|
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"react-dom": "^16.11.0",
|
|
39
|
-
"react": "^16.11.0",
|
|
40
|
-
"gulp": "4.0.2",
|
|
41
|
-
"gulp-less": "5.0.0",
|
|
42
|
-
"gulp-postcss": "9.0.1",
|
|
43
|
-
"gulp-rename": "2.0.0",
|
|
44
|
-
"postcss-less": "6.0.0",
|
|
45
|
-
"@babel/core": "^7.16.0",
|
|
46
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
|
47
|
-
"@rollup/plugin-babel": "^5.3.1",
|
|
48
|
-
"@rollup/plugin-commonjs": "^22.0.0",
|
|
49
|
-
"@rollup/plugin-image": "^2.1.1",
|
|
50
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
51
|
-
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
52
|
-
"@svgr/webpack": "^5.5.0",
|
|
53
|
-
"@types/axios": "^0.14.0",
|
|
54
|
-
"@types/lodash": "^4.14.182",
|
|
55
|
-
"@types/node": "^17.0.36",
|
|
56
|
-
"@types/react": "^18.0.9",
|
|
57
|
-
"@types/react-color": "^3.0.6",
|
|
58
|
-
"@types/react-dom": "^18.0.5",
|
|
59
|
-
"@types/uuid": "^8.3.4",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
61
|
-
"add": "^2.0.6",
|
|
62
|
-
"babel-loader": "^8.2.3",
|
|
63
|
-
"babel-plugin-named-asset-import": "^0.3.8",
|
|
64
|
-
"babel-preset-react-app": "^10.0.1",
|
|
65
|
-
"bfj": "^7.0.2",
|
|
66
|
-
"browserslist": "^4.18.1",
|
|
67
|
-
"camelcase": "^6.2.1",
|
|
68
|
-
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
69
|
-
"child_process": "^1.0.2",
|
|
70
|
-
"classnames": "^2.3.1",
|
|
71
|
-
"css-loader": "^6.5.1",
|
|
72
|
-
"css-minimizer-webpack-plugin": "^3.2.0",
|
|
73
|
-
"dotenv": "^10.0.0",
|
|
74
|
-
"dotenv-expand": "^5.1.0",
|
|
75
|
-
"eslint": "7",
|
|
76
|
-
"eslint-config-next": "^12.1.6",
|
|
77
|
-
"eslint-config-react-app": "^7.0.1",
|
|
78
|
-
"eslint-webpack-plugin": "^3.1.1",
|
|
79
|
-
"extract-zip": "^2.0.1",
|
|
80
|
-
"file-loader": "^6.2.0",
|
|
81
|
-
"fs-extra": "^10.0.0",
|
|
82
|
-
"html-webpack-plugin": "^5.5.0",
|
|
83
|
-
"http-proxy-middleware": "^2.0.6",
|
|
84
|
-
"identity-obj-proxy": "^3.0.0",
|
|
85
|
-
"less": "3.13.1",
|
|
86
|
-
"less-loader": "^11.0.0",
|
|
87
|
-
"mini-css-extract-plugin": "^2.4.5",
|
|
88
|
-
"mv": "^2.1.1",
|
|
89
|
-
"ora": "^4.1.1",
|
|
90
|
-
"postcss": "^8.4.4",
|
|
91
|
-
"postcss-flexbugs-fixes": "^5.0.2",
|
|
92
|
-
"postcss-loader": "^6.2.1",
|
|
93
|
-
"postcss-normalize": "^10.0.1",
|
|
94
|
-
"postcss-preset-env": "^7.0.1",
|
|
95
|
-
"postcss-px-to-viewport": "^1.1.1",
|
|
96
|
-
"postcss-selector-namespace": "^3.0.1",
|
|
97
|
-
"prompts": "^2.4.2",
|
|
98
|
-
"rc-tools": "^9.6.1-alpha.1",
|
|
99
|
-
"react-app-polyfill": "^3.0.0",
|
|
100
|
-
"react-dev-utils": "^12.0.1",
|
|
101
|
-
"react-refresh": "^0.11.0",
|
|
102
|
-
"resolve": "^1.20.0",
|
|
103
|
-
"resolve-url-loader": "^4.0.0",
|
|
104
|
-
"rollup-plugin-dts": "^4.2.2",
|
|
105
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
106
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
107
|
-
"rollup-plugin-styles": "^4.0.0",
|
|
108
|
-
"rollup-plugin-typescript2": "^0.32.1",
|
|
109
|
-
"sass-loader": "^12.3.0",
|
|
110
|
-
"semver": "^7.3.5",
|
|
111
|
-
"source-map-loader": "^3.0.0",
|
|
112
|
-
"style-loader": "^3.3.1",
|
|
113
|
-
"tailwindcss": "^3.0.2",
|
|
114
|
-
"terser-webpack-plugin": "^5.2.5",
|
|
115
|
-
"typescript": "^4.7.2",
|
|
116
|
-
"web-vitals": "^2.1.4",
|
|
117
|
-
"webpack": "^5.64.4",
|
|
118
|
-
"webpack-dev-server": "^4.6.0",
|
|
119
|
-
"webpack-manifest-plugin": "^4.0.2",
|
|
120
|
-
"workbox-webpack-plugin": "^6.4.1"
|
|
121
|
-
},
|
|
122
37
|
"peerDependencies": {
|
|
123
38
|
"react-dom": ">=16.11.0",
|
|
124
39
|
"react": ">=16.11.0"
|
package/README.md
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
# 快捷指令使用
|
|
2
|
-
|
|
3
|
-
## 1、发布 -- npm run pub
|
|
4
|
-
|
|
5
|
-
## 2、新增国际化 -- npm run cl "Hello world"
|
|
6
|
-
|
|
7
|
-
## 3、更新iconfont -- npm run iconfont
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# 设计器二期
|
|
11
|
-
|
|
12
|
-
## 1、基本概念
|
|
13
|
-
|
|
14
|
-
### 1.1、元组件:构成复合组件的最小单位
|
|
15
|
-
|
|
16
|
-
Text、Image、Button、Divider、Video 等
|
|
17
|
-
|
|
18
|
-
### 1.2、复合组件:由若干个元组件构成的一个大组件
|
|
19
|
-
|
|
20
|
-
Text、Banner、Image Gallery、Image and Text、Carousel、Reward、Newsletter 等
|
|
21
|
-
|
|
22
|
-
### 1.3、业务公共组件:项目中复用的公共组件
|
|
23
|
-
|
|
24
|
-
所有的公共组件需要开放 value 和 onChange Api(除 Button、Iconfont)
|
|
25
|
-
|
|
26
|
-
Button、Iconfont、AlignSelecter、Collapse、ColorPicker、ImagePicker、LayoutSelecter、Slider、UrlPicker
|
|
27
|
-
|
|
28
|
-
## 2、元组件
|
|
29
|
-
|
|
30
|
-
### 2.1
|
|
31
|
-
|
|
32
|
-
元组件类型:
|
|
33
|
-
|
|
34
|
-
TEXT、IMAGE、BUTTON、DIVIDER、VIDEO
|
|
35
|
-
|
|
36
|
-
元组件报文格式:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
id:'xxxx' //元组件key
|
|
41
|
-
type: 'TYPE', //元组件类型
|
|
42
|
-
style:{
|
|
43
|
-
fontFamily:'xxx', //字体
|
|
44
|
-
...css //属性名称尽量使用标准css名称
|
|
45
|
-
},
|
|
46
|
-
hoverStyle:{
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
动态设置 hover 效果
|
|
53
|
-
|
|
54
|
-
onMouseEnter={e => { e.target.style.color = 'red'; }}
|
|
55
|
-
|
|
56
|
-
onMouseLeave={e => { e.target.style.color = 'white'; }}
|
|
57
|
-
|
|
58
|
-
文本可编辑
|
|
59
|
-
|
|
60
|
-
contenteditable="true"
|
|
61
|
-
|
|
62
|
-
### 2.2 、元组件报文
|
|
63
|
-
|
|
64
|
-
#### Text
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
id:'xxxx' //元组件key
|
|
69
|
-
type: 'TYPE', //元组件类型
|
|
70
|
-
content:'this is text',
|
|
71
|
-
style:{
|
|
72
|
-
fontFamily:'xxx', //字体
|
|
73
|
-
fontSize: '14px',
|
|
74
|
-
width: '200px',
|
|
75
|
-
...css
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
#### Image
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
id:'xxxx' //元组件key
|
|
85
|
-
type: 'IMAGE', //元组件类型
|
|
86
|
-
name:'123.png',
|
|
87
|
-
src:'../image.png', //图片地址
|
|
88
|
-
url:'www.baidu.com', //图片跳转地址
|
|
89
|
-
style:{
|
|
90
|
-
width: '200px',
|
|
91
|
-
...css
|
|
92
|
-
},
|
|
93
|
-
hoverStyle:{ //hover 类型为new时保存src,类型为enlarge时保存scale
|
|
94
|
-
scale: '2',
|
|
95
|
-
src:'../image1.png',
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
#### Button
|
|
101
|
-
|
|
102
|
-
```json
|
|
103
|
-
{
|
|
104
|
-
id:'xxxx' //元组件key
|
|
105
|
-
type: 'BUTTON', //元组件类型
|
|
106
|
-
name:'Submit',
|
|
107
|
-
url: 'www.baidu.com',
|
|
108
|
-
style:{
|
|
109
|
-
buttonIconSrc:'../img.png',
|
|
110
|
-
buttonIconPlace: 'left',
|
|
111
|
-
color:'#FEFEFE',
|
|
112
|
-
border: '1px solid red',
|
|
113
|
-
borderRadius:'10px',
|
|
114
|
-
fontFamily:'xxx', //字体
|
|
115
|
-
fontSize: '14px',
|
|
116
|
-
...css
|
|
117
|
-
},
|
|
118
|
-
hoverStyle {
|
|
119
|
-
color:'#FEFEFE',
|
|
120
|
-
border: '1px solid red',
|
|
121
|
-
fontFamily:'xxx', //字体
|
|
122
|
-
fontSize: '14px',
|
|
123
|
-
...css
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## 2、复合组件
|
|
129
|
-
|
|
130
|
-
### 2.1
|
|
131
|
-
|
|
132
|
-
元组件类型:
|
|
133
|
-
|
|
134
|
-
TEXT、BANNER、IMAGE_GALLERT、IMAGE_TEXT、CAROUSEL、REWARD、NEWSLETTER
|
|
135
|
-
|
|
136
|
-
复合组件报文格式:
|
|
137
|
-
|
|
138
|
-
```json
|
|
139
|
-
{
|
|
140
|
-
id:'xxxx' //复合组件key
|
|
141
|
-
type: 'TYPE', //复合组件类型
|
|
142
|
-
setting:{ //开关类型的配置及属性配置放在这里
|
|
143
|
-
autoplays: 3, //3秒轮播
|
|
144
|
-
},
|
|
145
|
-
groupSource:[], //元组件集合组数据放在这里
|
|
146
|
-
metas:{
|
|
147
|
-
title:{
|
|
148
|
-
open:false,
|
|
149
|
-
type:'IMAGE'
|
|
150
|
-
...metaCompJson
|
|
151
|
-
},
|
|
152
|
-
subTitle:{
|
|
153
|
-
open:false,
|
|
154
|
-
type:'IMAGE'
|
|
155
|
-
...metaCompJson
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
customize:{
|
|
159
|
-
layout:'',
|
|
160
|
-
background:{
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
#### Text
|
|
168
|
-
|
|
169
|
-
```js
|
|
170
|
-
{
|
|
171
|
-
id: 'xxxx', //复合组件key
|
|
172
|
-
type: 'TEXT', //复合组件类型
|
|
173
|
-
setting:{
|
|
174
|
-
layout:'left', // 模块布局 left/center/right ,每一个layout可能都是一个不同的组件
|
|
175
|
-
title:{
|
|
176
|
-
type:'TEXT'
|
|
177
|
-
...metaCompJson
|
|
178
|
-
},
|
|
179
|
-
subtitle:{
|
|
180
|
-
type:'TEXT'
|
|
181
|
-
...metaCompJson
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
source:[
|
|
185
|
-
{ //此处可以抽出业务组件
|
|
186
|
-
title:{
|
|
187
|
-
type:'TEXT'
|
|
188
|
-
...metaCompJson
|
|
189
|
-
},
|
|
190
|
-
content:{
|
|
191
|
-
type:'TEXT'
|
|
192
|
-
...metaCompJson
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
style:{
|
|
197
|
-
align:'left', //文本布局 left/center/right
|
|
198
|
-
backgroundColor: 'red',
|
|
199
|
-
backgroundImage:'../image.png'
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
#### Banner
|
|
205
|
-
|
|
206
|
-
modifySetting
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"comositeId": "1111",
|
|
211
|
-
|
|
212
|
-
"value": {
|
|
213
|
-
"autoplays": 4
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
```json
|
|
219
|
-
{
|
|
220
|
-
id: 'xxxx',
|
|
221
|
-
type: 'BANNER',
|
|
222
|
-
setting:{
|
|
223
|
-
open:false
|
|
224
|
-
autoplays: 3, //3秒轮播
|
|
225
|
-
arrows:{ // 滚动箭头
|
|
226
|
-
open:false,
|
|
227
|
-
color:'red',
|
|
228
|
-
size:'',
|
|
229
|
-
hoverSize:'',
|
|
230
|
-
hoverColor:'green',
|
|
231
|
-
},
|
|
232
|
-
dots:{ //面板指示点
|
|
233
|
-
open:false,
|
|
234
|
-
color: 'red',
|
|
235
|
-
size:'',
|
|
236
|
-
hoverSize:''
|
|
237
|
-
hoverColor:'green',
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
groupSource:[
|
|
241
|
-
{ //此处可以作为一个业务组件
|
|
242
|
-
id:'xxxxx',
|
|
243
|
-
image:{
|
|
244
|
-
open:false,
|
|
245
|
-
type:'IMAGE'
|
|
246
|
-
...metaCompJson
|
|
247
|
-
},
|
|
248
|
-
title:{
|
|
249
|
-
open:false,
|
|
250
|
-
type:'TEXT',
|
|
251
|
-
...metaCompJson
|
|
252
|
-
},
|
|
253
|
-
content:{
|
|
254
|
-
open:false,
|
|
255
|
-
type:'TEXT',
|
|
256
|
-
...metaCompJson
|
|
257
|
-
},
|
|
258
|
-
button:{
|
|
259
|
-
type:'BUTTON',
|
|
260
|
-
...metaCompJson
|
|
261
|
-
},
|
|
262
|
-
secondaryButton:{
|
|
263
|
-
type:'BUTTON',
|
|
264
|
-
...metaCompJson
|
|
265
|
-
},
|
|
266
|
-
layout:'center',
|
|
267
|
-
align:'left',
|
|
268
|
-
//文本布局 left/center/right
|
|
269
|
-
}
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
#### Image Gallery
|
|
275
|
-
|
|
276
|
-
```json
|
|
277
|
-
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
#### Image and Text
|
|
281
|
-
|
|
282
|
-
```json
|
|
283
|
-
{
|
|
284
|
-
id:'xxxx'
|
|
285
|
-
type: 'IMAGE_TEXT',
|
|
286
|
-
setting:{
|
|
287
|
-
layout:'left',
|
|
288
|
-
title:{},
|
|
289
|
-
subtitle:{},
|
|
290
|
-
button:{},
|
|
291
|
-
secondaryButton:{}
|
|
292
|
-
},
|
|
293
|
-
source:[
|
|
294
|
-
|
|
295
|
-
],
|
|
296
|
-
style:{
|
|
297
|
-
align:'left',
|
|
298
|
-
backgroundColor:'red',
|
|
299
|
-
backgroundImage:'./img.png'
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
疑问:
|
|
305
|
-
|
|
306
|
-
Text 元组件
|
|
307
|
-
|
|
308
|
-
文字链接配置好之后,怎么删除
|
|
309
|
-
|
|
310
|
-
链接配置的规则,按单词还是字符
|
|
311
|
-
|
|
312
|
-
image 元组件
|
|
313
|
-
|
|
314
|
-
属性控制进度条和输入框是否要限制最大最小值
|
|
315
|
-
|
|
316
|
-
button 元组件
|
|
317
|
-
|
|
318
|
-
是否需要 icon 的 hover 效果
|
|
319
|
-
|
|
320
|
-
banner 中的 text Align 放在元组件里?
|