Explorar el Código

브랜드메인 배경컬러 수정

bin2107 hace 5 años
padre
commit
158e05f6a6

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

@@ -293,7 +293,7 @@
 								<ul class="swiper-wrapper">
 									<th:block th:each="ContentsData, ContentsStat : ${mainData.ContentsList}">
 										<li class="swiper-slide" th:classappend="${ContentsStat.count==1}?'on'"> <!-- li.on / li .btn.active : 메뉴 표시 -->
-											<button class="btn btn_link" th:attr="data-tab=${'pick'+ContentsStat.count}"><span th:text="${ContentsData.brandGroupNm}">BUKAROO</span></button>
+											<button class="btn btn_link" th:id="${'pickBtn'+ContentsStat.count}" th:attr="data-tab=${'pick'+ContentsStat.count}"><span th:text="${ContentsData.brandGroupNm}">BUKAROO</span></button>
 										</li>
 									</th:block>
 								</ul>
@@ -340,7 +340,7 @@
 								<!-- 210524 : pick-post 형제로 버튼그룹 이동 -->
 								<div class="btn_group_flex">
 									<div>
-										<button class="btn btn_default" th:onclick="cfnGoToBrandMain([[${brandPickData.brandGroupNo}]])">다음 브랜드 보기<span></span></button>
+										<button class="btn btn_default" th:onclick="fnNextBrand([[${brandPickStat.size}]],[[${brandPickStat.count}]])">다음 브랜드 보기<span></span></button>
 									</div>
 								</div>
 								<!-- //210329 : 브랜드 pick 상품 swiper 제거 -->
@@ -831,6 +831,14 @@
 			$('#htopSub').show();
 		}
 	}
+
+	var fnNextBrand = function (tot, idx){
+		if(tot == idx){
+			$("#pickBtn1").click();
+		}else{
+			$("#pickBtn"+(idx+1)).click();
+		}
+	}
 /*]]>*/
 </script>
 

+ 2 - 2
src/main/webapp/WEB-INF/views/web/common/fragments/BrandGnbWeb.html

@@ -17,7 +17,7 @@
 <header id="header" th:fragment="gnb">
 
 	<div class="common_header br_header" th:style="${'background-color: #' + brandGroupInfo.rgbCd}">
-		<div class="area">
+		<div class="area" th:style="${'background-color: #' + brandGroupInfo.rgbCd}">
 			<div class="logo">
 				<a href="javascript:void(0);" th:onclick="cfnGoToBrandMain([[${brandGroupInfo.brandGroupNo}]]);">
 					<h1>
@@ -34,7 +34,7 @@
 				<span><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MYPAGE);" title="마이페이지 바로가기">마이페이지</a></span>
 			</div>
 		</div>
-		<div class="gnb">
+		<div class="gnb" th:style="${'background-color: #' + brandGroupInfo.rgbCd}">
 			<!-- nav -->
 			<div class="nav">
 				<ul class="bundle" id="ulGnbTab">

+ 7 - 1
src/main/webapp/WEB-INF/views/web/common/layout/BrandLayoutWeb.html

@@ -35,7 +35,13 @@
 <script th:inline="javascript">
 /*<![CDATA[*/
 	$(document).ready(function() {
-		$("#container").css('backgroundColor','#fff');
+		let brandGroupColor = [[${brandGroupInfo.rgbCd}]];
+		if(brandGroupColor != null){
+			$("#container").css('backgroundColor',[[${brandGroupInfo.rgbCd}]]);
+		}else{
+			$("#container").css('backgroundColor','#fff');
+		}
+
 	});
 /*]]>*/
 </script>

+ 206 - 0
src/main/webapp/ux/plugins/gaga/gaga.infinite.scroll.js

@@ -0,0 +1,206 @@
+/*
+ * Inifinite Scroll Java Script written by gagamel.
+ *
+ * Copyright (c) 2016 gagamel (nogdoo.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2016-04-28 $
+ *
+ * 사용 예)
+ * 		// HTML 태그는 다음과 같은 구조로 되어 있어야 하며
+ * 		// id 명칭은 container, listBoxOuter, listBox 가 필요하다.
+ * 		<section id="container">
+ * 			<div id="listBoxOuter">
+ * 				<ul id="listBox">
+ * 				</ul>
+ *			</div>
+ *		</section>
+ *
+ * 		// JQUERY History 파일과 인피니트 스크롤 관련 자바스크립트 파일을 import 되어 있어야 한다.
+ * 		<script type="text/javascript" src="/ux/plugins/jquery.history.min.js"></script>
+ * 		<script type="text/javascript" src="/ux/plugins/gaga.infinite.scroll.js"></script>
+ *
+ * 		<script type="text/javascript">
+ * 			// 인피니트 스크롤에 대한 History 정보를 가져오기 위해 함수를 호출한다.
+ *			// History 정보가 없을 경우 fnGetInfiniteScrollDataList 함수가 호출된다.
+ * 			$(function() { gagaInfiniteScroll.getHistory(); });
+ *
+ *			// 인피니트 스크롤 이벤트 발생 시 데이터 가져오기
+ *			var fnGetInfiniteScrollDataList = function(pageNum) {
+ *				// 콜백함수인 gagaInfiniteScroll.jsonToHtml 에서는 fnDrawInfiniteScrollData 함수를 호출한다.
+ *				gagajf.ajaxSubmitForm(document.searchForm, "/goods/list", "json", gagaInfiniteScroll.jsonToHtml);
+ *			}
+ *
+ *			// 인피니트 스크롤 이벤트 발생 시 가져온 데이터를 특정 태그에 append
+ *			// fnDrawInfiniteScrollData(result, pageNum) 함수 구현
+ *			// 		이 함수 내에서의 로직은
+ *			//		1. 가져온 데이터로 HTML 태그를 만든다.
+ *			// 		2. 만든 태그를 append 하는 gagaInfiniteScroll.draw() 함수를 호출
+ *		</script>
+ */
+
+var gagaInfiniteScroll = {
+	pageStatus : {
+		pageNum : []      // [0,1,2...] 로드된 페이지 (Array)
+		, loadPage : 0      // 로드할 페이지
+		, loadAlign : 'not' // 로드 상태(prev, next, not)
+		, historyScroll : 0 //
+		, nowPage : null    // 현재 페이지
+		, pageUrl : {       // page url
+		}
+		, totalCount : ''
+	},
+	obj : {
+		$ajaxBoxOuter : $('#listBoxOuter')
+		, $ajaxBox : $('#listBox')
+		, $window : $(window)
+		, $loadingBar : '<div style="width: 100%; padding-top: 50px; text-align: center;" id="loadingBar"><img src="/ux/plugins/gaga/loader.gif" style="width:25px; height:25px;"/></div>'
+//		, $loadingBar : '<div style="width: 100%; padding-top: 50px; text-align: center;" id="loadingBar"><img src="/images/hsmob/common/loading_bar_01.gif" width="24px" height=" 22px"/></div>'
+	},
+	scrollCheck : function() {
+		var obj = this.obj, stat = this.pageStatus;
+
+		if (obj.$window.scrollTop() >= obj.$ajaxBox.offset().top + obj.$ajaxBox.height() - obj.$window.height()) { // 더보기
+			if (stat.loadAlign == 'not') {
+				var pageLen = this.pageStatus.pageNum.length - 1;
+				var nextPageNum = this.pageStatus.pageNum[pageLen] + 1;
+				this.pageStatus.pageNum.push(nextPageNum);
+				this.pageStatus.loadPage = nextPageNum;
+				stat.loadAlign = 'next';
+				this.getDataList();
+			};
+		}
+	},
+	getDataList : function() {
+		if (this.pageStatus.loadAlign == 'prev') {
+			this.obj.$ajaxBoxOuter.prepend($(this.obj.$loadingBar));
+		} else if (this.pageStatus.loadAlign == 'next') {
+			this.obj.$ajaxBoxOuter.append($(this.obj.$loadingBar));
+		};
+
+		// 인피니트 스크롤 이벤트에서 호출될 함수(데이터 가져오기 등)
+		// fnGetInfiniteScrollDataList 함수는 개발단에서 구현해야 한다.
+		fnGetInfiniteScrollDataList(this.pageStatus.loadPage);
+	},
+	getHistory : function() {
+		var historyData = History.getState();
+		if (historyData.data.pageNum === undefined || historyData.data.pageNum === '' || historyData.data.htm === undefined || historyData.data.htm == '') {
+			this.pageStatus.loadPage = 0;
+			this.pageStatus.pageNum[0] = 0;
+			this.pageStatus.loadAlign = 'next';
+			this.pageStatus.historyScroll = 0;
+
+			this.getDataList();
+		} else {
+			this.pageStatus.loadPage = historyData.data.pageNum;
+			this.pageStatus.pageNum[0] = historyData.data.pageNum;
+			this.pageStatus.historyScroll = historyData.data.dataIndex;
+			this.pageStatus.loadAlign = 'next';
+			this.pageStatus.loadAlign = historyData.data.totalCount;
+
+			gagaInfiniteScroll.draw(historyData.data.htm);
+		};
+
+		$(window).on('scroll', function() {
+			gagaInfiniteScroll.scrollCheck();
+		});
+	},
+	draw : function(htm, scrollTop, containerHeight) {
+		if (htm == 'not') {
+			$('#loadingBar').remove();
+			this.pageStatus.loadAlign = 'top';
+		} else {
+			var startH = $('#infiniteContainer').height();
+			var $addHtm = $(htm);
+			var $imgs = $addHtm.find('img');
+			var loadCheck = 0;
+			var len = $imgs.length;
+
+			if (scrollTop && containerHeight) {
+			} else {
+			}
+
+			// $addHtm.find('img.lazy').lazyload({root: null,
+			// 	rootMargin: "100px",
+			// 	threshold: 0});
+
+			$.each($imgs, function(index) {
+				$imgs.eq(index).on('load',function() {
+					loadCheck++;
+					imgLpadComp();
+				});
+			});
+
+			var imgLpadComp = function() {
+				if (len - 1 == loadCheck) {
+					gagaInfiniteScroll.pushHistory(
+						gagaInfiniteScroll.pageStatus.nowPage
+						, $(window).scrollTop()
+						, $('#infiniteContainer').height()
+						, gagaInfiniteScroll.pageStatus.loadPage
+						, 0
+						, gagaInfiniteScroll.obj.$ajaxBox.html());
+					if (scrollTop && containerHeight) {
+						gagaInfiniteScroll.obj.$window.scrollTop.scrollTop(0).scrollTop(scrollTop);
+					} else {
+						gagaInfiniteScroll.obj.$window.scrollTop(gagaInfiniteScroll.obj.$window.scrollTop() + 1);
+					}
+				};
+			};
+
+			$('#loadingBar').remove();
+
+			// Append HTML
+			this.obj.$ajaxBox.append($addHtm);
+
+			if (scrollTop && containerHeight) {
+				gagaInfiniteScroll.obj.$window.scrollTop.scrollTop(0).scrollTop(scrollTop);
+			} else {
+				$(window).scrollTop($(window).scrollTop() + 1);
+			}
+
+			this.pageStatus.loadAlign = 'not';
+		}
+	},
+	pushHistory : function(page, sScrollTop, sHeight, sPageNum, sDataIndex, sHtml) {
+		History.replaceState({
+			state: page
+			, scroll: sScrollTop
+			, height: sHeight
+			, pageUrl: gagaInfiniteScroll.pageStatus.pageUrl
+			, name: gagaInfiniteScroll.pageStatus.nowPage
+			, pageNum : sPageNum
+			, dataIndex : sDataIndex
+			, htm : sHtml
+			, totalCount : gagaInfiniteScroll.pageStatus.totalCount
+		}, "", "");
+	},
+	pushLinkHistory : function(pageNum, dataIndex, obj) { // 링크에서 사용
+		var $pageNum = (pageNum || pageNum == 0) ? pageNum : '';
+		var $dataIndex = (dataIndex || dataIndex == 0) ? dataIndex : '';
+		var $html = (obj) ? $(obj).parents('#listBox').html() : '';
+
+		History.replaceState({
+			state : gagaInfiniteScroll.pageStatus.nowPage
+			, scroll : $(window).scrollTop()
+			, height : $('#infiniteContainer').height()
+			, pageUrl : gagaInfiniteScroll.pageStatus.pageUrl
+			, name : gagaInfiniteScroll.pageStatus.nowPage
+			, pageNum : $pageNum
+			, dataIndex : $dataIndex
+			, htm : $html
+			, totalCount : gagaInfiniteScroll.pageStatus.totalCount
+		}, "", "");
+
+		return false;
+	},
+	jsonToHtml : function(result) {
+		// Data 가져온 후 실행될 함수
+		// fnDrawInfiniteScrollData 함수는 개발단에서 구현해야 한다.
+		if (result.dataList == "not") // data가 더 이상 없으면
+			fnDrawInfiniteScrollData('not', result.CURRENT_PAGE - 1);
+		else
+			fnDrawInfiniteScrollData(result, result.CURRENT_PAGE - 1);
+	}
+};