Bläddra i källkod

Merge branch 'develop' into eskim

eskim 5 år sedan
förälder
incheckning
acdd03da70

+ 15 - 4
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -635,15 +635,20 @@
 	<select id="getGoodsListCategoryFilterList" parameterType="SearchEngine" resultType="Filter">
 		/* TsfDisplay.getGoodsListCategoryFilterList */
 		SELECT
-		<if test="brandGroupNo != null and brandGroupNo > 0 ">
 		    DISTINCT
-		</if>
 		       FILTER_GB
 		     , CASE WHEN FILTER_GB = 'SIZE' THEN
 		                SUBSTRING_INDEX(FILTER_CD,'|',1)
 		            ELSE
 		                FILTER_CD
 		       END       AS FILTER_CD
+		<choose>
+		    <when test="cate1No == null and cate2No == null and cate3No == null and cate4No == null">
+		    </when>
+		    <otherwise>
+		     , DISP_ORD
+		    </otherwise>
+		</choose>
 		     , FILTER_NM
 		FROM   TB_CATE_FILTER
 		WHERE  SITE_CD = #{siteCd}
@@ -652,7 +657,6 @@
 		AND    BRAND_GROUP_NO = #{brandGroupNo}
 		<choose>
 		  <when test="cate1No == null and cate2No == null and cate3No == null and cate4No == null">
-		ORDER  BY FILTER_GB
 		  </when>
 		  <otherwise>
 		  AND    CATE_NO = CASE WHEN IFNULL(#{cate4No},0) > 0 THEN
@@ -668,9 +672,16 @@
 		                                            END
 		                                  END
 		                             END
-		  ORDER  BY FILTER_GB
 		  </otherwise>
 		</choose>
+		<choose>
+		    <when test="brandGroupNo > 0 and cate1No == null and cate2No == null and cate3No == null and cate4No == null">
+		 ORDER  BY FILTER_GB
+		    </when>
+		    <otherwise>
+		 ORDER  BY FILTER_GB, DISP_ORD
+		    </otherwise>
+		</choose>
 	</select>
 	
 	<!-- 검색상품리스트 카테고리별 필터 목록 -->

+ 2 - 24
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -2039,7 +2039,7 @@
 		            AND    ((IF(G.LIST_PRICE = 0,0,G.LIST_PRICE) - G.CURR_PRICE) / IF(G.LIST_PRICE = 0,0,G.LIST_PRICE) * 100) <![CDATA[<=]]> #{dcRateTo}
 		        </if>
 		       ) G
-		        LEFT OUTER JOIN TB_OPTION O ON G.GOODS_CD = O.GOODS_CD AND G.SELF_GOODS_YN = 'Y' /*자사상품만*/ AND    O.DISP_YN = 'Y'
+		        INNER JOIN TB_OPTION O ON G.GOODS_CD = O.GOODS_CD AND G.SELF_GOODS_YN = 'Y' /*자사상품만*/ AND    O.DISP_YN = 'Y'
 		        <if test="colorArr != null and colorArr.length > 0"> <!-- 색상 -->
 		            AND    O.OPT_CD1 IN (SELECT COLOR_CD
 		            FROM   TB_COLOR
@@ -2055,17 +2055,6 @@
 		SELECT COUNT(*)
 		FROM   TAB_GOODS G
 		WHERE 1=1
-		<if test="colorArr != null and colorArr.length > 0"> <!-- 색상 -->
-		  AND    G.MAIN_COLOR_CD IN (SELECT COLOR_CD
-		                               FROM   TB_COLOR
-		                               WHERE  1 = 1
-		                               AND    COLOR_GRP_CD IN
-		                               <foreach collection="colorArr" item="item" index="index"  open="(" close=")" separator=",">
-		                               	#{item}
-		                               </foreach>
-		                               AND    USE_YN = 'Y' /*사용하는색상*/
-		                              )
-		</if>
 	</select>
 
 	<!-- 카테고리별 상품 목록 -->
@@ -2222,7 +2211,7 @@
 					AND    ((IF(G.LIST_PRICE = 0,0,G.LIST_PRICE) - G.CURR_PRICE) / IF(G.LIST_PRICE = 0,0,G.LIST_PRICE) * 100) <![CDATA[<=]]> #{dcRateTo}
 				</if>
 		      ) G
-			  LEFT OUTER JOIN TB_OPTION O ON G.GOODS_CD = O.GOODS_CD AND G.SELF_GOODS_YN = 'Y' /*자사상품만*/ AND    O.DISP_YN = 'Y'
+			  INNER JOIN TB_OPTION O ON G.GOODS_CD = O.GOODS_CD AND G.SELF_GOODS_YN = 'Y' /*자사상품만*/ AND    O.DISP_YN = 'Y'
 			  <if test="colorArr != null and colorArr.length > 0"> <!-- 색상 -->
 					AND    O.OPT_CD1 IN (SELECT COLOR_CD
 					FROM   TB_COLOR
@@ -2323,17 +2312,6 @@
 		    AND    W.CUST_NO = #{custNo}
 		</if>
 		WHERE 1=1
-		<if test="colorArr != null and colorArr.length > 0"> <!-- 색상 -->
-		  AND    G.MAIN_COLOR_CD IN (SELECT COLOR_CD
-		        FROM   TB_COLOR
-		        WHERE  1 = 1
-		        AND    COLOR_GRP_CD IN
-		        <foreach collection="colorArr" item="item" index="index"  open="(" close=")" separator=",">
-		            #{item}
-		        </foreach>
-		        AND    USE_YN = 'Y' /*사용하는색상*/
-		  )
-		</if>
 	</select>
 	
 	<!-- 검색상품 총건수 -->

+ 1 - 2
src/main/webapp/WEB-INF/views/mob/display/BrandMainFormMob.html

@@ -25,7 +25,7 @@
 			<p class="br_subtitle">브랜드 메인</p>
 		</div>
 
-		<th:block th:if="${brandMainLayoutList}" th:each="brandMainLayoutData, mainStat : ${brandMainLayoutList}" th:with="contentsLoc=${#strings.replace(brandMainLayoutData.contentsLoc,'SBMM','')},contentsTitle=${brandMainLayoutData.contentsTitle}">
+		<th:block th:if="${brandMainLayoutList}" th:each="brandMainLayoutData, mainStat : ${brandMainLayoutList}" th:with="contentsLoc=${#strings.replace(brandMainLayoutData.contentsLoc,'SBM','')},contentsTitle=${brandMainLayoutData.contentsTitle}">
 			<th:block th:if="${brandMainLayoutData.ContentsList != null and !brandMainLayoutData.ContentsList.empty}">
 				<th:block th:if="${contentsLoc=='004'}">
 					<!-- 첫번째 슬라이드 -->
@@ -69,7 +69,6 @@
 								</p>
 								<div class="btn_group_flex">
 									<div>
-										<button class="btn btn_default">브랜드 사이트<span></span></button>
 										<a th:href="${ContentsData.strVar1}" th:target="${ContentsData.contentsType=='SELF'?'_self':'_blank'}" class="btn btn_default">브랜드 사이트<span></span></a>
 									</div>
 								</div>

+ 74 - 62
src/main/webapp/WEB-INF/views/web/display/CategoryGoodsListFormWeb.html

@@ -134,8 +134,8 @@
 								<div class="sort tap04" id="priceFilterDiv">
 									<div class="range">
 										<input type="text" class="js-range-slider01" name="" value="" />
-										<input type="hidden" id="price_input_from" name="price_input_from" value="0"/>
-										<input type="hidden" id="price_input_to" name="price_input_to" value="0"/>
+										<input type="hidden" id="price_input_from" name="price_input_from" value=""/>
+										<input type="hidden" id="price_input_to" name="price_input_to" value=""/>
 									</div>
 									<a href="javascript:void(0)" class="tap_close">delete-btn</a>
 								</div>
@@ -156,8 +156,8 @@
 									</ul>
 									<div class="range">
 										<input type="text" class="js-range-slider02" name="" value="" />
-										<input type="hidden" id="dcrate_input_from" value="0"/>
-										<input type="hidden" id="dcrate_input_to" value="0"/>
+										<input type="hidden" id="dcrate_input_from" name="dcrate_input_from" value=""/>
+										<input type="hidden" id="dcrate_input_to" name="dcrate_input_to" value=""/>
 									</div>
 									<a href="javascript:void(0)" class="tap_close">delete-btn</a>
 								</div>
@@ -1009,7 +1009,7 @@
 			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('historyData>>'+historyData);
+					console.log('historyData>>'+historyData);
 					historyData = JSON.parse(historyData);
 				}else{
 					historyData = {};
@@ -1018,39 +1018,18 @@
 					$(".arrayWrap .btn").text(historyData.sortingTypeNm);
 				}
 				if(typeof historyData.filterHtml!='undefined' && historyData.filterHtml!=''){
+					console.log('filterHtml>>'+historyData.filterHtml);
 					$("#searchGoodsForm").append(historyData.filterHtml);
 					filterHtml = historyData.filterHtml;
 				}
 				if(typeof historyData.filterStatHtml!='undefined' && historyData.filterStatHtml!=''){
+					console.log('filterStatHtml>>'+historyData.filterStatHtml);
 					$("#filterData").append(historyData.filterStatHtml);
 					filterStatHtml = historyData.filterStatHtml;
 				}
 				if(typeof historyData.totalCount!='undefined' && historyData.totalCount!=''){
 					$("#totCntId").text(historyData.totalCount);
 				}
-				if(!gagajf.isNull(filterPriceList)){
-					let min = 0;
-					let max = 5;
-					let priceFrom = '';
-					let priceTo = '';
-					if(!gagajf.isNull($("#searchGoodsForm").find("input:hidden[name=priceFrom]").val())){
-						priceFrom = $("#searchGoodsForm").find("input:hidden[name=priceFrom]").val();
-					}
-					if(!gagajf.isNull($("#searchGoodsForm").find("input:hidden[name=priceTo]").val())){
-						priceTo = $("#searchGoodsForm").find("input:hidden[name=priceTo]").val();
-					}
-					$.each(filterPriceList, function (priceIdx, priceItem){
-						custom_values[priceIdx] = priceItem.filterNm;
-						if(custom_values[priceIdx] == priceFrom){
-							min = priceIdx;
-						}
-						if(custom_values[priceIdx] == priceTo){
-							max = priceIdx;
-						}
-					});
-				
-					fnFilterSliderMove(min,max);
-				}
 				if(typeof historyData.sortingType!='undefined' && historyData.sortingType!=''){
 					$("#searchGoodsForm input:hidden[name=sortingType]").val(historyData.sortingType);
 					fnSortingChange(this,historyData.sortingType,'back');
@@ -1059,6 +1038,7 @@
 					$(".fillter").show();
 					// fnCategoryGoodsInfiniteScrollInit();
 					fnGoodsListSearch();
+					fnSetPriceFilter();
 					fnImgOnoff();
 				}
 			}else{
@@ -1077,45 +1057,77 @@
 			}
 		});
 
+		var fnSetPriceFilter = function (){
+			if(!gagajf.isNull(filterPriceList)){
+				let min = 0;
+				let max = 5;
+				let priceFrom = '';
+				let priceTo = '';
+				if(!gagajf.isNull($("#searchGoodsForm").find("input:hidden[name=priceFrom]").val())){
+					priceFrom = $("#searchGoodsForm").find("input:hidden[name=priceFrom]").val();
+				}
+				if(!gagajf.isNull($("#searchGoodsForm").find("input:hidden[name=priceTo]").val())){
+					priceTo = $("#searchGoodsForm").find("input:hidden[name=priceTo]").val();
+				}
+				console.log('priceFrom>>'+priceFrom);
+				console.log('priceTo>>'+priceTo);
+				$.each(filterPriceList, function (priceIdx, priceItem){
+					custom_values[priceIdx] = priceItem.filterNm;
+					console.log('custom_values[priceIdx]>>'+custom_values[priceIdx])
+					if(custom_values[priceIdx] == priceFrom){
+						min = priceIdx;
+					}
+					if(custom_values[priceIdx] == priceTo){
+						max = priceIdx;
+					}
+					console.log('min>>'+min);
+					console.log('max>>'+max);
+				});
+
+				console.log('1min>>'+min);
+				console.log('1max>>'+max);
+				fnFilterSliderMove(min,max);
+			}
+		}
 
 		
 		/*]]>*/
 		
 		// 동영상 플레이어
-		var iframe= document.createElement('iframe');
-		iframe.setAttribute('allowFullScreen', '');
-		iframe.setAttribute('allow', 'fullscreen');
-		var controller;
-		var player = document.getElementById('player');
-		
-		player.onload = function() {
-			try {
-				var controller = new VgControllerClient({
-					target_window: document.getElementById('pdThumbVideo').contentWindow
-					// target_window: document.getElementsByClassName('pd_mov').contentWindow
-				});
-				var playMov;
-				
-				controller.on('ready', function(){
-					//플레이어 준비 완료
-					controller.set_ratio('fill');
-					//  contain : 비율에 맞게 채웁니다.
-					//fill : 화면에 꽉 차게 채웁니다.
-					//enlargement : 세로 높이를 꽉 차게 맞춥니다. 좌우로 스크롤이 가능합니다
-					controller.play();
-				});
-				controller.on('done', function(){
-					//플레이어 재생 완료
-					controller.play();
-				});
-				
-			} catch(e) {
-				// Videogateweay Controller Library는 window.postMessage API를 이용하기 때문에
-				// 해당 기능을 지원하지 않는 웹브라우져에서는 동작하지 않습니다.
-				// 이 부분에 적절한 fail-over 코드를 추가하여 주십시요.
-			}
-			
-		}
+		// var iframe= document.createElement('iframe');
+		// iframe.setAttribute('allowFullScreen', '');
+		// iframe.setAttribute('allow', 'fullscreen');
+		// var controller;
+		// var player = document.getElementById('player');
+		//
+		// player.onload = function() {
+		// 	try {
+		// 		var controller = new VgControllerClient({
+		// 			target_window: document.getElementById('pdThumbVideo').contentWindow
+		// 			// target_window: document.getElementsByClassName('pd_mov').contentWindow
+		// 		});
+		// 		var playMov;
+		//
+		// 		controller.on('ready', function(){
+		// 			//플레이어 준비 완료
+		// 			controller.set_ratio('fill');
+		// 			//  contain : 비율에 맞게 채웁니다.
+		// 			//fill : 화면에 꽉 차게 채웁니다.
+		// 			//enlargement : 세로 높이를 꽉 차게 맞춥니다. 좌우로 스크롤이 가능합니다
+		// 			controller.play();
+		// 		});
+		// 		controller.on('done', function(){
+		// 			//플레이어 재생 완료
+		// 			controller.play();
+		// 		});
+		//
+		// 	} catch(e) {
+		// 		// Videogateweay Controller Library는 window.postMessage API를 이용하기 때문에
+		// 		// 해당 기능을 지원하지 않는 웹브라우져에서는 동작하지 않습니다.
+		// 		// 이 부분에 적절한 fail-over 코드를 추가하여 주십시요.
+		// 	}
+		//
+		// }
 	</script>
 
 	<script>

+ 75 - 11
src/main/webapp/biz/goods.js

@@ -244,7 +244,13 @@ var fnCreateGoodsList = function(result, ithrCd, contentLoc, goodsUrl, lastPage,
 			var iconGb = '';
 			var iconNm = '';
 			tag += '	<p class="itemBadge">';
-			for(let i=0; i<3; i++){
+			let arrCnt;
+			if(iconArr.length > 2){
+				arrCnt = 3;
+			}else{
+				arrCnt = iconArr.length;
+			}
+			for(let i=0; i<arrCnt; i++){
 				var iconInfo = iconArr[i].split(":");
 				iconGb = iconInfo[0];
 				iconNm = iconInfo[1];
@@ -291,12 +297,16 @@ var filterStatHtml = '';
 
 // 상품상세 필터 조회
 var filterSel = function (obj, gubun, staus, sizeGb){
-	filterHtml = '';
-	filterStatHtml = '';
+	// fnCategoryGoodsInfiniteScrollInit();
+	// filterHtml = '';
+	// filterStatHtml = '';
+	// console.log('1.filterHtml++'+filterHtml);
+	// console.log('2.filterStatHtml++'+filterStatHtml);
 	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
 	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
 	let $obj = $(obj);
 	if(staus=='on'){
+		filterStatHtml = '';
 		if(gubun=='size'){
 			$(obj).attr('onclick','filterSel(this,\''+gubun+'\',\'off\',\''+sizeGb+'\');');
 		}else{
@@ -314,6 +324,7 @@ var filterSel = function (obj, gubun, staus, sizeGb){
 				}
 			}
 		});
+		filterStatHtml = $("#filterData").html();
 	}else{
 		if(gubun=='size'){
 			$(obj).attr('onclick','filterSel(this,\''+gubun+'\',\'on\',\''+sizeGb+'\');');
@@ -329,7 +340,7 @@ var filterSel = function (obj, gubun, staus, sizeGb){
 			}else{
 				tag += '	<span class="pdColor-color" style="background-color: #'+$obj.attr('data-id')+'" value="'+$obj.attr('data-id')+'"></span>';
 			}
-			tag += '	<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\');"></a >';
+			tag += '	<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\');"></a >';
 			tag += '</span>';
 		}else{
 			tag += '<span>'+$obj.attr('data-id');
@@ -359,13 +370,13 @@ var fnFilterSet = function (searchId, sizeGb, appGb){
 		$('#filterForm input[name='+searchId+']:checked').each(function(){
 			tag = '<input type="hidden" name="'+searchId+'Arr" value="'+$(this).attr('data-id')+'"/>\n';
 			$("#searchGoodsForm").append(tag);
-			filterHtml += tag;
+			// filterHtml += tag;
 		});
 	}else{
 		$('#filterForm input[name='+searchId+']:checked').each(function(){
 			tag = '<input type="hidden" name="'+searchId+'Arr" value="'+$(this).val()+'"/>\n';
 			$("#searchGoodsForm").append(tag);
-			filterHtml += tag;
+			// filterHtml += tag;
 		});
 	}
 
@@ -397,11 +408,49 @@ var fnFilterSet = function (searchId, sizeGb, appGb){
 		});
 
 	}
-	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
-	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+	fnSetFilterHtml();
+	// gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
+	// gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
 	fnGoodsListSearch();
 }
 
+var fnSetFilterHtml = function (gubun, staus){
+	filterHtml = '';
+
+	$('#filterForm input[name=size]:checked').each(function(){
+		filterHtml += '<input type="hidden" name="sizeArr" value="'+$(this).attr('data-id')+'"/>\n';
+	});
+	$('#filterForm input[name=brandGroup]:checked').each(function(){
+		filterHtml += '<input type="hidden" name="brandGroupArr" value="'+$(this).val()+'"/>\n';
+	});
+	$('#filterForm input[name=age]:checked').each(function(){
+		filterHtml += '<input type="hidden" name="ageArr" value="'+$(this).val()+'"/>\n';
+	});
+	$('#filterForm input[name=season]:checked').each(function(){
+		filterHtml += '<input type="hidden" name="seasonArr" value="'+$(this).val()+'"/>\n';
+	});
+	$('#filterForm input[name=color]:checked').each(function(){
+		filterHtml += '<input type="hidden" name="colorArr" value="'+$(this).val()+'"/>\n';
+	});
+	$('#filterForm input[name=benefit]:checked').each(function(){
+		filterHtml += '<input type="hidden" name="benefitArr" value="'+$(this).val()+'"/>\n';
+	});
+	if(!gagajf.isNull($("#filterForm input[name=price_input_from]").val())){
+		filterHtml += '<input type="hidden" name="priceFrom" value="'+$("#filterForm input[name=price_input_from]").val()+'"/>\n';
+	}
+	if(!gagajf.isNull($("#filterForm input[name=price_input_to]").val())){
+		filterHtml += '<input type="hidden" name="priceTo" value="'+$("#filterForm input[name=price_input_to]").val()+'"/>\n';
+	}
+	if(!gagajf.isNull($("#filterForm input[name=dcrate_input_from]").val())){
+		filterHtml += '<input type="hidden" name="dcRateFrom" value="'+$("#filterForm input[name=dcrate_input_from]").val()+'"/>\n';
+	}
+	if(!gagajf.isNull($("#filterForm input[name=dcrate_input_to]").val())){
+		filterHtml += '<input type="hidden" name="dcRateTo" value="'+$("#filterForm input[name=dcrate_input_to]").val()+'"/>\n';
+	}
+
+	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
+}
+
 // 상품상세 필터 삭제
 var fnDeleteFilter = function (obj, gubun, staus, sizeGb){
 	if(gubun=='size'){
@@ -439,12 +488,13 @@ var fnFilterSliderMove = function (min, max){
 	instance.update({
 		from: min
 	});
-	$inputFrom.val(min);
+	//$inputFrom.val(min);
 	
 	instance.update({
 		to: max
 	});
-	$inputTo.prop("value",max);
+	//$inputTo.prop("value",max);
+	fnSetFilterHtml();
 }
 
 var fnDcRateFilterSliderMove = function (min, max){
@@ -463,6 +513,7 @@ var fnDcRateFilterSliderMove = function (min, max){
 		to: max
 	});
 	$inputTo.prop("value",max);
+	fnSetFilterHtml();
 }
 
 var fnFilterSlider = function (gubun, min, max){
@@ -490,7 +541,7 @@ var fnFilterSlider = function (gubun, min, max){
 			tag += '<span id="dcrateSpan">'+max+'%';
 		}
 	}
-	tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilterSlider(this,\''+gubun+'\', '+oriMin+', '+oriMax+');"></a >';
+	tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilterSlider(this,\''+gubun+'\', \''+oriMin+'\', \''+oriMax+'\');"></a >';
 	tag += '</span>';
 
 	$("#filterData").append(tag);
@@ -517,7 +568,14 @@ var fnFilterSlider = function (gubun, min, max){
 }
 
 var fnDeleteFilterSlider = function (obj, gubun, minVal, maxVal){
+	console.log('fnDeleteFilterSlider >>>'+filterStatHtml);
 	if(gubun=='price'){
+		// filterStatHtml.find('#priceSpan').each(function (){
+		// 	$(this).remove();
+		// 	console.log('priceSpan:::'+filterStatHtml);
+		// 	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+		// });
+
 		var $range = $(".dp .js-range-slider01, .sch_result .js-range-slider01");
 		var $inputFrom = $("#price_input_from");
 		var $inputTo = $("#price_input_to");
@@ -536,6 +594,11 @@ var fnDeleteFilterSlider = function (obj, gubun, minVal, maxVal){
 		$("#filterForm input:hidden[name=priceFrom]").remove();
 		$("#filterForm input:hidden[name=priceTo]").remove();
 	}else{
+		// filterStatHtml.find('#dcrateSpan').each(function (){
+		// 	$(this).remove();
+		// 	console.log('dcrateSpan:::'+filterStatHtml);
+		// 	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
+		// });
 		var $range = $(".dp .js-range-slider02, .sch_result .js-range-slider02");
 		var $inputFrom = $("#dcrate_input_from");
 		var $inputTo = $("#dcrate_input_to");
@@ -555,6 +618,7 @@ var fnDeleteFilterSlider = function (obj, gubun, minVal, maxVal){
 		$("#searchGoodsForm input:hidden[name=dcRateTo]").remove();
 	}
 	$(obj).closest("span").remove();
+	fnSetFilterHtml();
 	fnCategoryGoodsInfiniteScrollInit();
 	fnGoodsListSearch();
 }