فهرست منبع

모바일 당신을 위한 추천

bin2107 4 سال پیش
والد
کامیت
0da9d301a6
1فایلهای تغییر یافته به همراه118 افزوده شده و 174 حذف شده
  1. 118 174
      src/main/webapp/WEB-INF/views/mob/display/MallMainFormMob.html

+ 118 - 174
src/main/webapp/WEB-INF/views/mob/display/MallMainFormMob.html

@@ -711,7 +711,7 @@
 										itemTag += '						<div class="swiper-slide">\n';
 										itemTag += '							<div class="item_prod">\n';
 										itemTag += '								<div class="item_state">\n';
-										itemTag += '									<a href="javascript:void(0)" class="itemLink">\n';
+										itemTag += '									<a href="'+keyItem.product.itemUrl+'" class="itemLink">\n';
 										itemTag += '										<div class="itemPic">\n';
 										itemTag += '											<img alt="" class=" pd_img" src="'+keyItem.product.itemImage+'">\n';
 										itemTag += '										</div>\n';
@@ -723,19 +723,19 @@
 										itemTag += '						</div>\n';
 									});
 
-									if(i == key1.length-1){
-										itemTag += '						<div class="swiper-slide">\n';
-										itemTag += '							<div class="item_prod">\n';
-										itemTag += '								<div class="item_state">\n';
-										itemTag += '									<a href="javascript:void(0)" class="itemLink" onclick="cfnGoToSearchGoodsListForm(\''+ item.sourceId + '\')">\n';
-										itemTag += '										<div class="itemPic">\n';
-										itemTag += '											<span class="more_txt">더보기</span>\n';
-										itemTag += '										</div>\n';
-										itemTag += '									</a>\n';
-										itemTag += '								</div>\n';
-										itemTag += '							</div>\n';
-										itemTag += '						</div>\n';
-									}
+									//if(i == key1.length-1){
+									itemTag += '						<div class="swiper-slide">\n';
+									itemTag += '							<div class="item_prod">\n';
+									itemTag += '								<div class="item_state">\n';
+									itemTag += '									<a href="javascript:void(0)" class="itemLink" onclick="cfnGoToSearchGoodsListForm(\''+ item.sourceId + '\')">\n';
+									itemTag += '										<div class="itemPic">\n';
+									itemTag += '											<span class="more_txt">더보기</span>\n';
+									itemTag += '										</div>\n';
+									itemTag += '									</a>\n';
+									itemTag += '								</div>\n';
+									itemTag += '							</div>\n';
+									itemTag += '						</div>\n';
+									//}
 								}
 							}
 
@@ -753,73 +753,121 @@
 							}
 						});
 
-						$("#recomItemArea").html(itemTag);
+						if(itemTag.indexOf('swiper-slide') >-1 ){
+							$("#recomItemArea").html(itemTag);
+							fnSwiperScript();
+						}
+					}
+				}
+			});
+		}
 
+		/*]]>*/
+
+	</script>
 
+	<script type="text/javascript">
+		var fnSwiperScript = function (){
+		// post_sug
+		var numCnt = 0;
+		var post_sug = new Swiper('.swiper-container.post-sug', {
+
+			a11y: {
+				enabled: true,
+				notificationClass: 'swiper-notification',
+				prevSlideMessage: '이전 슬라이드',
+				nextSlideMessage: '다음 슬라이드',
+				firstSlideMessage: '첫번째 슬라이드 입니다',
+				lastSlideMessage: '마지막 슬라이드 입니다',
+				paginationBulletMessage: '슬라이드 {{index}}로 이동',
+			},
+			pagination: {
+				el: '.swiper-pagination',
+			},
+			// autoplay: {
+			// 	delay: 24700,
+			// 	disableOnInteraction: false,
+			// },
+			on : {
+				slideChange: function(){
+					foryouIndex = 0;
+					if(numCnt === 0){
+						$(".swiper-slide.type1 .list_cate > li").removeClass('on');
+						$(".swiper-slide.type2 .list_cate > li").removeClass('on');
+						$(".swiper-slide.type2 .list_cate .first").addClass('on');
+						numCnt = 1;
+					} else {
+						$(".swiper-slide.type1 .list_cate > li").removeClass('on');
+						$(".swiper-slide.type2 .list_cate > li").removeClass('on');
+						$(".swiper-slide.type1 .list_cate .first").addClass('on');
+						numCnt = 0;
 					}
 				}
+			},
 
-				// post_sug
-				var numCnt = 0;
-				var post_sug = new Swiper('.swiper-container.post-sug', {
-					a11y: {
-						enabled: true,
-						notificationClass: 'swiper-notification',
-						prevSlideMessage: '이전 슬라이드',
-						nextSlideMessage: '다음 슬라이드',
-						firstSlideMessage: '첫번째 슬라이드 입니다',
-						lastSlideMessage: '마지막 슬라이드 입니다',
-						paginationBulletMessage: '슬라이드 {{index}}로 이동',
-					},
-					pagination: {
-						el: '.swiper-pagination',
-					},
-					// autoplay: {
-					// 	delay: 24700,
-					// 	disableOnInteraction: false,
-					// },
-					on : {
-						slideChange: function(){
-							foryouIndex = 0;
-							if(numCnt === 0){
-								$(".swiper-slide.type1 .list_cate > li").removeClass('on');
-								$(".swiper-slide.type2 .list_cate > li").removeClass('on');
-								$(".swiper-slide.type2 .list_cate .first").addClass('on');
-								numCnt = 1;
-							} else {
-								$(".swiper-slide.type1 .list_cate > li").removeClass('on');
-								$(".swiper-slide.type2 .list_cate > li").removeClass('on');
-								$(".swiper-slide.type1 .list_cate .first").addClass('on');
-								numCnt = 0;
-							}
-						}
-					},
+		});
 
-				});
+		var foryouIndex = 0;
+		var cntNum = 0;
+		function foryouInterval(_foryouIndex) {
+			var foryouCateItems1 = $(".main_foryou .post-sug .swiper-slide.type1.swiper-slide-active .list_cate li");
+			var foryouCateItems2 = $(".main_foryou .post-sug .swiper-slide.type2.swiper-slide-active .list_cate li");
+			$(".main_foryou .post-sug .swiper-slide.type1 .list_cate li").removeClass("on");
+			$(".main_foryou .post-sug .swiper-slide.type2 .list_cate li").removeClass("on");
 
-				var foryouIndex = 0;
-				var cntNum = 0;
-				var post_sug_items = new Swiper ('.swiper-container.post-sug-items', {
-					autoHeight: true, //210720_ 추가
-					slidesPerView: 3,
-					spaceBetween: 10,
-					speed : 1000,
-					a11y: {
-						enabled: true,
-						notificationClass: 'swiper-notification',
-						prevSlideMessage: '이전 슬라이드',
-						nextSlideMessage: '다음 슬라이드',
-						firstSlideMessage: '첫번째 슬라이드 입니다',
-						lastSlideMessage: '마지막 슬라이드 입니다',
-						paginationBulletMessage: '슬라이드 {{index}}로 이동',
-					},
+			if($(".main_foryou .post-sug .swiper-slide.type1").hasClass("swiper-slide-active")){
+				$(foryouCateItems1[(_foryouIndex ) % 5]).addClass("on");
+				if (_foryouIndex >= 5) foryouIndex = 0;
+				foryouIndex++;
+				(foryouCateItems1).click(function () {
+					foryouIndex = $(this).index();
+					clearInterval(stopInter);
+					stopInter = startTimeInterval();
 				});
-
-			});
+			}
+			if($(".main_foryou .post-sug .swiper-slide.type2").hasClass("swiper-slide-active")){
+				$(foryouCateItems2[(_foryouIndex ) % 5]).addClass("on");
+				if (_foryouIndex >= 5) foryouIndex = 0;
+				foryouIndex++;
+				$(foryouCateItems2).click(function () {
+					foryouIndex = $(this).index();
+					clearInterval(stopInter);
+					stopInter = startTimeInterval();
+				});
+			}
+		}
+		function startTimeInterval(){
+			return setInterval(function () {
+				foryouInterval(foryouIndex);
+			}, 5000);
 		}
 
-		/*]]>*/
+		var stopInter = startTimeInterval();
 
+		//setTimeout(function () {
+		//		foryouInterval(foryouIndex);
+		//		if (foryouIndex >= 5) foryouIndex = 0;
+		//		foryouIndex++;
+		//}, 2000);
+
+
+
+		var post_sug_items = new Swiper ('.swiper-container.post-sug-items', {
+			autoHeight: true, //210720_ 추가
+			slidesPerView: 3,
+			spaceBetween: 10,
+			speed : 1000,
+			a11y: {
+				enabled: true,
+				notificationClass: 'swiper-notification',
+				prevSlideMessage: '이전 슬라이드',
+				nextSlideMessage: '다음 슬라이드',
+				firstSlideMessage: '첫번째 슬라이드 입니다',
+				lastSlideMessage: '마지막 슬라이드 입니다',
+				paginationBulletMessage: '슬라이드 {{index}}로 이동',
+			},
+		});
+		}
 	</script>
 
 	<script type="text/javascript">
@@ -1096,110 +1144,6 @@
 			});
 		}
 
-		// post_sug
-		var numCnt = 0;
-		var post_sug = new Swiper('.swiper-container.post-sug', {
-			a11y: {
-				enabled: true,
-				notificationClass: 'swiper-notification',
-				prevSlideMessage: '이전 슬라이드',
-				nextSlideMessage: '다음 슬라이드',
-				firstSlideMessage: '첫번째 슬라이드 입니다',
-				lastSlideMessage: '마지막 슬라이드 입니다',
-				paginationBulletMessage: '슬라이드 {{index}}로 이동',
-			},
-			pagination: {
-				el: '.swiper-pagination',
-			},
-			// autoplay: {
-			// 	delay: 24700,
-			// 	disableOnInteraction: false,
-			// },
-			on : {
-				slideChange: function(){
-					foryouIndex = 0;
-					if(numCnt === 0){
-						$(".swiper-slide.type1 .list_cate > li").removeClass('on');
-						$(".swiper-slide.type2 .list_cate > li").removeClass('on');
-						$(".swiper-slide.type2 .list_cate .first").addClass('on');
-						numCnt = 1;
-					} else {
-						$(".swiper-slide.type1 .list_cate > li").removeClass('on');
-						$(".swiper-slide.type2 .list_cate > li").removeClass('on');
-						$(".swiper-slide.type1 .list_cate .first").addClass('on');
-						numCnt = 0;
-					}
-				}
-			},
-
-		});
-
-		var foryouIndex = 0;
-		var cntNum = 0;
-		function foryouInterval(_foryouIndex) {
-			console.log('here1');
-			var foryouCateItems1 = $(".main_foryou .post-sug .swiper-slide.type1.swiper-slide-active .list_cate li");
-			var foryouCateItems2 = $(".main_foryou .post-sug .swiper-slide.type2.swiper-slide-active .list_cate li");
-			$(".main_foryou .post-sug .swiper-slide.type1 .list_cate li").removeClass("on");
-			$(".main_foryou .post-sug .swiper-slide.type2 .list_cate li").removeClass("on");
-
-			if($(".main_foryou .post-sug .swiper-slide.type1").hasClass("swiper-slide-active")){
-				console.log('here2');
-				$(foryouCateItems1[(_foryouIndex + 1) % 5]).addClass("on");
-				if (_foryouIndex >= 5) foryouIndex = 0;
-				foryouIndex++;
-				$(foryouCateItems1).click(function () {
-					console.log('here333');
-					foryouIndex = $(this).index();
-					console.log('foryouIndex>>'+foryouIndex);
-					clearInterval(stopInter);
-					stopInter = startTimeInterval();
-				});
-			}
-			if($(".main_foryou .post-sug .swiper-slide.type2").hasClass("swiper-slide-active")){
-				$(foryouCateItems2[(_foryouIndex + 1) % 5]).addClass("on");
-				if (_foryouIndex >= 5) foryouIndex = 0;
-				foryouIndex++;
-				$(foryouCateItems2).click(function () {
-					foryouIndex = $(this).index();
-					clearInterval(stopInter);
-					stopInter = startTimeInterval();
-				});
-			}
-		}
-
-		function startTimeInterval(){
-			return setInterval(function () {
-				foryouInterval(foryouIndex);
-			}, 5000);
-		}
-		var stopInter = startTimeInterval();
-
-
-		//setTimeout(function () {
-		//		foryouInterval(foryouIndex);
-		//		if (foryouIndex >= 5) foryouIndex = 0;
-		//		foryouIndex++;
-		//}, 2000);
-
-
-
-		var post_sug_items = new Swiper ('.swiper-container.post-sug-items', {
-			autoHeight: true, //210720_ 추가
-			slidesPerView: 3,
-			spaceBetween: 10,
-			speed : 1000,
-			a11y: {
-				enabled: true,
-				notificationClass: 'swiper-notification',
-				prevSlideMessage: '이전 슬라이드',
-				nextSlideMessage: '다음 슬라이드',
-				firstSlideMessage: '첫번째 슬라이드 입니다',
-				lastSlideMessage: '마지막 슬라이드 입니다',
-				paginationBulletMessage: '슬라이드 {{index}}로 이동',
-			},
-		});
-
 		// post-tv
 		var post_tv = new Swiper ('.post-tv', {
 			loop: true,