`);$(printHtml).printThis({importCSS: true,importStyle: true, printDelay : 500});$(".modal").filter(function(idx,obj){return $(obj).attr("aria-hidden")=="false"}).modal("hide");}function fn_callMain(){location.href = window.location.origin;}function fn_eventMainParamCheck(){if(!$("#tourId").val() || !$("#tourCode").val() || !$("#masterId").val() || !$("#masterCode").val()){//_Popup.openPopupConfirm(errParam,fn_callMain)return false;}else{return true;}}function fn_setPringModal(){ let tabId = ['goodsEvtTab_1', 'goodsEvtTab_2', 'goodsEvtTab_5','goodsEvtTab_7']; if(fnCkeckTabSelectYN(tabId)) selectGoodsEvtTabData(tabId);$.each($(".tab-d-area>button").map(function(idx,obj){return obj.id}).get(),function(idx,obj){let printArea = $("#print_"+obj);let id = printArea.attr("id");if(printArea.length > 0){printArea.html("");printArea.append($(".cont-box."+obj).clone());//기존 상세 정보에서 hide 할 영역설정 및 추가if(id=="print_goodsEvtTab_1"){$("#print_goodsEvtTab_1 .tourBanner").hide();$("#print_goodsEvtTab_1 .tab1_point_9").addClass("show");$("#print_goodsEvtTab_1 .tab1_point_9").find().addClass("show");$("#print_goodsEvtTab_1").find("#tab1_evt_img_btn").hide(); $("#print_goodsEvtTab_1").find(".tourplan-intro-box").hide();}//선택관광 , 쇼핑정보$.each(printArea.find("input[type='checkbox']:checked"),function(idx,obj){$(obj).trigger("click");});//약관printArea.find(".insurance").hide();}});}function fnGoReserve() { //출발일체크 let departDateYmd = $("#departDateYmd").val(); let date = new Date(); let year = date.getFullYear().toString(); let month = new String(date.getMonth()+1)<10?"0"+(date.getMonth()+1):(date.getMonth()+1).toString(); let day = date.getDate()<10?"0"+date.getDate():date.getDate().toString(); let currDate = year+month+day; if(departDateYmd < currDate){ _Popup.openDefaultPopup(resDeptDatePassed); return; }//메뉴코드let menuCode = $("#menuCode").val()?$("#menuCode").val():"";//즉시결제여부let instantPaymentFlag = $("#immediatePaymentFlag").val();//행사코드let tourCode = $("#tourCode").val();if(!tourCode){_Popup.openDefaultPopup("행사코드가 없습니다. 문의 바랍니다.");return false;}//성인let adultCnt = $("#adultCnt").val()?$("#adultCnt").val():"0";//아동let childCnt = $("#childCnt").val()?$("#childCnt").val():"0";//유아let infantCnt = $("#infantCnt").val()?$("#infantCnt").val():"0";if(!adultCnt||adultCnt <= 0){_Popup.openDefaultPopup("예약은 성인이 필수로 들어가야합니다.");return false;}let param = {menuCode:menuCode,instantPaymentFlag:instantPaymentFlag,tourCode:tourCode,adultCnt:adultCnt,childCnt:childCnt,infantCnt:infantCnt};$.ajax({url: reservationProcURL,type: 'post',dataType: 'json',data: {data : reservationURL(param)},contentType: 'application/x-www-form-urlencoded; charset=UTF-8',async: true,success: function (result, textStatus, data) {let fn_proc;let login = function(){location.href = "/member/login"; return false;}let reservation = function(){location.href = reservationURL(param); return false;}if(result.data.session!="Y"){_Popup.openPopupConfirm(reservationProcMsg,login,reservation,"로그인","비회원예약");}else{reservation();}},error: function (xhr, errorName, error) {_Popup.openDefaultPopup('상품 비교함 조회 시 에러입니다.');}});}//예약하기function fn_reservation(){//상태코드let statusId = $("#statusId").val();let count = Number("10");if( !(statusId == "3" || statusId == "6") || count<=0){_Popup.openPopupConfirm(resFailConfMsg,constHisBack);}else{if (statusId == "6") {_Popup.openPopupConfirm(resWaitConfMsg,fnGoReserve);} else {fnGoReserve()}}}//다른출발일 조회 결과 리스트 셋function fn_setDifferentListData(data){let table = $(".table-type-1.tb-airplane");let tableTbody = $(".table-type-1.tb-airplane tbody");tableTbody.remove();let $tbody = $("
");if(data.length > 0){$.each(data,function(idx,obj){let className = obj.statusId==3?"reserve-on":"reserve-off"let departDate = obj.departDateType4.split("~")[0];let returnDate = obj.departDateType4.split("~")[1];let preferredAirlineNm = obj.preferredAirlineNm ? obj.preferredAirlineNm : "";let price = comma(obj.adultPrice);let url = evtDetailUrl(obj.tourCode);$tbody.append(`
`);});$tbody.addClass("mcScroll");}else{let hdCnt = $(".table-type-1.tb-airplane th").length+1;let tdWidth = $(".table-type-1.tb-airplane").width();$tbody.append(`
`)}table.append($tbody);table.find("tbody").mCustomScrollbar();}//항공편 변경 관련 모달 데이터 셋팅function fn_setFlightChange(data){let fliModal = $("#popup-df-flight");fliModal.find(".flight-area").children().remove();$.each(data,function(idx,obj){let pmSign = obj.pmSign?obj.pmSign:"";let price = pmSign.concat(comma(obj.resultPrice));let row =$(`
${price} 원
`)fliModal.find(".flight-area").append(row);});fliModal.modal();}//예약관련 인원에 따른 금액 계산 후 _reservation 전역변수 값 셋팅function fn_setReservation(totalSync){let payInfos = $(".option-area input[type='text']").map(function(idx,obj){return {id:obj.id,value:obj.value}}).toArray();//계산$.each(payInfos,function(idx,obj){let currentPrice = $(".option-area .won").filter(function(ft_idx,ft_obj){let id = $(ft_obj).attr("data-input-id"); return id == obj.id}).map(function(m_idx,m_obj){return $(m_obj).attr("data-price")}).get(0);_reservation["pay"][obj.id] = obj.value * currentPrice;let minusBtn = $(".option-area input[id='"+obj.id+"']").closest("div").find(".btn-minus");if(_reservation["pay"][obj.id]<= 0){minusBtn.attr("disabled",true);}else{minusBtn.attr("disabled",false);}});_reservation["payTotal"]=Object.values(_reservation["pay"]).reduce((partialSum, a) => partialSum + a, 0);if(totalSync){//최종합계 금액 셋팅$(".option-area .item-total .won").html(comma(_reservation["payTotal"])+"원");}}//여행일정 콤보 셋팅function fn_setTourDay(tourDay , tabId){for(var i = 1; i <= tourDay ; i++){let $option = $("");$option.attr("value",i);$option.text(i+" 일차");$option.attr("tabId",tabId)$("#tourSchDay").append($option);}}//모달 내 데이터 셋팅function fn_setModalData(target,currentData){let modalEl = $("#"+target);if(modalEl.length > 0){//이미지 3개 모달if(target=="popup-df-tourist"){//모달명let modalTitle = modalEl.find(".modal-header>.modal-title");let modalTitleData = currentData.typeId==7 ? "자세히보기" : (currentData.type ? currentData.type : "");modalTitle.html(modalTitleData);//타이틀let title = modalEl.find(".item-header").find("strong");currentData.nameKo?title.html(currentData.nameKo):title.html("");//짧은설명let descriptionShort = modalEl.find(".item-header").find("p");currentData.descriptionShort?descriptionShort.html(changeEnterToBr(currentData.descriptionShort)):descriptionShort.html("");//이미지let imgTag = modalEl.find(".swiper-photo.swiper-dt-pop-1");let $div = $("
");if(_swipeInfo["popupTourImg_3"]){_swipeInfo["popupTourImg_3"].destroy();imgTag.find(".swiper-wrapper").children().remove();}if(currentData && currentData.hasOwnProperty("img")){let img = currentData.img.split("|");$.each(img,function(idx,obj){let cloneDiv = $div.clone();cloneDiv.css("background-image","url('"+encodeURI(obj)+"')");imgTag.find(".swiper-wrapper").append(cloneDiv);});}else{let cloneDiv = $div.clone();cloneDiv.css("background-image","url(../../resources/images/noimage.png)");imgTag.find(".swiper-wrapper").append(cloneDiv);}//관광 이미지 3개_swipeInfo["popupTourImg_3"] = new Swiper(".swiper-dt-pop-1", {slidesPerView: 'auto',spaceBetween: 10,speed: 500,observer: true,observeParents: true,loop: true,pagination: {el: ".swiper-pagination-dt-pop-1", type: "fraction"// clickable: true,},navigation: {nextEl: ".swiper-button-next",prevEl: ".swiper-button-prev"}});$(_swipeInfo["popupTourImg_3"].el).find(".swiper-button-disabled").removeClass("swiper-button-disabled");//상세내용let description = modalEl.find(".photo-txt");currentData.description?description.html(changeEnterToBr(currentData.description)):description.html("");//주소 존재유무에 따른 주소영역 셋팅//tb-detail addreslet addrTag = modalEl.find(".tb-detail.addressDiv");if(addrTag.length > 0 && currentData.address){addrTag.css("display","");let address = currentData.address ? currentData.address : "";addrTag.find(".address").html(address);let homepage = currentData.homepage ? currentData.homepage : "";addrTag.find(".homepage").html(''+homepage+'');let contents = currentData.contents ? currentData.contents : "";addrTag.find(".addressContent").html(contents);let openingDay = currentData.openingDay ? currentData.openingDay : "";addrTag.find(".addressOpenDay").html(openingDay);}else{addrTag.css("display","none");}}//이미지 1개 모달else if(target=="popup-df-tourist2"){//타이틀let title = modalEl.find(".item-header").find("strong");currentData.nameKo?title.html(currentData.nameKo):title.html("");//짧은설명let descriptionShort = modalEl.find(".item-header").find("p");currentData.descriptionShort?descriptionShort.html(changeEnterToBr(currentData.descriptionShort)):descriptionShort.html("");//이미지let imgTag = modalEl.find(".swiper-photo.swiper-dt-pop-2");let $div = $("
");if(_swipeInfo["popupTourImg_1"]){_swipeInfo["popupTourImg_1"].destroy();imgTag.find(".swiper-wrapper").children().remove();}if(currentData && currentData.hasOwnProperty("img")){let img = currentData.img.split("|");$.each(img,function(idx,obj){let cloneDiv = $div.clone();cloneDiv.css("background-image","url('"+obj+"')");imgTag.find(".swiper-wrapper").append(cloneDiv);});}else{let cloneDiv = $div.clone();cloneDiv.css("background-image","url(../../resources/images/noimage.png)");imgTag.find(".swiper-wrapper").append(cloneDiv);}//관광 이미지 1개_swipeInfo["popupTourImg_1"] = new Swiper(".swiper-dt-pop-2", {slidesPerView: 'auto',spaceBetween: 10,speed: 500,observer: true,observeParents: true,loop: true,pagination: {el: ".swiper-pagination-dt-pop-2", type: "fraction"// clickable: true,},navigation: {nextEl: ".swiper-button-next",prevEl: ".swiper-button-prev"}});$(_swipeInfo["popupTourImg_1"].el).find(".swiper-button-disabled").removeClass("swiper-button-disabled");//상세내용let description = modalEl.find(".photo-txt");currentData.description?description.html(changeEnterToBr(currentData.description)):description.html("");//행사 기타 정보정보let tourInfo = modalEl.find(".info-box");//요금let adultPrice = currentData.adultPrice ? currentData.adultPrice : "0";let childPrice = currentData.childPrice ? currentData.childPrice : "0";let infantPrice = currentData.infantPrice ? currentData.infantPrice : "0";tourInfo.find("dd[id='popTourPrice']").html("성인 : "+comma(adultPrice)+" / "+" 아동 : "+comma(childPrice)+" / "+" 유아 : "+comma(infantPrice));//소요시간let timeRequired = currentData.timeRequired ? currentData.timeRequired : "";tourInfo.find("dd[id='popTourTime']").html(timeRequired);//대체일정let otherSchedule = currentData.otherSchedule ? currentData.otherSchedule : "";tourInfo.find("dd[id='popTourOth']").html(otherSchedule);}//호텔 모달else if(target=="popup-10"){//타이틀let title = modalEl.find(".item-header").find("strong");currentData.nameKo?title.html(currentData.nameKo):title.html("");//짧은설명let descriptionShort = modalEl.find(".item-header").find(".txt");currentData.descriptionShort?descriptionShort.html(changeEnterToBr(currentData.descriptionShort)):descriptionShort.html("");//popupHotel photo-txt//이미지let imgTag = modalEl.find(".swiper-photo.swiper-dt-pop-3");let $div = $("
");if(_swipeInfo["popupHotel"]){_swipeInfo["popupHotel"].destroy();imgTag.find(".swiper-wrapper").children().remove();}if(currentData && currentData.hasOwnProperty("img")){let img = currentData.img.split("|");$.each(img,function(idx,obj){let cloneDiv = $div.clone(); obj = encodeURI(obj);cloneDiv.css("background-image","url('"+obj+"')");imgTag.find(".swiper-wrapper").append(cloneDiv);});}else{let cloneDiv = $div.clone();cloneDiv.css("background-image","url(../../resources/images/noimage.png)");imgTag.find(".swiper-wrapper").append(cloneDiv);}//호텔 이미지_swipeInfo["popupHotel"] = new Swiper(".swiper-dt-pop-3", {slidesPerView: 'auto',spaceBetween: 10,speed: 500,observer: true,observeParents: true,loop: true,pagination: {el: ".swiper-pagination",clickable: true,},navigation: {nextEl: ".swiper-button-next",prevEl: ".swiper-button-prev"}});$(_swipeInfo["popupHotel"].el).find(".swiper-button-disabled").removeClass("swiper-button-disabled");//상세내용let description = modalEl.find(".photo-txt");currentData.description?description.html(changeEnterToBr(currentData.description)):description.html("");//주소 존재유무에 따른 주소영역 셋팅//tb-detail addreslet addrTag = modalEl.find(".tb-detail");if(addrTag.length > 0){addrTag.css("display","");let address = currentData.address ? currentData.address : "";let address2 = currentData.address2 ? currentData.address2 : "";addrTag.find(".address").html(address);if(address2){addrTag.find(".address").append(" "+address2);}let tel = currentData.tel ? currentData.tel : "";addrTag.find(".tel").html(tel);let homepage = currentData.homepage ? currentData.homepage : "";addrTag.find(".homepage").html(''+homepage+'');let resultContent = function(str){str = unicodeToKor(str).split(",");let div = $("
");$.each(str,function(idx,obj){let result = idx == 0 ? `- ${obj}` : ` - ${obj}`;div.append(result);});return div;}addrTag.find(".content").html("");let content = currentData.contents ? currentData.contents : "";if(content){addrTag.find(".content").append(resultContent(content));}addrTag.find(".content2").html("");let content2 = currentData.contents2 ? currentData.contents2 : "";if(content2){addrTag.find(".content2").append(resultContent(content2));}}else{addrTag.css("display","none");}}modalEl.modal();}} //탭 데이터 조회 function selectGoodsEvtTabData(tabId){let url = tourEventDataURL;let data ={ "menuCode": $("#menuCode").val(),"tourId": $("#tourId").val(),"tourCode": $("#tourCode").val(),"masterId": $("#masterId").val(),"masterCode": $("#masterCode").val(),"tabId": tabId};$.ajax({url: url,type: 'post',data: {data:JSON.stringify(data)},dataType: 'json',contentType: 'application/x-www-form-urlencoded; charset=UTF-8',async: false,success: function (result, textStatus, data) {if(result.statusCode!=200){onShowToast(errProc);return false;}// _tabObj=result.data; tabId.map((v,i)=>{ if(_tabArray.findIndex(o=>o === v) === -1 )_tabArray.push(v); }) $.each(Object.keys(result.data),function(idx,obj){ _tabObj[obj] = result.data[obj]["detail"]; fnSetTabViewSet(obj); });},error: function (xhr, errorName, error) {}}); }//탭 데이터 조회 후 탭 데이터 및 태그 셋팅let fn_emptyChkSetDefData = function(data){return data ? (data=="undefined"?"":data):""};function fnSetTabViewSet(tabId){//선택된 탭 태그let tabEl = $(".cont-box."+tabId);if(tabEl.length > 0){//START 탭1--------------------------------------------------------------------------------------------------------if("goodsEvtTab_1" == tabId){//행사상세에 대한 타입정보 공통코드 ER05let evtType = _tabObj["goodsEvtTab_1"]["evtType"];let etcShopingData = evtType.filter(function(obj){return obj.type==8});if(etcShopingData.length > 0){etcShopingData = evtType.filter(function(obj){return obj.type==8})[0]["etc"];if(etcShopingData && etcShopingData.hasOwnProperty("shopping_list")){let shopping_list = etcShopingData["shopping_list"];let shopTxt = "";$.each(shopping_list,function(idx,obj){let txt = fn_emptyChkSetDefData(obj.item);shopTxt = shopTxt.concat("
");shopTxt = shopTxt.concat(txt);});//여행상품핵심정보$("table td[id='popShopingTd']").html(`${shopping_list.length}회${shopTxt}`);}}//START 상세 배너관련-------------------------------------------------------------------------------let banner = _tabObj["goodsEvtTab_1"]["banner"];if(banner && banner.length>0){if(_swipeInfo["bannerDetail"]){_swipeInfo["bannerDetail"].destroy();}tabEl.find(".tourBanner").css("display","");tabEl.find(".swiper-wrapper").children().remove();$.each(banner,function(idx,obj){let dynEl =$(`
${obj.mainWords}
${obj.mainWordsEtc}
${obj.cndcyWords}
`);dynEl.find(".img").on("click",function(){window.open(obj.linkUrl,"_blank");});dynEl.find(".txt").on("click",function(){window.open(obj.linkUrl,"_blank");});tabEl.find(".swiper-wrapper").append(dynEl);});//상세 이미지 스와이프 관련_swipeInfo["bannerDetail"] = new Swiper(".tourBanner", {slidesPerView: 'auto',spaceBetween: 10,speed: 500,loop: true,pagination: {el: ".swiper-pagination-tourBanner",clickable: true,},navigation: {nextEl: ".swiper-button-next",prevEl: ".swiper-button-prev"}});$(_swipeInfo["bannerDetail"].el).find(".swiper-button-disabled").removeClass("swiper-button-disabled");}else{tabEl.find(".tourBanner").css("display","none");}//END 상세 배너관련-------------------------------------------------------------------------------//START 상품핵심포인트-------------------------------------------------------------------------------let point = _tabObj["goodsEvtTab_1"]["point"];let noDup_point = [...new Set(point.map(function(obj){return obj.type}))]; // EES 상품상세 > 여행참조정보 > 상품특전에 여행후기영상이 있을 떄 let videoInfo = _tabObj["goodsEvtTab_1"]["videoInfo"]; if (typeof videoInfo == "undefined" || videoInfo === null || videoInfo == "") { $(".embedded-video").css("display","none"); } else { $(".embedded-video").append(''); }//이미지존재여부 에 따른 show hideif(noDup_point.indexOf(tab1_imgType) >= 0){$("#tab1_imgPoint").css("display","");}else{ // $("#tab1_imgPoint").css("display","none");// $("#tab1_imgPoint .tab1_point_9").css("display","none");// $("#tab1_imgPoint #tab1_evt_img_btn").css("display","none");} let imageUrls = [];$.each(noDup_point,function(idx,obj){let pointEl = tabEl.find(".tab1_point_"+obj);if(pointEl.length > 0){pointEl.css("display","");pointEl.find(".area").html("");let getPointFilter = point.filter(function(subObj,subIdx){return subObj.type == obj;}); // 이미지 URL 수집$.each(getPointFilter,function(filterIdx,filterObj){let nameKo = fn_emptyChkSetDefData(filterObj.nameKo);let descriptionShort = fn_emptyChkSetDefData(filterObj.descriptionShort);let exImage = fn_emptyChkSetDefData(filterObj.exImage);let tag1 = fn_emptyChkSetDefData(filterObj.tag1);if(obj!=9){pointEl.find(".area").append("
"+nameKo+" : "+descriptionShort+"
");}else{ //기획전 이미지 링크(태그1) if(tag1){ pointEl.find(".area").append(`
`); }else{ pointEl.find(".area").append('
'); } imageUrls.push(exImage);}});}}); // loadImages(imageUrls).then(() => { // let areaHeight = $(".goodsEvtTab_1 .tab1_point_9 .area").height(); // // // 높이에 따른 추가 작업 // if (areaHeight < 840) { // $("#tab1_evt_img_btn").hide(); // } else { // $("#tab1_evt_img_btn").show(); // } // })//END 상품핵심포인트-------------------------------------------------------------------------------if(evtType.length>0){//START 보험-------------------------------------------------------------------------------let insurance = $(evtType.filter(function(obj){return obj.type=="1"})).get(0);let inEtc = insurance ? ( insurance.etc ? insurance.etc : "" ) : "";tabEl.find(".tab1_evt_typ_2").css("display",""); inEtc = "
"+inEtc+"
" inEtc += "
보장내용 및 금액 상세보기
"tabEl.find(".tab1_evt_typ_2 .area").html(inEtc);//END 보험-------------------------------------------------------------------------------//START 포함 미포함 관련 , 인솔자/가이드정보 -------------------------------------------------------------------------------//포함 미포함 관련let type2Data = $(evtType.filter(function(obj){return obj.type=="2"})).get(0);let including = type2Data ? type2Data["etc3"] : "";let includingTag = tabEl.find(".included-list .item.check .area");let noneEl;includingTag.html("");if(including){tabEl.find(".included-list .item.check").css("display","");$.each(including,function(idx,obj){if(obj.tag && obj.remark){includingTag.append("[".concat(obj.tag).concat("]").concat(obj.remark).concat(""));}else if(obj.tag && !obj.remark){includingTag.append("[".concat(obj.tag).concat("]").concat(""));}else if(!obj.tag && obj.remark){includingTag.append(obj.remark.concat(""));}});}else{tabEl.find(".included-list .item.check").css("display","none");}let notInclud = type2Data ? type2Data["etc4"] : "";let notIncludTag = tabEl.find(".included-list .item.no-check .area");notIncludTag.html("");if(notInclud){tabEl.find(".included-list .item.no-check").css("display","");$.each(notInclud,function(idx,obj){if(obj.tag && obj.remark){notIncludTag.append("[".concat(obj.tag).concat("]").concat(obj.remark).concat(""));}else if(obj.tag && !obj.remark){notIncludTag.append("[".concat(obj.tag).concat("]").concat(""));}else if(!obj.tag && obj.remark){notIncludTag.append(obj.remark.concat(""));}});}else{tabEl.find(".included-list .item.no-check").css("display","none");}if(tabEl.find(".included-list .item").length==0){tabEl.find(".included-list").css("display","none");}else{tabEl.find(".included-list").css("display","");}//인솔자/가이드정보//TYPE 값이 2 일때 가이드 인솔자 여부 / 1 : 가이드Y, 인솔자N / 2 : 가이드N, 인솔자Y / 3 : 가이드Y, 인솔자Y / 0 : 가이드N, 인솔자Nlet guideTag = tabEl.find(".evt_type_2_guide");let guideFlag = type2Data ? type2Data["etcFlag"] : ""; let guideEtc = "";if(guideFlag==1){ guideTag.find(".leader").css("color","#666"); guideTag.find(".leader").css("border-color","#666"); guideEtc = type2Data["etc"]? type2Data["etc"] : "가이드가 포함된 상품입니다.";}else if(guideFlag==2){ guideTag.find(".guide").css("color","#666"); guideTag.find(".guide").css("border-color","#666"); guideEtc = type2Data["etc"]? type2Data["etc"] : "인솔자가 포함된 상품입니다.";}else if(guideFlag==3){ guideEtc = type2Data["etc"]? type2Data["etc"] : "가이드 및 인솔자가 포함된 상품입니다.";}else{ guideTag.find(".guide").css("color","#666"); guideTag.find(".guide").css("border-color","#666"); guideTag.find(".leader").css("color","#666"); guideTag.find(".leader").css("border-color","#666"); guideEtc = "가이드 및 인솔자가 포함되지 않은 상품입니다.";}guideEtc = type2Data? guideEtc : "가이드/인솔자 정보가 없습니다.";guideTag.find(".cont").html(guideEtc);let scheduleTag = tabEl.find(".evt_type_2_schedule"); let scheduleFlag = type2Data ? type2Data["etcFlag5"] : ""; /* 자유일정여부 / 1 : Y / 0 : N */ let schedulEtc5 = ""; if(scheduleFlag == 1) schedulEtc5 = type2Data["etc5"]? type2Data["etc5"] : "자유일정이 포함된 상품입니다."; else if(scheduleFlag == 2){ scheduleTag.find(".free").css("color","#666"); scheduleTag.find(".free").css("border-color","#666"); schedulEtc5 = type2Data["etc5"]? type2Data["etc5"] : "자유일정이 포함되지 않은 상품입니다."; } else{ scheduleTag.find(".free").css("color","#666"); scheduleTag.find(".free").css("border-color","#666"); schedulEtc5 = "자유일정이 포함되지 않은 상품입니다.";} schedulEtc5 = type2Data? schedulEtc5 : "자유일정 정보가 없습니다.";scheduleTag.find(".cont").html(schedulEtc5);//END 포함 미포함 관련 , 인솔자/가이드정보 -------------------------------------------------------------------------------}}//END 탭1--------------------------------------------------------------------------------------------------------//START 탭2--------------------------------------------------------------------------------------------------------else if("goodsEvtTab_2" == tabId){//수하물정보let luggageTag = tabEl.find(".item-luggage");let iuggageInfo = _tabObj["goodsEvtTab_2"]["iuggageInfo"];if(iuggageInfo && luggageTag.length > 0){luggageTag.find(".airline").html("");luggageTag.find(".free").html("");luggageTag.find(".add").html("");luggageTag.find(".in").html("");if(iuggageInfo){luggageTag.find(".airline").html(iuggageInfo.airmanNm);luggageTag.find(".free").html(iuggageInfo.freeHydcmpPermQy);luggageTag.find(".add").html(iuggageInfo.excessChrge);luggageTag.find(".in").html(iuggageInfo.inflgtTkinPermSize);}}else{luggageTag.css("display","none");}//항공정보let schAir = _tabObj["goodsEvtTab_2"]["schAir"];//미팅장소//let meeting = tabEl.find(".item-luggage");let meeting = _tabObj["goodsEvtTab_2"]["meeting"]; if(meeting) { let description = meeting.description ? meeting.description : ""; if (description == "") { $(".goodsEvtTab_2 .item-box-meeting .area ").find(".desc").hide(); } $(".goodsEvtTab_2 .item-box-meeting .area ").find(".desc").html(changeEnterToBr(description)); let remark = meeting.remark ? meeting.remark : ""; if (remark == "") { $(".goodsEvtTab_2 .item-box-meeting .area ").find(".remark").hide(); } else $(".goodsEvtTab_2 .item-box-meeting .area ").find(".remark").html(changeEnterToBr(remark)); } else{ $(".goodsEvtTab_2 .item-box-meeting .area ").find(".desc").html('* 미팅 관련 자세한 사항은 추후 안내 드립니다.'); $(".goodsEvtTab_2 .item-box-meeting .area ").find(".remark").hide(); }//일정//스케줄 관련 탭 오브젝트 키const tabObjKey = "schedule";let buttonSetAtt = function(el,obj){el.find("button").attr("data-type",tabObjKey);el.find("button").attr("typeDay",obj.day);el.find("button").attr("typeId",obj.typeId);el.find("button").attr("typeIdx",obj.typeIdx-1);}let schedule = _tabObj["goodsEvtTab_2"][tabObjKey];let schedule_days = _tabObj["goodsEvtTab_2"]["schedule"].map(function(obj){return obj.day});schedule_days = schedule_days.filter((val, idx) => {return schedule_days.indexOf(val) === idx; //값이 처음나오는 배열 인덱스와 현재 인덱스가 같으면 포함});tabEl.find(".item-plan-info.schedule").html("");let scheduleDate = moment($("#departDate").val(),'YYYYMMDD');let weekdaysText = $("#weekdaysText").val().split(",");//일정영역 forlet startDayAryIdx = 0;let lastDayArIdx = schedule_days.length-1;$.each(schedule_days,function(dayIdx,dayObj){//자식 태그가 존재 할 경우 return;if(tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).length > 0){return false;}scheduleDate = dayIdx > 0 ? moment(scheduleDate,'YYYYMMDD').add(1,"day").format('YYYYMMDD') : moment(scheduleDate).format('YYYYMMDD');let addDate = moment(scheduleDate,'YYYYMMDD').format('YYYY-MM-DD dddd');let scheduleTag = $("#hiddenSchedule_date").children().clone();scheduleTag.find(".plan-header .no").html(dayObj+"일차");scheduleTag.find(".plan-header .date").html(addDate);scheduleTag.addClass("_schDayHD"+dayObj);//일정에대한 DIV 구분을 위한 CLASS ADDlet schedule_body = $("#hiddenSchedule_body").children().clone();schedule_body.find(".detailSch").addClass("day"+dayObj);scheduleTag.append(schedule_body);//일정영역 appendtabEl.find(".item-plan-info.schedule").append(scheduleTag);//상세일정 셋팅 setp 구분으로let detailSchedule = schedule.filter(function(ftObj,ftIdx){return ftObj["day"] == dayObj;});// 항공 정보 셋팅 변수let airSchSetEl = function(cloneEl , data){let startTime = moment(data.departTime,'YYYYMMDDHHmm').format("HH:mm");cloneEl.find(".schDepartTime").html(startTime);let departDate = moment(data.departDate,"YYYYMMDD").format("YYYY.MM.DD");let startDay = moment(departDate,"YYYYMMDD").format('dddd');let startPlace = data.departPlaceStartName;let startPlaceCode = data.departPlaceStart;cloneEl.find(".schDepartDateLoc").html(departDate+"("+startDay+")
"+startPlace+"("+startPlaceCode+") 출발");let endTime = moment(data.departArriveTime,'YYYYMMDDHHmm').format("HH:mm");cloneEl.find(".schArrivalTime").html(endTime); let departFlight = data.departFlight; cloneEl.find(".schAirLine").html(departFlight); cloneEl.find(".schShipLine").html(departFlight)let departArrivalDate = moment(data.departArrivalDate,"YYYYMMDD").format("YYYY.MM.DD");let endDay = moment(departArrivalDate,"YYYYMMDD").format('dddd');let departPlaceEndName = data.departPlaceEndName;let departPlaceEnd = data.departPlaceEnd;cloneEl.find(".schArrivalDateLoc").html(departArrivalDate+"("+endDay+")
"+departPlaceEndName+"("+departPlaceEnd+") 도착");let f_hh;let f_mm;let flightTime = data.departTotalFlyingTime;if(flightTime && flightTime.length == 4){f_hh = flightTime.substr(0,2);f_mm = flightTime.substr(2);}else{if(flightTime){f_hh = '0'.concat(flightTime.substr(0,1));f_mm = flightTime.substr(1);}else{f_hh = '00';f_mm = '00';}}cloneEl.find(".air-time .schAirFlightTime").html(f_hh+"시간"+f_mm+"분");if(departFlight){return cloneEl;}else{null;}}//한국 출발항공 관련let schedule_air;let schedule_air_sub; /*이동 수단에 따른 이미지 변경 */ let departTypeId = schAir[0].departTypeId; if(departTypeId == 1){ $('.detail .plan-airplane .air-time strong').removeClass('schShipLine'); $('.detail .plan-airplane .air-time strong').addClass('schAirLine'); }else if(departTypeId == 2){ $('.detail .plan-airplane .air-time strong').removeClass('schAirLine'); $('.detail .plan-airplane .air-time strong').addClass('schShipLine'); }if(dayObj==1){let airData_1 = { departTime : fn_emptyChkSetDefData(schAir[0].departTime),departDate : fn_emptyChkSetDefData(schAir[0].departDate),departArriveTime : fn_emptyChkSetDefData(schAir[0].departArriveTime),departPlaceStartName : fn_emptyChkSetDefData(schAir[0].departPlaceStartName),departPlaceStart : fn_emptyChkSetDefData(schAir[0].departPlaceStart),departFlight : fn_emptyChkSetDefData(schAir[0].departFlight),departArrivalDate : fn_emptyChkSetDefData(schAir[0].departDestinationDate),departPlaceEndName : fn_emptyChkSetDefData(schAir[0].departPlaceEndName),departPlaceEnd : fn_emptyChkSetDefData(schAir[0].departPlaceEnd),departTotalFlyingTime: fn_emptyChkSetDefData(schAir[0].departTotalFlyingTime),departTypeId : fn_emptyChkSetDefData(schAir[0].departTypeId)}schedule_air = airSchSetEl($("#hiddenSchedule_air").children().clone(),airData_1);if(schedule_air){tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(schedule_air);}//경유 항공 있을 경우if(schAir[0].hasOwnProperty("departDestinationFlight")){let airData_2 = { departTime : fn_emptyChkSetDefData(schAir[0].departDestinationTime),departDate : fn_emptyChkSetDefData(schAir[0].departDestinationLayoverDate),departArriveTime : fn_emptyChkSetDefData(schAir[0].departDestinationArriveTime),departPlaceStartName : fn_emptyChkSetDefData(schAir[0].departDestinationPlaceStartName),departPlaceStart : fn_emptyChkSetDefData(schAir[0].departDestinationPlaceStart),departFlight : fn_emptyChkSetDefData(schAir[0].departDestinationFlight),departArrivalDate : fn_emptyChkSetDefData(schAir[0].departArrivalDate),departPlaceEndName : fn_emptyChkSetDefData(schAir[0].departDestinationPlaceEndName),departPlaceEnd : fn_emptyChkSetDefData(schAir[0].departDestinationPlaceEnd),departTotalFlyingTime: fn_emptyChkSetDefData(schAir[0].departDestinationFlyingTime)}schedule_air_sub = airSchSetEl($("#hiddenSchedule_air").children().clone(),airData_2);if(schedule_air_sub){tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(schedule_air_sub);}}}//현지출발항공let end_schedule_air_1;let end_schedule_air_2;if(dayObj==schedule_days[schedule_days.length-1]){let airData_1 = { departTime : fn_emptyChkSetDefData(schAir[0].returnTime),departDate : fn_emptyChkSetDefData(schAir[0].returnDepartDate),departArriveTime : fn_emptyChkSetDefData(schAir[0].returnArriveTime),departPlaceStartName : fn_emptyChkSetDefData(schAir[0].returnPlaceStartName),departPlaceStart : fn_emptyChkSetDefData(schAir[0].returnPlaceStart),departFlight : fn_emptyChkSetDefData(schAir[0].returnFlight),departArrivalDate : fn_emptyChkSetDefData(schAir[0].returnOriginArrivalDate),departPlaceEndName : fn_emptyChkSetDefData(schAir[0].returnPlaceEndName),departPlaceEnd : fn_emptyChkSetDefData(schAir[0].returnPlaceEnd),departTotalFlyingTime: fn_emptyChkSetDefData(schAir[0].returnFlyingTime)}end_schedule_air_1 = airSchSetEl($("#hiddenSchedule_air").children().clone(),airData_1);if(end_schedule_air_1){tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(end_schedule_air_1);}//경유 항공 있을 경우if(schAir[0].hasOwnProperty("returnOriginFlight")){let airData_2 = { departTime : fn_emptyChkSetDefData(schAir[0].returnOriginTime),departDate : fn_emptyChkSetDefData(schAir[0].returnArrivalLayoverDate),departArriveTime : fn_emptyChkSetDefData(schAir[0].returnOriginArriveTime),departPlaceStartName : fn_emptyChkSetDefData(schAir[0].returnOriginPlaceStartName),departPlaceStart : fn_emptyChkSetDefData(schAir[0].returnOriginPlaceStart),departFlight : fn_emptyChkSetDefData(schAir[0].returnOriginFlight),departArrivalDate : fn_emptyChkSetDefData(schAir[0].returnArrivalDate),departPlaceEndName : fn_emptyChkSetDefData(schAir[0].returnOriginPlaceEndName),departPlaceEnd : fn_emptyChkSetDefData(schAir[0].returnOriginPlaceEnd),departTotalFlyingTime: fn_emptyChkSetDefData(schAir[0].returnOriginFlyingTime)}end_schedule_air_2 = airSchSetEl($("#hiddenSchedule_air").children().clone(),airData_2);if(end_schedule_air_2){tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(end_schedule_air_2);}}}$.each(detailSchedule,function(subIdx , subObj){//교통수단let transportation;if(subObj.typeId==1){transportation = $("#hiddenSchedule_time").children().clone();let etc1Desc = subObj.etc1Desc? subObj.etc1Desc: erpTrafficEtc1[subObj.etc1]? subObj[erpTrafficEtc1[subObj.etc1]]? subObj[erpTrafficEtc1[subObj.etc1]]: "": "";transportation.find(".tit").html("[교통편 : "+etc1Desc+" ]");let description_1 = "";$.each(Object.keys(erpTrafficEtcDetail),function(idx,obj){if(erpTrafficEtcDetail[obj] && subObj[obj]){let data = ""+erpTrafficEtcDetail[obj]+""+subObj[obj]+"";description_1 = description_1.concat(data);}});transportation.find(".txt").html(changeEnterToBr(description_1));let description_2 = subObj.description?changeEnterToBr(subObj.description):"";transportation.find(".txt").append(changeEnterToBr(description_2));transportation.attr("typeId",subObj.typeId);tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(transportation);}//VW_ERP_EVENT_SCHEDULE 정보에 없다 대표님에게 요청//국가/도시let goCity;if(subObj.typeId==5){goCity = $("#hiddenSchedule_time").children().clone();goCity.addClass("location");goCity.find(".tit").html(subObj.etc1Desc+"/"+subObj.etc2Desc);let description = changeEnterToBr(subObj.description);goCity.find(".txt").html(description);goCity.attr("typeId",subObj.typeId);tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(goCity);}//선택관광let choiceTourDetailif(subObj.typeId==8){choiceTourDetail = $("#hiddenSchedule_tour_img_1").children().clone();choiceTourDetail.attr("typeId",subObj.typeId);//타이틀let title = subObj.nameKo?subObj.nameKo:"";choiceTourDetail.find(".info-header>.tit>strong").html(title);//약식설명let descriptionShort = subObj.descriptionShort?subObj.descriptionShort:"";choiceTourDetail.find(".info-header>.txt").html(descriptionShort);//선택관광 라벨choiceTourDetail.find(".info-header>.tit>.label-state.in.select").css("display","");//특별포함 라벨let confirmed = subObj.confirmed;if(confirmed=="1"){choiceTourDetail.find(".info-header>.tit>.label-state.special").css("display","");}else{choiceTourDetail.find(".info-header>.tit>.label-state.special").css("display","none");}//이미지if(subObj.img){let img = subObj.img.split("|");$.each(img,function(idx,obj){if(idx == 0){$(choiceTourDetail.find(".photo").get(idx)).css("background-image","url('"+obj+"')");}else{return false;}});}else{choiceTourDetail.find(".photo").css("background-image","url('../../resources/images/noimage.png')");}//요금let adultPrice = subObj.adultPrice ? subObj.adultPrice : "0";let childPrice = subObj.childPrice ? subObj.childPrice : "0";let infantPrice = subObj.infantPrice ? subObj.infantPrice : "0";let currency = subObj.currency ? subObj.currency : "";choiceTourDetail.find("dd[id='_tourPay']").html("성인 : "+comma(adultPrice)+currency+" / "+" 아동 : "+comma(childPrice)+currency+" / 유아 : "+comma(infantPrice)+currency);//소요시간let timeRequired = subObj.timeRequired ? subObj.timeRequired : "";choiceTourDetail.find("dd[id='_tourTime']").html(timeRequired);//대체일정let otherSchedule = subObj.otherSchedule ? subObj.otherSchedule : "";choiceTourDetail.find("dd[id='_tourDay']").html(otherSchedule);buttonSetAtt(choiceTourDetail,subObj);tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(choiceTourDetail);}//직접입력 : 7 이미지존재유무에 따라 보여지는 형식이 달라짐let directInput;if(subObj.typeId==7){let img = subObj.img;let etc1 = subObj.etc1 ? subObj.etc1: "";let description = subObj.description ? changeEnterToBr(subObj.description) : "";//이미지 존재 시if(img){description = description.length > constDescLen ? description.substr(0,constDescLen)+"..." : description;directInput = $("#hiddenSchedule_tour_img_3").children().clone();directInput.find(".txt").html(subObj.etc1);directInput.find(".areaShotDesc").html(subObj.descriptionShort);directInput.find(".list").html(description);if(subObj.img){let img = subObj.img.split("|");$.each(img,function(idx,obj){if(idx <= 2){$(directInput.find(".photo").get(idx)).css("background-image","url('"+obj+"')");}else{return false;}});}else{directInput.find(".photo").css("display","none");}buttonSetAtt(directInput,subObj);}//이미지 존재 하지 않을경우else{directInput = $("#hiddenSchedule_time").children().clone();directInput.find(".tit").html(etc1);directInput.find(".txt").html(description);directInput.attr("typeId",subObj.typeId);}tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(directInput);}//골프장 : 9 / 관광지 : 4 / 식사 : 3let tour_imgType;if(subObj.typeId==9 || subObj.typeId==4 || subObj.typeId==3){let description = subObj.description ? changeEnterToBr(subObj.description) : "";description = description.length > constDescLen ? description.substr(0,constDescLen)+"..." : description;tour_imgType = $("#hiddenSchedule_tour_img_3").children().clone();tour_imgType.find(".tit strong").html(subObj.nameKo);tour_imgType.find(".txt").html(subObj.descriptionShort);//tour_imgType.find(".areaShotDesc").html(subObj.descriptionShort);tour_imgType.find(".list").html(description);if(subObj.img){let img = subObj.img.split("|");$.each(img,function(idx,obj){if(idx <= 2){$(tour_imgType.find(".photo").get(idx)).css("background-image","url('"+obj+"')");}else{return false;}});}else{tour_imgType.find(".photo").css("display","none");}buttonSetAtt(tour_imgType,subObj);tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(tour_imgType);}});//호텔let hotelData = detailSchedule.filter(function(obj){return obj.typeId==2});if(hotelData.length > 0){//호텔let hotelDetail = $("#hiddenSchedule_hotel").clone();let confirmHotel = hotelData.filter(function(obj){return obj.confirmed == 1});if(confirmHotel.length > 0){let hotelDetail_info = $("#hiddenSchedule_hotel_info").children().clone();hotelDetail_info.find(".notConfirmed").css("display","none");hotelDetail_info.find(".confirmed").css("display","");if(hotelData.confirmed==1){hotelDetail_info.find(".label-state.in").hide();}hotelDetail_info.find("strong").html(confirmHotel[0].nameKo);hotelDetail_info.find("strong").on("click",function(e){hotelDetail_info.find("button").trigger("click");});hotelDetail_info.filter(function(htIdx,htObj){return htObj.className.indexOf("content")>=0}).html(confirmHotel[0].contentRemark);buttonSetAtt(hotelDetail_info,confirmHotel[0]);hotelDetail.find(".plan-box.hotel>.box-header").append(hotelDetail_info);}else{$.each(hotelData,function(htIdx , htObj){let hotelDetail_info = $("#hiddenSchedule_hotel_info").children().clone();hotelDetail_info.find(".notConfirmed").css("display","");hotelDetail_info.find(".confirmed").css("display","none");hotelDetail_info.find("strong").html(htObj.nameKo);hotelDetail_info.find("strong").on("click",function(e){hotelDetail_info.find("button").trigger("click");});hotelDetail_info.filter(function(htIdx,htObj){return htObj.className.indexOf("content")>=0}).html(htObj.contentRemark);buttonSetAtt(hotelDetail_info,htObj);hotelDetail.find(".plan-box.hotel").addClass("toggle");hotelDetail.find(".plan-box.hotel>.box-header").addClass("show-toggle");hotelDetail.find(".plan-box.hotel>.box-header").append(hotelDetail_info);});}hotelDetail.find(".plan-box.hotel>.box-header").append($("#hiddenSchedule_hotel_last").children().clone());//호텔이 다건 일 경우 css 수정if(hotelData.length > 1){hotelDetail.find(".plan-box.hotel>.box-header>.btn-arrow2").css("display","");hotelDetail.find(".plan-box.hotel>.box-header>.btn-arrow2").addClass("up");}else{hotelDetail.find(".plan-box.hotel>.box-header>.btn-arrow2").css("display","none");}$(hotelDetail.children().get(0)).attr("typeId",hotelData[0].typeId);tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(hotelDetail.children());}//조식 중식 석식let scheduleMeal = _tabObj["goodsEvtTab_2"]["scheduleMeal"];if(scheduleMeal && scheduleMeal.length > 0){let mealDetail = $("#hiddenSchedule_meal").clone();let currentMeal = scheduleMeal.filter(function(obj){return obj.day==dayObj});let breakfast = currentMeal.length > 0 ? currentMeal[0].breakfast ? currentMeal[0].breakfast : "없음" : "없음";let lunch = currentMeal.length > 0 ? currentMeal[0].lunch ? currentMeal[0].lunch : "없음" : "없음";let dinner = currentMeal.length > 0 ? currentMeal[0].dinner ? currentMeal[0].dinner : "없음" : "없음";mealDetail.find(".plan-box.meal").find("[id='breakfast']").html("[조식]"+breakfast);mealDetail.find(".plan-box.meal").find("[id='lunch']").html("[중식]"+lunch);mealDetail.find(".plan-box.meal").find("[id='dinner']").html("[석식]"+dinner);tabEl.find(".item-plan-info.schedule").find(".day"+dayObj).append(mealDetail.children());}scheduleTag.find(".time-info:eq(0)").addClass("start");scheduleTag.find(".time-info:eq(0)").addClass("plan-time");scheduleTag.find(".time-info:last").addClass("end");});}//END 탭2--------------------------------------------------------------------------------------------------------//START 탭3--------------------------------------------------------------------------------------------------------else if("goodsEvtTab_3" == tabId){let reservation = _tabObj["goodsEvtTab_3"]["reservation"];if(reservation && reservation.type==5){let typeTag = tabEl.find(".tb-detail").children();if(reservation){$.each(Object.keys(reservation),function(idx,key){let typeTagDiv = typeTag.filter(function(idx,obj){return obj.className.indexOf(key) > 0});if(typeTagDiv.length > 0){let data = reservation[key];if(data){data = data ? changeEnterToBr(data): reservationMsg;typeTagDiv.find(".text-area").html(data);}}});}else{typeTag.find(".text-area").html(reservationMsg);}}}//END 탭3--------------------------------------------------------------------------------------------------------//START 탭4--------------------------------------------------------------------------------------------------------else if("goodsEvtTab_4" == tabId){}//END 탭4--------------------------------------------------------------------------------------------------------//START 탭5--------------------------------------------------------------------------------------------------------else if("goodsEvtTab_5" == tabId){let term = _tabObj["goodsEvtTab_5"];//let description = subObj.description ? subObj.description.replace(/(?:\r\n|\r|\n)/g, '
') : "";let termDesc = _tabObj["goodsEvtTab_5"] ? changeEnterToBr(_tabObj["goodsEvtTab_5"].termDesc) : "약관정보가 존재하지 않습니다.";let termType = _tabObj["goodsEvtTab_5"] ? _tabObj["goodsEvtTab_5"].termType : "";let cancelTerm = _tabObj["goodsEvtTab_5"]?_tabObj["goodsEvtTab_5"].cancelTerm?changeEnterToBr(_tabObj["goodsEvtTab_5"].cancelTerm): "": "";if(termType==2){$(".cont-box.term .term1").css("display","");}else if(termType==1){$(".cont-box.term .term2").css("display","");}else{if(term && _tabObj["goodsEvtTab_5"].hasOwnProperty("termDesc")){let lawCn = _tabObj["goodsEvtTab_5"].termDesc ? changeEnterToBr(_tabObj["goodsEvtTab_5"].termDesc) : "약관정보가 존재하지 않습니다.";lawCn = ConvertSystemSourcetoHtml(lawCn);lawCn = new DOMParser().parseFromString(lawCn, 'text/html');lawCn = $(lawCn).children().html().replaceAll(""," ");termDesc = changeEnterToBr(lawCn); $(".cont-box.term .term3").css("display","");}}$(".cont-box.term .termDesc").html(termDesc);}//END 탭5--------------------------------------------------------------------------------------------------------//START 탭6--------------------------------------------------------------------------------------------------------else if("goodsEvtTab_6" == tabId){ // 해외안전정보 데이터 없을때 - 숨기기 let overseaSaftyInfo = _tabObj["goodsEvtTab_6"]["response"]; if(!overseaSaftyInfo || overseaSaftyInfo.body.totalCount == 0){ // 데이터 해당없음 // 안보여주기 display none $(".overseas-safty").hide(); } else { let overseaSaftyInfoList = overseaSaftyInfo.body.items.item; let overseaSaftyInfoLength = overseaSaftyInfo.body.items.item.length; let overseasTab = $(".overseas-safty").find(".tab-default"); let overseasContainer = $(".overseas-safty").find(".tab-container"); if(overseaSaftyInfoList && overseaSaftyInfoLength == undefined){ // a태그 생성 let aTag = document.createElement('a'); aTag.setAttribute("href", "#" + overseaSaftyInfoList.isoCode); aTag.text = overseaSaftyInfoList.countryName; aTag.setAttribute("class", "selected"); overseasTab.append(aTag); overseasTab.css("justify-content","left"); // div tab-cont 생성 let cTag = document.createElement('div'); cTag.setAttribute("class", "tab-cont active"); cTag.setAttribute("id", overseaSaftyInfoList.isoCode); overseasContainer.append(cTag); // 테이블 생성 let attention = overseaSaftyInfoList.attention || overseaSaftyInfoList.attentionPartial || '여행유의'; let control = overseaSaftyInfoList.control || overseaSaftyInfoList.controlPartial || '여행자제'; let limita = overseaSaftyInfoList.limita || overseaSaftyInfoList.limitaPartial || '철수권고'; let countryName = overseaSaftyInfoList.countryName; let attentionNote = overseaSaftyInfoList.attentionNote || '-'; let controlNote = overseaSaftyInfoList.controlNote || '-'; let limitaNote = overseaSaftyInfoList.limitaNote || '-'; let saftyTableHtml = `
여행경보 단계 | 여행지(국가 또는 지역) |
---|---|
남색 경보${attention} | ${attentionNote} |
황색 경보${control} | ${controlNote} |
적색 경보${limita} | ${limitaNote} |
`; // id 같은 컨테이너 안에 넣기 overseasContainer.find("#" + overseaSaftyInfoList.isoCode).append(saftyTableHtml); } else { overseaSaftyInfoList.map(function (o, i) { // a태그 생성 let aTag = document.createElement('a'); aTag.setAttribute("href", "#" + o.isoCode); aTag.text = o.countryName; if (i == 0) aTag.setAttribute("class", "selected"); overseasTab.append(aTag); // div tab-cont 생성 let cTag = document.createElement('div'); if (i == 0) cTag.setAttribute("class", "tab-cont active"); else cTag.setAttribute("class", "tab-cont"); cTag.setAttribute("id", o.isoCode); overseasContainer.append(cTag); // 테이블 생성 let attention = o.attention || o.attentionPartial || '여행유의'; let control = o.control || o.controlPartial || '여행자제'; let limita = o.limita || o.limitaPartial || '철수권고'; let countryName = o.countryName; let attentionNote = o.attentionNote || '-'; let controlNote = o.controlNote || '-'; let limitaNote = o.limitaNote || '-'; let saftyTableHtml = `
여행경보 단계 | 여행지(국가 또는 지역) |
---|---|
남색 경보${attention} | ${attentionNote} |
황색 경보${control} | ${controlNote} |
적색 경보${limita} | ${limitaNote} |
`; // id 같은 컨테이너 안에 넣기 overseasContainer.find("#" + o.isoCode).append(saftyTableHtml); }); overseasTab.css("justify-content","left"); } }}//END 탭6--------------------------------------------------------------------------------------------------------//START 탭7--------------------------------------------------------------------------------------------------------else if("goodsEvtTab_7" == tabId){if(tabEl.find(".etcTour").children().length>0){return false;}else{//선택관광let etcTour = _tabObj["goodsEvtTab_7"]["etcTour"];if(etcTour && etcTour.length > 0){$(".item-box.column.etcTourMain").css("display","");let choiceTourDetail;$.each(etcTour,function(subIdx , subObj){choiceTourDetail = $("#hiddenSchedule_tour_img_1").find(".time-info.box").children().clone();choiceTourDetail.attr("typeId",subObj.typeId);//타이틀let title = subObj.nameKo?subObj.nameKo:"";choiceTourDetail.find(".info-header>.tit>strong").html(title);//약식설명let descriptionShort = subObj.descriptionShort?subObj.descriptionShort:"";choiceTourDetail.find(".info-header>.txt").html(descriptionShort);//선택관광 라벨let scheduleYn = subObj.scheduleYn;choiceTourDetail.find(".info-header>.tit>.label-state.in.select").css("display","");/*if(scheduleYn=="Y"){choiceTourDetail.find(".info-header>.tit>.label-state.in.select").css("display","");}else{choiceTourDetail.find(".info-header>.tit>.label-state.in.select").css("display","none");}*///특별포함 라벨let confirmed = subObj.confirmed;if(confirmed=="1"){choiceTourDetail.find(".info-header>.tit>.label-state.special").css("display","");}else{choiceTourDetail.find(".info-header>.tit>.label-state.special").css("display","none");}//이미지let img = subObj.img ? subObj.img.split("|") : [];if(subObj.img){$.each(img,function(idx,obj){if(idx == 0){$(choiceTourDetail.find(".photo").get(idx)).css("background-image","url('"+obj+"')");}else{return false;}});}else{choiceTourDetail.find(".photo").css("background-image","url('../../resources/images/noimage.png')");}//요금let adultPrice = subObj.adultPrice ? subObj.adultPrice : "0";let childPrice = subObj.childPrice ? subObj.childPrice : "0";let infantPrice = subObj.infantPrice ? subObj.infantPrice : "0";let currency = subObj.currency ? subObj.currency : "";choiceTourDetail.find("dd[id='_tourPay']").html("성인 : "+comma(adultPrice)+currency+" / "+" 아동 : "+comma(childPrice)+currency+" / 유아 : "+comma(infantPrice)+currency);//소요시간let timeRequired = subObj.timeRequired ? subObj.timeRequired : "";choiceTourDetail.find("dd[id='_tourTime']").html(timeRequired);//대체일정let otherSchedule = subObj.otherSchedule ? subObj.otherSchedule : "";choiceTourDetail.find("dd[id='_tourDay']").html(otherSchedule);choiceTourDetail.find("button").attr("typeDay",subObj.day);choiceTourDetail.find("button").attr("typeId",subObj.typeId);choiceTourDetail.find("button").attr("etcTourId",subObj.tourId);tabEl.find(".etcTour").append(choiceTourDetail);});}else{$(".item-box.column.etcTourMain").css("display","none");}//쇼핑정보let type8_data = _tabObj["goodsEvtTab_7"]["evtType"];if(type8_data.length > 0){$(".shoppingMain").css("display","");let typeTag = tabEl.find(".shopping-plan");let etcData = type8_data.length > 0 ? type8_data[0]["etc"] : "";if(etcData && etcData.hasOwnProperty("shopping_list")){let etcHdStr = "총"+etcData["shopping_list"].length+" 건 일정이 있습니다.";typeTag.find(".txt-info").html(etcHdStr);typeTag.find(".shopping-body").children().remove();$.each(etcData["shopping_list"],function(idx,obj){typeTag.find(".shopping-body").append(`
${idx+1}
${obj.item}
${obj.location}
${obj.time}
${obj.cancel}
`)});}else{}}else{$(".shoppingMain").css("display","none");}}//여행자보험let insurance = _tabObj["goodsEvtTab_7"]["insurance"] ? Object.values(_tabObj["goodsEvtTab_7"]["insurance"])[0] : '';if(insurance != ''){ // 여행자 보험 데이터가 있을때 tabEl.find(".insurance .dtl-btn").show(); tabEl.find(".insurance .dtl-view").css("display","flex"); tabEl.find(".insurance .dtl-view").css("justify-content","flex-start"); tabEl.find(".insurance .dtl-view .cont").css("margin-right","auto"); tabEl.find(".insurance .dtl-view .cont").text("보장내역은 자세히보기를 통하여 확인하실 수 있습니다."); }else { // 여행자 보험 데이터 없을때 tabEl.find(".insurance .dtl-btn").hide(); tabEl.find(".insurance .dtl-view .cont").text("보험관련 내용은 고객센터에 문의 바랍니다."); }let resultHTML = ConvertSystemSourcetoHtml(insurance);$('#popup-df-insurance .insurance-area').html(resultHTML);}//END 탭7--------------------------------------------------------------------------------------------------------//START 탭8-------------------------------------------------------------------------------------------------------- else if("goodsEvtTab_8" === tabId){ const feedbacks = _tabObj["goodsEvtTab_8"]; // 후기 const review = feedbacks.review; displayFeedbacks(feedbacks.review, feedbackType.REVIEW); displayFeedbacks(feedbacks.evaluation, feedbackType.EVALUATION); displayFeedbacks(feedbacks.compliment, feedbackType.COMPLIMENT); }//END 탭8--------------------------------------------------------------------------------------------------------}}function fnCkeckTabSelectYN(tabId){ let check = false; let dataTabArray = []; tabId.map((v,i)=>{ if(_tabArray.findIndex(o=>o==v) == -1 )dataTabArray.push(v); }); if(dataTabArray.length > 0) check = true; return check; } /* 쿠폰 script */ function downloadCoupon(couponId) { const url = '/coupon/' + couponId + '/download?tourCode=' + $("#tourCode").val(); $.ajax({ url: url, type: 'POST', success: (response) => { const statusCode = response.statusCode; const msg = response.responseMsg; const data = response.data; if(statusCode !== 200){ if(statusCode === 401) fnloginChk(); else onShowToast(msg); } else onShowToast(msg); } }) } function fnloginChk(){ // 세션체크 if (_Utils.fnIsEmpty('')) { // 로그인 안되어있을때 _Popup.openPopupAsync({ isCancel: true, message: '로그인이 필요한 서비스입니다.\n로그인 페이지로 이동하시겠습니까?' }, function () { onChangeLoding(); location.href = '/member/login'; }); return false; } else if( '' == '') { // 회원이 아닐 때 onShowToast('회원가입한 회원만 쿠폰 사용 가능합니다.'); return false; } else { // 로그인 상태 && 회원일때 // 중복체크 return true; } } // 안내사항 클릭시 예약 안내사항, 약관 정보, 해외안전정보 가져오기 function getEtcInfos(){ let tabs = ['goodsEvtTab_3','goodsEvtTab_5','goodsEvtTab_6'] let dataTabArray = []; tabs.map((v,i)=>{ if(_tabArray.findIndex(o => o === v) === -1 )dataTabArray.push(v); }); return dataTabArray; } // 후기 목록 그리기 function makeReviewList(list) { let listText = ``; list.map(obj => { let reprsntImgPath = obj.reprsntImgPath; if (reprsntImgPath != null && reprsntImgPath.indexOf('imagecontentfile') > -1) { reprsntImgPath = 'https://img-kyowontour.kyowontour.com/erp' + reprsntImgPath; } listText += `