Pārlūkot izejas kodu

修改屏幕左滑和右滑不显示问题

wuyongxiang 4 gadi atpakaļ
vecāks
revīzija
53e78e8293
1 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. 11 4
      screenH5/homeNew.html

+ 11 - 4
screenH5/homeNew.html

@@ -375,9 +375,9 @@
 								console.log("slideChangeTransitionEnd", this.activeIndex)
 								this.activeIndexData = this.activeIndex;
 								if (this.swipeDirection == "next") {
-									that.getSwiperInfo("next");
+									that.getSwiperInfo("nextSlide");
 								} else if (this.swipeDirection == "prev") {
-									that.getSwiperInfo("prev");
+									that.getSwiperInfo("prevSlide");
 								}
 							},
 							// slideChangeStart: function() {
@@ -457,16 +457,23 @@
 
 					},
 					getSwiperInfo(data) {
-						console.log("方向=======",data);
+						console.log("方向=======",data, $('.swiper-slide-active').index());
+						// return
 						if (data == "next") {
 							var activeIndex = $('.swiper-slide-active').index() + 1;
 						} else if (data == "prev") {
 							var activeIndex = $('.swiper-slide-active').index() - 1;
 
+						}else if (data == "prevSlide") {
+							var activeIndex = $('.swiper-slide-active').index();
+
+						}else if (data == "nextSlide") {
+							var activeIndex = $('.swiper-slide-active').index();
+
 						}
 						var ids = "#wine" + $('.swiper-slide-active').index();
 						var domprev = $(ids);
-						console.log("下标id======", ids);
+						console.log("下标id======", activeIndex);
 						domprev.empty();
 						let rbdData = {
 							"userCardId": this.homeList[activeIndex].id,