// odaeri1911/js1911/inquiry.js
///////////////////////////////////////////////////////////////////////////////
//////////////// POI 키입력 대응 루틴...
$(document).on("keyup", "#POISearchInput", function (e) {
var keyCode = e.keyCode || e.which;
if (e.keyCode == 13) {
console.log("Enter pressed!!");
e.preventDefault();
$(this).blur();
}
//console.log("키 입력 감지.....");
// destGeoId , destPointId 리셋...
//$("#destGeoId").val( '' );
//$("#destPointId").val( '' );
// 항목 입력값이 한글 1.5자 이상일 때 부터 트리거... "길3"
if ($(this).val().length >= 2) {
// delay .... 모든 keyUp 에 대응하지 않도록 딜레이를 걸어준다. 0.6sec
delay(function () {
searchInputVal = $("#POISearchInput").val();
var serverActionUrl =
"/ajax1911/POIv5.php?POISearchInput=" + searchInputVal + "&callback=?";
var serverActionUrl = $("#autoSuggestKeywordForm").attr("action");
$("#autoSuggestKeywordFormInput").val(searchInputVal);
var formStr = $("#autoSuggestKeywordForm").serialize() + "&callback=?";
//console.log("serverActionUrl: "+serverActionUrl );
$.getJSON(serverActionUrl, formStr, function (jsonObj) {
$(".destinationFullAddressText").html("").slideUp();
if (typeof jsonObj === "object" && jsonObj.JSON != null) {
// POISuggestions 목록을 구성해주는 펑션
makePOISuggestions(jsonObj.JSON);
} else {
// POI 결과가 없을 때.. 펑션
failedAutoSuggestList();
}
});
}, 500);
} else {
// 검색어 길이가 1.5자 미만일 때.. 검색결과 디비전을 초기화한다.
resetAutoSuggestList();
}
});
//// #popupDivisionInquiryHistorySpan 클릭 대응
$(document).on("click", "#popupDivisionInquiryHistorySpan", function () {
$.getJSON("/ajax1911/pastPOIs.php?callback=?", function (jsonObj) {
$(".destinationFullAddressText").html("").slideUp();
if (typeof jsonObj === "object" && jsonObj.JSON != null) {
// POISuggestions 목록을 구성해주는 펑션
makePOISuggestions(jsonObj.JSON);
} else {
// POI 결과가 없을 때.. 펑션
failedAutoSuggestList();
}
});
});
/*/////////////////////////////////////////////////////////////////////////////
POISuggestionsListDiv 목록 클릭시....
1. 선택 지명/주소/도로 항목 값을 메인 폼인 #inquireChargeForm 의 input 필드값으로 인스턴스 해준다.
2. 서버에 주소를 쿼리해서 좌표값을 받아온다.
$.getJSON( "/ajax/destPointSelectAction2.php?"+paramStr+"&callback=?", function(jsonObj) {} );
3. 팝업 창을 닫고, 획득한 좌표값으로 initTmap() 해준다.
*/
$(document).on("click", ".POISuggestionsListDiv", function () {
// 파라메터로 전달하는 $("#autoSuggestResultUl > li") 를 셀렉트상태로 처리하는 일련의 Ajax 프로세스...
// console.log("POISuggestionsListDiv @ 2506 클릭...");
var $selectedPOI = $(this);
makeSelectAutoSuggestResultLi($selectedPOI);
// console.log("#deptPointId value : " + $("#deptPointId").val());
});
/*/////////////////////////////////////////////////////////////////////////////
//////// POI 서제스쳔 리스트를 구성해준다. */
function makePOISuggestions(obj) {
// console.log("makePOISuggestions 펑션 액션!!");
//console.log(obj);
$("#POISuggestionsFrameDiv").children().not("div:first").remove();
$(obj).each(function (ind, ea) {
//console.log("POISuggestionDoroAddr" + ea.addressDoro );
var $addedClone = $("#POISuggestionsListPrototype")
.clone()
.attr("id", "")
.removeClass("display-none")
.appendTo("#POISuggestionsFrameDiv");
$addedClone.find(".POISuggestionName").text(ea.pointName);
$addedClone.find(".POISuggestionAddress").text(ea.addressBunji);
$addedClone.find(".POISuggestionDoroAddr").text(ea.addressDoro);
});
$("#POISuggestionsFrameDiv").slideDown("slow");
$(".POIInputBoxFooterAnnotation").addClass("display-none");
$("#POIInputBoxFooterAnnotation2").removeClass("display-none");
}
// POI 획득에 실패한 경우..
function failedAutoSuggestList() {
$(".POIInputBoxFooterAnnotation").addClass("display-none");
$("#POIInputBoxFooterAnnotation3").removeClass("display-none");
}
// POI 결과 리스트를 초기화한다.
function resetAutoSuggestList() {
$("#POISuggestionsFrameDiv").children().not("div:first").remove();
//$("#POISuggestionsFrameDiv").slideUp('fast');
$(".POIInputBoxFooterAnnotation").addClass("display-none");
$("#POIInputBoxFooterAnnotation1").removeClass("display-none");
}
// 서버의 destPointSelectAction2.php 에 요청을 전달하고, drivePoint 처리를 수행한다.
// 처리결과 drivePointId 를 포함한 JSON 을 받아와 스턴스한다.
function destPointSelectAction2(
selectedPOIName,
selectedPOIAddress,
selectedPOIDoroAddr
) {
// 인콰이어리 프로시드 리셋..
var paramStr =
"addressBunji=" +
selectedPOIAddress +
"&addressDoro=" +
selectedPOIDoroAddr +
"&pointName=" +
selectedPOIName;
//console.log("파라메터 paramStr : " + paramStr);
// console.log("destPointSelectAction2 들어왔다....");
// console.log("/api2506/destPointSelectAction2506.php?" + paramStr);
paramStr = encodeURI(paramStr);
$.getJSON(
"/api2506/destPointSelectAction2506.php?" + paramStr + "&callback=?",
function (jsonObj) {
// console.log("destPointSelectAction2506 선택 클릭 액션!!!");
// console.log("/api2506/destPointSelectAction2506.php?" + paramStr);
// console.log(jsonObj);
// 출발위치 항목 업데이트..
if (typeof jsonObj === "object" && jsonObj != null) {
//console.log("instanting geoId value: " + jsonObj.geoId);
//console.log("여기 두번 오나??????");
if (POITriggered == "deptInputTrigger") {
//console.log("#setOrderMapFrameDiv.children : " + $("#setOrderMapFrameDiv").children().length);
//console.log("#setOrderMapFrameDiv.css : " + $("#setOrderMapFrameDiv").css("display") );
// DeptPointPOI 에 기존 밸류가 있으면 리셋
if ($("#setOrderMapFrameDiv").css("display") == "block") {
//console.log(" 인콰이어리 프로시드 롤백......... ");
rollBackInquiry("dept");
}
// 폼 엘리먼트 밸류 인스턴스
$("#deptGeoId").val(jsonObj.geoId);
$("#deptPointId").val(jsonObj.pointId);
$("#deptFullAddr").val(selectedPOIAddress);
$("#deptCoord4326X").val(jsonObj.coordX);
$("#deptCoord4326Y").val(jsonObj.coordY);
// 출력요소 항목값 인스턴스
$("#DeptPointPOISelectedDiv")
.find(".POIListPOIName")
.text(selectedPOIName);
$("#DeptPointPOISelectedDiv")
.find(".POIListPOIAddr")
.text(selectedPOIAddress);
$("#DeptPointPOISelectedDiv")
.find(".POIListPOIDoro")
.text(selectedPOIDoroAddr);
$(".deptInputTrigger")
.find(".inputTriggerSucceedSpan")
.text(selectedPOIName);
$(".deptInputTrigger")
.find(".inputTriggerBlankSpan")
.addClass("display-none");
$(".deptInputTrigger")
.find(".inputTriggerSucceedSpan")
.removeClass("display-none");
// 팝업을 닫는다.
//$("#POIInputBox").slideUp();
modalPopupPOISelector("off");
$("#setOrderMapFrameDiv").slideDown();
$("#DeptPointPOISelectedDiv").slideDown("slow");
// 화면전환의 극적 효과를 위해 셋타임아웃을 걸어준다.
setTimeout(function () {
// 2019-11-12 13:01:57
// $('#setOrderMapDiv') 를 깨끗이 비우고 맵을 새로 생성함..
// 멥 객체: naverDefaultMap
moveNaverMapCenter(naverDefaultMap, jsonObj.coordX, jsonObj.coordY);
setNaverMapMarker(naverDefaultMap, jsonObj.coordX, jsonObj.coordY);
selectedCoordArr = {
coordX: jsonObj.coordX,
coordY: jsonObj.coordY,
};
//setTimeout( function() {
window.dispatchEvent(new Event("resize"));
//}, 500);
// console.log(
// "selectedCoordArr : " +
// selectedCoordArr.coordX +
// " -- " +
// selectedCoordArr.coordY
// );
}, 700);
}
// 도착지 항목 업데이트...
else if (POITriggered == "destInputTrigger") {
// DeptPointPOI 에 기존 밸류가 있으면 리셋
if ($("#DestPointPOISelectedDiv").children().length > 0)
rollBackInquiry("dest");
// 폼 엘리먼트 밸류 인스턴스
$("#destGeoId").val(jsonObj.geoId);
$("#destPointId").val(jsonObj.pointId);
$("#destPointName").val(selectedPOIName);
$("#destFullAddr").val(selectedPOIAddress);
// 출력요소 항목값 인스턴스
$("#DestPointPOISelectedDiv")
.find(".POIListPOIName")
.text(selectedPOIName);
$("#DestPointPOISelectedDiv")
.find(".POIListPOIAddr")
.text(selectedPOIAddress);
$("#DestPointPOISelectedDiv")
.find(".POIListPOIDoro")
.text(selectedPOIDoroAddr);
$(".destInputTrigger")
.find(".inputTriggerSucceedSpan")
.text(selectedPOIName);
$(".destInputTrigger")
.find(".inputTriggerBlankSpan")
.addClass("display-none");
$(".destInputTrigger")
.find(".inputTriggerSucceedSpan")
.removeClass("display-none");
// 팝업을 닫는다.
//$("#POIInputBox").slideUp();
modalPopupPOISelector("off");
$("#DestPointPOISelectedDiv").slideDown("slow");
$("#inquiryFailedProcessAlertBox").slideUp();
}
$("#inquiryFailedProcessAlertBox").slideUp();
}
}
);
}
/*/////////////////////////////////////////////////////////////////////////////
//////// POI 서제스쳔 리스트 클릭 대응 펑션
// 파라메터로 전달하는 $("#autoSuggestResultUl > li") 를 셀렉트상태로 처리하는 일련의 Ajax 프로세스...
// var $selectedPOI = $("#autoSuggestResultUl > li"); */
function makeSelectAutoSuggestResultLi($selectedPOI) {
// jQuery 오브젝트를 파라메터로 전달해준다.
// 클릭 시점의 유저인풋 스트링을 보관해둔다.
var userInputStringFinal = $("#pointNameSearchInput").val();
var selectedPOIHtml = $selectedPOI.html();
var selectedPOIName = $selectedPOI.find(".POISuggestionName").text();
var selectedPOIAddress = $selectedPOI.find(".POISuggestionAddress").text();
var selectedPOIDoroAddr = $selectedPOI.find(".POISuggestionDoroAddr").text();
//console.log( "selectedPOIHtml 내용 : " +selectedPOIHtml );
/* 2018-03-15오후 1:38 ver.5 */
/* 2019-11-11 18:32:46 */
// console.log("selectedPOIName", selectedPOIName);
// console.log("selectedPOIAddress", selectedPOIAddress);
if (selectedPOIAddress) {
destPointSelectAction2(
selectedPOIName,
selectedPOIAddress,
selectedPOIDoroAddr
);
} else {
$("#pointNameSearchInput").removeClass("approvedPointInput");
}
}
/*/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////*/
//////// Naver Map 처리 펑션들...
// 디폴트 맵...
function initNaverDefaultMap(coordX, coordY, mapDiv) {
// 불필요한 서버쿼리 카운트를 줄이기 위해, 맵 오브젝트가 이미 생성된 상태인지를 체크해야한다.
console.log("typeof naverDefaultMap.... " + typeof naverDefaultMap);
if (typeof naverDefaultMap == "undefined") {
console.log("디폴트 맵을 생성한다.");
naverDefaultMap = new naver.maps.Map(mapDiv, {
center: new naver.maps.LatLng(coordY, coordX),
zoom: 15,
});
naverMapShutOptions(naverDefaultMap);
//naverDefaultMap.panBy(new naver.maps.Point(-100, 10)); // 오른쪽 아래로 10 픽셀 이동
//$("#setOrderMapDiv > div").css("left","100px");
}
// 맵 오브젝트가 존재하면 setCenter() 로 할 일 변경
else {
console.log("디폴트 맵이 존재한다.");
moveNaverMapCenter(naverDefaultMap, coordX, coordY);
}
}
// 맵 지저분한 옵션 모두 끄기
function naverMapShutOptions(naverMapObject) {
//setOptions 메서드를 이용해 옵션을 조정할 수도 있습니다.
naverMapObject.setOptions({
//지도 인터랙션 끄기
draggable: true,
pinchZoom: false,
scrollWheel: false,
keyboardShortcuts: false,
disableDoubleTapZoom: true,
disableDoubleClickZoom: true,
disableTwoFingerTapZoom: true, //모든 지도 컨트롤 숨기기
mapTypeControl: false,
scaleControl: false,
logoControl: false,
mapDataControl: false,
zoomControl: false,
mapTypeControl: false,
});
}
// 맵 인터랙티브 옵션 켜주기 - 드래그, 클릭, 줌 허용
function naverMapEnableOptions(naverMapObject) {
naverAdjustorMap.setOptions({
//지도 인터랙션 켜기
draggable: true,
pinchZoom: true,
scrollWheel: true,
keyboardShortcuts: true,
disableDoubleTapZoom: false,
disableDoubleClickZoom: false,
disableTwoFingerTapZoom: false, //모든 지도 컨트롤 숨기기
mapTypeControl: false,
scaleControl: false,
logoControl: false,
mapDataControl: false,
zoomControl: false,
mapTypeControl: false,
});
}
//// 어저스터 맵 initialize...
// moveNaverMapCenter( naverDefaultMap, coordX, coordY );
let coordArr = "";
function initNaverAdjustorMap(coordX, coordY, mapDiv) {
var adjustorMapObj = document.getElementById(mapDiv);
console.log("adjustorMapObj : " + adjustorMapObj);
// 불필요한 서버쿼리 카운트를 줄이기 위해, 맵 오브젝트가 이미 생성된 상태인지를 체크해야한다.
if (adjustorMapObj.childNodes.length == 0) {
console.log(
"어저스터맵이 존재하지 않아 새로 생성한다." + coordY + "..." + coordX
);
var position = new naver.maps.LatLng(coordY, coordX);
naverAdjustorMap = new naver.maps.Map(mapDiv, {
center: position,
zoom: 16,
});
naverMapEnableOptions(naverAdjustorMap);
//$("#setOrderMapDiv > div").css("left","100px");
var marker = new naver.maps.Marker({
position: position,
map: naverAdjustorMap,
});
// 어저스터맵 init 시에, 중심좌표값을 확보, 인스턴스 해두어야 한다.
coordArr = { x: coordX, y: coordY };
adjustorMapGeoCoderJSON(coordArr);
// 어저스터 맵 내에서의 클릭 - 마커 추가 액션 대응...
naver.maps.Event.addListener(naverAdjustorMap, "click", function (e) {
marker.setPosition(e.coord);
//console.log("e.coord : " + e.coord);
$("#MapAdjustorPopupFooterMarkerAddress > p").text(e.coord);
adjustorMapGeoCoderJSON(e.coord);
});
}
// 맵 오브젝트가 존재하면 setCenter() 로 할 일 변경
else {
// 어저스터맵 init 시에, 중심좌표값을 확보, 인스턴스 해두어야 한다.
coordArr = { x: coordX, y: coordY };
moveNaverMapCenter(naverAdjustorMap, coordX, coordY);
setNaverMapMarker(naverAdjustorMap, coordX, coordY);
adjustorMapGeoCoderJSON(coordArr);
console.log("어저스터맵이 존재한다.");
//moveNaverMapCenter( naverAdjustorMap, coordX, coordY );
}
window.dispatchEvent(new Event("resize"));
}
// 서버의 지오코더 호출 .. #adjustorMap 의 지도지점 클릭에 대응하는 전용 펑션
function adjustorMapGeoCoderJSON(coordArr) {
//console.log("coordArr : "+coordArr);
$.getJSON(
"/ajax1911/geoCoder.php?x=" +
coordArr.x +
"&y=" +
coordArr.y +
"&callback=?",
function (data) {
console.log(data);
$("#adjustorMapMarkedCoordX").text(coordArr.x);
$("#adjustorMapMarkedCoordY").text(coordArr.y);
$("#adjustorMapMarkedPointName").text(data.buildingName);
$("#adjustorMapMarkedAddress").text(data.fullAddr);
$("#adjustorMapMarkedDoroAddr").text(data.addressDoro);
}
);
}
// 네이버 지도 객체를 지정위치 중심으로 이동시킨다.
function moveNaverMapCenter(mapObj, coordX, coordY) {
var nowLoc = naver.maps.LatLng(coordY, coordX);
mapObj.setCenter(nowLoc);
}
// 네이버 지도 객체에 마커를 추가해준다. 좌표 필요..
function setNaverMapMarker(mapObj, coordX, coordY) {
// DOM 에 marker 가 존재하는지 확인.. 없으면 생성
if (typeof marker == "undefined") {
marker = new naver.maps.Marker({
position: new naver.maps.LatLng(coordY, coordX),
map: mapObj,
});
}
// 존재하면 위치변경
else {
var position = new naver.maps.LatLng(coordY, coordX);
marker.setPosition(position);
}
}
var searchInputVal;
var jsonSerialized;
var selectedCoordArr;
var naverDefaultMap;
var marker;
var callBackFunc;
var driveChargeRangeArray;
var driveChargeDefault;
var driveChargeMileageUsed;
var maxPrice, minPrice;
var chargeIndexDefault;
var finalCharge;
/* #locationRefresherBtn 클릭에 반응... POISearchInputMarkerIcon */
$(document).on(
"click",
"#locationRefreshBtn, #locationRefresherIcon, #POISearchInputMarkerIcon",
function () {
if (mobileCheck == false)
modalPopupWithIcon(
"on",
"warning",
"데스크탑 PC 에서는 단말기 위치가 정확하지 않을 수 있습니다."
);
// 모달 팝업...
modalPopupSpinner("on", "잠시 기다려주세요.");
// 지오코드 쿼리 결과 JSON 을 수신한 뒤 익스큐트되는 콜백펑션 지정..
geolocationCallBackFunc = "callToDestPointSelectAction";
geoActionGateWay();
//setNaverMapMarker( naverDefaultMap, coordX, coordY );
}
);
// 지오코드 쿼리 결과 JSON 을 수신한 뒤 익스큐트되는 콜백펑션 지정..
function callToDestPointSelectAction() {
// naverDefaultMap 의 중심좌표를 이동시켜준다.
destPointSelectAction2(locationPointName, locationFullAddr, locationDoroAddr);
// 모달 팝업...
modalPopupSpinner("off", "...");
/*
setTimeout(function () {
// 네이버맵의 왼쪽 치우침 문제... css 로 1픽셀 width 를 늘여줘보자.... 소용 없었음. 2019-11-29 20:04:46
let setOrderMapDivWidth = $("#setOrderMapDiv").css("width");
setOrderMapDivWidth = setOrderMapDivWidth.replace(/[^0-9]/g,"");
console.log("setOrderMapDivWidth : "+setOrderMapDivWidth);
$("#setOrderMapDiv").css("width", parseInt(setOrderMapDivWidth)+10 + "px");
},1000);
*/
}
$(document).ready(function () {
// 디폴트 setOrderMapDiv 로드
coordX = 127.0283303;
coordY = 37.2631736;
//initTmap( coordX, coordY, "setOrderMapDiv");
// #setOrderMapDiv DOM 이 존재할 때만 맵 init.
if (typeof setOrderMapDiv !== "undefined") {
initNaverDefaultMap(coordX, coordY, "setOrderMapDiv");
}
});
/******** 클릭 대응.. **********/
// 팝업 - 뒤로가기
$(document).on("click", ".popupDivisionBackDiv", function () {
//$(".popupDivisionWithBack").addClass("display-none");
//$(".popupDivisionWithBack").slideUp();
modalPopupPOISelector("off");
modalPopupMapAdjustor("off");
});
// #deptInputTrigger, #destInputTrigger 클릭 대응
var POITriggered = "";
$(document).on("click", "#deptInputTrigger, #destInputTrigger", function (e) {
if (!$(e.target).hasClass("icon")) {
// 이전 검색결과를 초기화 한다.
//console.log("인풋 트리거드 + " + $(".POIInputBox").css("display") );
resetAutoSuggestList();
//$(".POIInputBox").slideDown();
modalPopupPOISelector("on");
$("#POISearchInput").val("");
$("#POISearchInput").focus();
}
POITriggered = $(this).attr("id");
});
// 디폴트 맵에 클릭시, 팝업으로 #adjustorMapPopupDiv 를 띄워준다.
// 맵 init() 도 수행된다.
$(document).on("click", "#setOrderMapDiv", function () {
console.log("#setOrderMapDiv 클릭...");
//naverDefaultMap.setCenter( jeju );
//$("#MapAdjustorPopupDiv").slideDown('fast');
modalPopupMapAdjustor("on");
initNaverAdjustorMap(
selectedCoordArr.coordX,
selectedCoordArr.coordY,
"adjustorMapDiv"
);
POITriggered = "deptInputTrigger";
});
// 어저스터맵의 확인 버튼... #MapAdjustorPopupFooterButton 클릭 대응 펑션..
// 마커 클릭 이벤트가 존재하지 않을 때, 확인 버튼을 클릭하면 null 이 인스턴스되면서 심각한 오류가 발생한다.
// 맵 생성지 마커의 디폴트 좌표값을 확보해야 한다.
$(document).on("click", "#MapAdjustorPopupFooterButton", function () {
// naverDefaultMap 의 중심좌표를 이동시켜준다.
var coordX = $("#adjustorMapMarkedCoordX").text();
var coordY = $("#adjustorMapMarkedCoordY").text();
var pointName = $("#adjustorMapMarkedPointName").text();
var pointAddr = $("#adjustorMapMarkedAddress").text();
var pointDoro = $("#adjustorMapMarkedDoroAddr").text();
moveNaverMapCenter(naverDefaultMap, coordX, coordY);
setNaverMapMarker(naverDefaultMap, coordX, coordY);
// 서버에 DrivePoint 처리를 완료시키고 drivePointId 를 포함한 JSON 을 받아와 인스턴스...
destPointSelectAction2(pointName, pointAddr, pointDoro);
// 어저스터맵 팝업 닫기
//$("#MapAdjustorPopupDiv").slideUp();
modalPopupMapAdjustor("off");
});
// InquireChargeAction Button 클릭 대응
$(document).on("click", "#inquireChargeFormActionBtn", function (e) {
e.preventDefault();
// console.log("#inquireChargeFormActionBtn Action triggered!!!!");
// 필수항목들 점검
if (!$("#deptPointId").val() || !$("#destPointId").val())
reportError(3, "출발지와 도착지를 모두 선택해주세요.");
// quickOrder.html 에서, 출발지 번지수 없으면 alert...
if (window.location.pathname == "/order/quickOrder.html")
if (/\d/.test($("#deptFullAddr").val()) == false) {
modalPopupWithIcon(
"on",
"warning",
"오더 접수에는 번지수가 포함된 자세한 출발위치가 필요합니다."
);
return false;
}
var serialized = $("#inquireChargeForm").serialize();
var serverURL = "/api2506/driveChargeAction2506.php";
// 모달 팝업...
modalPopupSpinner("on", "서버에 데이터를 요청중입니다.", 5000);
// console.log(serverURL + "?" + serialized);
$.getJSON(serverURL + "?" + serialized + "&callback=?", function (jsonObj) {
// JSON 오브젝트의 유효성 검사..
if (jsonObj.actionResult == "OK") {
assignDriveChargeJSON(jsonObj); // JSON 데이터를 모두 인젝트
makeInquieryResultChart(jsonObj); // JSON 으로 차트를 구성.
makeCarousel(jsonObj); // JSON 으로 카루셀 구성.
genRandFAIcons(); // 카루셀.each 에 랜덤 아이콘
// 모달 팝업...
modalPopupSpinner("off", "...");
$("#inquireChargeFormActionBtnDiv").slideUp(400, function () {
$(
"#adjustOrderSection, #viewOrderSection, #inquiryChartSection, #inquiryAgainActionButtonDiv"
).slideDown();
});
} else if (jsonObj.actionResult == "Failed") {
// 모달 팝업...
modalPopupSpinner("off", "...");
$("#inquiryFailedProcessAlertBox").slideDown();
$(
"#adjustOrderSection, #viewOrderSection, #inquiryChartSection, #inquiryAgainActionButtonDiv"
).slideUp();
}
});
});
//// #inquireAgainBtn 버튼 클릭 대응...
//// inquiry 입력요소들을 모두 초기화한다.
$(document).on("click", "#inquireAgainBtn", function (e) {
e.preventDefault();
rollBackInquiry("dept");
rollBackInquiry("dest");
$(
"#adjustOrderSection, #viewOrderSection, #inquiryChartSection, #inquiryAgainActionButtonDiv"
).slideUp();
document.getElementById("socialTopTel").scrollIntoView();
});
//// #goToQuickOrderBtn 버튼 클릭대응...
$(document).on("click", "#goToQuickOrderBtn", function (e) {
e.preventDefault();
document.location.href = "/order/quickOrder.html";
});
//// 구간요금 JSON 의 항목 값들을 모든 데이터 요소들에 할당해준다.
function assignDriveChargeJSON(jsonObj) {
// 어저스트 허용 프라이스 어레이
//console.log("console.log : " +console.log);
//driveChargeRangeArray = jsonObj.priceRangeFullStr.split(":"); 오래전 인콰이어리의 이 스트링에 문제가 있다.
driveChargeRangeArray = [
jsonObj.priceRange0,
jsonObj.priceRange1,
jsonObj.priceRange2,
];
if (jsonObj.priceRange3) driveChargeRangeArray.push(jsonObj.priceRange3);
if (jsonObj.priceRange4) driveChargeRangeArray.push(jsonObj.priceRange4);
if (jsonObj.priceRange5) driveChargeRangeArray.push(jsonObj.priceRange5);
driveChargeDefault = jsonObj.defaultPrice;
driveChargeMileageUsed = driveChargeDefault;
chargeIndexDefault = parseInt(
findKey(driveChargeRangeArray, driveChargeDefault)
);
//console.log("driveChargeRangeArray......... : " +driveChargeRangeArray);
//console.log("driveChargeRangeArray[3]......... : " +driveChargeRangeArray[3]);
//console.log("driveChargeDefault......... : " +driveChargeDefault);
//console.log("chargeIndexDefault......... : " + chargeIndexDefault);
//console.log(" typeof driveChargeRangeArray[2] = " +typeof driveChargeRangeArray[2] );
//console.log(" typeof driveChargeDefault = " +typeof driveChargeDefault );
//console.log(" value driveChargeRangeArray[2] = '" + driveChargeRangeArray[2]+"'" );
//console.log(" value driveChargeDefault = '" + driveChargeDefault+"'" );
maxPrice = jsonObj.priceRangeFullStr.split(":").pop();
var weatherIcon = weatherStatusIcon(jsonObj.weatherStatus);
$(".driveDistance").text(jsonObj.driveDistance);
$(".driveTimeMin").text(jsonObj.driveTimeMin);
$(".driveChargeDefault").text(jsonObj.defaultPrice.format());
$(".driveChargeMin").text(jsonObj.priceRange0.format());
$(".driveChargeMax").text(maxPrice.format());
$(".localWeatherIcon").addClass(weatherIcon);
// form value assign.. defaultChargeValue
$("#driveDistance").val(jsonObj.driveDistance);
$("#priceRangeSerialized").val(jsonObj.priceRangeFullStr);
$("#defaultChargeValue").val(driveChargeDefault);
$("#selectedChargeValue").val(driveChargeDefault);
// 지역 페널티를 제외한 나머지 페널티..
let extraPenaltyRate =
jsonObj.extraChargeRate - jsonObj.deptPenalty - jsonObj.destPenalty;
// console.log("extraPenaltyRate : " + extraPenaltyRate);
// console.log("type of extraPenaltyRate : " + typeof extraPenaltyRate);
// console.log("jsonObj.weatherPenalty : " + jsonObj.weatherPenalty);
let weatherPenalty = parseFloat(jsonObj.weatherPenalty);
let seasonExtraAddedRate = parseFloat(jsonObj.seasonExtraAddedRate);
let deptPenalty = parseFloat(jsonObj.deptPenalty);
let destPenalty = parseFloat(jsonObj.destPenalty);
let adminOverridePenalty = parseFloat(jsonObj.adminOverridePenalty);
let coronaPenalty = parseFloat(jsonObj.coronaPenalty);
// 각종 페널티에 대응하는 유저 알림 CSS 추가/제거
if (
weatherPenalty > 0 ||
seasonExtraAddedRate > 0 ||
deptPenalty >= 0.8 ||
destPenalty >= 0.6 ||
adminOverridePenalty > 0 ||
coronaPenalty > 0
) {
// 엑스트라 페널티 활성상태이면 디폴트 디스플레이 변경
if (jsonObj.extraChargeRate >= 0.9) {
// 디폴트 OrderProcessAlertBox 제거
$(".viewOrderProcessAlertBox").addClass("display-none");
// 페널티 OrderProcessAlertBox 표시
$("#extraAddedProcessAlertBox").removeClass("display-none").slideDown();
// 코로나19 예외상황 알림은 모든 redAlert 상황에서 on 해주자.
//$(".coronaPenaltySpan ").removeClass("display-none");
}
// weatherPenalty 가 0 보다 크면, 아이콘 블링킹 & && jsonObj.extraPenaltyRate > 0.4
if (weatherPenalty > 0) {
$(".localWeatherIcon").addClass("blinking");
$(".weatherStatusPenaltySpan ").removeClass("display-none");
}
// SeasonsExtra... 아이콘 블링킹 & upperPriceCnt
// extraChargeRate - surplusDistanceRate - deptPenalty - destPenalty -
if (seasonExtraAddedRate > 0 && jsonObj.extraChargeRate >= 0.9) {
$(".seasonsExtraFaTree").remove();
$("#weatherSeasonIconsDivSpan").append(
""
);
$(".seasonsPenaltySpan ").removeClass("display-none");
}
// deptPenaltySpan Penalty 대응
if (deptPenalty >= 0.8 && jsonObj.extraChargeRate >= 0.9) {
$(".deptPenaltySpan ").removeClass("display-none");
}
// destPenaltySpan Penalty 대응
if (destPenalty >= 0.6 && jsonObj.extraChargeRate >= 0.9) {
$(".destPenaltySpan ").removeClass("display-none");
}
// AdminOverride Penalty 대응
if (adminOverridePenalty > 0 && jsonObj.extraChargeRate >= 0.9) {
$(".adminOverridePenaltySpan ").removeClass("display-none");
let imbalancedBy = jsonObj.adminOverridePenaltyImbalancedBy;
$(".adminOverridePenaltyImbalancedBy").addClass("display-none");
$(".adminOverridePenaltySpan")
.children("." + imbalancedBy)
.removeClass("display-none");
}
// Corona Penalty 대응
if (coronaPenalty > 0 && jsonObj.extraChargeRate >= 0.9) {
$(".postCoronaPenaltySpan ").removeClass("display-none");
}
}
}
// 요금 통계 차트 Div 를 구성한다. easyPieChart
// 인수로 전달받는 jsonObj 는 서버 JSON 통째로 받는다.
function makeInquieryResultChart(obj) {
$(".deptAreaName").text(obj.areaNames.deptArea);
$(".destAreaName").text(" - " + obj.areaNames.destArea);
$(".driveChargeTotalCnt").text(obj.driveChargeSummary.driveChargeTotalCnt);
$(".minDriveDate").text(obj.driveChargeSummary.minDriveDate);
// 타겟 DOM : $("#inquieryResultChartDiv .chart")
// 소스 JSON: obj.driveChargeArr
// proto DOM : $("#inquieryResultChartProtoDiv")
// proto DOM 의 타겟 데이터 항목 : $(".chart").attr("data-percent"), $(".chart > span.percent").text()
// $(".chart").siblings(".easyPieChartPriceSpan").text()
// proto DOM 제외한 나머지 모두 제거
$("#inquieryResultChartDiv").children().not("div:first").remove();
let i = 0;
$(obj.driveChargeArr).each(function (ind, ea) {
// 5개 이상 차트는 노노
if (i > 4) {
return true;
}
// proto DOM 의 클론 생성 & append()
let $addedClone = $("#inquieryResultChartProtoDiv")
.clone()
.attr("id", "")
.removeClass("display-none")
.appendTo("#inquieryResultChartDiv");
$addedClone.attr("data-percent", ea.percent);
$addedClone.find(".percent").text(ea.percent);
$addedClone.find(".easyPieChartPriceSpan").text(ea.driveCharge.format());
// instantiate the plugin
$addedClone.easyPieChart({
size: 70,
barColor: "#ef1e25",
trackColor: "#FFDE66",
lineWidth: 16,
lineCap: "butt",
easing: "easeOutBounce",
onStep: function (from, to, percent) {
$(this.el).find(".percent").text(Math.round(percent));
},
});
i++;
});
}
//// weather Status 에 해당하는 아이콘 리턴 펑션...
// 영향없는 클래스 : sunny12, clear12, cloudy12, moreCloudy, rainyLittle12
// 영향을 주는 클래스 : rainy, hardRain, rainSnow, typhoon, snowy, hardSnow
function weatherStatusIcon(wStat) {
//wStat="rainy2";
var iconStr = "wi-night-clear";
if (wStat == "sunny1") iconStr = "wi-day-sunny";
else if (wStat == "sunny2") iconStr = "wi-night-clear";
else if (wStat == "clear1") iconStr = "wi-day-cloudy-high";
else if (wStat == "clear2") iconStr = "wi-night-cloudy-high";
else if (wStat == "cloudy1") iconStr = "wi-day-cloudy";
else if (wStat == "cloudy2") iconStr = "wi-night-cloudy";
else if (wStat == "moreCloudy1") iconStr = "wi-day-cloudy-gusts";
else if (wStat == "moreCloudy2") iconStr = "wi-night-cloudy-gusts";
else if (wStat == "rainyLittle1") iconStr = "wi-day-sleet";
else if (wStat == "rainyLittle2") iconStr = "wi-night-sleet";
//else if( wStat=="hardRain" ) iconStr= "wi-day-rain";
else if (wStat == "rainy") iconStr = "wi-night-rain";
else if (wStat == "hardRain") iconStr = "wi-night-rain";
else if (wStat == "rainSnow") iconStr = "wi-night-rain-wind";
else if (wStat == "typhoon") iconStr = "wi-thunderstorm";
else if (wStat == "snowy") iconStr = "wi-night-alt-snow";
else if (wStat == "hardSnow") iconStr = "wi-night-alt-snow";
return iconStr;
}
function reportError(code, msg) {
console.log("Error...." + code + msg);
}
//// 인콰이어리 프로세스를 롤백, 초기화한다.
function rollBackInquiry(deptDest) {
if (deptDest == "dept") {
// 폼요소, 출력요소 아이디 리셋
$(
"#deptGeoId, #deptPointId, #deptFullAddr, #deptCoord4326X, #deptCoord4326Y"
).val("");
$("#DeptPointPOISelectedDiv").find("span").text("");
// 출력요소 항목값 인스턴스
$(".deptInputTrigger").find(".inputTriggerSucceedSpan").text("");
$(".deptInputTrigger")
.find(".inputTriggerBlankSpan")
.removeClass("display-none");
$(".deptInputTrigger")
.find(".inputTriggerSucceedSpan")
.addClass("display-none");
// 맵을 닫는다.
$("#setOrderMapFrameDiv").slideUp();
$("#DeptPointPOISelectedDiv").slideUp();
} else if (deptDest == "dest") {
$("#destGeoId, #destPointId, #destPointName, #destFullAddr").val("");
// 출력요소 항목값 리셋
$("#DestPointPOISelectedDiv").find("span").text("");
// 출력요소 항목값 인스턴스
$(".destInputTrigger").find(".inputTriggerSucceedSpan").text("");
$(".destInputTrigger")
.find(".inputTriggerBlankSpan")
.removeClass("display-none");
$(".destInputTrigger")
.find(".inputTriggerSucceedSpan")
.addClass("display-none");
$("#DestPointPOISelectedDiv, .adjustOrderAlertBox").slideUp();
}
// 폼요소, 출력요소 클래스 리셋
$(
".driveDistance, .driveTimeMin, .driveChargeDefault, .driveChargeMin, .driveChargeMax "
).text("");
$(".localWeatherIcon").removeClass("weatherIcon blinking");
// viewOrder, adjustOrder Section slideUp()
$("#inquireChargeFormActionBtnDiv").slideDown(400, function () {
$(
"#adjustOrderSection, #viewOrderSection, #inquiryAgainActionButtonDiv"
).slideUp();
});
// .inquiryResultLiData 초기화
$(".inquiryResultLiData").not(".loggedMilage").text("0");
// thisInd 초기화
thisInd = undefined;
// Extra Charge Alert Box 리셋..
$(".viewOrderProcessAlertBox").removeClass("display-none");
$("#extraAddedProcessAlertBox").addClass("display-none");
$(
".weatherStatusPenaltySpan, .seasonsPenaltySpan, .deptPenaltySpan, .destPenaltySpan, .adminOverridePenaltySpan"
).addClass("display-none");
$(".seasonsExtraFaTree").remove();
}
/*// 요금수정 버튼 .adjustDriveChargeBtn 클릭에 대응....
+ - 클릭시...
먼저, driveChargeRangeArray 에서, driveChargeDefault 인덱스 chargeIndexDefault 위치를 찾아내고,
- "-" 클릭시, driveChargeRangeArray.indDefault-1 의 유효값을 확인한다.
- 값이 유효하다면, updateSelectedCharge() 펑션 호출.. -- 끝
*/
var thisInd, targetInd;
$(document).on("click", ".adjustDriveChargeBtn", function () {
console.log(
"adjustDriveChargeBtn 클릭... with chargeIndexDefault = " +
chargeIndexDefault
);
// driveChargeRangeArray 에서, driveChargeDefault 인덱스 chargeIndexDefault 찾기..
// chargeIndexDefault 는 JSON 수신 펑션에서 이미 할당되어 있다.
if (thisInd === undefined) thisInd = chargeIndexDefault;
if ($(this).hasClass("minus")) targetInd = thisInd - 1;
else if ($(this).hasClass("plus")) targetInd = thisInd + 1;
console.log("thisInd : " + thisInd);
console.log("targetInd : " + targetInd);
// "-" 클릭시, driveChargeRangeArray.indDefault-1 의 유효값을 확인한다.
// 범위를 벗어나면 에러 펑션...
if (targetInd < 0 || targetInd >= driveChargeRangeArray.length) {
console.log("limit exceeded!! : " + targetInd);
modalPopupWithIcon("on", "warning", "조정 범위를 초과하였습니다.");
return;
}
// - 값이 유효하다면, updateSelectedCharge() 펑션 호출..
else updateSelectedCharge();
// #driveChargeAmount 를 업데이트
updateChargeAmount();
// adjustOrderAlertBox slideDown...
if (finalCharge == driveChargeDefault) $(".adjustOrderAlertBox").slideUp();
else if (finalCharge > driveChargeDefault)
$("#adjustOrderPlusAlertBox").slideDown();
// 마이너스 옵션 클릭시... 2020-06-30 22:44:14
// 선택금액에 따라 주의안내 문구를 선택적으로 노출... 20k 이하는 .unacceptableMinus , 20k 초과는 .acceptableMinus
else if (finalCharge < driveChargeDefault) {
$("#adjustOrderMinusAlertBox .minusAlertSpan").addClass("display-none");
$("#adjustOrderMinusAlertBox").slideDown();
// 선택금액에 따라 알럿 텍스트 선택..
if (driveChargeRangeArray[targetInd] <= 20000)
$(".unacceptableMinus").removeClass("display-none");
else $(".acceptableMinus").removeClass("display-none");
}
});
function updateSelectedCharge() {
// 출력항목, 폼 일리먼트 업데이트
$(".selectedCharge").text(driveChargeRangeArray[targetInd]);
$(".selectedCharge").val(driveChargeRangeArray[targetInd]);
$("#selectedChargeValue").val(driveChargeRangeArray[targetInd]);
// Mileage Usage 용 변수 값 업데이트
driveChargeMileageUsed = driveChargeRangeArray[targetInd];
mileageUsageReset();
// 런타임 현재 thisInd 값을 업데이트...
thisInd = targetInd;
}
// #driveChargeAmount 를 업데이트
function updateChargeAmount() {
// 사용마일리지를 추가 제액 해줘야 한다.
finalCharge = parseInt(driveChargeRangeArray[thisInd]);
$("#driveChargeAmount").text(finalCharge);
}
// 마일리지 사용 버튼 만지작.. 을 모두 리셋한다.
// 마일리지 만지다가 대리비 만지는 경우 구동된다.
function mileageUsageReset() {
mileageUsageUnit = 10000;
mileageInVault = mileageInDB;
$("#milageToUse").text("0");
$("#milageToUseValue").val("0");
$("#driveChargeAmount").text(driveChargeDefault);
}
/*************************************************** 2020-06-21 17:01:50
* 마일리지 사용 버튼 .adjustMilageUseBtn 클릭 대응...
* 1만원단위로 업다운 해준다.
*/
// 서버에서 인증된 마일리지 어마운트 밸류
var driveChargeMileageUsed = driveChargeDefault;
// 마일리지 사용 유닛
var mileageUsageUnit = 10000;
var adjustUnit;
// console.log();
$(document).on("click", ".adjustMilageUseBtn", function () {
console.log("초기값 mileageInVault : " + mileageInVault);
// 마일리지 사용조건 불충족시 리턴
if ($(this).hasClass("disabledIcons")) return;
console.log("type of mileageInVault : " + mileageInVault);
console.log("driveChargeMileageUsed : " + driveChargeMileageUsed);
// 마일리지 사용 Plus 버튼 클릭
if ($(this).hasClass("plus")) {
// 마일리지 지갑 금액이 마일리지유닛 보다 같거나 클 때..
if (mileageInVault >= mileageUsageUnit) {
adjustUnit = mileageUsageUnit;
if (driveChargeMileageUsed < mileageUsageUnit)
adjustUnit = driveChargeMileageUsed;
console.log("adjustUnit : " + adjustUnit);
mileageInVault -= adjustUnit;
$("#milageToUse").text(mileageInDB - mileageInVault);
$("#milageToUseValue").val(mileageInDB - mileageInVault);
driveChargeMileageUsed -= adjustUnit;
$("#driveChargeAmount").text(driveChargeMileageUsed);
} else {
alert("마일리지 사용범위를 초과하였습니다.");
}
} else if ($(this).hasClass("minus")) {
if (mileageInDB > mileageUsageUnit) {
adjustUnit = mileageUsageUnit;
if (mileageInDB - mileageInVault < mileageUsageUnit)
adjustUnit = mileageInDB - mileageInVault;
mileageInVault += adjustUnit;
console.log("adjustUnit : " + adjustUnit);
console.log("mileageInVault : " + mileageInVault);
$("#milageToUse").text(mileageInDB - mileageInVault);
$("#milageToUseValue").val(mileageInDB - mileageInVault);
driveChargeMileageUsed += adjustUnit;
$("#driveChargeAmount").text(driveChargeMileageUsed);
} else {
alert("마일리지 사용범위를 초과하였습니다.");
}
}
console.log(
"type of mileageInVault : " + typeof mileageInVault + " - " + mileageInVault
);
});
/****** Session 인증 상수 ******/
var sessAuthStatus = "";
var sessUserHpNum = "";
var sessHpAuthId = "";
/****** 인증완료 세션일 경우, 인증완료 상태로 출력전환 ******/
$(document).ready(function () {
if (sessAuthStatus == "AUTHDONE" && sessUserHpNum) switchToAuthenticated();
});
var regExp = /^\d{3}-\d{3,4}-\d{4}$/;
function returnHPNumFormat(hpNum) {
if (hpNum.length > 3) {
hpNum = hpNum.replace(/[- ]/g, "");
//console.log("hpNum..."+hpNum);
//console.log("hpNum.replace(/[^0-9]/, '')..."+hpNum.replace(/[^0-9]/, ''));
if (hpNum !== hpNum.replace(/[^0-9]/, "")) return "Error";
if (hpNum.length > 7)
returnHpNum =
hpNum.substr(0, 3) + "-" + hpNum.substr(3, 4) + "-" + hpNum.substr(7);
else if (hpNum.length > 3)
returnHpNum = hpNum.substr(0, 3) + "-" + hpNum.substr(3, 4);
return returnHpNum;
}
}
/****** 휴대폰번호 키입력 대응.. 통일된 형식으로 실시간 바꿔주자. ******/
$(document).on("keyup", ".hpNumInputField ", function (e) {
let hpNumVal = $(this).val().toString();
if (hpNumVal.length <= 3) return;
let returnVal = returnHPNumFormat(hpNumVal);
//console.log("폰번호 키업 모니터링..."+returnVal);
if (returnVal == "Error") {
$(".processAlertBoxFrameDivHpNum .processAlertBox").css("display", "none");
$(".authenticationwrongProcessAlertBox").slideDown();
return;
} else {
$(".authenticationwrongProcessAlertBox").slideUp();
$(this).val(returnVal);
}
});
/****** 인증번호요청 버튼 #reqHpauthKeyBtn 클릭 대응 ******/
var hpNumVal;
$(document).on("click", ".hpAuthSetAuthKeyRequestBtn", function () {
hpNumVal = $(this)
.parent()
.siblings(".splitInputDiv")
.find("input")
.val()
.replace(/[^0-9]/g, "");
console.log("hpNumVal " + hpNumVal);
// 유효한 전화번호형식 검사
if (!validateHPNum(hpNumVal)) {
$(".processAlertBoxFrameDivEmail .processAlertBox").css("display", "none");
$(".authenticationwrongProcessAlertBox").slideDown();
return;
}
// .authTimerSpan 의 ID 가 여러개 생기는걸 방지함..
$(".authTimerSpan").attr("id", "");
//let $sucheDOM = $(this).parent().parent().siblings(".hpAuthSetSubmitFrameDiv");
console.log("$sucheDOM 접근중...");
//$sucheDOM.css("background", "red");
let $authKeyTimerDOM = $(this)
.parent()
.parent()
.siblings(".hpAuthSetSubmitFrameDiv")
.find(".authTimerSpan");
$authKeyTimerDOM.attr("id", "authTimerSpan");
$.getJSON(
"/ajax1911/authNumAction2.php?userHpNum=" + hpNumVal + "&callback=?",
function (jsonObj) {
// Server JSON 의 종류.. SENT WAITING SENDFAILED
if (jsonObj.authActionResult == "SENT") {
modalPopupWithIcon("on", "mobile", "인증번호가 발송되었습니다.");
$("#authTimerSpan").slideDown();
countdown("authTimerSpan", 3, 0);
} else if (jsonObj.authActionResult == "WAITING") {
modalPopupWithIcon(
"on",
"mobile",
"이미 인증번호가 발송되어 입력을 기다리고 있습니다."
);
} else if (jsonObj.authActionResult == "SENDFAILED") {
modalPopupWithIcon(
"on",
"warning",
"서버와 통신중 오류가 발생하였습니다. 잠시후 다시 시도해주세요."
);
} else if (jsonObj.authActionResult.indexOf("error") != -1) {
modalPopupWithIcon(
"on",
"warning",
"비인가 호출입니다. " + jsonObj.authActionResult
);
} else if (jsonObj.actionResult == "AuthFailed") {
modalPopupWithIcon(
"on",
"warning",
"권한오류가 발생했습니다. Error: " + jsonObj.ErrorCode
);
}
}
);
});
$(document).on("click", ".hpAuthSetAuthKeySubmitBtn", function () {
console.log("auth 제출...");
// 유효한 인증번호형식 검사
let authKey = $(this).parent().siblings(".splitInputDiv").find("input").val();
let actionerURI =
"/ajax1911/authNumAction2.php?userHpNum=" +
hpNumVal +
"&authKeyStr=" +
authKey +
"&callback=?";
// 2021-04-14 07:32:31
// 조건과 분기가 추가되었다.
// 로그인 사용자로부터 비밀번호 변경 요청이 있을 때...
$.getJSON(actionerURI, function (jsonObj) {
// Server JSON 의 종류.. AUTHFAILED AUTHDONE
// 인증 성공시...
if (jsonObj.authActionResult == "AUTHDONE") {
$("#hpAuthenticated, #setPWHpNumVerified").val(jsonObj.authAt);
// 인증이 완료되었다는 DOM 이 자동 슬라이드다눙/업 된다.
switchToAuthenticated();
} else if (jsonObj.authActionResult == "AUTHFAILED") {
modalPopupWithIcon(
"on",
"warning",
"인증에 실패했습니다. 인증번호를 확인해주세요"
);
} else if (jsonObj.actionResult == "AuthFailed") {
modalPopupWithIcon(
"on",
"warning",
"권한오류가 발생했습니다. Error: " + jsonObj.ErrorCode
);
} else {
modalPopupWithIcon(
"on",
"warning",
"오류가 발생했습니다. 인증을 다시 시도해주세요. " +
jsonObj.authActionResult
);
}
});
});
// HP 인증완료된 사용자에게 출력형식 스위칭 userHpNumVal
// splitInputDiv
function switchToAuthenticated() {
console.log("switchToAuthenticated...");
$(".hpAuthSetSubmitFrameDiv ").slideUp(function () {
$(".authenticationRequirededProcessAlertBox").slideUp();
$(".hpAuthSetRequestFrameDiv").find(".splitButtonDiv").slideUp();
$(".hpAuthSetRequestFrameDiv")
.find(".splitInputDiv")
.removeClass("splitLeft70")
.addClass("splitLeft90");
$(".authenticationSucceededProcessAlertBox").slideDown(function () {
setTimeout(function () {
$(".authenticationSucceededProcessAlertBox").slideUp();
}, 1500);
});
$("#userHpNum, #userHpNumVal, #signInInputHpNum, #setPWHpNum")
.val(hpNumVal)
.attr("readonly", true);
// 인증완료 세션이 유지되는 상황에서 리로드 되었을 때.. userHpNumVal
if (sessUserHpNum) {
$("#userHpNum").val(sessUserHpNum);
$("#userHpNumVal").val(sessUserHpNum);
}
// 비번찾기 모듈에서 .SetPWAppearAfterAuthDoneDiv 를 노출시켜야 할 일이 있다.
$(".SetPWAppearAfterAuthDoneDiv").slideDown();
});
}
// 인증 만료시간까지 카운트다운을 포시한다.
function countdown(elementName, minutes, seconds) {
var element, endTime, hours, mins, msLeft, time;
function twoDigits(n) {
return n <= 9 ? "0" + n : n;
}
function updateTimer() {
msLeft = endTime - +new Date();
if (msLeft < 1000) {
element.innerHTML = "countdown's over!";
} else {
time = new Date(msLeft);
hours = time.getUTCHours();
mins = time.getUTCMinutes();
element.innerHTML =
(hours ? hours + ":" + twoDigits(mins) : mins) +
":" +
twoDigits(time.getUTCSeconds());
setTimeout(updateTimer, time.getUTCMilliseconds() + 500);
}
}
element = document.getElementById(elementName);
endTime = +new Date() + 1000 * (60 * minutes + seconds) + 500;
updateTimer();
}
// 오더 최종 컨펌 버튼 클릭 대응...
$(document).on("click", "#orderConfirmSubmitBtn", function () {
// 필수 입력항목 중 누락 또는 규격이탈된 항목 검사...
let validateResult = chkValidateOrderConfirmElements();
if (!validateResult) return;
// 폼 serialize()
var inquirySerialized = $("#inquireChargeForm").serialize();
// 사용자 정보는 이미 서버사이드 인증이 완료된 상태이므로, 서버사이드 세션에서 가져온다.
// 여기선 사용자정보 전달이 이루어지지 않음.
// getJSON()
$.getJSON(
"/ajax1911/orderAction2.php?" + inquirySerialized + "&callback=?",
function (jsonObj) {
// return JSON : {"actionResult":"Duplicated","orderCode":"49248934C","validTillSec":1678})
// JSON.actionResult 의 종류 : Succeeded// Duplicated// AuthFailed// ActionFailed
if (jsonObj.actionResult == "Succeeded") {
modalPopupSpinner(
"on",
"서버에 요청을 처리중입니다. 잠시만 기다려주세요."
);
setTimeout(function () {
document.location.href =
"/order/orderDone.html?orderCode=" + jsonObj.orderCode;
}, 1000);
} else if (jsonObj.actionResult == "AuthFailed")
modalPopupWithIcon(
"on",
"warning",
"요청 권한이 없습니다. Error Code: " + jsonObj.ErrorCode
);
else if (jsonObj.actionResult == "ActionFailed")
modalPopupWithIcon(
"on",
"warning",
"요청을 처리하지 못하였습니다. Error Code: " + jsonObj.ErrorCode
);
else if (jsonObj.actionResult == "Duplicated")
modalPopupWithIcon(
"on",
"warning",
"이미 등록되어 처리중인 오더입니다. 오더 수정을 원하시면 클릭해 주세요."
);
//console.log(" 오더액션 결과..... " +jsonObj.ErrorCode );
//if( jsonObj.actionResult == "Succeeded" ) shortPopUp("오더등록 성공") ;
// else shortPopUp("오더 등록에 실패하였습니다.", "Error Code : " + jsonObj.ErrorCode );
}
);
});
// 필수 입력항목 중 누락 또는 규격이탈된 항목 검사...
function chkValidateOrderConfirmElements() {
if (!$("#deptPointId").val()) {
modalPopupWithIcon("on", "warning", "출발위치를 선택해주세요.");
return false;
} else if (!$("#destPointId").val()) {
modalPopupWithIcon("on", "warning", "도착지를 선택해주세요.");
return false;
} else if (!$("#defaultChargeValue").val()) {
modalPopupWithIcon("on", "warning", "대리비 조회를 먼저 확인해주세요.");
return false;
} else if (!$("#userHpNumVal").val()) {
modalPopupWithIcon("on", "warning", "휴대폰 인증이 이루어지지 않았습니다.");
return false;
} else if ($("#legalAgreementChkbox").prop("checked") == false) {
modalPopupWithIcon("on", "warning", "고지내용에 대한 동의가 필요합니다.");
return false;
}
return true;
}
/****** Modal Popup 컨트롤 펑션들.. ******/
$(document).on(
"click",
".modalPopupButtonClose, modalConfirmButtonClose",
function () {
// 모달을 닫는다.
modalPopupWithIcon("off", "", "");
}
);
//// 모달 컨펌의 버튼 클릭 대응...
$(document).on("click", ".modalConfirmButtonsDiv > .buttonDiv", function () {
// 취소 클릭시..
if ($(this).hasClass("modalConfirmButtonClose")) {
console.log("cancled...");
modalConfirmWithIcon("off");
} else if ($(this).hasClass("modalConfirmButtonConfirm")) {
let fncExcute = $(this).attr("data-func");
console.log("confirmed..." + fncExcute);
window[fncExcute]();
}
});
//// 컨펌 모달... 클릭 버튼의 밸류에 따라 호출 펑션을 달리한다.
function modalConfirmWithIcon(onOff, icon, message, functionName) {
if (onOff == "on") {
$("body").addClass("modal-open");
$("#modalConfirmWithIcon").removeClass("display-none");
$("#modalConfirmWithIcon").find(".modalPopupMessage").text(message);
$("#modalConfirmWithIcon")
.find(".modalPopupHeaderIcon")
.addClass("fa-" + icon);
// 컨펌 버튼에 액션 펑션명을 data- 로 넣어준다.
$("#modalConfirmWithIcon")
.find(".modalConfirmButtonConfirm")
.attr("data-func", functionName);
} else if (onOff == "off") {
$("body").removeClass("modal-open");
$("#modalConfirmWithIcon").addClass("display-none");
$("#modalConfirmWithIcon").find(".modalPopupMessage").text("");
}
}
//// modalPopupPOISelector POI Selector Modal ... POI 셀렉터 #modalPopupPOISelector 모달을 팝업한다.
function modalPopupPOISelector(onOff) {
if (onOff == "on") {
$("body").addClass("modal-open");
$("#modalPopupPOISelector").removeClass("display-none");
} else if (onOff == "off") {
$("body").removeClass("modal-open");
$("#modalPopupPOISelector").addClass("display-none");
}
}
//// modalPopupMapAdjustor Map Adjustor Modal ... 맵 어저스터 #modalPopupMapAdjustor 모달을 팝업한다.
function modalPopupMapAdjustor(onOff) {
if (onOff == "on") {
$("body").addClass("modal-open");
$("#modalPopupMapAdjustor").removeClass("display-none");
} else if (onOff == "off") {
$("body").removeClass("modal-open");
$("#modalPopupMapAdjustor").addClass("display-none");
}
}
//// 확인 버튼이 있는 아이콘 헤더 모달.. 사용자의 주의를 끌어야하는, 오류메세지 등에 사용한다.
function modalPopupWithIcon(onOff, icon, message) {
if (onOff == "on") {
$("body").addClass("modal-open");
$("#modalPopupWithIcon").removeClass("display-none");
$("#modalPopupWithIcon").find(".modalPopupMessage").text(message);
$("#modalPopupWithIcon")
.find(".modalPopupHeaderIcon")
.addClass("fa-" + icon);
} else if (onOff == "off") {
$("body").removeClass("modal-open");
$("#modalPopupWithIcon, #modalPopupAlertWin").addClass("display-none");
$("#modalPopupWithIcon").find(".modalPopupMessage").text("");
}
}
//// 버튼이 없는 모달.. Ajax 프로세스 완료후 스스로 닫는다.
function modalPopupSpinner(onOff, message, timer) {
if (onOff == "on") {
$("body").addClass("modal-open");
$("#modalPopupSpinner").removeClass("display-none");
$("#modalPopupSpinner").find(".modalPopupMessage").text(message);
if (timer) {
setTimeout(function () {
$("body").removeClass("modal-open");
$("#modalPopupSpinner").addClass("display-none");
$("#modalPopupSpinner").find(".modalPopupMessage").text("");
}, timer);
}
}
// off 를 인터랙티브로 호출하지는 않는다. JSON 처리가 끝나면 콜백으로 자동호출된다.
else if (onOff == "off") {
$("body").removeClass("modal-open");
$("#modalPopupSpinner").addClass("display-none");
$("#modalPopupSpinner").find(".modalPopupMessage").text("");
}
}
//// Long Text 를 인자로 받는 모달 : modalPopupLongText
function modalPopupLongText(onOff, title, body) {
if (onOff == "on") {
$("body").addClass("modal-open");
$("#modalPopupLongText").removeClass("display-none");
$("#modalPopupLongText").find(".longTextModalHeaderText").text(title);
$("#modalPopupLongText").find(".longTextModalBody > p").text(body);
} else if (onOff == "off") {
$("body").removeClass("modal-open");
$("#modalPopupLongText").addClass("display-none");
$("#modalPopupWithIcon").find(".longTextModalHeaderText").text("");
$("#modalPopupWithIcon").find(".longTextModalBody > p").text("");
}
}
// rulesPopupTrigger .. 롱텍스트 외부파일을 인수로 하는 모달팝업
// 외부 파일은 클릭되는 객체의 data-external 어트리뷰트에 할당되어 있어야 한다.
$(document).on("click", ".rulesPopupTrigger", function (e) {
e.preventDefault();
let popUpTitle, fileSrc;
fileSrc = $(this).attr("data-external");
console.log("fileSrc..." + fileSrc);
if ($(this).attr("id") == "privacyRulesPopupTrigger")
popUpTitle = "개인정보 취급방침";
else if ($(this).attr("id") == "cookieRulesPopupTrigger")
popUpTitle = "쿠키 취급방침";
modalPopupLongText("on", popUpTitle, "");
if (fileSrc) $(".longTextModalBody > p").load(fileSrc);
});
// modalPopupLongText 닫기 제어 펑션..
$(document).on("click", ".modalLongTextCloseIcon", function () {
modalPopupLongText("off");
});
//// 2021-01-12 19:30:07
//// 악천후 알럿 팝업 Div
//// 가동되는 기상상황 : 호우,대설,태풍/ 주의보,경보
$(document).ready(function () {});
//// 2020-11-26 00:16:10
//// 코로나 알럿 팝업 Div
/* 2020-11-25 23:54:23
2020-11-24 ~ 2020-12-07 까지 && 18:00 ~ 24:00 시간대에 팝업을 활성화 시켜준다.
*/
const CUR_DATE = new Date();
let curYear = CUR_DATE.getFullYear();
let curMon = CUR_DATE.getMonth() + 1;
let curDate = CUR_DATE.getDate();
let curDay = CUR_DATE.getDay();
let curHour = CUR_DATE.getHours();
let curMin = CUR_DATE.getMinutes();
let curTimestamp = parseInt(CUR_DATE.getTime());
let alertPopupClosedAt = 0;
let alertPopupClosedTill = 0; // 1시간
//console.log("curTimestamp : " +curTimestamp );
$(document).ready(function () {
/********* DEFAULT POPUPS *********/
// popupDefaultPeakTimeAlertPopup()
// 평일 20~24, 금요일 20~01 시 우선 팝업
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill) {
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
} else {
if (curDay >= 1 && curDay <= 4 && curHour >= 20)
popupDefaultPeakTimeAlertPopup();
else if ((curDay == 5 && curHour >= 19) || (curDay == 6 && curHour < 1))
popupDefaultPeakTimeAlertPopup();
}
/********* END DEFAULT POPUPS *********/
// 특정 기간동안의 지정 팝업...
if (curYear == 2021) {
console.log("curMon : " + curMon);
if (curMon <= 10) {
if (curHour >= 11 || curHour <= 4) {
// sessionStorage를 검사해야 한다. 2020-11-26 00:26:44
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupCoronaAlertPopup();
//popupCoronaAlertPopup();
}
} else if (curMon == 9 && curDate <= 8) {
if (curHour >= 11 || curHour <= 8) {
// sessionStorage를 검사해야 한다. 2020-11-26 00:26:44
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
//else popupCorona40AlertPopup();
}
}
// With Corona Alert PopUp... 2021-10-31 01:27:29
else if (curMon == 11 || (curMon == 12 && curDate <= 1)) {
if (curHour >= 0) {
// sessionStorage를 검사해야 한다. 2021-10-31 01:26:29
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupWithCoronaAlertPopup();
}
}
/* End Of The Year Alert Popup... 2021-11-15 22:11:53
else if( curMon==12 && curDate > 1 ) {
if( curHour>=0 ) {
// sessionStorage를 검사해야 한다. 2021-10-31 01:26:29
alertPopupClosedAt = Number( sessionStorage.getItem('alertPopupClosed') );
alertPopupClosedTill = alertPopupClosedAt + 60*30*1000; // 30min.
if( curTimestamp < alertPopupClosedTill ) console.log("팝업은 아직 열리지 않는다. : " +parseInt((alertPopupClosedTill-curTimestamp)/1000) );
else popupEndOfTheYearAlertPopup();
}
}
*/
// 2021-12-15 01:40:52
else if (curMon == 12 && curDate <= 26) {
if (curHour >= 0) {
console.log("popupCorona40BackAlertPopup...");
// sessionStorage를 검사해야 한다. 2021-10-31 01:26:29
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
//else popupCoronaRediffusionAlertPopup();
else popupCorona40BackAlertPopup();
}
}
// 2021-12-27 18:13:04
// 연말 인사 Greetings PopUp... EndOfTheYearGreetingsPopUp
else if (curMon == 12 && curDate > 26) {
if (curDate >= 28 || curHour >= 16) {
console.log("popUpEndOfTheYearGreetingsPopUp...");
// sessionStorage를 검사해야 한다. 2021-10-31 01:26:29
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
//else popupCoronaRediffusionAlertPopup();
else popUpEndOfTheYearGreetingsPopUp();
}
}
}
// EmployInsurement Alert Popup... 2021-11-15 22:14:45
else if (curYear == 2022) {
console.log("curMon : " + curMon);
if (curMon == 1) {
if (curDate <= 3) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popUpNewYearsDayGreetingsPopUp();
} else if (curDate <= 27) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
//else popupEmployInsurementAlertPopup();
else popupCorona40BackAlertPopup();
} else if (curDate > 27) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupSulnalAlertPopup();
}
} else if (curMon == 2) {
if (curDate <= 2) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupSulnalAlertPopup();
} else if (curDate <= 28) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupCorona40BackAlertPopup();
}
} else if (curMon == 3 && curDate <= 31) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupOmicronDistanceFinalAlertPopup();
} else if (curMon == 4 && curDate <= 3) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupOmicronDistanceFinalAlertPopup();
}
// popupEndOfCoronaAlertPopup
else if (curMon == 4 && curDate > 3) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupEndOfCoronaAlertPopup();
}
// popupEndOfCoronaAlertPopup
else if (curMon == 5 && curDate >= 1) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupEndOfCoronaAlertPopup();
}
// popupAfterPandemicAlertPopup
else if (curMon == 6 && curDate >= 1 && curMon == 7 && curDate <= 23) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupAfterPandemicAlertPopup();
}
// 7월말 ~ 8월초 혹서기 팝업...
else if (curMon == 8 && curDate <= 31) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// 비가 와서 혹서기 팝업 일시 중단..
//else popupSevereHotWeatherAlertPopup();
//else popupAfterPandemicAlertPopup();
}
}
});
//// 2021-12-28 16:32:07
//// 새해 1월 1일 팝업...
if (curYear == 2022) {
}
// 창 닫을 때, 쿠키를 심고 동일 날짜에 다시 팝업되지 않도록 해준다.
$(document).on("click", ".modalPopupAlertWinButtonClose", function () {
$("body").removeClass("modal-open");
$("#modalPopupAlertWin").addClass("display-none");
sessionStorage.setItem("alertPopupClosed", curTimestamp);
// console.log("sessionStorage.setItem alertPopupClosed : ", curTimestamp , alertPopupClosedTill );
});
// 2022-06-02 11:56:05
// 수요공급 불균형-일시적 콜 증가 알럿 팝업
function popupSupplyDemandImbalanceAlertPopup(imbalancedBy) {
resetAlertPopup();
var thsdayStr = curYear + "." + curMon + "." + curDate;
var imbalancedByStr = "공급 부족";
var imbalancedByCausal = "대리기사";
if (imbalancedBy == "demand") {
imbalancedByStr = "수요 급증";
imbalancedByCausal = "대리운전";
}
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"일시적 " + imbalancedByStr + "에 따른 대리운전 이용안내"
);
$(".modalPopupAlertWinBody").html(
"현재 " +
imbalancedByCausal +
" " +
imbalancedByStr +
"으로 대리기사님 배정이 원활하지 않습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-11-02 23:09:12
// 음주운전 단속 알럿 팝업
function popupCrackdownDrunkDriversAlertPopup() {
resetAlertPopup();
var thsdayStr = curYear + "." + curMon + "." + curDate;
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("음주운전 특별단속 안내");
$(".modalPopupAlertWinBody").html(
thsdayStr + " 현재 수도권 전역에서 음주운전 특별단속이 이뤄지고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2022-08-27 02:42:11
// 음주운전 단속기간 안내 팝업.. popupCrackdownDrunkDriversPeriodAlertPopup
function popupCrackdownDrunkDriversPeriodAlertPopup(crackDownTillStr) {
resetAlertPopup();
var thsdayStr = curYear + "." + curMon + "." + curDate;
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("음주운전 특별단속 기간 안내");
$(".modalPopupAlertWinBody").html(
"2022년 " +
crackDownTillStr +
" 까지 수도권 전역에서 음주운전 특별 합동단속이 이뤄지고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2022-02-14 19:14:32
// 도로결빙 안내 팝업
// 오늘 밤 기온이 큰 폭으로 떨어지면서 도로결빙이 예상되므로 차량운행시 각별한 주의가 요구됩니다.
function popupRoadIcingAlertPopup() {
resetAlertPopup();
var thsdayStr = curYear + "." + curMon + "." + curDate;
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("도로결빙에 따른 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
thsdayStr +
" 오늘 밤 기온이 큰 폭으로 떨어지면서 도로결빙이 예상되고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-11-11 15:48:43
// 2021.12월 팝업 -- 12월 연말 대리운전 이용안내
// 일상회복 이후 12월 연말 모임이 늘어나면서, 대리운전 수요가 폭발적으로 증가하고 있습니다.
function popupEndOfTheYearAlertPopup() {
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("일상회복후 12월 연말 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"일상회복후 12월 연말 모임이 시작되면서 대리운전 수요가 증가하고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-11-11 15:49:00
// 2022.01월 팝업 -- 2022년 대리기사고용보험 적용에 따른 안내
// 소득이 노출되면 곤란한 근로계층(기초생활수급자, 연금수령자, 겸직불가업종근로자 등) 의 대대적인 플랫폼노동현장 이탈
// 2022년 1월 이후, 이전의 대리요금 통계를 웃도는 선에서 대리요금이 형성되고 있습니다.
function popupEmployInsurementAlertPopup() {
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"2022년 대리기사 고용보험 도입에 따른 안내"
);
$(".modalPopupAlertWinBody").html(
"2022년 1월부터 플랫폼 노동자의 고용보험이 전면 도입됩니다. 이에따라 플랫폼 노동자에게도 투명한 납세의무가 발생하면서 대리운전 공급시장에 큰 변화가 일어나고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:odd").addClass("red ");
}
// 2021-12-15 01:39:49
// 일상회복후 코로나 재확산 알럿 팝업...
function popupCoronaRediffusionAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"일상회복후 코로나 재확산에 따른 대리운전 이용안내"
);
$(".modalPopupAlertWinBody").html(
"코로나 재확산으로 인해, 연말임에도 콜이 줄어들면서 현장의 대리기사님들도 줄어들고 있습니다. 이에 따라 배차 지연이 자주 발생하고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-12-18 00:39:32
// 일상회복후 강화된 거리두기 재도입 알럿 팝업...
function popupCorona40BackAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"오미크론(코로나) 확산과 사회적 거리두기에 따른 대리운전 이용안내"
);
$(".modalPopupAlertWinBody").html(
"사회적 거리두기의 영향으로, 식당 등의 운영제한 시간인 21~23시 시간대에 대리운전 수요가 급격히 집중되고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2022-03-05 05:25:15
// 오미크론 거리두기 막바지 알럿 팝업
function popupOmicronDistanceFinalAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"완화된 사회적 거리두기에 따른 대리운전 이용안내"
);
$(".modalPopupAlertWinBody").html(
"영업제한 시간이 23시로 완화됨에 따라, 22~24시 시간대에 대리운전 수요가 집중되고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-12-27 18:17:09
// 2021 연말 감사인사 팝업... EndOfTheYearGreetingsPopUp
function popUpEndOfTheYearGreetingsPopUp() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("다사다난했던 2023년이 저물어갑니다.");
$(".modalPopupAlertWinBody").html(
"코로나 팬데믹 상황으로 어려운 중에도 2021년 한 해 동안의 성원에 감사와 위로의 인사를 드립니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-12-28 16:23:23
// 2022 신년 인사 팝업... NewYearsDayGreetingsPopUp
function popUpNewYearsDayGreetingsPopUp() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("새해 복 많이 받으세요.");
$(".modalPopupAlertWinBody").html(
"코로나 팬데믹 상황으로 어려운 중에서도, 2022년 임인년 새 해가 밝았습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-10-31 01:16:12
// WithCorona 팝업...
function popupWithCoronaAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("일상회복 시행에 따른 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"11월 일상회복(위드코로나) 시행에 따라 저녁 피크시간대의 대리운전 수요가 크게 증가하고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2022-04-05 02:33:05
// 코로나 종식 팝업
function popupEndOfCoronaAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"사회적 거리두기 종료에 따른 대리운전 이용안내"
);
$(".modalPopupAlertWinBody").html(
"코로나 팬대믹 이후로 많은 대리기사님들이 현장을 떠나서, 코로나 이전의 대리요금 통계를 웃도는 선에서 대리요금이 형성되고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2022-07-14 22:12:42
// 코로나 팬대믹 이후... 팝업
function popupAfterPandemicAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("코로나 팬대믹 이후 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"코로나 팬대믹 이후로 많은 대리기사님들이 현장을 떠나서, 코로나 이전의 대리요금 통계를 훌쩍 웃도는 선에서 대리요금이 형성되고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 코로나 디폴트 알럿 팝업...
function popupCoronaAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("코로나19 사회적 거리두기에 따른 안내");
$(".modalPopupAlertWinBody").html(
"코로나19 사회적 거리두기의 영향으로 21~23시 시간대에 대리운전 수요가 급격히 집중되고 있습니다.
이례적인 수요공급 붕괴상황이라, 통합 콜센터의 정상적인 콜관리가 어려운 상황입니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 사회적 거리두기 4단계 알럿 팝업...
function popupCorona40AlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"강화된 사회적 거리두기 4단계에 따른 안내"
);
$(".modalPopupAlertWinBody").html(
"코로나19 사회적 거리두기 4단계의 영향으로 대리기사님 공급이 매우 부족한 상황입니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-11-30 23:11:54
// 특수 기상상황 알럿 팝업...
// 기상 현재상황을 액티배이트시 추가/수정 해줘야 한다.
// 현재 갑작스런 한파와 강풍의 영향으로, 대리기사님 공급이 원활하지 않습니다
// 강우, 강설, 태풍, 폭우, 갑작스런 한파와 강풍
function popupSevereWeatherAlertPopup(severerWeatherCausedBy = "") {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("기상상황에 따른 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"현재, 기상상황으로 인해 대리기사님 공급이 매우 부족한 상황입니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".severeWeatherUL li:even").addClass("red ");
}
// 2021-12-03 02:32:54
// 크리스마스이브 등 주요 콜 몰리는 날들 피크시간대 전용 팝업...
// 저녁 피크시간대에만 잠깐 팝업되고, 이후 자동으로 디저블 되도록 호출위치를 잡아줘야 한다.
function popupSpecialEveningAlertPopup(specialEvening) {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(specialEvening + " 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"현재, " +
specialEvening +
" 수요급증으로 인해 대리기사 공급이 매우 부족한 상황입니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".specialEveningUL li:even").addClass("red ");
}
//// 명절 팝업... 파라메터는 없고, 최대한 길게 팝업시킨다. 약 7일??
function popupSulnalAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("설날 연휴기간 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"오미크론(코로나19) 확산과 귀성을 자제하는 사회 분위기로 인해, 이번 연휴에는 평년보다는 많은 기사님들이 대기중일 것으로 예상됩니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".sulnalUL li:even").addClass("red ");
}
//// 2022-08-26 23:45:28
//// 추석 팝업...
//// 연휴 전날인 9월 8일 목요일은 콜이 급증해서 기사님 공급이 매우 부족해집니다.
function popupChuseokAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("설날 연휴기간 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"예년보다 길어진 연휴기간으로, 이번 설날 연휴에는 예년에 비해서 적은 수의 대리기사님들이 대기중일 것으로 예상됩니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".sulnalUL li:even").addClass("red ");
}
//// 2022-07-25 21:11:37
//// 혹서기 팝업....
function popupSevereHotWeatherAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("여름철 혹서기 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"혹서기 날씨 환경으로 인해 대리기사님 공급이 매우 부족해진 상황입니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".sulnalUL li:even").addClass("red ");
}
//// 2022-09-13 09:18:16
//// 피크시간대 팝업... 아무런 이슈가 없는 날에는 피크시간대 팝업이라도 띄워보자.
//// 다름 모든 팝업의 priority 에 뒤진다. 팝업 순서에서 가장 앞에두고, 뒤에 활성화 되는 팝업 테마에게 자리를 양보한다.
function popupDefaultPeakTimeAlertPopup() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("대리운전 피크시간대 이용안내");
$(".modalPopupAlertWinBody").html(
"평일 21~24시, 금요일 21~01시는 대리운전 콜이 집중되는 피크시간대입니다. 피크시간대에는 대리요금의 단가가 전반적으로 오르기 때문에, 낮시간대의 요금으로는 기사님 배정을 받기 어려워질 수도 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".sulnalUL li:even").addClass("red ");
}
// 2022-09-23 19:09:51
// 축구경기로 인한 일시적인 수요공급 불균형-일시적 콜 증가 알럿 팝업
function popupSupplyDemandImbalancedBySportsAlertPopup() {
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"축구경기로 인한 일시적 수요집중과 대리운전 이용안내"
);
$(".modalPopupAlertWinBody").html(
"오늘밤 국가대표 축구경기로 인한 대리운전 수요공급 불균형이 발생할 것으로 예상됩니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2022-11-04 02:32:57
// 이태원 참사로 인한 팝업
function popupIteawonDisasterAlertPopup() {
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text(
"이태원 참사 희생자와 유가족의 슬픔에 함께합니다."
);
$(".modalPopupAlertWinBody").html(
"
"
);
$(".modalPopupAlertWinBody").append(`
`);
$(".corona19UL li:even").addClass("red ");
}
// 2022-11-23 07:39:24
// 월드컵 경기일정 팝업
function popupWorldCup2022AlertPopup() {
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("월드컵 경기에 따른 대리운전 이용안내.");
$(".modalPopupAlertWinBody").html(
"오늘밤 월드컵 축구경기로 인해 대리운전 수요공급 불균형이 크게 발생할 것으로 예상됩니다."
);
$(".modalPopupAlertWinBody").append(`
`);
$(".corona19UL li:even").addClass("red ");
}
// 2022-12-16 22:23:53
// 2022.12월 팝업 -- 12월 연말 대리운전 이용안내
//
function popupEndOfTheYear2023AlertPopup() {
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("12월 연말 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"12월 연말 모임이 시작되면서 대리운전 수요가 증가하고 있습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-12-27 18:17:09
// 2021 연말 감사인사 팝업... EndOfTheYearGreetingsPopUp
function popUpEndOfTheYear2023GreetingsPopUp() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("다사다난했던 2023년이 저물어갑니다.");
$(".modalPopupAlertWinBody").html(
"어려운 경제여건 중에서도 2023년 한해 동안 보내주신 성원에 깊은 감사의 인사를 드립니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
// 2021-12-27 18:17:09
// 2021 연말 감사인사 팝업... EndOfTheYearGreetingsPopUp
function popUpNewYearsGreetingsPopUp() {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("새해 복 많이 받으세요.");
$(".modalPopupAlertWinBody").html(
"희망의 2024년 갑진년 새해가 밝아왔습니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".corona19UL li:even").addClass("red ");
}
//
function popupSevereRainAlertPopup(severerWeatherCausedBy = "") {
console.log("Modal Popup...");
resetAlertPopup();
$("#modalPopupAlertWin").removeClass("display-none");
$(".modalPopupAlertWinHeader").text("기상상황에 따른 대리운전 이용안내");
$(".modalPopupAlertWinBody").html(
"현재, 전국에 계속되고 있는 비와 도로상황으로 인해 대리기사님 공급이 매우 부족한 상황입니다."
);
$(".modalPopupAlertWinBody").append(
""
);
$(".severeWeatherUL li:even").addClass("red ");
}
// 팝업 프레임을 리셋... 팝업 액션시 먼저 선언해서 초기화 하는데 사용된다.
function resetAlertPopup() {
//$("#modalPopupAlertWin").addClass("display-none");
$(
".modalPopupAlertWinHeader, .modalPopupAlertWinBody, .modalPopupAlertWinBody"
).text("");
}
/* modalPopupBackgroundDiv */
/*
$(document).on("click", ".modalPopupBackgroundDiv:not(.modalPopupAlertWinFrameDiv) ", function() {
$("body").removeClass("modal-open");
$("#modalPopupAlertWin").addClass("display-none");
} );
*/
//// 2021-02-09 01:06:09
//// 모든 사전 팝업에 우선해서 팝업된다!!!!!
//// 설연휴 팝업...
//// 팝업 관리를 좀 체계적으로 해보자.
//// 팝업의 hierarchy 를 관리해주는 모듈이 필요하다. 팝업 중첩 상태일 때, 우선순위 1개만 팝업되도록
//// 팝업의 규격은 통일하지만, CSS 스타일링은 약간의 변화를 준다.
//// 2021.추석으로 수정함 2021-09-13 22:19:48
$(document).ready(function () {
// 설날/ 추석 팝업 활성화
if (curYear == 2025) {
if (curMon == 1 && curDate >= 21 && curDate <= 30) {
// sessionStorage를 검사해야 한다. 2020-11-26 00:26:44
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
else popupChuseokAlertPopup();
}
}
//// 2021-12-03 02:41:02
// 저녁 피크시간대에만 잠깐 팝업되고, 이후 자동으로 디저블 되도록 호출위치를 잡아줘야 한다.
// if( curHour>=19 || curHour<=1 ) popupSpecialEveningAlertPopup( "성탄절 기간" );
//// 기상 특수상황에 팝업
//// 특수한 기상상황 & 콜이 안빠지는 날씨... 에 ON 해준다.
// "갑작스런 한파와 강풍", "폭설", "우천"
//popupSevereWeatherAlertPopup("우천");
//// 2021.12.24.22:00~12.26.07:00 한파경보 대응...
//// 16:00~24:00 && 00:00~07:00
if (curYear == 2022) {
if (
curMon == 11 &&
((curDate == 12 && curHour >= 16) || (curDate == 13 && curHour <= 5))
) {
// 7월23일~
popupSevereWeatherAlertPopup("우천");
}
}
//// 2022-08-27 02:38:14
//// 기간 음주단속 안내...
//// 기간동안, 시간대 확인후 팝업 활성화된다.
//// 단속기간을 파라메터로 전달한다.
if (curYear == 2022) {
let crackDownTillStr = "8월말";
if (curMon == 10 && curDate == 27 && (curHour >= 16 || curHour <= 8)) {
//popupRoadIcingAlertPopup();
popupCrackdownDrunkDriversAlertPopup();
// popupCrackdownDrunkDriversPeriodAlertPopup(crackDownTillStr);
}
}
//// 2022-02-14 19:24:10
//// 도로결빙 안내..
//// 2022-09-04 11:15:19
//// 태풍...
if (curYear == 2022) {
if (
curMon == 12 &&
((curDate == 17 && curHour >= 17) || (curDate == 18 && curHour <= 6))
) {
//popupRoadIcingAlertPopup();
// popupIteawonDisasterAlertPopup()
// popupSevereWeatherAlertPopup("눈과 함께 예보된 한파");
popupSevereWeatherAlertPopup("많이 내린 눈");
}
}
//// 2022-09-23 19:08:10
//// 월드컵 popupWorldCup2022AlertPopup
if (curYear == 2022) {
if (
curMon == 12 &&
((curDate == 2 && curHour >= 12) || (curDate == 3 && curHour <= 3))
) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// else popupChuseokAlertPopup();
else popupWorldCup2022AlertPopup();
//popupRoadIcingAlertPopup();
//popupSupplyDemandImbalancedBySportsAlertPopup();
}
}
//// popupEndOfTheYear2023AlertPopup
if (curYear == 2023) {
if (curMon == 12 && curDate >= 29) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// else popupChuseokAlertPopup();
// else popupEndOfTheYear2023AlertPopup();
// else popUpEndOfTheYear2022GreetingsPopUp();
//popupRoadIcingAlertPopup();
//popupSupplyDemandImbalancedBySportsAlertPopup();
}
}
//// 2022-12-17 19:28:51
//// 한파
if (curYear == 2022) {
if (
curMon == 12 &&
((curDate == 22 && curHour >= 17) || (curDate == 23 && curHour <= 6))
) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// else popupChuseokAlertPopup();
else {
// popupSevereWeatherAlertPopup("눈과 함께 예보된 한파");
// popupSevereWeatherAlertPopup("눈으로 인한 도로상황");
// popupSevereWeatherAlertPopup("한파");
}
}
}
//// 2022-12-30 13:17:36
//// popUpEndOfTheYear2022GreetingsPopUp
if (curYear == 2023) {
if (curMon == 12 && ((curDate) => 29 && curHour >= 1)) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// else popupChuseokAlertPopup();
else {
// popUpEndOfTheYear2022GreetingsPopUp();
// popupEndOfTheYear2023AlertPopup();
popUpEndOfTheYear2023GreetingsPopUp();
}
}
}
//// 2022-12-31 15:08:52
//// popUpNewYearsGreetingsPopUp
if (curYear == 2024) {
if (curMon == 2 && curDate >= 6 && curDate <= 12) {
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// else popupChuseokAlertPopup();
else {
// popUpNewYearsGreetingsPopUp();
popupChuseokAlertPopup();
}
}
}
//// 2023-01-13 17:16:00
//// 비,눈비
if (curYear == 2025) {
if (
curMon == 7 &&
((curDate == 17 && curHour >= 7) || (curDate == 18 && curHour <= 6))
) {
console.log("팝업의 조건이 트리거 됨.");
alertPopupClosedAt = Number(sessionStorage.getItem("alertPopupClosed"));
alertPopupClosedTill = alertPopupClosedAt + 60 * 30 * 1000; // 30min.
if (curTimestamp < alertPopupClosedTill)
console.log(
"팝업은 아직 열리지 않는다. : " +
parseInt((alertPopupClosedTill - curTimestamp) / 1000)
);
// else popupChuseokAlertPopup();
else {
// popupSevereWeatherAlertPopup("폭설");
// popupSevereWeatherAlertPopup("눈과 함께 예보된 한파");
// popupSevereWeatherAlertPopup("눈으로 인한 도로상황");
popupSevereWeatherAlertPopup("전국에 내리고 있는 많은 비");
// popupSevereWeatherAlertPopup("수도권에 내리고 있는 많은 비");
// popupSevereWeatherAlertPopup("수도권의 폭우");
// popupSevereWeatherAlertPopup("기록적인 폭염");
// popupSevereWeatherAlertPopup("태풍");
// popupCrackdownDrunkDriversAlertPopup();
// popupSevereRainAlertPopup("태풍");
// popupSevereRainAlertPopup("장맛비");
// popupSupplyDemandImbalancedBySportsAlertPopup();
// popupCrackdownDrunkDriversAlertPopup();
}
}
}
//// 2021-11-02 23:16:19
//// 음주운전 집중단속 알럿 팝업
//// 음주운전 집중단속 예보가 있으면, 당일에 한해 ON 해준다.
//popupCrackdownDrunkDriversAlertPopup();
//popupSupplyDemandImbalanceAlertPopup();
//popupSupplyDemandImbalanceAlertPopup("supply");
});