PageSourceSearch

https://www.kt.com/js/v2/main/draw_new.js?ver=4.2

js kt.com collected 2026-09-24 08:26:38 UTC 49,977 bytes, 1,055 lines download raw bytes

1/* 
2   KT.com version 1.0
3  
4   Copyright ⓒ 2017 kt corp. All rights reserved.
5   
6   This is a proprietary software of kt corp, and you may not use this file except in 
7   compliance with license agreement with kt corp. Any redistribution or use of this 
8   software, with or without modification shall be strictly prohibited without prior written 
9   approval of kt corp, and the copyright notice above does not evidence any actual or 
10   intended publication of such software. 
11*/
12
13// DATA - 배포파일(cashing)
14var mainNow = new Date();
15var mainVersion = '?' + mainNow.getFullYear() +''+ (mainNow.getMonth()+1) +''+ mainNow.getDate() +''+ mainNow.getHours();
16document.write('<script src="/js/json/cl_main_area.js' + mainVersion + '"></script>');
17
18var mainNowDate;
19var mainTarget = '#cfm'+ ktChannel +'Contents ';
20var mainAreaHtml = {
21
22    //초기화 & 세팅
23	init: function(){
24        try {
25            mainAreaHtml.areaInfo();
26        } catch (e){
27            common_log.log('draw.js init() [' + e.message + ']');
28        }       
29    },
30
31    //타이틀영역
32    titleArea: function(type, target, areaData){
33        //배경이미지
34        if(kt_common.isNull(areaData.saveImgPath) != ''){
35            target.addClass('cfmbgsection');
36            target.attr('style', 'background-image:url('+ areaData.saveImgPath +');');
37        }
38
39        target.find('.section-area-tit').attr('data-nosnippet', '');
40
41        if(type == 'cs'){ //고객지원
42            target.find('.section-area-tit>h2').html(areaData.title);
43
44            //탭링크
45            /*
46            target.find('.item a').on('click', function(){  
47                var data = $j(this).data(); 
48                var index = target.find('.item a').index(this);            
49                var statInfo = areaData.statInfo + 'TAB'+ (index + 1) +'_'+ data.title;
50                kt_common.linkInfo('main', 'click', '', {statInfo:statInfo});
51            });*/
52        } else if (type == 'shophot'){ //핸드폰TOP3
53            if(kt_common.isNull(areaData.urlInfo) != ''){
54                target.find('.section-area-tit>h2').html('<a href="#">'+ areaData.title +'</a>');
55    
56                //링크
57                areaData.statInfo = areaData.statInfo + '타이틀';
58                kt_common.linkInfo2('main', type, target.find('.section-area-tit>h2>a'), areaData, areaData.trgtType);
59            }else{
60                target.find('.section-area-tit>h2').html(areaData.title);
61            }
62            
63            //서브타이틀 (핸드폰 Top 3 하단 안내 메시지)
64            if(kt_common.isNull(areaData.moreText) != ''){
65                target.find('.section-hot-product-div>p').html(areaData.moreText);
66            } else {
67                target.find('.section-hot-product-div>p').hide();
68            }
69        }else{
70            if(kt_common.isNull(areaData.urlInfo) != ''){
71                target.find('.section-area-tit>h2').html('<a href="#">'+ areaData.title +'</a>');
72    
73                //링크
74                areaData.statInfo = areaData.statInfo + '타이틀';
75                kt_common.linkInfo2('main', type, target.find('.section-area-tit>h2>a'), areaData, areaData.trgtType);
76            }else{
77                target.find('.section-area-tit>h2').html(areaData.title);
78            }
79            
80            //서브타이틀
81            target.find('.section-area-tit>p').html(areaData.moreText);
82        }        
83    },
84
85    //메인영역관리
86    areaInfo: function(){
87        var html;
88
89        $j.each(mainAreaInfoJson, function(i, data){
90            if(data.showYn == 'Y'){ //노출인 경우만
91                if(data.areaNm == '브랜드메시지'){
92                    html = $j('<div class="section brandmsg" data-nosnippet>'+
93                            '   <div class="column"></div>'+
94                            '</div>');
95        
96                    $j(mainTarget).append(html);            
97                    mainAreaHtml.brandmsgArea(html, data);
98                }else if(data.areaNm == '빅배너'){
99                    html = $j('<div class="section key-visual" data-nosnippet>'+
100                            '    <ul class="bxslider top-swiper"></ul>'+
101                            '</section>');
102                    
103                    $j(mainTarget).append(html);            
104                    mainAreaHtml.bigBannerArea(html, data);
105                }else if(data.areaNm == '인기급상승'){
106                    html = $j('<div class="section hot-visual-list">'+
107                            '   <div class="column" data-nosnippet>'+
108                            '       <div class="section-area-tit">'+
109                            '           <h2></h2>'+
110                            '           <p class="section4-title-subtit"></p>'+
111                            '       </div>'+
112                            '       <ul class="bxslider hit-swiper"></ul>'+
113                            '    </div>'+
114                            '</section>');
115        
116                    $j(mainTarget).append(html);            
117                    mainAreaHtml.hitArea(html, data);
118                }else if(data.areaNm == '핸드폰 Top 3'){
119                    html = $j(`
120                    <div class="section hot-product-list cfmbgsection" id="ktMainShopItem" data-nosnippet>
121                        <div class="column">
122                            <div class="section-area-tit">
123                                <h2></h2>
124                                <div class="section-hot-product-btn"></div>
125                            </div>
126                            <div class="section-hot-product-div" data-nosnippet>
127                                <ul class="section-hot-product-list"></ul>
128                                <p class="section4-title-subtit"></p>
129                            </div>
130                        </div>
131                    </div>`);
132                    
133                    $j(mainTarget).append(html);            
134                    mainAreaHtml.shophotArea(html, data);
135                }else if(data.areaNm == 'Shop 유선 기획전'){
136                    html = $j(`
137                    <div class="section hot-product-list cfmbgsection" id="ktMainShopBannerItem" data-nosnippet>
138                        <div class="column">
139                            <div class="shop-area" data-rolling="Y">
140                                <ul class="shop-slider"></ul>
141                            </div>
142                        </div>
143                    </div>`);
144                    $j(mainTarget).append(html);
145                    mainAreaHtml.shopwiredBannerArea(html, data);
146                }else if(data.areaNm == '혜택'){
147                    html = $j('<div class="section benefit-frame" id="ktMainBenefitIframe" data-nosnippet>'+
148                            '</div>');
149                    
150                    $j(mainTarget).append(html);            
151                    mainAreaHtml.benefitArea(html, data);
152                }else if(data.areaNm == '핫딜'){
153                    html = $j('<div class="section hotdeal-visual">'+
154                            '   <div class="column">'+
155                            '       <ul class="bxslider hotdeal-swiper"></ul>'+
156                            '       <div class="swiper-wrapper hotdeal-swiper-pager">'+
157                            '           <div class="swiper-slide" data-nosnippet></div>'+
158                            '       </div>'+
159                            '    </div>'+
160                            '</div>');
161                    
162                    $j(mainTarget).append(html);            
163                    mainAreaHtml.hotDealArea(html, data);
164                }else if(data.areaNm == 'Shop'){
165                    html = $j('<div class="section shop-area">'+
166                            '   <div class="column" data-nosnippet>'+
167                            '       <div class="section-area-tit">'+
168                            '           <h2></h2>'+
169                            '           <p class="section5-title-subtit"></p>'+
170                            '       </div>'+
171                            '       <ul class="bxslider shop-slider"></ul>'+
172                            '    </div>'+
173                            '</div>');
174        
175                    $j(mainTarget).append(html);            
176                    mainAreaHtml.ktShopArea(html, data);
177                }else if(data.areaNm == '이벤트'){
178                    html = $j(`
179                    <div class="section event-area">
180                        <div class="column" data-nosnippet>
181                            <div class="section-area-tit" data-nosnippet>
182                                <h2></h2>
183                                <p class="section6-title-subtit"></p>
184                            </div>
185                            <ul class="event-list"></ul>
186                        </div>
187                    </div>`);
188        
189                    $j(mainTarget).append(html);            
190                    mainAreaHtml.eventArea(html, data);
191                }else if(data.areaNm == '고객지원'){
192                    html = $j(`
193                    <div class="section cs-area cfmbgsection">
194                        <div class="column">
195                            <div class="section-area-tit" data-nosnippet>
196                                <h2></h2>
197                            </div>
198                            <div class="cs-faq-area" data-nosnippet></div>
199                            <div class="one-notice"></div>
200                        </div>
201                    </div>`);
202        
203                    $j(mainTarget).append(html);            
204                    mainAreaHtml.csArea(html, data);
205                }else{ //기본영역
206                    html = $j('<div class="section basesection" id="'+ data.areaId +'">'+
207                            '   <div class="column">'+
208                            '       <div class="section-area-tit">'+
209                            '           <h2></h2>'+
210                            '           <p class="section4-title-subtit"></p>'+
211                            '       </div>'+
212                            '       <div class="basesection-content" data-nosnippet>'+
213                            '           <ul class="basesection-sli
213der"></ul>'+
214                            '       </div>'+
215                            '    </div>'+
216                            '</div>');
217        
218                    $j(mainTarget).append(html);  
219                    html.data(data);          
220                    mainAreaHtml.baseArea(html, data);
221                }
222            }
223        });
224    },
225
226    //브랜드메세지(html,이미지,이미지맵)
227    brandmsgArea: function(html, data){
228        var isView = false;
229        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
230            try {
231                var areaData = data[0];
232                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부                
233                    //컨텐츠-CMS
234                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){
235                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
236                            var conts = $j('<p class="banner-img"></p>');
237                            kt_common.contsViewType('main', conts, areaData, item);
238                            html.find('.column').append(conts);
239                            
240                            isView = true;
241                            return false; //하나만노출
242                        }
243                    });      
244                }
245            } catch(e) {
246                common_log.log('draw.js brandmsgArea() [' + e.message + ']');
247            }            
248
249            //노출
250            if(!isView) html.hide();
251        }).fail(function(e){
252            html.hide();
253            common_log.log('draw.js brandmsgArea() [' + e.message + ']');
254        });
255    },
256
257    //빅배너 PSM 사용자 매칭
258    bigCombineData: function(contentData, sUserNm) {
259        var usrName = (sUserNm) ? sUserNm : '**';
260        return contentData.map(function(item) {
261            var updataHtml = '';
262            if (item.html) {
263                updataHtml = item.html.replace(/\{이름\}/g, usrName);
264            }
265            return $.extend({}, item, {html:updataHtml});
266        });
267    },
268
269    //빅배너(html,이미지맵)
270    bigBannerArea: function(html, data){
271        var isView = false;
272        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
273            try {
274                var areaData = data[0];
275                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부                
276                    //자동롤링(autoRollYn:Y/N) 설정, 랜덤(rndCicYn:Y)/지정(rndCicYn:N) 설정
277                    html.find('.top-swiper').data('rolling', areaData.autoRollYn); 
278                    html.find('.top-swiper').data('ranyn', areaData.rndCicYn);
279                    
280                    //컨텐츠-CMS
281                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){
282                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
283                            var conts = $j('<li><div class="banner-img"></div></li>');
284
285                            item.omsBannerType = 'omsbann';
286                            kt_common.contsViewType('main', conts.find('.banner-img'), areaData, item);
287                            html.find('.top-swiper').append(conts);
288
289                            //지정(Y)배너
290                            if(areaData.rndCicYn == 'N' && item.rndCicYn == 'Y' && html.find('.rndCicYn').length == 0) {
291                                conts.addClass('rndCicYn');
292                            }
293
294                            isView = true;
295                        }
296                    });       
297
298                    //컨텐츠-오마시(노출순서지정) 
299                    if(areaData.omsShowYn == 'Y'){
300                        if (areaData.omsBannerSortOrdg) {
301                            //온마시 A,B 영역코드로 치환
302                            var omsOfferList = areaData.omsBannerSortOrdg
303                                                .replace(/\//g, ',')
304                                                .replace(/A/gi, 'OFFERAREA036')
305                                                .replace(/B/gi, 'OFFERAREA090');
306                            if (kt.isLogin() !== 'Y') { //로그인 전
307                                campaignMultiBanner(html, 'win', (areaData.omsSortOrdg - 1), omsOfferList);
308                            } else { //로그인 후
309                               var userInfoBasicBigBanner = kt_api.mainBicBannerBasic();                               
310                               var psmContentList = campaignLoginBigBanner('win', omsOfferList);
311                                
312                                $j.when(psmContentList, userInfoBasicBigBanner)
313                                .done(function(contentResponse, userResponse) {
314                                    var userData = userResponse[0] || userResponse;
315                                    var contentData = contentResponse[0] || contentResponse;
316                                    var usrName = '**';
317
318                                    //사용자 정보
319                                    if(userData.returnCode !== undefined){
320                                        if(userData.returnCode.toLowerCase() === 'ok'){
321                                            usrName = userData.data.info.name || '**';
322                                        }
323                                    }
324
325                                    //온마시 정보
326                                    if(contentData.returnCode !== undefined){
327                                        if(contentData.returnCode.toLowerCase() === 'ok'){
328                                            var psmCombineData = mainAreaHtml.bigCombineData(contentData.data, usrName);
329                                            mainAreaHtml.callbackCampaignBigBanner('success', html, psmCombineData,  (areaData.omsSortOrdg - 1));
330                                        }
331                                    }
332
333                                })
334                                .fail(function(e) {
335                                    common_log.log('draw.js bigBannerArea() [' + e.message + ']');
336                                });
337                            }
338                        }
339                    }
340                }
341            } catch(e) {
342                common_log.log('draw.js bigBannerArea() [' + e.message + ']');
343            }
344
345            //노출
346            if(!isView) {
347                html.hide();
348            } else {
349                ui.MAIN.top();
350            }
351        }).fail(function(e){
352            html.hide();
353            common_log.log('draw.js bigBannerArea() [' + e.message + ']');
354        });
355    },
356
357    //빅배너-온마시 callback
358    callbackCampaignBigBanner: function(type, target, resultData, order){
359        var isView = false;
360        try {
361            if(type == 'success'){
362                var nTime = kt_common.dateFormat('YYYYMMDDHHmm');
363                var style = target.find('.top-swiper li').not('.bx-clone').last().attr('style');
364                var contsCnt = $j(".top-swiper > li").not('.bx-clone').length;
365                $j.each(resultData, function(idx, data) {
366                    if (data.bnStDt <= nTime && nTime <= data.bnFnsDt && data.html !== ''){
367                        var omsCnts = data.html;
368                        var conts = $j('<li style="'+ style +'"><div class="banner-img"></div></li>');
369                        conts.find('.banner-img').append(omsCnts);
370                        conts.find('a').on('click', function(){
371                            kt_psmStat.campaignStatClick(data.caVal1, data.caVal2, data.caVal3, data.caVal4, 'CL', '클릭', '빅배너', data.statCd);
372                        }); //GA 통계
373    
374                        if (kt_common.isNull(omsCnts) != '') {
375                            if(contsCnt <= order){ //해당 위치가 없을시
376                                target.find('.top-swiper li:last').after(conts);
377                            }else{
378                                target.find('.top-swiper > li').not('.bx-clone').eq(order).before(conts);
379                            }
380                            order++;
381                            contsCnt++;
382    
383                            isView = true;
384                        }
385                    }
386                });
387    
388                if (isView) {
389                    //ui.js 호출
390                    ui.MAIN.top('reload');
391                }
392            }
393        } catch (e) {
394            common_log.log('draw.js callbackCampaignBigBanner() [' + e.message + ']');
395        }
396    },
397
398    //인기급상승(html,이미지)
399    hitArea: function(html, data){
400        var isView = false;
401        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
402            try {
403                var areaData = data[0]; 
404                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
405                    //자동롤링(autoRollYn:Y/N) 설정
406                    html.find('.hit-swiper').data('rolling', areaData.autoRollYn);
407
408                    //순서영역
409                    $j.each(areaData.ppbAreaGroupList, function(k, numData){
410                        var numCount = 0;
411                        $j.each(numData.ppbAreaList, function(i, item){ 
412                            if (numCount == 0 && ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate)))){                       
413                                var area = $j('<li></li>');
414    
415                                //컨텐츠-CMS
416                                $j.each(item.ppbContList, function(j, conts){                      
417                                    if(conts.contsDivType == '05'){
418                                        area.append('<a href="#"><img src="#"/></a>');                         
419                                        area.find('img:eq('+ j +')').attr('src', conts.saveImgPath + conts.saveImgNm);
420                                        area.find('img:eq('+ j +')').attr('alt', kt_common.removeTag(conts.altText));
421                                        kt_common.linkInfo2('main', 'hitImg', area.find('a:eq('+ j +')'), conts, conts.floatTrgtType);
422                                    }else{
423                                        area.append(conts.htmlInfo);
424                                    }
425    
426                                    isView = true;
427                                });
428    
429                                html.find('.hit-swiper').append(area);
430
431                                numCount += 1;
432                            }
433                        });
434                    });
435
436                    //제목&링크
437                    mainAreaHtml.titleArea('hit', html, areaData);
438                }
439            } catch (e) {
440                common_log.log('draw.js hitArea() [' + e.message + ']');
441            }             
442
443            //노출 및 ui 적용
444            if(!isView){
445                html.hide();
446            }else{
447                ui.MAIN.hit();
448            }         
449        }).fail(function(e){
450            html.hide();
451            common_log.log('draw.js hitArea() [' + e.message + ']');
452        });
453    },
454
455    //혜택(html,iframe)
456    benefitArea: function(html, data){
457        var isView = false;
458        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
459            try {
460                var areaData = data[0];
461                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
462                    if(areaData.urlInfo.indexOf('#benefits') > -1){ //컨텐츠-CMS
463                        $j.each(areaData.areaSetList[0].areaContsList, function(i, item){                 
464                            if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
465                                html.append(item.htmlInfo);
466                            }
467                        });
468                    }else{ //컨텐츠-iframe
469                        html.append('<iframe allowtransparency="true" frameborder="0" height="1080px" title="혜택 페이지" id="ktMainBeLayer" src="'+ areaData.urlInfo +'" tabindex="0"></iframe>');
470                    } 
471                    
472                    isView = true;
473                }
474            } catch(e) {
475                common_log.log('draw.js benefitArea() [' + e.message + ']');
476            }
477            
478            //노출
479            if(!isView) html.hide();
480        }).fail(function(e){
481            html.hide();
482            common_log.log('draw.js benefitArea() [' + e.message + ']');
483        });
484    },
485
486    //핸드폰 Top 3(html,iframe)
487    shophotArea: function(html, data){
488        var isView = false;
489        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
490            try {
491                var areaData = data[0];
492                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
493                    
494                    //더보기 버튼
495                    var shopAllbtnYn = false;
496                    var shopMaxCnt = "4"; //콘텐츠 노출 갯수
497                    if (cfmGnbEtc_codeList.length) {
498                        var cfmMainShopHotArea = $j.grep(cfmGnbEtc_codeList, function(element, index) {return element.dtlCd =='mainPhoneTop'});
499                        if (cfmMainShopHotArea.length > 0) {
500                            //콘텐츠 노출갯수
501                            if (cfmMainShopHotArea[0].dtlCdOpt2 !== "") shopMaxCnt = cfmMainShopHotArea[0].dtlCdOpt2;
502                            //더보기 버튼
503                            if (cfmMainShopHotArea[0].dtlCdOpt3 !=='N' && cfmMainShopHotArea[0].dtlCdDesc !== '') {
504                                var targetType = cfmMainShopHotArea[0].dtlCdOpt1.split('|') || '_self';
505                                var linkTargetMsg = '';
506                                var linkStateNm = cfmMainShopHotArea[0].dtlCdNm.replaceAll(' ', '');
507                                if (targetType.length > 1) {
508                                    linkTargetMsg = ` title='${targetType[1]}'`;
509                                }
510                                var btntxt = `
511                                <a href="${cfmMainShopHotArea[0].dtlCdDesc}" target="${targetType[0]}" ${linkTargetMsg} class="section-hot-product-btn-moreview" 
512                                onclick="KT_trackClicks('KT-개인_메인', '${areaData.statInfo}${linkStateNm}');"><span>${cfmMainShopHotArea[0].dtlCdNm}</span></a>`;
513                                html.find(".section-hot-product-btn").append(btntxt);
514                                shopAllbtnYn = true;
515                            }
516                        }
517                    }
518
519                    //핸드폰 Top 3 api
520                    kt_api.mainShopHot(html, {statInfo:areaData.statInfo, areaId:areaData.areaId, menuCd:areaData.menuCd, datalimit:shopMaxCnt});
521
522                    //제목&링크
523                    mainAreaHtml.titleArea('shophot', html, areaData);
524
525                    isView = true;
526                }
527            } catch(e) {
528                common_log.log('draw.js shophotArea() [' + e.message + ']');
529            }
530            
531            //노출
532            if(!shopAllbtnYn) html.find(".section-hot-product-btn").hide();
533            if(!isView) html.hide();
534        }).fail(function(e){
535            html.hide();
536            common_log.log('draw.js shophotArea() [' + e.message + ']');
537        });
538    },
539
540    //핸드폰 Top 3 callback
541    callbackShopHot: function(type, result, target, areaData){
542        let isView = false;
543        try {
544            if(type == 'success'){
545                var maxCnt = 1;
546                $j.each(result.data.shopMainList, function(i, item){
547                    //이미지
548                    var shopSumImage = '';
549                    if(kt_common.isNull(item.prodImgFilePathNm) !== ''){
550                        shopSumImage = `<img src="${item.prodImgFilePathNm}" alt="${kt_common.removeTag(item.prodNm)}" width="100%">`;
551                    }
552
553                    //월 납부금액
554                    var dcmonthPrice = "-"
555                    if(kt_common.isNull(item.dcMonthCharge) !== ''){
556                        dcmonthPrice = `${kt_common.setComma(item.dcMonthCharge)}<span class="txt">원</span>`;
557                    }
558
559                    //요금제 명
560                    var proSubTitle = (kt_common.isNull(item.pplNm) !=='') ? `${item.pplNm} 기준` : '';
561
562                    var shophotHtml = $j(`
563                        <li class="prod-list">
564                            <div class="hot-product-btnbox"><button type="button" class="hot-product-btn"><span>단말정보 열기</span></button></div>
565                            <a href="">
566                                <div class="prod-img">${shopSumImage}</div>
567                                <div class="prod-tit">
568                                    <div class="prod-flag"></div>
569                                    <strong class="prod-name">${item.prodNm}</strong>
570                                </div>
571                                <ul class="box-txt type2">
572                                    <li><span class="txt">월 </span><span class="price">${dcmonthPrice}</span></li>
573                                </ul>
574                                <ul class="box-txt type1"></ul>
575                                <div class="prod-price-info"><strong class="prod-price-cond">${proSubTitle}</strong></div>
576                            </a>
577                        </li>`);
578
579                    //월할부금
580                    if(kt_common.isNull(item.dcMonthPaymentCharge) !== ''){
581                        shophotHtml.find('.box-txt.type1').append(`<li><span class="txt">월 할부금</span><span class="price">${kt_common.setComma(item.dcMonthPaymentCharge)}원</span></li>`);
582                    }
583
584                    //월통신요금
585                    if(kt_common.isNull(item.dcMonthUseCharge) !== ''){
586                        shophotHtml.find('.box-txt.type1').append(`<li><span class="txt">월 통신요금</span><span class="price">${kt_common.setComma(item.dcMonthUseCharge)}원</span></li>`);
587                    }
588
589                    //할인
590                    var disCountName = '&nbsp;';
591                    var disCountMoney = '';
592                    if(kt_common.isNull(item.etcDiscountCharge) !== 0){
593                        disCountName = item.etcDiscountName;
594                        disCountMoney = `- ${kt_common.setComma(item.etcDiscountCharge)}원`;
595                    }
596                    shophotHtml.find('.box-txt.type1').append(`<li><span class="txt">${disCountName}</span><span class="price">${disCountMoney}</span></li>`);
597
598                    //링크
599                    item.urlInfo = item.goProductViewUrl;
600                    // 통계코드
601                    item.statInfo = areaData.statInfo + item.prodNm; 
602                    item.areaId = areaData.areaId;
603                    kt_common.linkInfo2('main', 'shophot', shophotHtml.find('a'), item, '01');
604
605                    target.find('.section-hot-product-list').append(shophotHtml);
606
607                    isView = true;
608
609                    //인기휴대폰 최대 허용갯수
610                    maxCnt++;
611                    if (maxCnt > parseInt(areaData.datalimit)) {return false;}
612                    
613                });
614            }            
615        } catch (e) {
616            $j('#ktMainShopItem').hide();
617            common_log.log('draw.js callbackShopHot() [' + e.message + ']');
618        } finally {
619            if (!isView) {
620                $j('#ktMainShopItem').hide();
621            } else {
622                $j('#ktMainShopItem').show();
623                ui.MAIN.hotprod();
624            }                
625        }
626    },
627
628    //유선기획전
629    shopwiredBannerArea: function(html, data){
630        var isView = false;
631        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
632            try {
633                var areaData = data[0];
634                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
635                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){                 
636                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){ //컨텐츠-CMS
637                            var conts = $j('<li class="section-hot-product-ban"></li>');
638                            kt_common.contsViewType('main', conts, areaData, item);
639                            html.find('ul').append(conts);
640                            isView = true;
641                        }
642                    });
643                }
644            } catch(e) {
645                common_log.log('draw.js shopwiredBannerArea() [' + e.message + ']');
646            } finally {
647                //노출 및 ui 적용
648                if(!isView){
649                    html.hide();
650                }else{
651                    ui.MAIN.shop();
652                }
653            }
654            
655        }).fail(function(e){
656            html.hide();
657            common_log.log('draw.js shopwiredBannerArea() [' + e.message + ']');
658        });
659    },
660
661    //혜택 대체 콘텐츠(html)
662    benefitReplace: function(){
663        var areaData = mainBenefitJson[0];
664        if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부                
665            //컨텐츠-CMS
666            $j.each(areaData.areaSetList[0].areaContsList, function(i, item){
667                if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
668                    $j('#benefitContainer').html(item.htmlInfo);                    
669                }
670            });
671        }
672    },
673
674    //핫딜(html)
675    hotDealArea: function(html, data){
676        var isView = false;
677        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
678            try {
679                var areaData = data[0];
680                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부                                  
681                    //컨텐츠-CMS
682                    var cnt = 0;     
683                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){
684                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){                        
685                            var conts = $j('<li>'+ item.htmlInfo +'</li>');
686                            var pager = $j(item.htmlInfo2);
687                            pager.attr('data-slide-index', cnt);
688    
689                            html.find('.hotdeal-swiper').append(conts);
690                            html.find('.hotdeal-swiper-pager .swiper-slide').append(pager);
691
692                            cnt += 1;
693
694                            isView = true;
695                        }
696                    });                            
697                } 
698            } catch(e) {
699                common_log.log('draw.js hotDealArea() [' + e.message + ']');
700            }            
701
702            //노출 및 ui 적용
703            if(!isView){
704                html.hide();
705            }else{
706                ui.MAIN.hotdeal();
707            }
708        }).fail(function(e){
709            html.hide();
710            common_log.log('draw.js hotDealArea() [' + e.message + ']');
711        });
712    },
713
714    //KT Shop(html,이미지,이미지맵)
715    ktShopArea: function(html, data){
716        var isView = false;
717        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
718            try {
719                var areaData = data[0];
720                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
721                    //자동롤링(autoRollYn:Y/N) 설정
722                    html.find('.shop-slider').data('rolling', areaData.autoRollYn);
723
724                    //컨텐츠-CMS
725                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){                 
726                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
727                            var conts = $j('<li><div class="banner-img"></div></li>');
728                            kt_common.contsViewType('main', conts.find('.banner-img'), areaData, item);
729                            html.find('.shop-slider').append(conts);
730
731                            isView = true;
732                        }
733                    });
734
735                    //제목&링크
736                    mainAreaHtml.titleArea('shop', html, areaData);
737                }
738            } catch(e) {
739                common_log.log('draw.js ktShopArea() [' + e.message + ']');
740            }
741            
742            //노출 및 ui 적용
743            if(!isView){
744                html.hide();
745            }else{
746                ui.MAIN.shop();
747            }
748        }).fail(function(e){
749            html.hide();
750            common_log.log('draw.js ktShopArea() [' + e.message + ']');
751        });
752    },
753
754    //이벤트(api)
755    eventArea: function(html, data){
756        var isView = false;
757        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
758            try {
759                var areaData = data[0];
760                var evtMaxCnt = 6; //콘텐츠 노출 갯수
761                var evtSeqList = '';
762                if((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){
763                    //콘텐츠 노출 갯수
764                    if (cfmGnbEtc_codeList.length) {
765                        var cfmMainEventArea = $j.grep(cfmGnbEtc_codeList, function(element, index) {return element.dtlCd == 'mainEvtMaxcnt'});
766                        if (cfmMainEventArea.length > 0) {
767                            if (cfmMainEventArea[0].dtlCdOpt3 !== 'N') {
768                                evtMaxCnt = parseInt(cfmMainEventArea[0].dtlCdOpt1) || evtMaxCnt;
769                                evtSeqList = cfmMainEventArea[0].dtlCdDesc || '';
770                            }
771                        }
772                    }
773
774                    //이벤트 카테고리 및 콘텐츠-api
775                    kt_api.mainEventCate(html, {statInfo:areaData.statInfo, areaId:areaData.areaId, menuCd:areaData.menuCd, datalimit:evtMaxCnt, exInputSeq:evtSeqList});
776
777
778                    //제목&링크
779                    mainAreaHtml.titleArea('event', html, areaData);
780                    
781                    isView = true;
782                }
783            } catch(e) {
784                common_log.log('draw.js eventArea() [' + e.message + ']');
785            }          
786
787            //노출
788            if(!isView) html.hide();
789        }).fail(function(e){
790            html.hide();
791            common_log.log('draw.js eventArea() [' + e.message + ']');
792        });
793    },
794
795    //이벤트 callback
796    callbackMainEvent: function(type, result, arrEvtCate, target, areaData){
797        try {
798            if(type == 'success'){
799                var exInputSeq = areaData.exInputSeq;
800                var filterevtList = result.data.evenCateList;
801                if (exInputSeq !== "") {
802                    var exceptionSeq = exInputSeq.split(',').map(function(item){ return item.trim()});
803                    filterevtList = result.data.evenCateList.filter(function(item) { return !exceptionSeq.includes(item.pcEvtNo);});
804                }
805                $j.each(filterevtList, function(i, item){
806                    var event = $j(`
807                        <li>
808                            <a href="">
809                                <div class="thumb"><img src=""></div>
810                                <div class="summary">
811                                    <div class="type"></div>
812                                    <div class="title"></div>
813                                    <div class="date"></div>
814                                </div>
815                            </a>
816                        </li>`);
817                    
818                    //이미지
819                    var evBanrList = $j.grep(item.eventBanrList, function(element, index) {return element.pcEvtBanrType === '07' && element.saveImgNm !== ''});
820                    if (evBanrList.length > 0) {
821                        event.find('img').attr('src', event_domain + evBanrList[0].saveImgPath + evBanrList[0].saveImgNm);
822                        event.find('img').attr('alt', kt_common.removeTag(evBanrList[0].sbtText));
823                    }
824    
825                    //카테고리
826                    var type;
827                    if (kt_common.isNull(arrEvtCate[item.evtSvcChType]) !== '') {
828                        type = '<span>'+ arrEvtCate[item.evtSvcChType] +'</span>';
829                    } else {
830                        type = '<span>'+ arrEvtCate["00"] +'</span>';
831                    }
832                    
833                    event.find('.type').html(type);
834    
835                    //내용
836                    event.find('.title').html(item.evtNm);
837                    event.find('.date').html(item.evtApctSdate.substr(0, 10) +' ~ '+ item.evtApctEdate.substr(0, 10));
838    
839                    //링크
840                    if (item.apctLinkType == "02"){ //새창
841                        item.urlInfo = item.apctUrl;
842                    }else{
843                        item.urlInfo = 'https://event.kt.com/html/event/ongoing_event_view.html?pcEvtNo='+ item.pcEvtNo;
844                    }
845                    item.statInfo = areaData.statInfo + item.evtNm;
846                    item.areaId = areaData.areaId;
847                    kt_common.linkInfo2('main', 'event', event.find('a'), item, item.apctLinkType);
848    
849                    target.find('.event-list').append(event);
850                });
851            }            
852        } catch (e) {
853            common_log.log('draw.js callbackMainEvent() [' + e.message + ']');
854        }
855
856        //노출 및 ui 적용
857        if(target.find('.event-list li').length > 0){
858            ui.MAIN.event();
859        }else{
860            target.hide();
861        }
862    },
863
864    //고객지원(html)
865    csArea: function(html, data){
866        var isView = false;
867        $j.getJSON('/js/json/area_'+ data.areaId +'.json'+ mainVersion, function(data){
868            try {
869                var areaData = data[0];            
870                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
871                    //컨텐츠-CMS(1개만 노출)
872                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){
873                        
874                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
875                            kt_common.contsViewType('main', html.find('.cs-faq-area'), areaData, item);
876                            isView = true;
877                            return false;
878                        }
879                    });
880
881                    //제목&링크
882                    mainAreaHtml.titleArea('cs', html, areaData);
883
884                    //한줄공지
885                    mainAreaHtml.oneNoticeArea(html.find('.one-notice'));
886                }
887            } catch(e) {
888            	html.hide();
889                common_log.log('draw.js csArea() [' + e.message + ']');
890            } finally {
891                //노출 및 ui 적용
892                if(!isView){
893                    html.hide();
894                }else{
895                    ui.MAIN.cs();
896                }
897            }
898
899        }).fail(function(e){
900            html.hide();
901            common_log.log('draw.js csArea() [' + e.message + ']');
902        });
903    },
904
905    //한줄공지
906    oneNoticeArea: function(html){
907        html.append('<div class="notice">'+
908                    '   <div class="column">'+
909                    '       <div class="inner" data-nosnippet>'+
910                    '           <h2>공지</h2>'+
911                    '           <p><a href="#"></a></p>'+
912                    '           <span class="btn-more-area">'+
913                    '               <span class="ottp-date"></span>'+
914                    '               <a href="#" class="btn-more reverse" title="공지사항 더보기">더보기</a>'+
915                    '           </span>'+
916                    '       </div>'+
917                    '   </div>'+
918                    '</div>');
919
920        var isView = false;
921        $j.getJSON('/js/json/linenotice.json'+ mainVersion, function(data){
922            try {
923                if (data.returnCode == "OK"){
924                    var areaData = data.data.filter(function(element){return element.lineNotiId == 'OL00000001';});
925                    if (areaData[0].lineNotiDtlList.length) {
926                        $j.each(areaData[0].lineNotiDtlList, function(i, item){
927                            if(item.showYn == "Y" && (mainNowDate >= item.showSDate && mainNowDate <= item.showEDate)){
928                                //제목                         
929                                html.find('a:eq(0)').html(item.title);
930                                kt_common.linkInfo2('main', 'notice', html.find('a:eq(0)'), item, item.trgtType);
931    
932                                //날짜
933                                html.find('span.ottp-date').html(item.ottpDate);
934                                
935                                //더보기
936                                item.urlInfo = inside_domain + '/html/notice/notice_list.html';
937                                item.statInfo = item.statInfo + '^더보기';
938                                kt_common.linkInfo2('main', 'notice', html.find('a:eq(1)'), item, '01');
939    
940                                isView = true;
941                                return false; //하나만노출
942                            }
943                        });
944                    }
945                }
946            } catch (e) {
947                common_log.log('draw_new.js oneNoticeArea() [' + e.message + ']');
948            } finally {
949                //노출 적용
950                if(!isView){
951                    html.hide();
952                }
953            }
954        }).fail(function(e){
955            html.hide();
956            common_log.log('draw.js oneNoticeArea\n[' + e.message + ']');
957        });        
958    },
959
960    //기본영역(html,이미지,이미지맵)
961    baseArea: function(html, area){
962        var isView = false;
963        $j.getJSON('/js/json/area_'+ area.areaId +'.json'+ mainVersion, function(data){
964            try {
965                var areaData = data[0];
966                if ((areaData.showYn == 'Y' && areaData.showPerdType == '01') || (areaData.showYn == 'Y' && (mainNowDate >= areaData.showSdate && mainNowDate <= areaData.showEdate))){ //영역노출여부
967                    //컨텐츠-CMS
968                    $j.each(areaData.areaSetList[0].areaContsList, function(i, item){                 
969                        if ((item.showYn == "Y" && item.showPerdType=="01") || (item.showYn == "Y" && ( mainNowDate >= item.showSdate && mainNowDate <= item.showEdate))){
970                            var conts = $j('<li><div></div></li>');
971                            kt_common.contsViewType('main', conts.find('div'), areaData, item);
972                            html.find('.basesection-slider').append(conts);
973
974                            isView = true;
975                        }
976                    });
977
978                    //제목&링크
979                    mainAreaHtml.titleArea('base', html, areaData);
980                }
981            } catch(e) {
982                common_log.log('draw.js baseArea() [' + e.message + ']');
983            }
984            
985            //노출
986            if(!isView) {
987                html.hide();
988            }else{
989                ui.MAIN.base($j('#'+ area.areaId));
990            }
991        }).fail(function(e){
992            html.hide();
993            common_log.log('draw.js baseArea() [' + e.message + ']');
994        });
995    }
996}
997
998//핫딜 타이머
999function setHotDealTimeCall(layID, oTime, tTime, s){
1000	var dtueday = new Date(oTime).getTime();
1001	var ctueday = new Date(tTime).getTime();//1차 종료 후 2차 마감시간
1002	var now = new Date();//지금 시간
1003
1004	var tuedistance = dtueday - now;
1005	var ctuedistance = ctueday - now;
1006
1007	$j(layID).find(".tp").hide();
1008	if (ctuedistance <= 0) {
1009		var t = $j(layID).find(".step3").text();
1010		$j(layID).html(t).addClass("hdendTime");
1011		return;
1012	}
1013
1014	setTimeout (function(){ 
1015		setHotDealTimeCall(layID, oTime, tTime, s)
1016	},s);
1017
1018	if (tuedistance > 0){
1019		$j(layID).find(".step1").css('display','block');
1020		$j(layID).find(".step2").css('display','none');
1021	} else	if (tuedistance <= 0){
1022		$j(layID).find(".step1").css('display','none');
1023		$j(layID).find(".step2").css('display','block');
1024
1025		tuedistance = ctueday - now;
1026	}
1027
1028	var tued = Math.floor(tuedistance / (1000 * 60 * 60 * 24));
1029	var tueh = Math.floor((tuedistance % (1000 * 60 * 60 * 24))/(1000 * 60 * 60));
1030	var tuem = Math.floor((tuedistance % (1000 * 60 * 60))/(1000 * 60));
1031	var tues = Math.floor((tuedistance % (1000 * 60))/1000);
1032	var tuess = Math.floor((tuedistance % (1000))/100);
1033	if (tueh < 10){tueh = '0'+tueh;}
1034	if (tuem < 10){tuem = '0'+tuem;}
1035	if (tues < 10){tues = '0'+tues;}
1036
1037	$j(layID).find(".gtday").html(tued);
1038	$j(layID).find(".gthur").html(tueh);
1039	$j(layID).find(".gtmin").html(tuem);
1040	$j(layID).find(".gtsnd").html(tues);
1041	$j(layID).find(".gtmsnd").html(tuess);
1042}
1043
1044$j(document).ready(function(){  
1045    function loadScreenChk(){
1046        if(cfmloadScreen){	//screen API 로드 true  
1047            mainNowDate = kt_common.dateFormat('YYYY.MM.DD HH:mm:ss');
1048            mainAreaHtml.init();
1049        }else{
1050            setTimeout(function(){ loadScreenChk(); }, 200);
1051        }
1052    }
1053
1054    loadScreenChk();
1055});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.