Ver código fonte

브랜드홈 기획전관련 수정

bin2107 4 anos atrás
pai
commit
7c04f969b3

+ 21 - 4
src/main/webapp/WEB-INF/views/mob/planning/PlanningMainFormMob.html

@@ -24,12 +24,18 @@
 		<section class="content dp_exhibition">
 			<div class="inner wide">
 				<div class="category_nav">
-					<ul>
+					<ul th:if="${brandGroupInfo==null}">
 						<li><button type="button" th:class="${cateNo == null ? 'active' : ''}" onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">전체</button></li>
 						<th:block th:each="oneData, stat : ${cateList}">
 						<li><button type="button" th:class="${oneData.cateNo == cateNo ? 'active' : '' }" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?cateNo=${oneData.cateNo}');|">[[${oneData.cateNm}]]</button></li>
 						</th:block>
 					</ul>
+					<ul th:unless="${brandGroupInfo==null}">
+						<li><button type="button" th:class="${cateNo == null ? 'active' : ''}" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?brandGroupNo=${brandGroupInfo.brandGroupNo}');|">전체</button></li>
+						<th:block th:each="oneData, stat : ${cateList}">
+							<li><button type="button" th:class="${oneData.cateNo == cateNo ? 'active' : '' }" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?cateNo=${oneData.cateNo}'+ '&brandGroupNo=${brandGroupInfo.brandGroupNo}');|">[[${oneData.cateNm}]]</button></li>
+						</th:block>
+					</ul>
 				</div>
 			</div>
 			<div class="inner">
@@ -43,7 +49,8 @@
                           <div>
                               <p>등록된 기획전이 없습니다.</p>
                           </div>
-                         <button type="button" class="btn btn_default" onclick="cfnGoToPage(_PAGE_MAIN);"><span>홈으로 가기</span></button>
+                         <button type="button" class="btn btn_default" th:if="${brandGroupInfo==null}" onclick="cfnGoToPage(_PAGE_MAIN);"><span>홈으로 가기</span></button>
+						 <button type="button" class="btn btn_default" th:unless="${brandGroupInfo==null}" th:onclick="cfnGoToBrandMain([[${brandGroupInfo.brandGroupNo}]]);"><span th:text="${brandGroupInfo.brandGroupNm+' 홈으로 가기'}"></span></button>
                      </div>
 					<div class="list_item" style="display: none;" id="divPlanningList">
 					</div>
@@ -58,7 +65,13 @@
 	let fnGetPlanningList = function(cateNo,brandGroupNo) {
 		let actionUrl = '/planning/main/list';
 		if (!gagajf.isNull(cateNo)) actionUrl += '?cateNo=' + cateNo;
-		if (!gagajf.isNull(brandGroupNo)) actionUrl += '?brandGroupNo=' + brandGroupNo;
+		if (!gagajf.isNull(brandGroupNo)){
+			if (!gagajf.isNull(cateNo)){
+				actionUrl += '&brandGroupNo=' + brandGroupNo;
+			}else{
+				actionUrl += '?brandGroupNo=' + brandGroupNo;
+			}
+		}
 		
 		$.getJSON(actionUrl
 			, function(result, status) {
@@ -71,7 +84,11 @@
 						$.each(result, function(idx, item) {
 							let tag = '<div>\n';
 							tag += '	<div class="visual">\n';
-							tag += '   <a href="javascript:void(0);" onclick="cfnGoToPlanDetail(\'' + item.planSq + '\')">';
+							if(!gagajf.isNull(brandGroupNo)){
+								tag += '   <a href="javascript:void(0);" onclick="cfnGoToPlanDetail(\'' + item.planSq + '\',\'' + brandGroupNo + '\')">';
+							}else{
+								tag += '   <a href="javascript:void(0);" onclick="cfnGoToPlanDetail(\'' + item.planSq + '\')">';
+							}
 							if (item.newYn == 'Y') {
 								tag += '		<div class="shape ranker"><span>NEW</span></div>\n';
 							}

+ 22 - 6
src/main/webapp/WEB-INF/views/web/planning/PlanningMainFormWeb.html

@@ -23,7 +23,9 @@
 	<div id="container" class="container dp">
 		<div class="breadcrumb"> 
 			<ul>
-				<li class="bread_home"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MAIN);">홈</a></li>
+				<li class="bread_home" th:if="${brandGroupInfo==null}"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MAIN);">홈</a></li>
+				<li class="bread_home" th:unless="${brandGroupInfo==null}"><a href="javascript:void(0);" th:onclick="cfnGoToBrandMain([[${brandGroupInfo.brandGroupNo}]]);">홈</a></li>
+				<li class="bread_home" th:unless="${brandGroupInfo==null}" th:text="${brandGroupInfo.brandGroupNm}"></li>
 				<li class="bread_2depth">기획전</li>
 			</ul> 
 		</div>
@@ -38,8 +40,10 @@
 					<div class="taps">
 						<div>
 							<ul>
-								<li th:class="${cateNo == null ? 'active' : ''}"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">전체</a></li>
-								<li th:each="oneData, stat : ${cateList}" th:class="${oneData.cateNo == cateNo ? 'active' : '' }" ><a href="javascript:void(0);" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?cateNo=${oneData.cateNo}');|">[[${oneData.cateNm}]]</a></li>
+								<li th:if="${brandGroupInfo==null}" th:class="${cateNo == null ? 'active' : ''}"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">전체</a></li>
+								<li th:unless="${brandGroupInfo==null}" th:class="${cateNo == null ? 'active' : ''}"><a href="javascript:void(0);" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?brandGroupNo=${brandGroupInfo.brandGroupNo}');|">전체</a></li>
+								<li th:if="${brandGroupInfo==null}" th:each="oneData, stat : ${cateList}" th:class="${oneData.cateNo == cateNo ? 'active' : '' }" ><a href="javascript:void(0);" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?cateNo=${oneData.cateNo}');|">[[${oneData.cateNm}]]</a></li>
+								<li th:unless="${brandGroupInfo==null}" th:each="oneData, stat : ${cateList}" th:class="${oneData.cateNo == cateNo ? 'active' : '' }" ><a href="javascript:void(0);" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?cateNo=${oneData.cateNo}' + '&brandGroupNo=${brandGroupInfo.brandGroupNo}');|">[[${oneData.cateNm}]]</a></li>
 							</ul>
 						</div>
 					</div>
@@ -54,7 +58,8 @@
 								<p>등록된 기획전이 없습니다.</p>
 							</div>
 							<div class="btn_box">
-								<button class="btn btn_default" onclick="cfnGoToPage(_PAGE_MAIN);"><span>메인으로 가기</span></button>
+								<button class="btn btn_default" th:if="${brandGroupInfo==null}" onclick="cfnGoToPage(_PAGE_MAIN);"><span>메인으로 가기</span></button>
+								<button class="btn btn_default" th:unless="${brandGroupInfo==null}" th:onclick="cfnGoToBrandMain([[${brandGroupInfo.brandGroupNo}]]);"><span th:text="${brandGroupInfo.brandGroupNm+' 홈으로 가기'}"></span></button>
 							</div>
 						</div>
 					</div> 
@@ -114,9 +119,16 @@
 <script th:inline="javascript">
 /*<![CDATA[*/
 	let fnGetPlanningList = function(cateNo,brandGroupNo) {
+		console.log('fnGetPlanningList>>'+brandGroupNo);
 		let actionUrl = '/planning/main/list';
 		if (!gagajf.isNull(cateNo)) actionUrl += '?cateNo=' + cateNo;
-		if (!gagajf.isNull(brandGroupNo)) actionUrl += '?brandGroupNo=' + brandGroupNo;
+		if (!gagajf.isNull(brandGroupNo)){
+			if (!gagajf.isNull(cateNo)){
+				actionUrl += '&brandGroupNo=' + brandGroupNo;
+			}else{
+				actionUrl += '?brandGroupNo=' + brandGroupNo;
+			}
+		}
 		
 		$.getJSON(actionUrl	, function(result, status) {
 				if (status == 'success') {
@@ -133,7 +145,11 @@
 						$.each(result, function(idx, item) {
 						    tag += '  <div class="exhi_item">\n';
 						    tag += '       <div class="exhi_item_img">\n';
-						    tag += '           <a href= "javascript:void(0);" onclick="cfnGoToPlanDetail(\'' + item.planSq + '\')">\n';
+						    if(!gagajf.isNull(brandGroupNo)){
+								tag += '           <a href= "javascript:void(0);" onclick="cfnGoToPlanDetail(\'' + item.planSq + '\',\'' + brandGroupNo + '\')">\n';
+							}else{
+								tag += '           <a href= "javascript:void(0);" onclick="cfnGoToPlanDetail(\'' + item.planSq + '\')">\n';
+							}
                             if (item.newYn == 'Y') {
 						    	tag += '				<div class="shape ranker"><span>NEW</span></div>\n';
 						    }