Sfoglia il codice sorgente

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.front.git into develop

eskim 5 anni fa
parent
commit
f91b65a465

+ 16 - 0
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -188,6 +188,22 @@ public class TsfDisplayController extends TsfBaseController {
 		return displayService.getGnbBrandGroupList(contents);
 	}
 
+	/**
+	 * GNB탭 > TOP BANNER 목록
+	 * @param contents - 컨텐츠 정보
+	 * @return
+	 * @throws Exception
+	 * @author bin2107
+	 * @since 2021. 4. 11
+	 */
+	@GetMapping("/gnb/topbanner/list")
+	@ResponseBody
+	public Collection<Contents> getGnbTopBannerList(Contents contents) {
+		contents.setContentsLoc("SGNB001");
+		contents.setMaxRow(1);
+		return displayService.getContentsList(contents);
+	}
+
 //	/**
 //	 * 전체 카테고리 목록
 //	 * @return

+ 87 - 31
src/main/webapp/WEB-INF/views/web/common/fragments/GnbWeb.html

@@ -19,37 +19,37 @@
 	<!-- head start -->
 	<div class="common_header">
 		<!-- 프로모션 띠 배너 등록 시 노출 -->
-<!-- 		<div class="hd_top_banner"> -->
-<!-- 			<div class="bnrtype_open" style="background-color:#496ac9;"> -->
-<!-- 				<a href="" target=""> -->
-<!-- 					<img src="/images/pc/thumb/tmp_top_banner2.jpg" alt="">	 -->
-<!-- 					<div class="open_bnr_area"> -->
-<!-- 						<img src="/images/pc/thumb/tmp_top_banner2_open.jpg" alt=""/> -->
-<!-- 					</div> -->
-<!-- 				</a> -->
-<!-- 				<button class="btn_toggle_bnr"><span>열기</span></button> -->
-<!-- 			</div> -->
-<!-- 			<div class="bnrtype_img" style="background-color:#57799d;"> -->
-<!-- 				<a href="" target=""> -->
-<!-- 					<img src="/images/pc/thumb/tmp_top_banner1.jpg" alt=""/> -->
-<!-- 				</a> -->
-<!-- 			</div> -->
-<!-- 			<div class="bnrtype_text" style="background-color:#fd4801;"> -->
-<!-- 				<a href="" target=""> -->
-<!-- 					<div style="color:#fff; font-size:20px; font-weight:300;"> -->
-<!-- 						<span style="font-weight:500">APP</span> 수신동의 하면 <span style="font-weight:500">1</span>만 포인트 증정! -->
-<!-- 					</div> -->
-<!-- 				</a> -->
-<!-- 			</div> -->
-<!-- 			<div class="close_bnr_area"> -->
-<!-- 				<form class="form_wrap"> -->
-<!-- 					<div class="form_field"> -->
-<!-- 						<input id="chk-cookie" type="checkbox"><label for="chk-cookie"><span>오늘 하루 보지 않기</span></label> -->
-<!-- 					</div> -->
-<!-- 				</form> -->
-<!-- 				<button id="btn_close_bnr" class="btn_close"><span>닫기</span></button> -->
-<!-- 			</div> -->
-<!-- 		</div> -->
+ 		<div class="hd_top_banner" id="divTopbanner">
+<!-- 			<div class="bnrtype_open" style="background-color:#496ac9;">-->
+<!-- 				<a href="" target="">-->
+<!-- 					<img src="/images/pc/thumb/tmp_top_banner2.jpg" alt="">-->
+<!-- 					<div class="open_bnr_area">-->
+<!-- 						<img src="/images/pc/thumb/tmp_top_banner2_open.jpg" alt=""/>-->
+<!-- 					</div>-->
+<!-- 				</a>-->
+<!-- 				<button class="btn_toggle_bnr"><span>열기</span></button>-->
+<!-- 			</div>-->
+<!-- 			<div class="bnrtype_img" style="background-color:#57799d;">-->
+<!-- 				<a href="" target="">-->
+<!-- 					<img src="/images/pc/thumb/tmp_top_banner1.jpg" alt=""/>-->
+<!-- 				</a>-->
+<!-- 			</div>-->
+<!-- 			<div class="bnrtype_text" style="background-color:#fd4801;">-->
+<!-- 				<a href="" target="">-->
+<!-- 					<div style="color:#fff; font-size:20px; font-weight:300;">-->
+<!-- 						<span style="font-weight:500">APP</span> 수신동의 하면 <span style="font-weight:500">1</span>만 포인트 증정!-->
+<!-- 					</div>-->
+<!-- 				</a>-->
+<!-- 			</div>-->
+<!-- 			<div class="close_bnr_area">-->
+<!-- 				<form class="form_wrap">-->
+<!-- 					<div class="form_field">-->
+<!-- 						<input id="chk-cookie" type="checkbox"><label for="chk-cookie"><span>오늘 하루 보지 않기</span></label>-->
+<!-- 					</div>-->
+<!-- 				</form>-->
+<!-- 				<button id="btn_close_bnr" class="btn_close"><span>닫기</span></button>-->
+<!-- 			</div>-->
+ 		</div>
 		<!-- //프로모션 띠 배너 등록 시 노출 -->
 
 		<div class="area">
@@ -716,6 +716,59 @@
 		//검색창 호출
 		$(".common_search").addClass('active');
 	});
+
+
+	// 띠배너 조회
+	let fnCreateTopBanner = function (){
+		$.getJSON('/display/gnb/topbanner/list', function (result, status){
+			if(status=='success'){
+				if(result.length>0){
+					var bannerImgUrl = [[${@environment.getProperty('domain.image')}]];
+					$.each(result, function (idx, item) {
+						$('#divTopbanner').html('');
+						let tag = '';
+						if(item.contentsType == 'OPEN'){
+							tag +='<div class="bnrtype_open" style="background-color:'+item.strVar5+';">';
+							tag +=' 	<a href="'+item.strVar1+'" target="">';
+							tag +=' 		<img src="'+bannerImgUrl+''+item.imgPath1+'" alt="">';
+							tag +=' 		<div class="open_bnr_area">';
+							tag +=' 			<img src="'+bannerImgUrl+''+item.imgPath2+'" alt=""/>';
+							tag +=' 		</div>';
+							tag +=' 	</a>';
+							tag +=' 	<button class="btn_toggle_bnr"><span>열기</span></button>';
+							tag +='</div>';
+							if(item.strVar8=='Y'){
+								tag+='<div class="close_bnr_area">';
+								tag+=' 	<form class="form_wrap">';
+								tag+=' 		<div class="form_field">';
+								tag+=' 			<input id="chk-cookie" type="checkbox"><label for="chk-cookie"><span>오늘 하루 보지 않기</span></label>';
+								tag+=' 		</div>';
+								tag+=' 	</form>';
+								tag+=' 	<button id="btn_close_bnr" class="btn_close"><span>닫기</span></button>';
+								tag+='</div>';
+							}
+						}else if(item.contentsType == 'IMG'){
+							tag+='<div class="bnrtype_img" style="background-color:'+item.strVar5+';">';
+							tag+=' 	<a href="'+item.strVar1+'" target="">';
+							tag+=' 		<img src="'+bannerImgUrl+''+item.imgPath1+'" alt=""/>';
+							tag+=' 	</a>';
+							tag+='</div>';
+						}else{
+							tag+='<div class="bnrtype_text" style="background-color:'+item.strVar5+';">';
+							tag+=' 	<a href="'+item.strVar1+'" target="">';
+							tag+=' 		<div style="color:'+item.strVar6+'; font-size:20px; font-weight:300;">';
+							tag+=' 			<span style="font-weight:500">'+item.strTitle1+'</span>';
+							tag+=' 		</div>';
+							tag+=' 	</a>';
+							tag+='</div>';
+						}
+
+						$('#divTopbanner').html(tag);
+					});
+				}
+			}
+		});
+	}
 	
 	$(document).ready(function() {
 		//TOP BANNER close
@@ -810,6 +863,9 @@
 		
 		// GNB탭 > 브랜드 생성
 		fnCreateGnbBrandGroup();
+
+		// 띠배너 조회
+		fnCreateTopBanner();
 	});
 /*]]>*/
 </script>