<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<!--
 *******************************************************************************
 * @source  : OrderPaymentInfoWeb.html
 * @desc    : 결제정보 Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.02.01   jsh77b     최초 작성
 *******************************************************************************
 -->
<!-- 결제수단 선택 -->
<div class="foldGroup">
	<ul>
		<li>
			<div class="fold_head">
				<a href="javascript:void(0)">
					<div>
						<div class="fold_tit">
							<span>결제수단</span>
						</div>
						<div class="data payTypeNm">
							<span>선택없음</span>
						</div>
					</div>
				</a>
			</div>
			<div class="fold_cont">
				<div class="area_paymethod">
					<div class="paymethod_box">
						<div class="form_field">
							<ul class="sel_method">
								<li>
									<input type="radio" name="rdi-paynormal" id="payCreditCard" class="KCP" value="KCP|G014_30"> 
									<label for="payCreditCard">
										<span class="payType">신용카드</span>
									</label>
								</li>
								<li>
									<input type="radio" name="rdi-paynormal" id="payKakao" class="KAKAO" value="KAKAO|G014_99"> 
									<label for="payKakao">
										<span><em class="sr-only payType">카카오페이 결제</em>
										<em class="payimg kakao"></em></span>
									</label>
								</li>
								<li>
									<input type="radio" name="rdi-paynormal" id="payRealBank" class="KCP" value="KCP|G014_10">
									<label for="payRealBank">
										<span class="payType">실시간계좌이체</span>
									</label>
								</li>
								<li>
									<input type="radio" name="rdi-paynormal" id="payNaver" class="NAVER" value="NAVER|G014_99">
									<label for="payNaver">
										<span>
											<em class="sr-only payType">네이버페이 결제</em>
											<em class="payimg naver"></em>
										</span>
									</label>
								</li>
								<th:block th:if="${order.giftPackYn} == 'N'">
									<li>
										<input type="radio" name="rdi-paynormal" id="payVirtualBank" class="KCP" value="KCP|G014_20"> 
										<label for="payVirtualBank">
											<span class="payType">무통장입금</span>
										</label>
									</li>
								</th:block>
								<li>
									<input type="radio" name="rdi-paynormal" id="payPayco" class="PAYCO" value="PAYCO|G014_30"> 
									<label for="payPayco">
										<span>
											<em class="sr-only payType">페이코 결제</em>
											<em class="payimg payco"></em>
										</span>
									</label>
								</li>
								<li>
									<input type="radio" name="rdi-paynormal" id="payCellphone" class="KCP" value="KCP|G014_60"> 
									<label for="payCellphone">
										<span class="payType">휴대폰 결제</span>
									</label>
								</li>
							</ul>
						</div>
						<!-- 210527_ 추가 : 결제수단 반복사용 체크 -->
						<th:blcok th:if="${isLogin}">
							<div class="form_field">
								<div class="agree_paymethod123">
									<input id="chk-agree_paymethod123" type="checkbox">
									<label for="chk-agree_paymethod123">
										<span>선택한 결제수단으로 향후 결제 이용에 동의합니다.&nbsp;&nbsp;<em class="tmark_optional">(선택)</em></span>
									</label>
								</div>
							</div>
						</th:blcok>
						<div class="form_field">
							<div class="agree_insurance">
								<input id="chk-insurance" type="checkbox" name="insuranceYn"> 
								<label for="chk-insurance"> 
									<span>소비자 피해 보상보험 신청&nbsp;&nbsp;<em class="tmark_optional">(선택)</em></span>
								</label>
								<p>
									‘전자상거래 등에서의 소비자보호에 관한 법률‘에 따라 현금 결제 시 서울보증보험㈜가 제공하는 소비자
									피해보상보험을<br>신청할 수 있도록 해드리고 있습니다. (2013.11.28부터 시행)
								</p>
								<a href="/callcenter/faq/form" class="btn btn_default"><span>FAQ확인</span></a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</li>
	</ul>
</div><!-- //결제수단 선택 -->


<script th:inline="javascript">
var dispYn 		= [[${order.dispYn}]]; 	// 노출여부
var payMeans 	= [[${payMeans}]]; 		// 결제타입
var pgGb 		= [[${pgGb}]]; 			// PG구분

//화면노출
var paymentInfoDispYn = function(temp) {
	if (temp == "Y") {
		$("#paymentInfo .fold_head").addClass("on");
		$("#paymentInfo .fold_cont").show();
	} else {
		$("#paymentInfo .fold_head").removeClass("on");
		$("#paymentInfo .fold_cont").hide();
	}
}

//컨텐츠 호출
$(document).ready( function() {
	
	// 화면펼침
	if (pgGb == null || pgGb == '' || pgGb == 'ISTYLE' || pgGb == 'NAVER_ORDER') {
		$("#orderForm .payTypeNm").text("선택없음");
		paymentInfoDispYn("Y");
	} else {
		if (pgGb == 'KCP' && (payMeans == null || payMeans == "")) {
			$("#orderForm .payTypeNm").text("선택없음");
			paymentInfoDispYn("Y");
		}
		paymentInfoDispYn(dispYn);
	}

	// 2021.05.26 자주쓰는결제타입설정
	if (pgGb == "KCP") {
		if (payMeans == "G014_30") {
			$("#payCreditCard").attr("checked", true);
			$("#orderForm .payTypeNm").text("신용카드");
			$("#orderForm .area_paymethod .agree_insurance").hide();
		} else if (payMeans == "G014_60") {
			$("#payCellphone").attr("checked", true);
			$("#orderForm .payTypeNm").text("휴대폰 결제");
			$("#orderForm .area_paymethod .agree_insurance").hide();
		} else if (payMeans == "G014_10") {
			$("#payRealBank").attr("checked", true);
			$("#orderForm .payTypeNm").text("실시간계좌이체");
			$("#orderForm .area_paymethod .agree_insurance").show();
		} else if (payMeans == "G014_20") {
			$("#payVirtualBank").attr("checked", true);
			$("#orderForm .payTypeNm").text("무통장입금");
			$("#orderForm .area_paymethod .agree_insurance").show();
		}
	} else if (pgGb == "KAKAO") {
		$("#payKakao").attr("checked", true);
		$("#orderForm .payTypeNm").text("카카오페이 결제");
		$("#orderForm .area_paymethod .agree_insurance").hide();
	} else if (pgGb == "NAVER") {
		$("#payNaver").attr("checked", true);
		$("#orderForm .payTypeNm").text("네이버페이 결제");
		$("#orderForm .area_paymethod .agree_insurance").hide();
	} else if (pgGb == "PAYCO") {
		$("#payPayco").attr("checked", true);
		$("#orderForm .payTypeNm").text("페이코 결제");
		$("#orderForm .area_paymethod .agree_insurance").hide();
	}
});


</script>
</html>