@fonixtree/magic-design 2.0.43 → 2.0.44

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.
@@ -211,7 +211,10 @@ function (_super) {
211
211
  onClick: function onClick() {
212
212
  /** PTO 定制GA */
213
213
  if (window.magicDesign.pushGA) {
214
- window.magicDesign.pushGA({}, 'select_promotion');
214
+ window.magicDesign.pushGA({}, 'select_promotion', {
215
+ event_label: (0, _ConfigPanel.getSecondConfigName)(data, item.id),
216
+ promotion_name: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
217
+ });
215
218
  }
216
219
  },
217
220
  onMouseEnter: _this.mouseEnterWrap,
@@ -7,10 +7,12 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _reactSlick = _interopRequireDefault(require("react-slick"));
11
-
12
10
  var _classnames = _interopRequireDefault(require("classnames"));
13
11
 
12
+ var _react2 = require("swiper/react");
13
+
14
+ var _modules = require("swiper/modules");
15
+
14
16
  var _components = require("../../../../../meta-comp/components");
15
17
 
16
18
  var _mobx = require("../../../../../mobx");
@@ -27,12 +29,14 @@ var _currencyUtil = require("../../../../../utils/currencyUtil");
27
29
 
28
30
  var _ConfigPanel = require("../../../../../core/Designer/ConfigPanel");
29
31
 
32
+ require("swiper/css");
33
+
34
+ require("swiper/css/effect-cards");
35
+
30
36
  require("./index.less");
31
37
 
32
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
39
 
34
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
35
-
36
40
  var __extends = void 0 && (void 0).__extends || function () {
37
41
  var _extendStatics = function extendStatics(d, b) {
38
42
  _extendStatics = Object.setPrototypeOf || {
@@ -243,7 +247,7 @@ function (_super) {
243
247
  sliderIndex: 0,
244
248
  userWalletData: {}
245
249
  };
246
- _this.sliderRef = null;
250
+ _this.swiperRef = null;
247
251
  _this.destroy = null;
248
252
 
249
253
  _this.getMyWalletData = function () {
@@ -306,12 +310,12 @@ function (_super) {
306
310
  // defaultShowWallet: 'Balance',
307
311
  // };
308
312
 
309
- if (data.customize.layout === 'layout2' && this.sliderRef) {
313
+ if (data.customize.layout === 'layout2' && this.swiperRef) {
310
314
  defaultShowIndex_1 = 0;
311
315
  data.groupSource.forEach(function (f, i) {
312
316
  if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
313
317
  });
314
- this.sliderRef.slickGoTo(defaultShowIndex_1);
318
+ this.swiperRef.slideTo(defaultShowIndex_1);
315
319
  }
316
320
 
317
321
  bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
@@ -384,7 +388,7 @@ function (_super) {
384
388
  });
385
389
 
386
390
  if (nextIndex != -1 && nextIndex != _this.state.sliderIndex) {
387
- _this.sliderRef.slickGoTo(nextIndex);
391
+ _this.swiperRef.slideTo(nextIndex);
388
392
  }
389
393
  };
390
394
 
@@ -396,26 +400,30 @@ function (_super) {
396
400
 
397
401
  this.getMyWalletData();
398
402
  this.destroy = (0, _mobx.autorun)(function () {
399
- if (_this.props.data.customize.layout === 'layout2' && _this.sliderRef) {
403
+ var _a;
404
+
405
+ if (_this.props.data.customize.layout === 'layout2' && _this.swiperRef) {
400
406
  _this.sliderGoTo(_this.props.data.groupSource);
401
407
  /** 设计器模式下 如果选中特定group 自动播放关闭 */
402
408
 
403
409
 
404
410
  if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
405
- _this.sliderRef.slickPause();
411
+ (_a = _this.swiperRef.autoplay) === null || _a === void 0 ? void 0 : _a.stop();
406
412
  }
407
413
  }
408
414
  });
409
415
  };
410
416
 
411
417
  WalletMobile.prototype.componentWillReceiveProps = function (nextProps) {
412
- if (nextProps.data.customize.layout === 'layout2' && this.sliderRef) {
418
+ var _a, _b;
419
+
420
+ if (nextProps.data.customize.layout === 'layout2' && this.swiperRef) {
413
421
  this.sliderGoTo(nextProps.data.groupSource);
414
422
 
415
423
  if (nextProps.data.setting.autoplay.open) {
416
- this.sliderRef.slickPlay();
424
+ (_a = this.swiperRef.autoplay) === null || _a === void 0 ? void 0 : _a.start();
417
425
  } else {
418
- this.sliderRef.slickPause();
426
+ (_b = this.swiperRef.autoplay) === null || _b === void 0 ? void 0 : _b.stop();
419
427
  }
420
428
  }
421
429
  };
@@ -423,37 +431,20 @@ function (_super) {
423
431
  WalletMobile.prototype.render = function () {
424
432
  var _this = this;
425
433
 
426
- var _a, _b, _c, _d, _e, _f, _g, _h;
434
+ var _a, _b, _c, _d, _e, _f, _g;
427
435
 
428
436
  var data = this.props.data;
429
437
  var sliderIndex = this.state.sliderIndex;
430
438
  var colNum = data.customize.rowNum;
431
- var autoplay = (_b = (_a = data.setting) === null || _a === void 0 ? void 0 : _a.autoplay) === null || _b === void 0 ? void 0 : _b.open;
432
439
  /** 设计器模式下 如果选中特定group 自动播放关闭 */
433
440
 
434
441
  if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
435
- autoplay = false;
442
+ (_a = this.swiperRef.autoplay) === null || _a === void 0 ? void 0 : _a.stop();
436
443
  }
437
444
 
438
- var settings = {
439
- className: 'slider-wrap',
440
- arrows: false,
441
- dots: false,
442
- autoplay: autoplay,
443
- autoplaySpeed: ((_d = (_c = data.setting) === null || _c === void 0 ? void 0 : _c.autoplay) === null || _d === void 0 ? void 0 : _d.interval) * 1000,
444
- speed: 500,
445
- draggable: window.magicDesign.mode === 'renderer',
446
- slidesToShow: 1,
447
- slidesToScroll: 1,
448
- beforeChange: function beforeChange(oldIndex, newIndex) {
449
- _this.setState({
450
- sliderIndex: newIndex
451
- });
452
- }
453
- };
454
445
  var navStyle = {
455
- fontSize: (0, _commonUtil.convertToRem)((_f = (_e = data.setting) === null || _e === void 0 ? void 0 : _e.navigation) === null || _f === void 0 ? void 0 : _f.size),
456
- color: (_h = (_g = data.setting) === null || _g === void 0 ? void 0 : _g.navigation) === null || _h === void 0 ? void 0 : _h.color
446
+ fontSize: (0, _commonUtil.convertToRem)((_c = (_b = data.setting) === null || _b === void 0 ? void 0 : _b.navigation) === null || _c === void 0 ? void 0 : _c.size),
447
+ color: (_e = (_d = data.setting) === null || _d === void 0 ? void 0 : _d.navigation) === null || _e === void 0 ? void 0 : _e.color
457
448
  };
458
449
 
459
450
  var getItemContent = function getItemContent(item, preItem, nextItem) {
@@ -567,42 +558,54 @@ function (_super) {
567
558
  style: (0, _commonUtil.pxToRem)({
568
559
  gap: MOBILE_IMG_SIZE[colNum].gap
569
560
  })
570
- }, data.groupSource.map(function (item, index) {
571
- var preItem = index === 0 ? {} : data.groupSource[index - 1];
572
- var nextItem = index === data.groupSource.length ? {} : data.groupSource[index + 1];
561
+ }, data.groupSource.map(function (item) {
573
562
  return /*#__PURE__*/_react["default"].createElement("div", {
574
563
  key: item.id,
575
564
  className: "item-wrap",
576
565
  style: (0, _commonUtil.pxToRem)({
577
566
  width: "calc((100% - " + (0, _commonUtil.convertToRem)(MOBILE_IMG_SIZE[colNum].gap * (colNum - 1)) + ") / " + colNum + ")"
578
567
  })
579
- }, getItemContent(item, preItem, nextItem));
568
+ }, getItemContent(item));
580
569
  })) : /*#__PURE__*/_react["default"].createElement("div", {
581
570
  className: "carousel-layout"
582
571
  }, data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
583
572
  className: "carousel-icon-left",
584
573
  onClick: function onClick() {
585
- return _this.sliderRef.slickPrev();
574
+ return _this.swiperRef.slidePrev();
586
575
  },
587
576
  onMouseEnter: this.mouseEnterBtn,
588
577
  onMouseLeave: this.mouseLeaveBtn,
589
578
  style: navStyle,
590
579
  type: "icon-left"
591
- }), /*#__PURE__*/_react["default"].createElement(_reactSlick["default"], _extends({
592
- ref: function ref(slider) {
593
- return _this.sliderRef = slider;
594
- }
595
- }, settings), data.groupSource.map(function (item, index) {
596
- var preItem = index === 0 ? {} : data.groupSource[index - 1];
597
- var nextItem = index === data.groupSource.length ? {} : data.groupSource[index + 1];
598
- return /*#__PURE__*/_react["default"].createElement("div", {
580
+ }), /*#__PURE__*/_react["default"].createElement(_react2.Swiper, {
581
+ autoplay: {
582
+ delay: ((_g = (_f = data.setting) === null || _f === void 0 ? void 0 : _f.autoplay) === null || _g === void 0 ? void 0 : _g.interval) * 1000
583
+ },
584
+ effect: "cards",
585
+ loop: true,
586
+ modules: [_modules.EffectCards, _modules.Autoplay],
587
+ onSlideChange: function onSlideChange(swiper) {
588
+ return _this.setState({
589
+ sliderIndex: swiper.realIndex || 0
590
+ });
591
+ },
592
+ onSwiper: function onSwiper(swiper) {
593
+ return _this.swiperRef = swiper;
594
+ },
595
+ slidesPerView: 1
596
+ }, data.groupSource.map(function (item, index) {
597
+ var preItemFirst = data.groupSource.length > 1 ? data.groupSource[data.groupSource.length - 1] : null;
598
+ var preItemLast = data.groupSource.length > 1 ? data.groupSource[0] : null;
599
+ var preItem = index === 0 ? preItemFirst : data.groupSource[index - 1];
600
+ var nextItem = index === data.groupSource.length - 1 ? preItemLast : data.groupSource[index + 1];
601
+ return /*#__PURE__*/_react["default"].createElement(_react2.SwiperSlide, null, /*#__PURE__*/_react["default"].createElement("div", {
599
602
  key: item.id,
600
603
  className: "item-wrap"
601
- }, getItemContent(item, preItem, nextItem));
604
+ }, getItemContent(item, preItem, nextItem)));
602
605
  })), data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
603
606
  className: "carousel-icon-right",
604
607
  onClick: function onClick() {
605
- return _this.sliderRef.slickNext();
608
+ return _this.swiperRef.slideNext();
606
609
  },
607
610
  onMouseEnter: this.mouseEnterBtn,
608
611
  onMouseLeave: this.mouseLeaveBtn,
@@ -617,7 +620,7 @@ function (_super) {
617
620
  active: i == sliderIndex
618
621
  }),
619
622
  onClick: function onClick() {
620
- return _this.sliderRef.slickGoTo(i);
623
+ return _this.swiperRef.slideTo(i);
621
624
  },
622
625
  style: (0, _commonUtil.pxToRem)({
623
626
  backgroundColor: i == sliderIndex ? data.setting.dots.hoverColor : data.setting.dots.color,
@@ -8,14 +8,14 @@
8
8
  justify-content: center;
9
9
  flex-wrap: wrap;
10
10
  border-radius: 0.2rem;
11
- padding: 0.4rem 0.8rem 1.8rem 0.8rem;
11
+ padding: 0.2rem 0.8rem 1.3rem 0.8rem;
12
12
  }
13
13
  .m-Wallet-mobile .item-wrap .text-content .wallet-btn {
14
- margin-top: 0.4rem;
14
+ margin-top: 0.2rem;
15
15
  }
16
16
  .m-Wallet-mobile .item-wrap .text-content .peek {
17
17
  position: absolute;
18
- bottom: 0.32rem;
18
+ bottom: 0.16rem;
19
19
  width: 1.2rem !important;
20
20
  white-space: nowrap;
21
21
  }
@@ -28,9 +28,10 @@
28
28
  .m-Wallet-mobile .column-layout {
29
29
  display: flex;
30
30
  flex-wrap: wrap;
31
+ justify-content: space-between;
31
32
  }
32
33
  .m-Wallet-mobile .column-layout .text-content {
33
- padding: 0.2rem 0 0.4rem 0;
34
+ padding: 0.2rem 0 0.2rem 0;
34
35
  }
35
36
  .m-Wallet-mobile .column-layout .text-content .wallet-btn {
36
37
  margin-top: 0.2rem;
@@ -44,6 +45,10 @@
44
45
  .m-Wallet-mobile .column-layout .text-content .peek.right {
45
46
  right: 0.32rem;
46
47
  }
48
+ .m-Wallet-mobile .carousel-layout {
49
+ position: relative;
50
+ min-height: 4.8rem;
51
+ }
47
52
  .m-Wallet-mobile .carousel-layout .slick-track {
48
53
  display: flex;
49
54
  justify-content: center;
@@ -65,14 +70,16 @@
65
70
  bottom: 0;
66
71
  margin: auto;
67
72
  cursor: pointer;
73
+ z-index: 10;
68
74
  }
69
75
  .m-Wallet-mobile .carousel-layout .swiper-ban {
70
76
  position: absolute;
71
77
  width: 100%;
72
- bottom: 0.8rem;
78
+ bottom: 0.6rem;
73
79
  display: flex;
74
80
  align-items: center;
75
81
  justify-content: center;
82
+ z-index: 10;
76
83
  }
77
84
  .m-Wallet-mobile .carousel-layout .swiper-ban .ban {
78
85
  font-size: 0.16rem;
@@ -211,7 +211,10 @@ function (_super) {
211
211
  onClick: function onClick() {
212
212
  /** PTO 定制GA */
213
213
  if (window.magicDesign.pushGA) {
214
- window.magicDesign.pushGA({}, 'select_promotion');
214
+ window.magicDesign.pushGA({}, 'select_promotion', {
215
+ event_label: (0, _ConfigPanel.getSecondConfigName)(data, item.id),
216
+ promotion_name: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
217
+ });
215
218
  }
216
219
  },
217
220
  onMouseEnter: _this.mouseEnterWrap,
@@ -7,10 +7,12 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _reactSlick = _interopRequireDefault(require("react-slick"));
11
-
12
10
  var _classnames = _interopRequireDefault(require("classnames"));
13
11
 
12
+ var _react2 = require("swiper/react");
13
+
14
+ var _modules = require("swiper/modules");
15
+
14
16
  var _components = require("../../../../../meta-comp/components");
15
17
 
16
18
  var _mobx = require("../../../../../mobx");
@@ -27,12 +29,14 @@ var _currencyUtil = require("../../../../../utils/currencyUtil");
27
29
 
28
30
  var _ConfigPanel = require("../../../../../core/Designer/ConfigPanel");
29
31
 
32
+ require("swiper/css");
33
+
34
+ require("swiper/css/effect-cards");
35
+
30
36
  require("./index.less");
31
37
 
32
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
39
 
34
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
35
-
36
40
  var __extends = void 0 && (void 0).__extends || function () {
37
41
  var _extendStatics = function extendStatics(d, b) {
38
42
  _extendStatics = Object.setPrototypeOf || {
@@ -243,7 +247,7 @@ function (_super) {
243
247
  sliderIndex: 0,
244
248
  userWalletData: {}
245
249
  };
246
- _this.sliderRef = null;
250
+ _this.swiperRef = null;
247
251
  _this.destroy = null;
248
252
 
249
253
  _this.getMyWalletData = function () {
@@ -306,12 +310,12 @@ function (_super) {
306
310
  // defaultShowWallet: 'Balance',
307
311
  // };
308
312
 
309
- if (data.customize.layout === 'layout2' && this.sliderRef) {
313
+ if (data.customize.layout === 'layout2' && this.swiperRef) {
310
314
  defaultShowIndex_1 = 0;
311
315
  data.groupSource.forEach(function (f, i) {
312
316
  if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
313
317
  });
314
- this.sliderRef.slickGoTo(defaultShowIndex_1);
318
+ this.swiperRef.slideTo(defaultShowIndex_1);
315
319
  }
316
320
 
317
321
  bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
@@ -384,7 +388,7 @@ function (_super) {
384
388
  });
385
389
 
386
390
  if (nextIndex != -1 && nextIndex != _this.state.sliderIndex) {
387
- _this.sliderRef.slickGoTo(nextIndex);
391
+ _this.swiperRef.slideTo(nextIndex);
388
392
  }
389
393
  };
390
394
 
@@ -396,26 +400,30 @@ function (_super) {
396
400
 
397
401
  this.getMyWalletData();
398
402
  this.destroy = (0, _mobx.autorun)(function () {
399
- if (_this.props.data.customize.layout === 'layout2' && _this.sliderRef) {
403
+ var _a;
404
+
405
+ if (_this.props.data.customize.layout === 'layout2' && _this.swiperRef) {
400
406
  _this.sliderGoTo(_this.props.data.groupSource);
401
407
  /** 设计器模式下 如果选中特定group 自动播放关闭 */
402
408
 
403
409
 
404
410
  if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
405
- _this.sliderRef.slickPause();
411
+ (_a = _this.swiperRef.autoplay) === null || _a === void 0 ? void 0 : _a.stop();
406
412
  }
407
413
  }
408
414
  });
409
415
  };
410
416
 
411
417
  WalletMobile.prototype.componentWillReceiveProps = function (nextProps) {
412
- if (nextProps.data.customize.layout === 'layout2' && this.sliderRef) {
418
+ var _a, _b;
419
+
420
+ if (nextProps.data.customize.layout === 'layout2' && this.swiperRef) {
413
421
  this.sliderGoTo(nextProps.data.groupSource);
414
422
 
415
423
  if (nextProps.data.setting.autoplay.open) {
416
- this.sliderRef.slickPlay();
424
+ (_a = this.swiperRef.autoplay) === null || _a === void 0 ? void 0 : _a.start();
417
425
  } else {
418
- this.sliderRef.slickPause();
426
+ (_b = this.swiperRef.autoplay) === null || _b === void 0 ? void 0 : _b.stop();
419
427
  }
420
428
  }
421
429
  };
@@ -423,37 +431,20 @@ function (_super) {
423
431
  WalletMobile.prototype.render = function () {
424
432
  var _this = this;
425
433
 
426
- var _a, _b, _c, _d, _e, _f, _g, _h;
434
+ var _a, _b, _c, _d, _e, _f, _g;
427
435
 
428
436
  var data = this.props.data;
429
437
  var sliderIndex = this.state.sliderIndex;
430
438
  var colNum = data.customize.rowNum;
431
- var autoplay = (_b = (_a = data.setting) === null || _a === void 0 ? void 0 : _a.autoplay) === null || _b === void 0 ? void 0 : _b.open;
432
439
  /** 设计器模式下 如果选中特定group 自动播放关闭 */
433
440
 
434
441
  if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
435
- autoplay = false;
442
+ (_a = this.swiperRef.autoplay) === null || _a === void 0 ? void 0 : _a.stop();
436
443
  }
437
444
 
438
- var settings = {
439
- className: 'slider-wrap',
440
- arrows: false,
441
- dots: false,
442
- autoplay: autoplay,
443
- autoplaySpeed: ((_d = (_c = data.setting) === null || _c === void 0 ? void 0 : _c.autoplay) === null || _d === void 0 ? void 0 : _d.interval) * 1000,
444
- speed: 500,
445
- draggable: window.magicDesign.mode === 'renderer',
446
- slidesToShow: 1,
447
- slidesToScroll: 1,
448
- beforeChange: function beforeChange(oldIndex, newIndex) {
449
- _this.setState({
450
- sliderIndex: newIndex
451
- });
452
- }
453
- };
454
445
  var navStyle = {
455
- fontSize: (0, _commonUtil.convertToRem)((_f = (_e = data.setting) === null || _e === void 0 ? void 0 : _e.navigation) === null || _f === void 0 ? void 0 : _f.size),
456
- color: (_h = (_g = data.setting) === null || _g === void 0 ? void 0 : _g.navigation) === null || _h === void 0 ? void 0 : _h.color
446
+ fontSize: (0, _commonUtil.convertToRem)((_c = (_b = data.setting) === null || _b === void 0 ? void 0 : _b.navigation) === null || _c === void 0 ? void 0 : _c.size),
447
+ color: (_e = (_d = data.setting) === null || _d === void 0 ? void 0 : _d.navigation) === null || _e === void 0 ? void 0 : _e.color
457
448
  };
458
449
 
459
450
  var getItemContent = function getItemContent(item, preItem, nextItem) {
@@ -567,42 +558,54 @@ function (_super) {
567
558
  style: (0, _commonUtil.pxToRem)({
568
559
  gap: MOBILE_IMG_SIZE[colNum].gap
569
560
  })
570
- }, data.groupSource.map(function (item, index) {
571
- var preItem = index === 0 ? {} : data.groupSource[index - 1];
572
- var nextItem = index === data.groupSource.length ? {} : data.groupSource[index + 1];
561
+ }, data.groupSource.map(function (item) {
573
562
  return /*#__PURE__*/_react["default"].createElement("div", {
574
563
  key: item.id,
575
564
  className: "item-wrap",
576
565
  style: (0, _commonUtil.pxToRem)({
577
566
  width: "calc((100% - " + (0, _commonUtil.convertToRem)(MOBILE_IMG_SIZE[colNum].gap * (colNum - 1)) + ") / " + colNum + ")"
578
567
  })
579
- }, getItemContent(item, preItem, nextItem));
568
+ }, getItemContent(item));
580
569
  })) : /*#__PURE__*/_react["default"].createElement("div", {
581
570
  className: "carousel-layout"
582
571
  }, data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
583
572
  className: "carousel-icon-left",
584
573
  onClick: function onClick() {
585
- return _this.sliderRef.slickPrev();
574
+ return _this.swiperRef.slidePrev();
586
575
  },
587
576
  onMouseEnter: this.mouseEnterBtn,
588
577
  onMouseLeave: this.mouseLeaveBtn,
589
578
  style: navStyle,
590
579
  type: "icon-left"
591
- }), /*#__PURE__*/_react["default"].createElement(_reactSlick["default"], _extends({
592
- ref: function ref(slider) {
593
- return _this.sliderRef = slider;
594
- }
595
- }, settings), data.groupSource.map(function (item, index) {
596
- var preItem = index === 0 ? {} : data.groupSource[index - 1];
597
- var nextItem = index === data.groupSource.length ? {} : data.groupSource[index + 1];
598
- return /*#__PURE__*/_react["default"].createElement("div", {
580
+ }), /*#__PURE__*/_react["default"].createElement(_react2.Swiper, {
581
+ autoplay: {
582
+ delay: ((_g = (_f = data.setting) === null || _f === void 0 ? void 0 : _f.autoplay) === null || _g === void 0 ? void 0 : _g.interval) * 1000
583
+ },
584
+ effect: "cards",
585
+ loop: true,
586
+ modules: [_modules.EffectCards, _modules.Autoplay],
587
+ onSlideChange: function onSlideChange(swiper) {
588
+ return _this.setState({
589
+ sliderIndex: swiper.realIndex || 0
590
+ });
591
+ },
592
+ onSwiper: function onSwiper(swiper) {
593
+ return _this.swiperRef = swiper;
594
+ },
595
+ slidesPerView: 1
596
+ }, data.groupSource.map(function (item, index) {
597
+ var preItemFirst = data.groupSource.length > 1 ? data.groupSource[data.groupSource.length - 1] : null;
598
+ var preItemLast = data.groupSource.length > 1 ? data.groupSource[0] : null;
599
+ var preItem = index === 0 ? preItemFirst : data.groupSource[index - 1];
600
+ var nextItem = index === data.groupSource.length - 1 ? preItemLast : data.groupSource[index + 1];
601
+ return /*#__PURE__*/_react["default"].createElement(_react2.SwiperSlide, null, /*#__PURE__*/_react["default"].createElement("div", {
599
602
  key: item.id,
600
603
  className: "item-wrap"
601
- }, getItemContent(item, preItem, nextItem));
604
+ }, getItemContent(item, preItem, nextItem)));
602
605
  })), data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
603
606
  className: "carousel-icon-right",
604
607
  onClick: function onClick() {
605
- return _this.sliderRef.slickNext();
608
+ return _this.swiperRef.slideNext();
606
609
  },
607
610
  onMouseEnter: this.mouseEnterBtn,
608
611
  onMouseLeave: this.mouseLeaveBtn,
@@ -617,7 +620,7 @@ function (_super) {
617
620
  active: i == sliderIndex
618
621
  }),
619
622
  onClick: function onClick() {
620
- return _this.sliderRef.slickGoTo(i);
623
+ return _this.swiperRef.slideTo(i);
621
624
  },
622
625
  style: (0, _commonUtil.pxToRem)({
623
626
  backgroundColor: i == sliderIndex ? data.setting.dots.hoverColor : data.setting.dots.color,
@@ -8,14 +8,14 @@
8
8
  justify-content: center;
9
9
  flex-wrap: wrap;
10
10
  border-radius: 0.2rem;
11
- padding: 0.4rem 0.8rem 1.8rem 0.8rem;
11
+ padding: 0.2rem 0.8rem 1.3rem 0.8rem;
12
12
  }
13
13
  .m-Wallet-mobile .item-wrap .text-content .wallet-btn {
14
- margin-top: 0.4rem;
14
+ margin-top: 0.2rem;
15
15
  }
16
16
  .m-Wallet-mobile .item-wrap .text-content .peek {
17
17
  position: absolute;
18
- bottom: 0.32rem;
18
+ bottom: 0.16rem;
19
19
  width: 1.2rem !important;
20
20
  white-space: nowrap;
21
21
  }
@@ -28,9 +28,10 @@
28
28
  .m-Wallet-mobile .column-layout {
29
29
  display: flex;
30
30
  flex-wrap: wrap;
31
+ justify-content: space-between;
31
32
  }
32
33
  .m-Wallet-mobile .column-layout .text-content {
33
- padding: 0.2rem 0 0.4rem 0;
34
+ padding: 0.2rem 0 0.2rem 0;
34
35
  }
35
36
  .m-Wallet-mobile .column-layout .text-content .wallet-btn {
36
37
  margin-top: 0.2rem;
@@ -44,6 +45,10 @@
44
45
  .m-Wallet-mobile .column-layout .text-content .peek.right {
45
46
  right: 0.32rem;
46
47
  }
48
+ .m-Wallet-mobile .carousel-layout {
49
+ position: relative;
50
+ min-height: 4.8rem;
51
+ }
47
52
  .m-Wallet-mobile .carousel-layout .slick-track {
48
53
  display: flex;
49
54
  justify-content: center;
@@ -65,14 +70,16 @@
65
70
  bottom: 0;
66
71
  margin: auto;
67
72
  cursor: pointer;
73
+ z-index: 10;
68
74
  }
69
75
  .m-Wallet-mobile .carousel-layout .swiper-ban {
70
76
  position: absolute;
71
77
  width: 100%;
72
- bottom: 0.8rem;
78
+ bottom: 0.6rem;
73
79
  display: flex;
74
80
  align-items: center;
75
81
  justify-content: center;
82
+ z-index: 10;
76
83
  }
77
84
  .m-Wallet-mobile .carousel-layout .swiper-ban .ban {
78
85
  font-size: 0.16rem;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.43",
4
+ "version": "2.0.44",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
@@ -41,7 +41,8 @@
41
41
  "replace": "^1.2.1",
42
42
  "shortid": "^2.2.16",
43
43
  "slick-carousel": "^1.8.1",
44
- "spark-md5": "^3.0.2"
44
+ "spark-md5": "^3.0.2",
45
+ "swiper": "^11.0.1"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "react": ">=16.11.0",