Browse Source

모바일 검색화면 수정

bin2107 4 years ago
parent
commit
ea155f5107

+ 5 - 5
src/main/webapp/WEB-INF/views/mob/display/SearchGoodsListFormMob.html

@@ -341,7 +341,7 @@
 						<!-- 필터메뉴 -->
 						<!-- 필터메뉴 -->
 						<ul class="allFilter">
 						<ul class="allFilter">
 							<li class="categori chkFilter" id="categoryFilterDiv">
 							<li class="categori chkFilter" id="categoryFilterDiv">
-								<a href="javascript:void(0)" class="daps1">카테고리</a>
+								<a href="javascript:void(0)" class="daps1">카테고리<span class="pic"></span></a>
 								<ul class="daps2" id="categoryArea">
 								<ul class="daps2" id="categoryArea">
 
 
 								</ul>
 								</ul>
@@ -928,21 +928,21 @@
 		let tag = '';
 		let tag = '';
 		if(cate1 != null){
 		if(cate1 != null){
 			tag += '<li>\n';
 			tag += '<li>\n';
-			tag += '	<a href="javascript:void(0)" onclick="fnSetCateFilter(\''+cate1.cate1No+'\');">'+cate1.cate1Nm+'</a>';
+			tag += '	<a href="javascript:void(0)" data-depth="1" onclick="fnSetMobCateFilter(this, \''+cate1.cate1No+'\');" cateFullNm="'+cate1.cate1Nm+'">'+cate1.cate1Nm+'</a>';
 			if(cate1.leafYn == 'N' && cate1.cate2List.length > 0){
 			if(cate1.leafYn == 'N' && cate1.cate2List.length > 0){
 				tag += '	<ul class="daps3">\n';
 				tag += '	<ul class="daps3">\n';
 				$.each(cate1.cate2List, function (idx2,cate2){
 				$.each(cate1.cate2List, function (idx2,cate2){
 					tag += '		<li>\n';
 					tag += '		<li>\n';
-					tag += '			<a href="javascript:void(0)" onclick="fnSetCateFilter(\''+cate1.cate1No+'\',\''+cate2.cate2No+'\');">'+cate2.cate2Nm+'</a>';
+					tag += '			<a href="javascript:void(0)" data-depth="2" onclick="fnSetMobCateFilter(this, \''+cate1.cate1No+'\',\''+cate2.cate2No+'\');" cateFullNm="'+cate1.cate1Nm+'>'+cate2.cate2Nm+'">'+cate2.cate2Nm+'</a>';
 					if(cate2.leafYn == 'N' && cate2.cate3List.length > 0){
 					if(cate2.leafYn == 'N' && cate2.cate3List.length > 0){
 						tag += '	<ul class="daps4">\n';
 						tag += '	<ul class="daps4">\n';
 						$.each(cate2.cate3List, function (idx3,cate3){
 						$.each(cate2.cate3List, function (idx3,cate3){
 							tag += '<li>\n';
 							tag += '<li>\n';
-							tag += '<a href="javascript:void(0)" onclick="fnSetCateFilter(\''+cate1.cate1No+'\',\''+cate2.cate2No+'\',\''+cate3.cate3No+'\');">'+cate3.cate3Nm+'</a>\n';
+							tag += '<a href="javascript:void(0)" data-depth="3" onclick="fnSetMobCateFilter(this,\''+cate1.cate1No+'\',\''+cate2.cate2No+'\',\''+cate3.cate3No+'\');" cateFullNm="'+cate1.cate1Nm+'>'+cate2.cate2Nm+'>'+cate3.cate3Nm+'">'+cate3.cate3Nm+'</a>\n';
 							if(cate3.leafYn == 'N' && cate3.cate4List.length >0){
 							if(cate3.leafYn == 'N' && cate3.cate4List.length >0){
 								tag += '<ul class="daps5">\n';
 								tag += '<ul class="daps5">\n';
 								$.each(cate3.cate4List, function (idx4,cate4){
 								$.each(cate3.cate4List, function (idx4,cate4){
-									tag += '<li><a href="javascript:void(0)" onclick="fnSetCateFilter(\''+cate1.cate1No+'\',\''+cate2.cate2No+'\',\''+cate3.cate3No+'\',\''+cate4.cate4No+'\');">'+cate4.cate4Nm+'</a></li>\n';
+									tag += '<li><a href="javascript:void(0)" data-depth="4" onclick="fnSetMobCateFilter(this,\''+cate1.cate1No+'\',\''+cate2.cate2No+'\',\''+cate3.cate3No+'\',\''+cate4.cate4No+'\');" cateFullNm="'+cate1.cate1Nm+'>'+cate2.cate2Nm+'>'+cate3.cate3Nm+'>'+cate4.cate4Nm+'">'+cate4.cate4Nm+'</a></li>\n';
 								});
 								});
 								tag += '</ul>\n';
 								tag += '</ul>\n';
 							}
 							}

+ 69 - 0
src/main/webapp/biz/search.js

@@ -705,4 +705,73 @@ var fnSelectFilerMob = function (obj, gubun, staus, sizeGb){
 	fnFilterSet(gubun, sizeGb, 'Mob');
 	fnFilterSet(gubun, sizeGb, 'Mob');
 }
 }
 
 
+var fnSetMobCateFilter = function (obj, cate1No, cate2No, cate3No, cate4No, cate5No){
+	// 활성화 되었을때
+	if($(obj).hasClass("on")) {
+		if($(obj).attr('data-depth')==1){
+			$('#categoryFilterDiv').find('.daps1').find('span').html('');
+			fnSetCateFilter();
+		}else if($(obj).attr('data-depth')==2){
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=1]').attr('cateFullNm'));
+			fnSetCateFilter(cate1No);
+		}else if($(obj).attr('data-depth')==3){
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=2]').attr('cateFullNm'));
+			fnSetCateFilter(cate1No, cate2No);
+		}else if($(obj).attr('data-depth')==4){
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=3]').attr('cateFullNm'));
+			fnSetCateFilter(cate1No, cate2No, cate3No);
+		}else{
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=4]').attr('cateFullNm'));
+			fnSetCateFilter(cate1No, cate2No, cate3No, cate4No);
+		}
+
+	}else{
+		if($(obj).attr('data-depth')==1){
+			$("#categoryFilterDiv").find('[data-depth=1]').each(function (){
+				$("#categoryFilterDiv").find('.daps4').each(function (idx){
+					$(this).parent().find('a').removeClass('on');
+					$(this).css('display','none');
+				});
+				$("#categoryFilterDiv").find('.daps3').each(function (idx){
+					$(this).parent().find('a').removeClass('on');
+					$(this).css('display','none');
+				});
+				$("#categoryFilterDiv").find('.daps2').each(function (idx){
+					$(this).parent().find('a').removeClass('on');
+				});
+				$(this).removeClass("on");
+				$(this).parent().find('ul').css('display','none');
+			});
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
+			fnSetCateFilter(cate1No);
+		}else if($(obj).attr('data-depth')==2) {
+			$("#categoryFilterDiv").find('[data-depth=2]').each(function (){
+				$("#categoryFilterDiv").find('.daps4').each(function (idx){
+					$(this).parent().find('a').removeClass('on');
+					$(this).css('display','none');
+				});
+				$(this).removeClass("on");
+				$(this).parent().find('ul').css('display','none');
+			});
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
+			fnSetCateFilter(cate1No, cate2No);
+		}else if($(obj).attr('data-depth')==3) {
+			$("#categoryFilterDiv").find('[data-depth=3]').each(function (){
+				$(this).removeClass("on");
+				$(this).parent().find('ul').css('display','none');
+			});
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
+			fnSetCateFilter(cate1No, cate2No, cate3No);
+		}else if($(obj).attr('data-depth')==4) {
+			$("#categoryFilterDiv").find('[data-depth=4]').each(function (){
+				$(this).removeClass("on");
+				$(this).parent().find('ul').css('display','none');
+			});
+			$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
+			fnSetCateFilter(cate1No, cate2No, cate3No, cate4No);
+		}else{
+			fnSetCateFilter(cate1No, cate2No, cate3No, cate4No, cate5No);
+		}
+	}
+}
 //****************상품리스트  end **********************************
 //****************상품리스트  end **********************************