bin2107 5 лет назад
Родитель
Сommit
02c39167af

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

@@ -470,12 +470,24 @@ public class TsfDisplayController extends TsfBaseController {
 	 * @author bin2107
 	 * @since 2021. 3. 30
 	 */
-	@GetMapping("/lookbook/main/list")
+//	@GetMapping("/lookbook/main/list")
+//	@ResponseBody
+//	public Collection<Lookbook> lookbooklist(Lookbook lookbook) {
+//		lookbook.setFrontGb(TsfSession.getFrontGb());
+//		lookbook.setFrontYn("Y");
+//		return coreLookbookService.getLookbookList(lookbook);
+//	}
+	@PostMapping("/lookbook/main/list")
 	@ResponseBody
-	public Collection<Lookbook> lookbooklist(Lookbook lookbook) {
-		lookbook.setFrontGb(TsfSession.getFrontGb());
-		lookbook.setFrontYn("Y");
-		return coreLookbookService.getLookbookList(lookbook);
+	public GagaMap lookbooklist(@RequestBody Lookbook params){
+		GagaMap result = new GagaMap();
+		params.setPageable(new TscPageRequest(params.getPageNo() - 1, params.getPageSize()));
+		params.getPageable().setTotalCount(coreLookbookService.getLookbookListCount(params));
+
+		Collection<Lookbook> lookbookList = coreLookbookService.getLookbookList(params);
+		result.set("pageing", params);
+		result.set("lookbookList", lookbookList);
+		return result;
 	}
 
 	/**

+ 90 - 23
src/main/webapp/WEB-INF/views/mob/display/CategoryGoodsListFormMob.html

@@ -95,7 +95,7 @@
 								<div>
 									<input id="unisex" type="checkbox" onclick="fnFilterOption(this,'on');"><label for="unisex"> <span>남여 공용만 보기</span> </label>
 								</div>
-								<div>
+								<div th:unless="${cateInfo.formalGb=='G009_20'}">
 									<input id="newGoods" type="checkbox" checked="checked" onclick="fnFilterOption(this,'off');"><label for="newGoods"> <span>신상품만 보기</span> </label>
 								</div>
 							</div>
@@ -334,6 +334,26 @@
 				</div>
 			</div>
 		</div>
+
+		<div class="nav_box">
+			<div class="lap">
+				<div class="nav_close">네비닫기</div>
+				<div class="nav_list">
+					<!-- 카테고리 선택 -->
+					<div class="nav">
+						<ul>
+							<li class="active">
+<!--								<a href="javascript:void(0)" class="daps1">여성</a>-->
+								<ul class="daps2" id="cateDepth">
+
+								</ul>
+							</li>
+						</ul>
+					</div>
+					<!-- //카테고리 선택 -->
+				</div>
+			</div>
+		</div>
 	</main>
 
 	<form id="searchGoodsForm" name="searchGoodsForm">
@@ -387,6 +407,9 @@
 				$("#priceArea").append(priceHtml);
 			}
 
+			// TOP 동일 카테고리
+			fnCreateDepthList();
+
 			// 상단노출 하위 카테고리
 			fnCreateCategoryList();
 
@@ -570,9 +593,13 @@
 				$("body").css({"overflow":"visible"});
 			});
 
-
 		});
 
+		// TOP 카테고리 노출
+		var fnCreateDepthList = function (){
+
+		}
+
 		// 상단 하위카테고리 노출
 		var fnCreateCategoryList = function (){
 			let actionUrl = '';
@@ -600,17 +627,13 @@
 					$("#leafCateList").html('');
 
 					let allCate = [[${cateList}]];
-					if(brandGroupNo > 0){
-
-					}else{
-						$.each(result, function(idx, item) {
-							$.each(allCate, function(allCateIdx, allCateItem) {
-								if (item.cate1No == allCateItem.cate1No) {
-									$('#leafCateList').append(fnGetCategoryList(item));
-								}
-							});
+					$.each(result, function(idx, item) {
+						$.each(allCate, function(allCateIdx, allCateItem) {
+							if (item.cate1No == allCateItem.cate1No) {
+								$('#leafCateList').append(fnGetCategoryList(item));
+							}
 						});
-					}
+					});
 				}
 			});
 		}
@@ -634,48 +657,92 @@
 			if (cate1 != null) {
 				if(cate1.cate1No == cate1No){
 					if(gagajf.isNull(cate2No)){
-						tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ');">cate1전체(test)</a>';
+						tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ' ';
+						if(formalGb=='G009_20'){
+							tag += ' ,\'\',\'\',\'\',\'\',\''+formalGb+'\'';
+						}
+						tag += ');">전체</a>';
 					}
 					if(cate1.leafYn == 'N' && cate1.cate2List.length > 0){
 						$.each(cate1.cate2List, function (idx2, cate2){
 							if(gagajf.isNull(cate2No)){
-								tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ');">'+cate2.cate2Nm+'</a>';
+								tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ' ';
+								if(formalGb=='G009_20'){
+									tag += ' ,\'\',\'\',\'\',\''+formalGb+'\'';
+								}
+								tag += ');">'+cate2.cate2Nm+'</a>';
 							}else{
 								if(cate2.cate2No == cate2No){
 									if(cate2.leafYn == 'N' && cate2.cate3List.length > 0){
 										if(gagajf.isNull(cate3No)){
-											tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ');">cate2전체(test)</a>';
+											tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ' ';
+											if(formalGb=='G009_20'){
+												tag += ' ,\'\',\'\',\'\',\''+formalGb+'\'';
+											}
+											tag += ');">전체</a>';
 										}
 										$.each(cate2.cate3List, function (idx3, cate3){
 											if(gagajf.isNull(cate3No)){
-												tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ');">'+cate3.cate3Nm+'</a>';
+												tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ' ';
+												if(formalGb=='G009_20'){
+													tag += ' ,\'\',\'\',\''+formalGb+'\'';
+												}
+												tag += ');">'+cate3.cate3Nm+'</a>';
 											}else{
 												if(cate3.cate3No == cate3No){
 													if(cate3.leafYn == 'N' && cate3.cate4List.length > 0){
 														if(gagajf.isNull(cate4No)){
-															tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ');">cate3전체(test)</a>';
+															tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ' ';
+															if(formalGb=='G009_20'){
+																tag += ' ,\'\',\'\',\''+formalGb+'\'';
+															}
+															tag += ');">전체</a>';
 														}
 														$.each(cate3.cate4List, function (idx4, cate4){
 															if(gagajf.isNull(cate4No)){
-																tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ');">'+cate4.cate4Nm+'</a>';
+																tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ' ';
+																if(formalGb=='G009_20'){
+																	tag += ' ,\'\',\''+formalGb+'\'';
+																}
+																tag += ');">'+cate4.cate4Nm+'</a>';
 															}else{
 																if(cate4.cate4No == cate4No){
 																	if(cate4.leafYn == 'N' && cate4.cate5List.length > 0){
 																		if(gagajf.isNull(cate5No)){
-																			tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ');">cate4전체(test)</a>';
+																			tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ' ';
+																			if(formalGb=='G009_20'){
+																				tag += ' ,\'\',\''+formalGb+'\'';
+																			}
+																			tag += ');">전체</a>';
 																		}
 																		$.each(cate4.cate5List, function (idx5, cate5){
 																			if(gagajf.isNull(cate5No)){
-																				tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ',' + cate5.cate5No + ');">'+cate5.cate5Nm+'</a>';
+																				tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ',' + cate5.cate5No + ' ';
+																				if(formalGb=='G009_20'){
+																					tag += ' ,\''+formalGb+'\'';
+																				}
+																				tag += ');">'+cate5.cate5Nm+'</a>';
 																			}else{
 																				if(cate5.cate5No == cate5No){
-																					tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ',' + cate5.cate5No + ');">'+cate5.cate5Nm+'</a>';
+																					tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ',' + cate5.cate5No + ' ';
+																					if(formalGb=='G009_20'){
+																						tag += ' ,\''+formalGb+'\'';
+																					}
+																					tag += ');">'+cate5.cate5Nm+'</a>';
 																				}
 																			}
 																		});
 																	}else{
-																		tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ');">cate4전체</a>';
-																		tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ');">'+cate4.cate4Nm+'</a>';
+																		tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ' ';
+																		if(formalGb=='G009_20'){
+																			tag += ' ,\'\',\''+formalGb+'\'';
+																		}
+																		tag += ');">전체</a>';
+																		tag += '<a href="javascript:void(0);" onclick="cfnGoToGoodsList(' + brandGroupNo + ',\'' + cateGb + '\',' + cate1.cate1No + ',' + cate2.cate2No + ',' + cate3.cate3No + ',' + cate4.cate4No + ' ';
+																		if(formalGb=='G009_20'){
+																			tag += ' ,\'\',\''+formalGb+'\'';
+																		}
+																		tag += ');">'+cate4.cate4Nm+'</a>';
 																	}
 																}
 															}

+ 73 - 4
src/main/webapp/WEB-INF/views/web/display/LookbookMainFormWeb.html

@@ -59,8 +59,15 @@
 								</div>
 							</div>
 
+							<div id="infiniteContainer">
+								<div id="listBoxOuter" class="itemsGrp">
+									<ul class="productlist quarter" >
+									</ul>
+								</div>
+							</div>
+
 							<div class="list">
-								<ul class="clear event_con" id="lookbookArea" style="display: none;">
+								<ul class="clear event_con" id="listBox" style="display: none;"> <!--id="lookbookArea"-->
 
 								</ul>
 								<ul class="clear no_con" id="divLookbookNoData" style="display: none;">
@@ -78,6 +85,17 @@
 			</div>
 		</div>
 
+		<form id="lbMainForm" name="lbMainForm">
+			<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+			<input type="hidden" name="pageSize" value ="30"/>
+			<input type="hidden" name="lookbookGb" th:value="${lbInfo.lookbookGb}"/>
+			<input type="hidden" name="brandCd" th:value="${lbInfo.brandCd}">
+			<input type="hidden" name="multiBrandCd" />
+		</form>
+
+<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>
+<script src="/ux/plugins/jquery/jquery.history.min.js"></script>
+
 <script th:inline="javascript">
 /*<![CDATA[*/
 	var lookbookGb = [[${lbInfo.lookbookGb}]];
@@ -86,7 +104,58 @@
 	}
 	var brandCd = [[${lbInfo.brandCd}]];
 
-	let fnGetLookbookList = function (lookbookGb, brandGroupNo){
+	var fnLookbookListSearch = function (){
+		gagaInfiniteScroll.getHistory();
+	}
+
+	var fnGetInfiniteScrollDataList = function (pageNum){
+		$("#lbMainForm input[name=pageNo]").val(pageNum+1);
+		gagajf.ajaxFormSubmit("/display/lookbook/main/list", document.lbMainForm,  gagaInfiniteScroll.jsonToHtml);
+	}
+
+	var fnDrawInfiniteScrollData = function (result){
+		let totalCnt = result.totalCnt;
+		$("#lookbookTotCnt").text(totalCnt);
+		gagaInfiniteScroll.pageStatus.totalCount = totalCnt;
+
+		if (result.dataList != null && result.dataList.length > 0) {
+			$(".nodata").hide();
+			let lastPage = result.paging.pageable.pageNo;
+			let endRow = result.endRow - result.paging.pageable.pageSize;
+
+			var htm = fnGetLookbookList(result, lastPage, endRow);
+			gagaInfiniteScroll.draw(htm);
+		}else{
+			if($("#lbMainForm input[name=pageNo]").val()==1){
+				//$(".nodata").show();
+			}
+			//$("#divLastPage").show();
+			gagaInfiniteScroll.draw('not');
+		}
+	}
+
+	let fnGetLookbookList = function (result){
+		let html = '';
+
+		$.each(result.dataList, function (idx, item){
+			html += '<li>';
+			html += '	<a href="javascript:void(0);" onclick="cfnGoToLookbookDetail(\''+lookbookGb+'\','+item.lookbookSq+','+item.brandCd+')">';
+			html += '		<div class="ev_img">';
+			html += '			<img src="' + _imgUrl + item.orgTnfileNm + '" alt="" style="height:100%">';
+			html += '		</div>';
+			html += '		<div class="txt">';
+			if(lookbookGb != 'BL') {
+				html += '			<span class="brand">' + item.brandNm + '</span>';
+			}
+			html += '			<p class="tit">'+item.title+'</p>';
+			html += '		</div>';
+			html += '	</a>';
+			html += '</li>';
+		});
+		return html;
+	}
+
+	let fnGetLookbookList2 = function (lookbookGb, brandGroupNo){
 		let actionUrl = '/display/lookbook/main/list?lookbookGb='+lookbookGb;
 		if (!gagajf.isNull(brandGroupNo)) actionUrl += '&multiBrandCd=' + brandGroupNo;
 		$('#lookbookArea').html('');
@@ -161,8 +230,8 @@
 
 	$(document).ready(function() {
 		//$("#container .wrap .content .cont_body .event_list .event_top .ui_row .count").find('span').text(totalCnt.addComma());
-		fnGetLookbookList(lookbookGb,brandCd);
-
+		//fnGetLookbookList(lookbookGb,brandCd);
+		fnLookbookListSearch();
 		if(lookbookGb=='BL'){
 			$("#brandBox").hide();
 			$("#navHome").attr('onclick', 'cfnGoToBrandMain('+brandCd+');');