Bläddra i källkod

웹 상품 리스트 수정

bin2107 4 år sedan
förälder
incheckning
514df8c53c

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

@@ -9,6 +9,7 @@ import java.util.HashMap;
 
 import javax.servlet.http.HttpServletResponse;
 
+import com.gagaframework.web.util.GagaStringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.mobile.device.Device;
@@ -272,7 +273,15 @@ public class TsfDisplayController extends TsfBaseController {
 	public Collection<Contents> getGnbTopBannerList(Contents contents, @RequestParam(value = "contentsLoc") String contentsLoc) {
 		contents.setContentsLoc(contentsLoc);
 		contents.setMaxRow(1);
-		return displayService.getContentsList(contents);
+		Collection<Contents> bannerList = displayService.getContentsList(contents);
+
+		for(Contents tempContents : bannerList){
+			tempContents.setHtml(GagaStringUtil.replace(GagaStringUtil.replace(tempContents.getHtml(), "&lt;", "<"), "&gt;", ">"));
+		}
+
+		log.info("getGnbTopBannerList>>>>{}",bannerList);
+
+		return bannerList;
 	}
 
 //	/**

+ 7 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -1312,6 +1312,8 @@
 		      , Z.SUB_TEXT1
 		      , Z.SUB_TEXT2
 		FROM    (
+		    SELECT *
+		    FROM   (
 		            SELECT  'ADMIN' AS BANNER_GB
 		                  , IMG_PATH1
 		                  , STR_VAR1
@@ -1333,6 +1335,11 @@
 		            AND     USE_YN = 'Y'
 		            AND    DISP_STDT <![CDATA[<=]]> NOW()
 		            AND    DISP_EDDT <![CDATA[>=]]> NOW()
+		            ORDER BY  DISP_ORD
+		        <if test="maxRow != null and maxRow != ''">
+		            LIMIT #{maxRow}
+		        </if>
+		    ) AS TC
 		            UNION ALL
 		            SELECT  'PLAN' AS BANNER_GB
 		                  , A.MAIN_PIMG AS IMG_PATH1

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

@@ -379,9 +379,9 @@
 		<input type="hidden" name="cate3No" th:value="${cateInfo.cate3No}"/>
 		<input type="hidden" name="cate4No" th:value="${cateInfo.cate4No}"/>
 		<input type="hidden" name="sortingType" value="NEW"/>
-<!--		<input type="hidden" name="newGoods" th:value="${cateInfo.formalGb=='G009_20'?'':'40'}" />-->
+		<input type="hidden" name="newGoods" th:unless="${cateInfo.formalGb=='G009_20'}" th:value="${cateInfo.formalGb=='G009_20'?'':'40'}" />
 		<input type="hidden" name="keyword" value=""/>
-		<input type="hidden" name="benefitArr" th:unless="${cateInfo.formalGb=='G009_20'}" th:value="${cateInfo.formalGb=='G009_20'?'':'40:신상'}"/>
+<!--		<input type="hidden" name="benefitArr" th:unless="${cateInfo.formalGb=='G009_20'}" th:value="${cateInfo.formalGb=='G009_20'?'':'40:신상'}"/>-->
 	</form>
 
 
@@ -1002,10 +1002,11 @@
 				if(stat=='on'){
 					$(obj).attr('onclick','fnFilterOption(this,\'off\');');
 					// tag += '<input type="hidden" name="newGoods" value="40"/>\n';
-					tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
+					// tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
 					$("#searchGoodsForm").append(tag);
 				}else{
 					$(obj).attr('onclick','fnFilterOption(this,\'on\');');
+					$("#searchGoodsForm input:hidden[name=newGoods]").remove();
 					$("#searchGoodsForm input:hidden[name=benefitArr]").each(function(){
 						if($(this).val() == "40:신상"){
 							$(this).remove();

+ 1 - 3
src/main/webapp/WEB-INF/views/web/common/fragments/GnbWeb.html

@@ -448,9 +448,7 @@
 								}else{
 									tag +=' 	<a href="'+item.strVar1+'" target="">';
 									tag +=' 		<img src="'+bannerImgUrl+''+item.imgPath1+'" alt="">';
-									tag +=' 		<div class="open_bnr_area">';
-									tag += '		'+item.html+' ';
-									tag +=' 		</div>';
+									tag +=' 		<div class="open_bnr_area">'+item.html+'</div>';
 									tag +=' 	</a>';
 									tag +=' 	<button class="btn_toggle_bnr">열기</button>';
 								}

+ 29 - 6
src/main/webapp/WEB-INF/views/web/display/CategoryGoodsListFormWeb.html

@@ -294,9 +294,9 @@
 		<input type="hidden" name="cate3No" th:value="${cateInfo.cate3No}"/>
 		<input type="hidden" name="cate4No" th:value="${cateInfo.cate4No}"/>
 		<input type="hidden" name="sortingType" value="NEW"/>
-<!--		<input type="hidden" name="newGoods" th:value="${cateInfo.formalGb=='G009_20'?'':'40'}" />-->
+		<input type="hidden" name="newGoods" th:unless="${cateInfo.formalGb=='G009_20'}" th:value="${cateInfo.formalGb=='G009_20'?'':'40'}" />
 		<input type="hidden" name="keyword" value=""/>
-		<input type="hidden" name="benefitArr" th:unless="${cateInfo.formalGb=='G009_20'}" th:value="${cateInfo.formalGb=='G009_20'?'':'40:신상'}"/>
+<!--		<input type="hidden" name="benefitArr" th:unless="${cateInfo.formalGb=='G009_20'}" th:value="${cateInfo.formalGb=='G009_20'?'':'40:신상'}"/>-->
 	</form>
 
 	<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>
@@ -322,6 +322,7 @@
 					$(".br_header").css('background-color','#fff');
 				}
 			}
+
 			//가격 슬라이드
 			//var custom_values = ['9,000원', '230,000원', '487,000원', '700,000원', '1,360,000원', '1,799,000원'];
 
@@ -730,21 +731,25 @@ console.log(allCateList);
 			if(thisId == 'unisex'){
 				if(stat=='on'){
 					$(obj).attr('onclick','fnFilterOption(this,\'off\');');
+					$(obj).attr('checked', true);
 					tag += '<input type="hidden" name="unisex" value="G007_Z"/>\n';
 					$("#searchGoodsForm").append(tag);
 				}else{
 					$(obj).attr('onclick','fnFilterOption(this,\'on\');');
+					$(obj).attr('checked', false);
 					$("#searchGoodsForm input:hidden[name=unisex]").remove();
 				}
 			}else{
 				if(stat=='on'){
 					$(obj).attr('onclick','fnFilterOption(this,\'off\');');
-					// tag += '<input type="hidden" name="newGoods" value="40"/>\n';
-					tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
+					$(obj).attr('checked', true);
+					tag += '<input type="hidden" name="newGoods" value="40"/>\n';
+					// tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
 					$("#searchGoodsForm").append(tag);
 				}else{
 					$(obj).attr('onclick','fnFilterOption(this,\'on\');');
-					// $("#searchGoodsForm input:hidden[name=newGoods]").remove();
+					$(obj).attr('checked', false);
+					$("#searchGoodsForm input:hidden[name=newGoods]").remove();
 					$("#searchGoodsForm input:hidden[name=benefitArr]").each(function(){
 						if($(this).val() == "40:신상"){
 							$(this).remove();
@@ -752,6 +757,7 @@ console.log(allCateList);
 					});
 				}
 			}
+			fnSetFilterHtml();
 			fnCategoryGoodsInfiniteScrollInit();
 			fnGoodsListSearch();
 		}
@@ -1364,10 +1370,12 @@ console.log(allCateList);
 				}
 			});
 			if ( (event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2)) {
+				$("#searchGoodsForm input:hidden[name=unisex]").remove();
+				$("#searchGoodsForm input:hidden[name=newGoods]").remove();
 				if( history.scrollRestoration ) window.history.scrollRestoration = 'manual';
 				var historyData = sessionStorage.getItem(document.location.href);
 				if(historyData!=null){
-					// console.log('historyData>>'+historyData);
+					console.log('historyData>>'+historyData);
 					historyData = JSON.parse(historyData);
 				}else{
 					historyData = {};
@@ -1401,6 +1409,21 @@ console.log(allCateList);
 					$("#filterForm").find('input[name=hDcRateTo]').val($("#searchGoodsForm").find('input[name=dcRateTo]').val());
 				}
 				idx++;
+				if(gagajf.isNull($("#searchGoodsForm").find("input[name=unisex]").val())){
+					$("#unisex").attr('onclick','fnFilterOption(this,\'on\');');
+					$("#unisex").attr('checked', false);
+				}else{
+					$("#unisex").attr('onclick','fnFilterOption(this,\'off\');');
+					$("#unisex").attr('checked', true);
+				}
+
+				if(gagajf.isNull($("#searchGoodsForm").find("input[name=newGoods]").val())){
+					$("#newGoods").attr('onclick','fnFilterOption(this,\'on\');');
+					$("#newGoods").attr('checked', false);
+				}else{
+					$("#newGoods").attr('onclick','fnFilterOption(this,\'off\');');
+					$("#newGoods").attr('checked', true);
+				}
 				if(typeof historyData.sortingType!='undefined' && historyData.sortingType!=''){
 					$("#searchGoodsForm input:hidden[name=sortingType]").val(historyData.sortingType);
 					fnSortingChange(this,historyData.sortingType,'back');

+ 7 - 2
src/main/webapp/biz/goods.js

@@ -514,7 +514,7 @@ var fnFilterSet = function (searchId, sizeGb, appGb){
 		});
 		if(searchId=='benefit'){
 			if ($('#newGoods').is(":checked")) {
-				tag = '<input type="hidden" name="'+searchId+'Arr" value="40:신상"/>\n';
+				// tag = '<input type="hidden" name="'+searchId+'Arr" value="40:신상"/>\n';
 				$("#searchGoodsForm").append(tag);
 			}
 		}
@@ -602,7 +602,12 @@ var fnSetFilterHtml = function (gubun, staus, mobGb){
 		dcRateVal += ',' + $("#filterForm input[name=hDcRateTo]").val();
 	}
 	filterHtml += '<input type="hidden" name="dcRateArr" value="'+dcRateVal+'"/>\n';
-
+	if($('#filterForm').find("input:checkbox[id='unisex']").is(":checked") == true){
+		filterHtml += '<input type="hidden" name="unisex" value="G007_Z"/>\n';
+	}
+	if($('#filterForm').find("input:checkbox[id='newGoods']").is(":checked") == true){
+		filterHtml += '<input type="hidden" name="newGoods" value="40"/>\n';
+	}
 	// console.log('filterHtml>>'+filterHtml);
 	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
 }

+ 3 - 3
src/main/webapp/biz/search.js

@@ -218,11 +218,11 @@ var fnFilterOption = function (obj, stat){
 		if(stat=='on'){
 			$(obj).attr('onclick','fnFilterOption(this,\'off\');');
 			// tag += '<input type="hidden" name="newGoods" value="40"/>\n';
-			tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
+			// tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
 			$("#searchGoodsForm").append(tag);
 		}else{
 			$(obj).attr('onclick','fnFilterOption(this,\'on\');');
-			// $("#searchGoodsForm input:hidden[name=newGoods]").remove();
+			$("#searchGoodsForm input:hidden[name=newGoods]").remove();
 			$("#searchGoodsForm input:hidden[name=benefitArr]").each(function(){
 				if($(this).val() == "40:신상"){
 					$(this).remove();
@@ -312,7 +312,7 @@ var fnFilterSet = function (searchId, sizeGb, appGb){
 		});
 		if(searchId=='benefit'){
 			if ($('#newGoods').is(":checked")) {
-				tag = '<input type="hidden" name="'+searchId+'Arr" value="40:신상"/>\n';
+				// tag = '<input type="hidden" name="'+searchId+'Arr" value="40:신상"/>\n';
 				$("#searchGoodsForm").append(tag);
 			}
 		}