Sfoglia il codice sorgente

검색 상품리스트 수정

bin2107 4 anni fa
parent
commit
634740a021

+ 17 - 0
src/main/webapp/WEB-INF/views/mob/display/SearchGoodsListFormMob.html

@@ -625,6 +625,8 @@
 			$(this).attr('checked', true);
 		});
 		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();
 			var historyData = sessionStorage.getItem(document.location.href);
 			// console.log(historyData);
 			if(historyData!=null){
@@ -633,6 +635,21 @@
 			}else{
 				historyData = {};
 			}
+			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.filterHtml!='undefined' && historyData.filterHtml!=''){
 			// 	//console.log('historyData.filterHtml>>>'+historyData.filterHtml);
 			// 	$("#searchGoodsForm").append(historyData.filterHtml);

+ 17 - 0
src/main/webapp/WEB-INF/views/web/display/SearchGoodsListFormWeb.html

@@ -717,6 +717,8 @@
 			});
 
 			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();
 				var historyData = sessionStorage.getItem(document.location.href);
 				// console.log('historyData>>'+historyData);
 				if(historyData!=null){
@@ -740,6 +742,21 @@
 				if(typeof historyData.totalCount!='undefined' && historyData.totalCount!=''){
 					$("#totCntId").text(historyData.totalCount);
 				}
+				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(!gagajf.isNull($("#searchGoodsForm").find('input[name=priceArr]').val())){
 					let tempPrice = $("#searchGoodsForm").find('input[name=priceArr]').val();
 					let temp  = tempPrice.split(",");

+ 12 - 1
src/main/webapp/biz/search.js

@@ -208,20 +208,24 @@ var fnFilterOption = function (obj, stat){
 	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';
+			$(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\');');
+			$(obj).attr('checked', false);
 			$("#searchGoodsForm input:hidden[name=newGoods]").remove();
 			$("#searchGoodsForm input:hidden[name=benefitArr]").each(function(){
 				if($(this).val() == "40:신상"){
@@ -230,6 +234,7 @@ var fnFilterOption = function (obj, stat){
 			});
 		}
 	}
+	fnSetFilterHtml();
 	fnCategoryGoodsInfiniteScrollInit();
 	fnSearchGoodsListSearch();
 }
@@ -413,6 +418,12 @@ var fnSetFilterHtml = function (gubun, staus, mobGb){
 	if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate5No]').val())){
 		filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate5No]').val()+'"/>\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';
+	}
 
 	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
 }