Просмотр исходного кода

모바일 상품리스트 수정

bin2107 4 лет назад
Родитель
Сommit
e062b4eb74

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

@@ -992,20 +992,24 @@
 			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:신상"){
@@ -1014,6 +1018,7 @@
 					});
 				}
 			}
+			fnSetFilterHtml();
 			fnCategoryGoodsInfiniteScrollInit();
 			fnGoodsListSearch();
 		}
@@ -1047,6 +1052,8 @@
 			});
 			if ( (event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2)) {
 				// if( history.scrollRestoration ) window.history.scrollRestoration = 'manual';
+				$("#searchGoodsForm input:hidden[name=unisex]").remove();
+				$("#searchGoodsForm input:hidden[name=newGoods]").remove();
 				var historyData = sessionStorage.getItem(document.location.href);
 				if(historyData!=null){
 					historyData = JSON.parse(historyData);
@@ -1065,6 +1072,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(filterPriceList.length > 0){
 					let min = 0;
 					let max = 0;

+ 1 - 2
src/main/webapp/WEB-INF/views/web/display/CategoryGoodsListFormWeb.html

@@ -304,7 +304,6 @@
 	<script th:src="@{'/biz/goods.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/goods.js"></script>
 	<script th:inline="javascript">
 		/*<![CDATA[*/
-		console.log([[${cateInfo.formalGb}]]);
 		var filterPriceList = [[${filterPriceList}]];
 		var custom_values = [];
 		var custom_values02  = [];
@@ -1375,7 +1374,7 @@ console.log(allCateList);
 				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 = {};