Просмотр исходного кода

검색엔진 - 상품리스트[모바일]

bin2107 4 лет назад
Родитель
Сommit
b4a028910e

+ 2 - 2
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -650,7 +650,7 @@ public class TsfDisplayController extends TsfBaseController {
 			cate1.setBrandGroupNo(params.getBrandGroupNo() == null ? 0 : params.getBrandGroupNo());
 			cate1.setFrontGb(TsfSession.getFrontGb());
 			cate1.setSiteCd(TscConstants.Site.STYLE24.value());
-			cate1.setKeyword(" ");
+			cate1.setKeyword("TBJ");
 			cate1.setCateGb("G032_101");
 			cate1.setCate1No(params.getCate1No());
 			mav.addObject("cateList", diquest.getCategoryList(cate1));
@@ -773,7 +773,7 @@ public class TsfDisplayController extends TsfBaseController {
 
 		String syncYn = commonService.getSearchEngineSyncYn();
 		if (syncYn.equals("Y")) { // 검색엔진을 통한 상품리스트 조회
-			params.setKeyword(" ");
+			params.setKeyword("TBJ");
 			GoodsListResponse response = diquest.getGoodsList(params);
 			pageable.setTotalCount(response.getTotalCount());
 			dataList = response.getResponse();

+ 153 - 3
src/main/webapp/WEB-INF/views/mob/display/CategoryGoodsListFormMob.html

@@ -419,9 +419,10 @@
 			}
 
 			// TOP 동일 카테고리
-			fnCreateDepthList();
+			// fnCreateDepthList();
+			fnGetSameDepthList();
 			// 상단노출 하위 카테고리
-			fnCreateCategoryList();
+			// fnCreateCategoryList();
 
 			if ($('#sizeLi1').find('label').length == 0) $('#sizeLi1').hide();
 			if ($('#sizeLi2').find('label').length == 0) $('#sizeLi2').hide();
@@ -966,7 +967,13 @@
 
 			var ithrCd = '';
 			var contentLoc = '';
-			if (result.dataList != null && result.dataList.length > 0) {
+			let dataListLen = 0;
+			if(result.dataList != null){
+				dataListLen = result.dataList.length-1;
+			}
+
+			// result.dataList != null && result.dataList.length > 0
+			if (dataListLen > 0) {
 				$('.list_content .list_defult').hide();
 				//$('.list_content .count_wrap').show();
 				var goodsUrl = [[${@environment.getProperty('upload.goods.view')}]];
@@ -1173,6 +1180,149 @@
 			$('#cateDepth').append(tag);
 		}
 
+		var fnGetSameDepthList = function (){
+			var brandGroupNo = [[${cateInfo.brandGroupNo}]];
+			var cateGb =  [[${cateInfo.cateGb}]];
+			var formalGb = [[${cateInfo.formalGb}]];
+			let cate1No = [[${cateInfo.cate1No}]];
+			let cate2No = [[${cateInfo.cate2No}]];
+			let cate3No = [[${cateInfo.cate3No}]];
+			let cate4No = [[${cateInfo.cate4No}]];
+			let cate5No = [[${cateInfo.cate5No}]];
+			let cateList = [[${cateList}]];
+			let allCateList = [[${allCateList}]];
+			let tag = '';
+			let html = '';
+
+			if(!gagajf.isNull(cate5No)){
+
+			}else if(!gagajf.isNull(cate4No)){
+				$.each(cateList, function(idx,item){
+					$.each(item.cate4List, function (idx4,item4){
+						if(item4.cate4No == cate4No){
+							if(idx<1) {
+								$("#htopTitle").append(fnDisplayTitle(item4.cate4Nm));
+							}
+							if(item4.cate5List != null && item4.cate5List.length > 0){
+								let leafTag = '';
+								leafTag += '<a href="javascript:void(0);" class="on" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + item4.cate1No + ', ' + item4.cate2No + ', ' + item4.cate3No + ', ' + item4.cate4No + ' ';
+								if(formalGb=='G009_20'){
+									leafTag += ' ,\'\',\''+formalGb+'\'';
+								}
+								leafTag += ');">전체</a>';
+								$.each(item4.cate5List, function (idx5, item5){
+									leafTag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + [[${cateInfo.cateGb}]] + '\', ' + item5.cate1No + ' , ' + item5.cate2No + ', ' + item5.cate3No + ' , ' + item5.cate4No + ' , ' + item5.cate5No + ' ';
+									if(formalGb=='G009_20'){
+										leafTag += ' ,\''+formalGb+'\'';
+									}
+									leafTag += ');">'+item5.cate5Nm+'</a>';
+								});
+								$('#leafCateList').append(leafTag);
+							}
+						}
+					});
+				});
+			}else if(!gagajf.isNull(cate3No)){
+				$.each(cateList, function(idx,item){
+					$.each(item.cate3List, function (idx3,item3){
+						if(item3.cate3No == cate3No){
+							if(idx<1) {
+								$("#htopTitle").append(fnDisplayTitle(item3.cate3Nm));
+							}
+							if(item3.cate4List != null && item3.cate4List.length > 0){
+								let leafTag = '';
+								leafTag += '<a href="javascript:void(0);" class="on" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + item3.cate1No + ', ' + item3.cate2No + ', ' + item3.cate3No + ' ';
+								if(formalGb=='G009_20'){
+									leafTag += ' ,\'\',\'\',\''+formalGb+'\'';
+								}
+								leafTag += ');">전체</a>';
+								$.each(item3.cate4List, function (idx4, item4){
+									leafTag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + [[${cateInfo.cateGb}]] + '\', ' + item4.cate1No + ' , ' + item4.cate2No + ', ' + item4.cate3No + ' , ' + item4.cate4No + ' ';
+									if(formalGb=='G009_20'){
+										leafTag += ' ,\'\',\''+formalGb+'\'';
+									}
+									leafTag += ');">'+item4.cate4Nm+'</a>';
+								});
+								$('#leafCateList').append(leafTag);
+							}
+						}
+					});
+				});
+			}else if(!gagajf.isNull(cate2No)){
+				$.each(cateList, function(idx,item){
+					$.each(item.cate2List, function (idx2,item2){
+						if(item2.cate2No == cate2No){
+							if(idx<1) {
+								$("#htopTitle").append(fnDisplayTitle(item2.cate2Nm));
+							}
+							if(item2.cate3List != null && item2.cate3List.length > 0){
+								let leafTag = '';
+								leafTag += '<a href="javascript:void(0);" class="on" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + item2.cate1No + ', ' + item2.cate2No + ' ';
+								if(formalGb=='G009_20'){
+									leafTag += ' ,\'\',\'\',\'\',\''+formalGb+'\'';
+								}
+								leafTag += ');">전체</a>';
+								$.each(item2.cate3List, function (idx3, item3){
+									leafTag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + [[${cateInfo.cateGb}]] + '\', ' + item3.cate1No + ' , ' + item3.cate2No + ', ' + item3.cate3No + ' ';
+									if(formalGb=='G009_20'){
+										leafTag += ' ,\'\',\'\',\''+formalGb+'\'';
+									}
+									leafTag += ');">'+item3.cate3Nm+'</a>';
+								});
+								$('#leafCateList').append(leafTag);
+							}
+						}
+						if(idx<1) {
+							tag += '<li><a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + item2.cate1No + ', ' + item2.cate2No + ' ';
+							if(formalGb=='G009_20'){
+								tag += ' ,\'\',\'\',\'\',\''+formalGb+'\'';
+							}
+							tag += ');">'+item2.cate2Nm+'</a></li>';
+						}
+
+					});
+				});
+				$("#cateDepth").append(tag);
+			}else{
+				$.each(cateList, function(idx,item){
+					$.each(allCateList, function (allIdx, allItem){
+						if(item.cate1No==allItem.cate1No){
+							if(idx<1) {
+								$("#htopTitle").append(fnDisplayTitle(item.cate1Nm));
+							}
+						}
+						if(idx<1) {
+							tag += '<li><a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + allItem.cate1No + ' ';
+							if(formalGb=='G009_20'){
+								tag += ' ,\'\',\'\',\'\',\'\',\''+formalGb+'\'';
+							}
+							tag += ');">'+allItem.cate1Nm+'</a></li>';
+						}
+					});
+
+					if(item.cate2List != null && item.cate2List.length > 0){
+						let leafTag = '';
+						leafTag += '<a href="javascript:void(0);" class="on" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\', \'\' ';
+						if(formalGb=='G009_20'){
+							leafTag += ' ,\'\',\'\',\'\',\'\',\''+formalGb+'\'';
+						}
+						leafTag += ');">전체</a>';
+						$.each(item.cate2List, function (idx, item){
+							leafTag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + [[${cateInfo.cateGb}]] + '\', ' + item.cate1No + ' , ' + item.cate2No + ' ';
+							if(formalGb=='G009_20'){
+								leafTag += ' ,\'\',\'\',\'\',\''+formalGb+'\'';
+							}
+							leafTag += ');">'+item.cate2Nm+'</a>';
+						});
+						$('#leafCateList').append(leafTag);
+					}
+				});
+				$("#cateDepth").append(tag);
+			}
+
+
+		}
+
 	</script>
 
 	<script>