|
|
@@ -200,10 +200,149 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // 팝업
|
|
|
+ let fnGetPopup = function(){
|
|
|
+ let data = {viewPage : [[${viewPage}]]
|
|
|
+ ,cateNo : [[${popupCateNo}]]
|
|
|
+ ,brandCd : [[${popupBrandCd}]]
|
|
|
+ ,planSq : [[${popupPlanSq}]]
|
|
|
+ ,preview : [[${preview}]]
|
|
|
+ ,viewDt : [[${viewDt}]]
|
|
|
+ };
|
|
|
+ $.getJSON('/display/popup/list', data, function(result, status) {
|
|
|
+ if (status === 'success') {
|
|
|
+ if(result.dataList.length>0){
|
|
|
+ let pClass = "";
|
|
|
+ if ("H" == result.popupGb){
|
|
|
+ pClass = "half";
|
|
|
+ }
|
|
|
+ let popupYn = "N";
|
|
|
+ let popupSq = "";
|
|
|
+ let tag = '';
|
|
|
+ tag += '<div id="popupMainNotice" class="popup_main_notice half active">\n'; <!-- half 팝업일 경우 : half 클래스 포함 -->
|
|
|
+ tag += ' <div class="popup_content">\n';
|
|
|
+ if ("H" == result.popupGb){
|
|
|
+
|
|
|
+ $.each(result.dataList, function(idx, item) {
|
|
|
+ if(document.cookie.match('(^|;)?style_popup_'+item.popupSq+'=([^;]*)(;|$)')==null) {
|
|
|
+ popupSq += item.popupSq +"|";
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ tag += ' <div class="popup_header">\n';
|
|
|
+ tag += ' <a href="javascript:void(0);" onclick="fnLayerPopupUnexpDaysClose(\''+popupSq+'\',1);" class="btn_underline"> 하루 보지 않기</a>\n';
|
|
|
+ tag += ' <a href="javascript:void(0);" id="btnPopupClose" onclick="fnLayerPopupClose();" class="btn_popup_close">닫기</a>\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ }
|
|
|
+ tag += ' <div class="popup_body">\n';
|
|
|
+ tag += ' <div class="swiper-container">\n';
|
|
|
+ tag += ' <div class="swiper-wrapper">\n';
|
|
|
+ $.each(result.dataList, function(idx, item) {
|
|
|
+ if(document.cookie.match('(^|;)?style_popup_'+item.popupSq+'=([^;]*)(;|$)')==null) {
|
|
|
+ tag += ' <div class="swiper-slide">\n';
|
|
|
+ if(!gagajf.isNull(item.linkUrl1) && item.linkUrl1 !== "#"){
|
|
|
+ let linkTarget = "";
|
|
|
+ if ("N" == item.linkTarget){
|
|
|
+ linkTarget = "target=\"_blank\"";
|
|
|
+ }
|
|
|
+ tag += ' <a href="'+ item.linkUrl1 +'" '+linkTarget+' >\n';
|
|
|
+ }
|
|
|
+ tag += ' <img src="'+ _imgUrl+'/'+item.imgUrl1+'" alt="">\n';
|
|
|
+ if(!gagajf.isNull(item.linkUrl1) && item.linkUrl1 !== "#"){
|
|
|
+ tag += ' </a>\n';
|
|
|
+ }
|
|
|
+ tag += ' </div>\n';
|
|
|
+ popupYn = "Y";
|
|
|
+ popupSq += item.popupSq +"|";
|
|
|
+ }
|
|
|
+ });
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += ' <div class="swiper-pagination"></div>\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ if ("F" == result.popupGb){
|
|
|
+ tag += ' <div class="popup_footer">\n';
|
|
|
+ tag += ' <a href="javascript:void(0);" onclick="fnLayerPopupUnexpDaysClose(\''+popupSq+'\',1);" class="btn_underline"> 하루 보지 않기</a>\n';
|
|
|
+ tag += ' <a href="javascript:void(0);" id="btnPopupClose" onclick="fnLayerPopupClose();" class="btn_popup_close">닫기</a>\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ }
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += '</div>\n';
|
|
|
+
|
|
|
+ if (popupYn == "Y"){
|
|
|
+ if ($('#popupMainNotice').length === 0) {
|
|
|
+ $('body').append(tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* SLIDE - 메인 공지 팝업 */
|
|
|
+ var popup_main_notice_slide = new Swiper ('.popup_main_notice .swiper-container', {
|
|
|
+ loop: true,
|
|
|
+ spaceBetween: 0,
|
|
|
+ speed:200,
|
|
|
+ autoplay: {
|
|
|
+ delay: 4000,
|
|
|
+ disableOnInteraction: false,
|
|
|
+ },
|
|
|
+ pagination: {
|
|
|
+ el: '.popup_main_notice .swiper-pagination',
|
|
|
+ type: 'fraction',
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ if($(".popup_main_notice").hasClass("active")){
|
|
|
+ $("body").css({"overflow":"hidden"});
|
|
|
+ }else{
|
|
|
+ $("body").css({"overflow":"visible"});
|
|
|
+ };
|
|
|
+
|
|
|
+ /* 메인 공지 팝업 닫기 */
|
|
|
+ $(document).on('click','#btnPopupClose',function(e){
|
|
|
+ $('#popupMainNotice').hide();
|
|
|
+ $(".popup_main_notice").removeClass("active");
|
|
|
+
|
|
|
+ if(!$(".popup_main_notice").hasClass("active")){
|
|
|
+ $("body").css({"overflow":"visible"});
|
|
|
+ }else{
|
|
|
+ $("body").css({"overflow":"hidden"});
|
|
|
+ };
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ let fnLayerPopupUnexpDaysClose = function(seq, unexpDays){
|
|
|
+ let arrSeq = seq.split("|");
|
|
|
+ if (arrSeq.length > 0){
|
|
|
+ let todayDate = new Date();
|
|
|
+ //todayDate = new Date(parseInt(todayDate.getTime() / 86400000) * 86400000 + 54000000);
|
|
|
+ todayDate = new Date(parseInt(todayDate.getTime() / 86400000) * 86400000); // 당일 자정처리
|
|
|
+ todayDate.setDate(todayDate.getDate() + unexpDays);
|
|
|
+
|
|
|
+ $.each(arrSeq, function (idx, item) {
|
|
|
+ if (!gagajf.isNull(item)){
|
|
|
+ document.cookie = "style_popup_"+item+"=Y; path=/; expires=" + todayDate.toGMTString() + ";";
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ fnLayerPopupClose();
|
|
|
+ }
|
|
|
+ // 창 닫기
|
|
|
+ let fnLayerPopupClose = function(){
|
|
|
+ $('#popupMainNotice').remove();
|
|
|
+ }
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
|
// 퀵메뉴탭 조회
|
|
|
fnCreateQuickMenuTab();
|
|
|
|
|
|
+ // 팝업조회
|
|
|
+ fnGetPopup();
|
|
|
+
|
|
|
$.getJSON('/cart/goods/not/soldout/cnt', function (order, status) {
|
|
|
let cartCnt;
|
|
|
if (order.cartGoodsList.length > 99) {
|