ソースを参照

브랜드 상품리스트 수정

bin2107 5 年 前
コミット
53f065b115

+ 0 - 0
src/main/webapp/WEB-INF/views/mob/common/fragments/GnbSubPlanningMob.html → src/main/webapp/WEB-INF/views/mob/common/fragments/GnbSubBrandMob.html


+ 35 - 0
src/main/webapp/WEB-INF/views/mob/common/layout/BrandLayoutMob.html

@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
+
+<head th:replace="~{mob/common/fragments/HeadMob :: head}"></head>
+
+<body>
+
+<th:block th:replace="~{web/common/fragments/VariablesWeb :: variables}"></th:block>
+<th:block th:replace="~{mob/common/fragments/ScriptsMob :: scripts}"></th:block>
+<div class="app">
+	<!-- GNB -->
+	<th:block th:replace="~{mob/common/fragments/GnbSubBrandMob :: gnb}"></th:block>
+	<!--// GNB -->
+
+	<!-- CONTENT AREA -->
+	<th:block layout:fragment="content"></th:block>
+	<!-- // CONTENT AREA -->
+
+	<!-- Footer -->
+	<th:block th:replace="~{mob/common/fragments/FooterMob :: footer}"></th:block>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	$(document).ready(function() {
+		
+	});
+/*]]>*/
+</script>
+
+</div>
+
+</body>
+</html>

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

@@ -2,7 +2,7 @@
 <html lang="ko"
 	  xmlns:th="http://www.thymeleaf.org"
 	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
-	  layout:decorator="mob/common/layout/DefaultLayoutMob">
+	  layout:decorator="mob/common/layout/BrandLayoutMob">
 <!--
  *******************************************************************************
  * @source  : CategoryGoodsListFormMob.html
@@ -149,13 +149,17 @@
 									</div>
 								</li>
 								<li class="price chkFilter" id="priceFilterDiv">
+									<input type="hidden" id="hPriceFrom" name="hPriceFrom" value=""/>
+									<input type="hidden" id="hPriceTo" name="hPriceTo" value=""/>
 									<a href="javascript:void(0)" class="daps1">가격<!--<span class="pic">230,000원~487,000원, 700,000원~990,000원</span>--></a>
 									<ul class="daps2" id="priceArea">
 									</ul>
 								</li>
 								<li class="discount chkFilter" id="dcRateFilterDiv">
+									<input type="hidden" id="hDcRateFrom" name="hDcRateFrom" value=""/>
+									<input type="hidden" id="hDcRateTo" name="hDcRateTo" value=""/>
 									<a href="javascript:void(0)" class="daps1">할인율</a>
-									<ul class="daps2">
+									<ul class="daps2" id="dcRateArea">
 										<li>
 											<a href="javascript:void(0)">
 												<div class="form_field">
@@ -894,7 +898,7 @@
 			var ithrCd = '';
 			var contentLoc = '';
 			if (result.dataList != null && result.dataList.length > 0) {
-				//$('.list_content .list_defult').hide();
+				$('.list_content .list_defult').hide();
 				//$('.list_content .count_wrap').show();
 				var goodsUrl = [[${@environment.getProperty('upload.goods.view')}]];;
 				let lastPage = result.paging.pageNo;
@@ -968,15 +972,15 @@
 			if ( (event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2)) {
 				var historyData = sessionStorage.getItem(document.location.href);
 				if(historyData!=null){
-					//console.log('M historyData>>'+historyData);
+					// console.log('M historyData>>'+historyData);
 					historyData = JSON.parse(historyData);
 				}else{
 					historyData = {};
 				}
 				if(typeof historyData.filterHtml!='undefined' && historyData.filterHtml!=''){
+					// console.log('historyData.filterHtml>>>'+historyData.filterHtml);
 					$("#searchGoodsForm").append(historyData.filterHtml);
 					filterHtml = historyData.filterHtml;
-					fnReCheckFilterList();
 				}
 				if(typeof historyData.filterStatHtml!='undefined' && historyData.filterStatHtml!=''){
 					$("#filterForm").append(historyData.filterStatHtml);
@@ -1003,11 +1007,13 @@
 						}
 					});
 				}
+				fnReCheckFilterList();
 				if(typeof historyData.sortingType!='undefined' && historyData.sortingType!=''){
 					$("#searchGoodsForm input:hidden[name=sortingType]").val(historyData.sortingType);
 					fnSortingChange(this,historyData.sortingType,'back','Mob');
 				}else{
 					// fnCategoryGoodsInfiniteScrollInit();
+					console.log('here');
 					fnGoodsListSearch();
 				}
 			}else{

+ 76 - 38
src/main/webapp/biz/goods.js

@@ -414,7 +414,7 @@ var fnFilterSet = function (searchId, sizeGb, appGb){
 	fnGoodsListSearch();
 }
 
-var fnSetFilterHtml = function (gubun, staus){
+var fnSetFilterHtml = function (gubun, staus, mobGb){
 	filterHtml = '';
 
 	$('#filterForm input[name=size]:checked').each(function(){
@@ -576,7 +576,6 @@ var fnFilterSlider = function (gubun, min, max){
 	}
 	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
 	fnSetFilterHtml();
-	console.log('8888888888888888888888');
 	fnGoodsListSearch();
 }
 
@@ -692,6 +691,8 @@ var filterPriceMob = function (obj, gubun, staus, idx){
 		$("#searchGoodsForm input:hidden[name=priceFrom]").remove();
 		$("#searchGoodsForm input:hidden[name=priceTo]").remove();
 	}
+	$("#filterForm").find('input[name=hPriceFrom]').val(min);
+	$("#filterForm").find('input[name=hPriceTo]').val(max);
 
 	$('#priceFilterDiv').find('.daps1').find('span').html('');
 	$('#filterForm input[name=price]:checked').each(function(index){
@@ -699,11 +700,12 @@ var filterPriceMob = function (obj, gubun, staus, idx){
 	});
 
 	$("#searchGoodsForm").append(tag2);
-	filterHtml += tag2;
+	// filterHtml += tag2;
 	fnCategoryGoodsInfiniteScrollInit();
 
-	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
-	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+	// gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
+	// gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+	fnSetFilterHtml('','','Mob');
 	fnGoodsListSearch();
 }
 
@@ -739,6 +741,8 @@ var filterDcRateMob = function (obj, gubun, staus, idx){
 		$("#searchGoodsForm input:hidden[name=dcRateFrom]").remove();
 		$("#searchGoodsForm input:hidden[name=dcRateTo]").remove();
 	}
+	$("#filterForm").find('input[name=hDcRateFrom]').val(min);
+	$("#filterForm").find('input[name=hDcRateTo]').val(max);
 
 	$('#dcRateFilterDiv').find('.daps1').find('span').html('');
 	$('#filterForm input[name=dcRate]:checked').each(function(index){
@@ -746,19 +750,18 @@ var filterDcRateMob = function (obj, gubun, staus, idx){
 	});
 
 	$("#searchGoodsForm").append(tag2);
-	filterHtml += tag2;
+	// filterHtml += tag2;
 	fnCategoryGoodsInfiniteScrollInit();
 
-	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
-	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+	// gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
+	// gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+	fnSetFilterHtml('','','Mob');
 	fnGoodsListSearch();
 
 }
 
 // 상품상세 필터 조회
 var fnSelectFilerMob = function (obj, gubun, staus, sizeGb){
-	filterHtml = '';
-	filterStatHtml = '';
 	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
 	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
 	let $obj = $(obj);
@@ -791,7 +794,6 @@ var fnSelectFilerMob = function (obj, gubun, staus, sizeGb){
 }
 
 var fnReCheckFilterList = function (){
-	var data = '';
 	var searchId = '';
 	$('#filterForm').find('.allFilter').find('.chkFilter').each(function() {
 		if(!gagajf.isNull($(this).attr('id'))){
@@ -803,35 +805,71 @@ var fnReCheckFilterList = function (){
 		}
 
 		if(!gagajf.isNull(searchId)){
-			$('#filterForm input[name='+searchId+']:checked').each(function(idx){
-				if(searchId=='color'){
-					$('#'+searchId+'FilterDiv').find('.daps1').find('.pic').find('span').html('');
-					var mobTag = '';
-					var color = $(this).attr('data-id');
-					console.log('color::'+$(this).attr('data-id'));
-					if(color=='FFFFFF'){
-						mobTag += '<span class="pdColor-color" style="background-color:#'+color+';border:1px solid #aaa;"></span>';
-					}else{
-						mobTag += '<span class="pdColor-color" style="background-color:#'+color+'"></span>';
+			var data = '';
+			if(searchId == 'price'){
+				$('#filterForm #priceArea').find('li').each(function(index){
+					if($(this).find('input[name=price]').prop('checked') == true){
+						$("#priceFilterDiv").find('.daps1').append('<span class="pic">'+$("#pricdSpan"+(index+1)).text()+'</span>');
 					}
-					$("#"+searchId+"FilterDiv").find('.daps1').find('.pic').append(mobTag);
-				}else if(searchId=='price'){
-					$('#filterForm input[name=price]:checked').each(function(index){
-						$("#priceFilterDiv").find('.daps1').append('<span class="pic">'+$("#pricdSpan"+idx).text()+'</span>');
-					});
-				}else if(searchId=='dcRate'){
-					$('#filterForm input[name=dcRate]:checked').each(function(index){
-						$("#dcRateFilterDiv").find('.daps1').append('<span class="pic">'+$("#dcRateText"+idx).text()+'</span>');
-					});
-				}else{
-					$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
-					if(idx>0){
-						data += ',';
+				});
+			}else if(searchId == 'dcRate'){
+				$('#filterForm #dcRateArea').find('li').each(function(index){
+					if($(this).find('input[name=dcRate]').prop('checked') == true){
+						$("#dcRateFilterDiv").find('.daps1').append('<span class="pic">'+$("#dcRateText"+(index+1)).text()+'</span>');
 					}
-					data += $(this).attr('data-id');
-					$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
-				}
-			});
+				});
+			}else{
+				$('#filterForm input[name='+searchId+']:checked').each(function(idx){
+					if(searchId=='color'){
+						$('#'+searchId+'FilterDiv').find('.daps1').find('.pic').find('span').html('');
+						var mobTag = '';
+						var color = $(this).attr('data-id');
+						console.log('color::'+$(this).attr('data-id'));
+						if(color=='FFFFFF'){
+							mobTag += '<span class="pdColor-color" style="background-color:#'+color+';border:1px solid #aaa;"></span>';
+						}else{
+							mobTag += '<span class="pdColor-color" style="background-color:#'+color+'"></span>';
+						}
+						$("#"+searchId+"FilterDiv").find('.daps1').find('.pic').append(mobTag);
+					}else if(searchId=='brandGroup'){
+						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
+						if(idx>0){
+							data += ',';
+						}
+						data += $(this).attr('data-id');
+						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
+					}else if(searchId=='size'){
+						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
+						if(idx>0){
+							data += ',';
+						}
+						data += $(this).attr('data-id');
+						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
+					}else if(searchId=='season'){
+						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
+						if(idx>0){
+							data += ',';
+						}
+						data += $(this).attr('data-id');
+						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
+					}else if(searchId=='benefit'){
+						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
+						if(idx>0){
+							data += ',';
+						}
+						data += $(this).attr('data-id');
+						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
+					}else{
+						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
+						if(idx>0){
+							data += ',';
+						}
+						data += $(this).attr('data-id');
+						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
+					}
+				});
+			}
+
 		}
 
 	});