diff --git a/src/pages/plan/product/add.js b/src/pages/plan/product/add.js index 170f7a44..63ae24ed 100644 --- a/src/pages/plan/product/add.js +++ b/src/pages/plan/product/add.js @@ -49,8 +49,14 @@ export default class adduserinfo extends React.Component{ autoplay : 3000, initialSlide :0, observer: true, // 修改swiper自己或子元素时,自动初始化swiper - observeParents: true, // 修改swiper的父元素时,自动初始化swiper + observeParents: false, // 修改swiper的父元素时,自动初始化swiper pagination: '.swiper-pagination', + paginationClickable:true, + onSlideChangeEnd: function(swiper){ +    this.mySwiper.update(); +    this.mySwiper.startAutoplay(); +    this.mySwiper.reLoop(); + } }) @@ -119,8 +125,13 @@ export default class adduserinfo extends React.Component{ componentWillReceiveProps() { + console.log("更新") + // this.mySwiper.stopAutoplay(); + + // this.mySwiper.update(); + // this.mySwiper.reLoop(); + // this.mySwiper.startAutoplay(); - this.mySwiper.update(); } //获取直连天下商品映射信息 @@ -429,7 +440,12 @@ export default class adduserinfo extends React.Component{ this.setState({productpic:temp_arr}) } - this.mySwiper.update(); + this.mySwiper.stopAutoplay(); + + this.mySwiper.update(); + this.mySwiper.reLoop(); + this.mySwiper.startAutoplay(); + }; onUploadChange2(files){