Browse Source

전시수정

bin2107 5 years ago
parent
commit
e2c2cb9909

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

@@ -948,6 +948,7 @@
 		}
 
 		var fnGoodsListSearch = function (){
+			console.log('ya');
 			gagaInfiniteScroll.getHistory();
 		}
 
@@ -1015,6 +1016,7 @@
 
 		// 사파리 - event.persisted || 크롬 - window.performance.navigation.type 이 1이면 새로고침, 2면 페이지 이동을 통한 캐쉬페이징
 		$(window).on("pageshow", function(event) {
+			// if( history.scrollRestoration ) window.history.scrollRestoration = 'manual';
 			$('#filterForm input[name=brandGroup]:checked').each(function(){
 				$(this).attr('checked', true);
 			});
@@ -1037,15 +1039,16 @@
 				$(this).attr('checked', true);
 			});
 			if ( (event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2)) {
+				if( history.scrollRestoration ) window.history.scrollRestoration = 'manual';
+
 				var historyData = sessionStorage.getItem(document.location.href);
 				if(historyData!=null){
-					// console.log('M historyData>>'+historyData);
 					historyData = JSON.parse(historyData);
 				}else{
 					historyData = {};
 				}
 				if(typeof historyData.filterHtml!='undefined' && historyData.filterHtml!=''){
-					// console.log('historyData.filterHtml>>>'+historyData.filterHtml);
+					//console.log('historyData.filterHtml>>>'+historyData.filterHtml);
 					$("#searchGoodsForm").append(historyData.filterHtml);
 					filterHtml = historyData.filterHtml;
 				}
@@ -1081,9 +1084,9 @@
 				}else{
 					// fnCategoryGoodsInfiniteScrollInit();
 					console.log('here*'+historyData.scroll);
-					// $('html, body').animate({scrollTop: $('#'+scrollLoc).offset().top}, 'slow');
-					$('html, body').animate({scrollTop: historyData.scroll}, 'slow');
 					fnGoodsListSearch();
+					$('html, body').animate({scrollTop: historyData.backScroll});
+					// window.scrollTo(0, historyData.backScroll);
 				}
 			}else{
 				fnCategoryGoodsInfiniteScrollInit();

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

@@ -74,7 +74,7 @@
 													</div>
 													<p class="itemBrand" th:text="${item.brandGroupNm}">BRAND NAME</p>
 													<div class="itemName" th:text="${item.goodsFullNm}">남성 로고 자카드 방풍 패딩 스웨터 가디건 자카드 방풍 패딩 스웨터 가디건 자카드 방풍 패딩 스웨터 가디건</div>
-													<p class="itemPrice" th:text="${#numbers.formatInteger(item.currPrice,3,'POINT')}">80,100</p>
+													<p class="itemPrice" th:text="${#numbers.formatInteger(item.currPrice,3,'COMMA')}">80,100</p>
 													<div class="itemComment" th:if="${not #strings.isEmpty(item.goodsTnm)}" th:text="${item.goodsTnm}">#주문 폭주 상품</div>
 												</a>
 											</div>
@@ -102,7 +102,7 @@
 												</div>
 												<p class="itemBrand" th:text="${item.brandGroupNm}">BRAND NAME</p>
 												<div class=" itemName" th:text="${item.goodsFullNm}">여성 체인 프린트 큐롯 스커트 프린트 큐롯 스커트</div>
-												<p class="itemPrice_original" th:if="${item.currPrice != item.listPrice}" th:text="${#numbers.formatInteger(item.listPrice,3,'POINT')}">89,000</p>
+												<p class="itemPrice_original" th:if="${item.currPrice != item.listPrice}" th:text="${#numbers.formatInteger(item.listPrice,3,'COMMA')}">89,000</p>
 												<p class="itemPrice">[[${#numbers.formatInteger(item.currPrice,1,'COMMA')}]]
 													<span class=" itemPercent" th:if="${item.currPrice != item.listPrice}" th:text="${(item.listPrice == 0 ? 0 : #numbers.formatDecimal((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100, 1, 0)) + '%'}">10%</span>
 												</p>

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

@@ -1031,6 +1031,7 @@
 				}
 			});
 			if ( (event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2)) {
+				// if( history.scrollRestoration ) window.history.scrollRestoration = 'manual';
 				var historyData = sessionStorage.getItem(document.location.href);
 				if(historyData!=null){
 					// console.log('historyData>>'+historyData);
@@ -1073,10 +1074,12 @@
 				}else{
 					$(".fillter").show();
 					// fnCategoryGoodsInfiniteScrollInit();
-					$('html, body').animate({scrollTop: historyData.scroll}, 'slow');
+					// $('html, body').animate({scrollTop: historyData.scroll}, 'slow');
 					fnGoodsListSearch();
 					fnSetPriceFilter();
 					fnImgOnoff();
+					console.log('here*++ '+historyData.scroll);
+					$('html, body').animate({scrollTop: historyData.backScroll});
 				}
 			}else{
 				fnCategoryGoodsInfiniteScrollInit();

+ 3 - 3
src/main/webapp/WEB-INF/views/web/display/CategoryMainFormWeb.html

@@ -98,7 +98,7 @@
 												</div>
 												<p class="itemBrand" th:text="${item.brandGroupNm}">BRAND NAME</p>
 												<div class="itemName" th:text="${item.goodsFullNm}">스타 착용 여성 퍼 아플리케 오버핏 투마일 웨어링 점퍼</div>
-												<p class="itemPrice" th:text="${#numbers.formatInteger(item.currPrice,3,'POINT') + '원'}">488,000원</p>
+												<p class="itemPrice" th:text="${#numbers.formatInteger(item.currPrice,3,'COMMA') + '원'}">488,000원</p>
 												<div class="itemComment" th:if="${not #strings.isEmpty(item.goodsTnm)}" th:text="${item.goodsTnm}">#가을느낌 물씬!</div>
 											</a>
 										</div>
@@ -132,8 +132,8 @@
 											<p class="itemBrand" th:text="${item.brandGroupNm}">BRAND NAME</p>
 											<div class="itemName" th:text="${item.goodsFullNm}">남성 헤링본 기모 팬츠 헤링본 기모 팬츠</div>
 											<p class="itemPrice">
-												<span th:text="${#numbers.formatInteger(item.currPrice,3,'POINT') + '원'}">80,100</span>
-												<span class="itemPrice_original" th:if="${item.currPrice != item.listPrice}" th:text="${#numbers.formatInteger(item.listPrice,3,'POINT') + '원'}">89,000</span>
+												<span th:text="${#numbers.formatInteger(item.currPrice,3,'COMMA') + '원'}">80,100</span>
+												<span class="itemPrice_original" th:if="${item.currPrice != item.listPrice}" th:text="${#numbers.formatInteger(item.listPrice,3,'COMMA') + '원'}">89,000</span>
 												<span class="itemPercent" th:if="${item.currPrice != item.listPrice}" th:text="${(item.listPrice == 0 ? 0 : #numbers.formatDecimal((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100, 1, 0)) + '%'}">10%</span>
 											</p>
 											<div class="itemcolorchip">

+ 20 - 1
src/main/webapp/biz/goods.js

@@ -138,7 +138,7 @@ var fnCreateGoodsList = function(result, ithrCd, contentLoc, goodsUrl, lastPage,
 		}
 		tag += ' "';
 		tag += ' onClick="cfnPutWishList(this);" selfGoodsYn=\''+item.selfGoodsYn+'\' goodsCd=\''+item.goodsCd+'\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
-		tag += '<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.goodsCd+'\',\''+item.mainColorCd+'\');">';
+		tag += '<a href="javascript:void(0);" class="itemLink" onclick="fnClickGoodsCd(\''+item.goodsCd+'\',\''+item.mainColorCd+'\');">';
 		tag += '			<div class="itemPic">';
 		if(!gagajf.isNull(item.videos)){
 			var videoArr = item.videos.split(",");
@@ -875,4 +875,23 @@ var fnReCheckFilterList = function (){
 	});
 }
 
+var fnClickGoodsCd = function (goodsCd, mainColorCd){
+	let scrollTop = document.documentElement.scrollTop;
+	gagaInfiniteScroll.pageStatus.backScroll = scrollTop;
+	fnPushHistory();
+	cfnGoToGoodsDetail(goodsCd, mainColorCd);
+}
+
+var fnPushHistory = function(){
+	gagaInfiniteScroll.pushHistory(
+		gagaInfiniteScroll.pageStatus.nowPage
+		, $(window).scrollTop()
+		, $('#container').height()
+		, gagaInfiniteScroll.pageStatus.loadPage
+		, 0
+		, gagaInfiniteScroll.obj.$ajaxBox.html()
+		, gagaInfiniteScroll.pageStatus.backScroll
+	);
+}
+
 //****************상품리스트  end **********************************

+ 9 - 2
src/main/webapp/ux/plugins/gaga/gaga.infinite.scrollSession.js

@@ -54,6 +54,7 @@ var gagaInfiniteScroll = {
 		, filterHtml : ''
 		, filterStatHtml : ''
 		, totalCount : ''
+		, backScroll : ''
 	},
 	obj : {
 		  $ajaxBoxOuter : $('#listBoxOuter')
@@ -105,6 +106,7 @@ var gagaInfiniteScroll = {
 
 			this.getDataList();
 		} else {
+			if( history.scrollRestoration ) window.history.scrollRestoration = 'manual';
 			this.pageStatus.loadPage = historyData.pageNum;
 			this.pageStatus.pageNum[0] = historyData.pageNum;
 			this.pageStatus.historyScroll = historyData.dataIndex;
@@ -114,6 +116,7 @@ var gagaInfiniteScroll = {
 			this.pageStatus.filterHtml = historyData.filterHtml;
 			this.pageStatus.filterStatHtml = historyData.filterStatHtml;
 			this.pageStatus.totalCount = historyData.totalCount;
+			this.pageStatus.backScroll = historyData.backScroll;
 
 			gagaInfiniteScroll.draw(historyData.htm);
 		};
@@ -151,7 +154,9 @@ var gagaInfiniteScroll = {
 						, $('#infiniteContainer').height()
 						, gagaInfiniteScroll.pageStatus.loadPage
 						, 0
-						, gagaInfiniteScroll.obj.$ajaxBox.html());
+						, gagaInfiniteScroll.obj.$ajaxBox.html()
+						, gagaInfiniteScroll.pageStatus.backScroll
+					);
 				if (scrollTop && containerHeight) {
 					gagaInfiniteScroll.obj.$window.scrollTop.scrollTop(0).scrollTop(scrollTop);
 				} else {
@@ -173,7 +178,7 @@ var gagaInfiniteScroll = {
 			this.pageStatus.loadAlign = 'not';
 		}
 	},
-	pushHistory : function(page, sScrollTop, sHeight, sPageNum, sDataIndex, sHtml) {
+	pushHistory : function(page, sScrollTop, sHeight, sPageNum, sDataIndex, sHtml, sBackScroll) {
 		var historyData = {
 				state: page
 				, scroll: sScrollTop
@@ -188,6 +193,7 @@ var gagaInfiniteScroll = {
 				, filterHtml : gagaInfiniteScroll.pageStatus.filterHtml
 				, filterStatHtml : gagaInfiniteScroll.pageStatus.filterStatHtml
 				, totalCount : gagaInfiniteScroll.pageStatus.totalCount
+				, backScroll : sBackScroll
 		};
 		historyData = JSON.stringify(historyData);
 		sessionStorage.setItem(document.location.href, historyData);
@@ -212,6 +218,7 @@ var gagaInfiniteScroll = {
 					, filterHtml : gagaInfiniteScroll.pageStatus.filterHtml
 					, filterStatHtml : gagaInfiniteScroll.pageStatus.filterStatHtml
 					, totalCount : gagaInfiniteScroll.pageStatus.totalCount
+					, backScroll : gagaInfiniteScroll.pageStatus.backScroll
 		};
 		historyData = JSON.stringify(historyData);
 		sessionStorage.setItem(document.location.href, historyData);