<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="web/common/layout/MypageLayoutWeb">
<!--
 *******************************************************************************
 * @source  : MypageOrderDetailFormWeb.html
 * @desc    : 마이페이지 > 주문상세 Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2021 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.02.16   card007     최초 작성
 * 1.1  2021.03.23   card007     퍼블 수정
 *******************************************************************************
 -->
<body>

<th:block layout:fragment="content">
	<div class="content myOrderView">
		<div class="cont_body">
			<!-- CONT-BODY -->
			<div class="lnb">
				<div class="lnb_tit">
					<h2>마이페이지</h2>
				</div>
				<div class="lnb_list">
					<ul id="mypageLnbList"></ul>
				</div>
			</div>
			<div class="cont">
				<form id="orderDetailForm">
					<div class="sec_head">
						<h3 class="subH1">주문상세</h3>
						<span class="order_number">주문번호&nbsp;:&nbsp;<em th:text="${ordNo}"></em></span>
						<button type="button" id="btn_order_cancel" class="btn_underline" onclick="fnDeleteOrder()"><span>삭제하기</span></button>
					</div>
					<div class="sec_body">
						<th:block th:if="${orderList}" th:each="order, status : ${orderList}">
							<input type="hidden" name="accountNo" th:value="${order.oneData.accountNo}"/>
							<input type="hidden" name="accountNm" th:value="${order.oneData.accountNm}"/>
							<input type="hidden" name="bankCd" th:value="${order.oneData.bankCd}"/>
							<input type="hidden" name="delvMemo" th:value="${deliveryAddrInfo.delvMemo}"/>
							<div class="part_goods">
								<div class="goods_head">
									<p th:unless="${order.giftPackYn == 'Y'}">주문일 <span th:text="${order.ordDt}"></span></p>
									<p th:if="${order.giftPackYn == 'Y'}">선물일 <span th:text="${order.ordDt}"></span></p>
									<!-- 2021.09.01 card007 AS-IS Data 취소처리 못하게 처리 -->
									<!-- 2021.09.13 card007 AS-IS Data 취소처리 -->
<!--									<th:block th:if="${#numbers.formatInteger(#strings.replace(order.ordDt, '.', ''), 1)} >= 20210901">-->
									<li><a href="javascript:void(0)" th:if="${allCanYn == 'Y' and order.ordReqChgQty == 0}" onclick="fnAllCancel();">주문전체취소</a></li>
<!--									</th:block>-->
									<li><a href="javascript:void(0)" th:if="${allDecideYn == 'Y' and order.ordReqChgQty == 0}"  th:attr="ordNo=${ordNo}" onclick="fnAllDecideOrder(this);">전체구매확정</a></li>
								</div>
								<div class="goods_cont">
									<!-- 주문상품 -->
									<th:block th:if="${order.ordDtlList}" th:each="ordDtl, status : ${order.ordDtlList}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
										<div class="goods_info">
											<div class="order_desc">
												<div class="goods_box">
													<input type="hidden" name="ordDtlNoArr" th:value="${ordDtl.ordDtlNo}"/>
													<input type="hidden" name="cnclRtnReqQtyArr" th:value="${ordDtl.ordQty - ordDtl.cnclRtnQty}"/>
													<div class="gd_item">
														<a href="javascript:void(0)" th:attr="goodsCd=${ordDtl.goodsCd}, optCd1=${ordDtl.goodsType == 'G056_N' ? ordDtl.optCd1 : ''}, ithrCd='IN20_02'" onclick="fnGoToGoodsDetail(this)">
															<span class="thumb">
																<img th:src="${imageUrl + '/' + ordDtl.sysImgNm + '?RS=100'}" width="100%" alt="">
															</span>
															<p>
																<span class="brand" th:text="${ordDtl.brandNm}"></span>
																<span class="tag primary" th:if="${ordDtl.shotDelvYn == 'Y'}">총알배송</span>
																<span class="tag" th:if="${ordDtl.shotDelvYn == 'N' and ordDtl.selfGoodsYn == 'Y'}">STYLE24 일반배송</span>
																<span class="tag" th:if="${ordDtl.selfGoodsYn == 'N'}">업체직배송</span>
															</p>
															<p>
																<span class="name" th:text="${ordDtl.goodsNm}"></span>
															</p>
														</a>
													</div>
													<div class="gd_opt">
														<div class="option_wrap">
															<span class="title sr-only">주문 옵션</span>
															<span class="option" th:if="${ordDtl.goodsType == 'G056_S'}" th:each="option, status : ${ordDtl.colorNmArr}" th:text="|${ordDtl.itemNmArr[status.index]} / ${option} / ${ordDtl.optCd2Arr[status.index]}|"></span>
															<span class="option" th:unless="${ordDtl.goodsType == 'G056_S'}" th:text="|${ordDtl.colorNm} / ${ordDtl.optCd2}|"></span>
														</div>
													</div>
													<div class="gd_calc">
														<p>
															<span class="count"><em th:text="${ordDtl.ordQty - ordDtl.cnclRtnQty}"></em>개</span>
														</p>
														<p>
															<span class="price_org" th:if="${(ordDtl.ordAmt - ordDtl.cnclRtnAmt) > (ordDtl.realOrdAmt + ordDtl.pntDcAmt + ordDtl.gfcdUseAmt)}"><em th:text="${#numbers.formatInteger(ordDtl.ordAmt - ordDtl.cnclRtnAmt, 1, 'COMMA')}"></em>원</span>
															<span class="price_sale"><em th:text="${#numbers.formatInteger(ordDtl.realOrdAmt + ordDtl.pntDcAmt + ordDtl.gfcdUseAmt, 1, 'COMMA')}"></em>원</span>
														</p>
														<p>
															<span class="point"><em th:text="${#numbers.formatInteger(ordDtl.savePntAmt, 1, 'COMMA')}"></em><stong>P</stong>&nbsp;적립예정</span>
														</p>
													</div>
												</div>
												<div class="status_box">
													<!-- 선물 -->
													<th:block th:if="${order.giftPackYn == 'Y'}">
														<p th:if="${ordDtl.giftAddrInpYn == 'N' and ordDtl.giftLimitDay >= 0}">주소 입력 대기중</p>
														<p th:if="${ordDtl.giftAddrInpYn == 'Y' and ordDtl.ordDtlStat != 'G013_98' and ordDtl.ordDtlStat != 'G013_99'}">선물 완료</p>
														<p th:if="${ordDtl.ordDtlStat == 'G013_98' or ordDtl.ordDtlStat == 'G013_99'}">선물 취소</p>
													</th:block>
													<!-- 주문 -->
													<th:block th:unless="${order.giftPackYn == 'Y'}">
														<p th:if="${ordDtl.ordDtlStat == 'G013_10'}">주문접수</p>
														<p th:if="${ordDtl.ordDtlStat == 'G013_35'}">상품준비중</p>
														<p th:unless="${ordDtl.ordDtlStat == 'G013_10' or ordDtl.ordDtlStat == 'G013_35'}" th:text="${ordDtl.ordDtlStatNm}"></p>
													</th:block>
												</div>
												<div class="button_box">
													<!-- 선물 -->
													<th:block th:if="${order.giftPackYn == 'Y'}">
														<!-- SMS 재발송 버튼 -->
														<th:block th:if="${ordDtl.giftAddrInpYn == 'N' and ordDtl.giftLimitDay >= 0}">
															<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}" onclick="fnReSendSms(this);"><span>SMS 재발송</span></button></p>
														</th:block>

														<!-- 주문취소 버튼(결제완료, 상품준비중, 출고처지정) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_20' or ordDtl.ordDtlStat == 'G013_30' or ordDtl.ordDtlStat == 'G013_35'}">
															<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, delvFeeCd=${ordDtl.delvFeeCd}, ordCanChgQty=${ordDtl.ordCanChgQty}" onclick="fnCreateChange(this, 'cancel');"><span>주문 취소</span></button></p>
														</th:block>
														
														<!-- 리뷰 쓰기 버튼 -->
														<th:block th:if="${ordDtl.giftAddrInpYn == 'Y' and ordDtl.ordDtlStat != 'G013_98' and ordDtl.ordDtlStat != 'G013_99' and ordDtl.reviewableYn == 'Y' and ordDtl.reviewSq == null}">
															<p><button type="button" class="btn btn_primary_line btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, goodsCd=${ordDtl.goodsCd}" onclick="fnCreateReview(this);"><span>리뷰 쓰기</span></button></p>
														</th:block>

														<!-- 쇼핑백담기 버튼(구매확정) -->
														<th:block th:if="${ordDtl.giftAddrInpYn == 'Y' and ordDtl.ordDtlStat != 'G013_98' and ordDtl.ordDtlStat != 'G013_99'}">
															<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);"><span>쇼핑백 담기</span></button></p>
														</th:block>
													</th:block>
													<!-- 주문 -->
													<th:block th:unless="${order.giftPackYn == 'Y'}">
														<!-- 주문취소 버튼(결제완료, 상품준비중, 출고처지정) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_20' or ordDtl.ordDtlStat == 'G013_30' or ordDtl.ordDtlStat == 'G013_35'}">
															<th:block th:if="${ordDtl.ordExchGb == 'O'}">
																<!-- 2021.09.01 card007 AS-IS Data 취소처리 못하게 처리 -->
																<!-- 2021.09.13 card007 AS-IS Data 취소처리 -->
<!--																<th:block th:if="${#numbers.formatInteger(#strings.replace(ordDtl.ordDt, '.', ''), 1)} >= 20210901">-->
																<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, delvFeeCd=${ordDtl.delvFeeCd}, ordCanChgQty=${ordDtl.ordCanChgQty}" onclick="fnCreateChange(this, 'cancel');"><span>주문 취소</span></button></p>
<!--																</th:block>-->
															</th:block>
															<th:block th:unless="${ordDtl.ordExchGb == 'O'}">
																<p><button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_ONETOONE_QNA);"><span>1:1 문의</span></button></p>
																<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);"><span>쇼핑백 담기</span></button></p>
															</th:block>
														</th:block>
														
														<!-- 교환/반품 신청 버튼(배송중, 출고완료, 배송완료) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_50' or ordDtl.ordDtlStat == 'G013_55' or ordDtl.ordDtlStat == 'G013_60'}">
															<!-- 교환/반품 가능한 상품 -->
															<th:block th:if="${ordDtl.changeableYn == 'Y' and ordDtl.returnableYn == 'Y'}">
																<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, delvFeeCd=${ordDtl.delvFeeCd}, ordCanChgQty=${ordDtl.ordCanChgQty}" onclick="fnCreateChange(this, 'exchange');"><span>교환 신청</span></button></p>
																<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, delvFeeCd=${ordDtl.delvFeeCd}, ordCanChgQty=${ordDtl.ordCanChgQty}" onclick="fnCreateChange(this, 'return');"><span>반품 신청</span></button></p>
															</th:block>
															
															<!-- 교환 신청 불가 상품 -->
															<th:block th:if="${ordDtl.changeableYn == 'N' and ordDtl.returnableYn == 'Y'}">
																<p><button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_ONETOONE_QNA);"><span>1:1 문의</span></button></p>
																<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, delvFeeCd=${ordDtl.delvFeeCd}, ordCanChgQty=${ordDtl.ordCanChgQty}" onclick="fnCreateChange(this, 'return');"><span>반품 신청</span></button></p>
															</th:block>
	
															<!-- 반품 신청 불가 상품 -->
															<th:block th:if="${ordDtl.changeableYn == 'Y' and ordDtl.returnableYn == 'N'}">
																<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, delvFeeCd=${ordDtl.delvFeeCd}, ordCanChgQty=${ordDtl.ordCanChgQty}" onclick="fnCreateChange(this, 'exchange');"><span>교환 신청</span></button></p>
																<p><button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_ONETOONE_QNA);"><span>1:1 문의</span></button></p>
															</th:block>
	
															<!-- 교환/반품 신청 불가 상품 -->
															<th:block th:if="${ordDtl.changeableYn == 'N' and ordDtl.returnableYn == 'N'}">
																<p><button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_ONETOONE_QNA);"><span>1:1 문의</span></button></p>
															</th:block>
														</th:block>
														
														<!-- 배송조회 버튼(배송중, 배송완료) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_50' or ordDtl.ordDtlStat == 'G013_55' or ordDtl.ordDtlStat == 'G013_60'}">
															<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, shipCompCd=${ordDtl.shipCompCd}, invoiceNo=${ordDtl.invoiceNo}" onclick="fnGoToDelivery(this);"><span>배송 조회</span></button></p>
														</th:block>
	
														<!-- 구매확정 버튼(배송완료) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_60' and ordDtl.ordReqChgQty == 0}">
															<p><button type="button" class="btn btn_primary_line btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}" onclick="fnDecideOrder(this);"><span>구매 확정</span></button></p>
														</th:block>
	
														<!-- 리뷰작성 버튼(구매확정) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_70' and ordDtl.reviewableYn == 'Y' and ordDtl.reviewSq == null}">
															<p><button type="button" class="btn btn_primary_line btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, goodsCd=${ordDtl.goodsCd}" onclick="fnCreateReview(this);"><span>리뷰 쓰기</span></button></p>
														</th:block>
	
														<!-- 쇼핑백담기 버튼(입금대기, 배송준비중, 구매확정) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_10' or ordDtl.ordDtlStat == 'G013_40' or ordDtl.ordDtlStat == 'G013_70'}">
															<p><button type="button" class="btn btn_default btn_sm" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);"><span>쇼핑백 담기</span></button></p>
														</th:block>
	
														<!-- 1:1문의 버튼(입금대기, 배송준비중, 구매확정) -->
														<th:block th:if="${ordDtl.ordDtlStat == 'G013_10' or ordDtl.ordDtlStat == 'G013_40' or (ordDtl.ordDtlStat == 'G013_70' and (ordDtl.reviewableYn == 'N' or ordDtl.reviewSq > 0))}">
															<p><button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_ONETOONE_QNA);"><span>1:1 문의</span></button></p>
														</th:block>
													</th:block>
												</div>
											</div>
											<!-- 선물 -->
											<th:block th:if="${order.giftPackYn == 'Y'}">
												<!-- 주소 입력 대기중 -->
												<div class="order_text" th:if="${ordDtl.giftAddrInpYn == 'N' and ordDtl.giftLimitDay >= 0}">
													<p th:text="|${deliveryAddrInfo.recipNm}님이 주소를 입력하기 전입니다. (입력기한 ${ordDtl.giftLimitDt})|"></p>
												</div>
	
												<!-- 선물 완료 -->
												<div class="order_text" th:if="${ordDtl.giftAddrInpYn == 'Y' and ordDtl.ordDtlStat != 'G013_98' and ordDtl.ordDtlStat != 'G013_99'}">
													<p th:text="|${deliveryAddrInfo.recipNm}님께 선물이 발송되었습니다.|"></p>
												</div>
	
												<!-- 선물 취소 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_98' and ordDtl.ordDtlStat == 'G013_99'}">
													<p th:text="|주소 입력 기한이 경과되어 선물이 취소 되었습니다.|"></p>
												</div>
											</th:block>
											
											<!-- 주문 -->
											<th:block th:unless="${order.giftPackYn == 'Y'}">
												<!-- 주문 접수 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_10'}">
													<p>주문 완료/결제를 기다리고 있습니다.</p>
	
													<!-- 예약 상품 -->
													<p th:if="${!#strings.isEmpty(ordDtl.delvResDt)}" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
												</div>

												<!-- 결제 완료 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_20' and !#strings.isEmpty(ordDtl.delvResDt)}">
													<!-- 예약 상품 -->
													<p th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
												</div>
												
												<!-- 상품준비중 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_30' or ordDtl.ordDtlStat == 'G013_35'}">
													<p>배송할 상품을 준비 중입니다.</p>
	
													<!-- 예약 상품 -->
													<p th:if="${!#strings.isEmpty(ordDtl.delvResDt)}" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
												</div>
												
												<!-- 배송준비중 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_40'}">
													<p>상품 준비가 완료되어 곧 배송될 예정입니다.</p>
	
													<!-- 예약 상품 -->
													<p th:if="${!#strings.isEmpty(ordDtl.delvResDt)}" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
												</div>
												
												<!-- 배송중 -->
												<div class="order_text" th:if="${(ordDtl.ordDtlStat == 'G013_50' or ordDtl.ordDtlStat == 'G013_55') and (ordDtl.changeableYn == 'N' or ordDtl.returnableYn == 'N')}">
													<p th:if="${ordDtl.changeableYn == 'N' and ordDtl.returnableYn == 'Y'}">해당 상품은 교환이 불가능한 상품입니다. 문의사항은 1:1문의를 이용해주세요.</p>
													<p th:if="${ordDtl.changeableYn == 'Y' and ordDtl.returnableYn == 'N'}">해당 상품은 반품이 불가능한 상품입니다. 문의사항은 1:1문의를 이용해주세요.</p>
													<p th:if="${ordDtl.changeableYn == 'N' and ordDtl.returnableYn == 'N'}">해당 상품은 교환/반품이 불가능한 상품입니다. 문의사항은 1:1문의를 이용해주세요.</p>
												</div>
												
												<!-- 배송완료 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_60'}">
													<p th:if="${ordDtl.changeableYn == 'N' and ordDtl.returnableYn == 'Y'}">해당 상품은 교환이 불가능한 상품입니다. 문의사항은 1:1문의를 이용해주세요.</p>
													<p th:if="${ordDtl.changeableYn == 'Y' and ordDtl.returnableYn == 'N'}">해당 상품은 반품이 불가능한 상품입니다. 문의사항은 1:1문의를 이용해주세요.</p>
													<p th:if="${ordDtl.changeableYn == 'N' and ordDtl.returnableYn == 'N'}">해당 상품은 교환/반품이 불가능한 상품입니다. 문의사항은 1:1문의를 이용해주세요.</p>
													<p th:if="${ordDtl.ordReqChgQty == 0}" th:text="|${ordDtl.autoDecideLeftDay}일 후 자동으로 구매확정됩니다.|"></p>
													<p th:unless="${ordDtl.ordReqChgQty == 0}" th:text="|반품/교환이 진행 중입니다.|"></p>
												</div>
												
												<!-- 구매확정 -->
												<div class="order_text" th:if="${ordDtl.ordDtlStat == 'G013_70' and ordDtl.reviewableYn == 'Y' and ordDtl.reviewSq == null}">
													<p>리뷰를 작성하면 다른 구매자에게 도움이 될 수 있습니다.</p>
												</div>
											</th:block>
										</div>
									</th:block>
									<!-- //주문상품 -->
								</div>
								<div class="goods_foot" th:if="${order.freeGiftList.size() > 0}">
									<div class="order_gift">
										<span class="title">사은품</span>
										<ul>
											<li th:each="freeGift, status : ${order.freeGiftList}">
												<th:block th:text="${freeGift.goodsNm}"></th:block>
												<span th:if="${freeGift.usePoint > 0}" th:text="|(-${#numbers.formatInteger(freeGift.usePoint, 1, 'COMMA')}P)|"></span>
											</li> 
										</ul>
									</div>
								</div>
							</div>
						</th:block>
						<th:block th:if="${paymentInfo.payMeans == 'G014_20'}">
							<h4 class="subH3">무통장 입금 정보</h4>
							<div class="tbl type1">
								<table>
									<colgroup>
										<col width="210">
										<col width="*">
									</colgroup>
									<tbody><tr>
										<th>
											계좌정보/입금기한
										</th>
										<td>
											<div class="single_line">
												<ul>
													<li><span th:text="${paymentInfo.vaBank}"></span>&nbsp;<span th:text="|(${paymentInfo.vaNm})|"></span></li>
													<li><span th:text="${paymentInfo.vaNo}"></span></li>
													<li><span th:text="${paymentInfo.vaDeadlineYmd}"></span>&nbsp;<span th:text="${paymentInfo.vaDeadlineHms}"></span>&nbsp;까지</li>
												</ul>
											</div>
										</td>
									</tr>
									</tbody></table>
							</div>
						</th:block>
						<!-- 선물 -->
						<h4 class="subH3" th:if="${oneData.giftPackYn == 'Y'}">주문자 정보</h4>
						<!-- 주문 -->
						<h4 class="subH3" th:unless="${oneData.giftPackYn == 'Y'}">주문자/배송지 정보</h4>
						<div class="tbl type1">
							<table>
								<colgroup>
									<col width="210">
									<col width="*">
								</colgroup>
								<tbody>
									<tr>
										<th>
											주문 고객
										</th>
										<td>
											<div class="single_line">
												<ul>
													<li><span th:text="${orderInfo.ordNm}"></span></li>
													<li><span th:text="${orderInfo.ordEmail}"></span></li>
													<li><span th:text="${orderInfo.ordPhnno}"></span></li>
												</ul>
											</div>
										</td>
									</tr>
									<!-- 선물 -->
									<tr th:if="${oneData.giftPackYn == 'Y'}">
										<th>
											선물 받으실 분
										</th>
										<td>
											<div class="single_line">
												<ul>
													<li><span th:text="${deliveryAddrInfo.recipNm}"></span></li>
													<li><span th:text="${deliveryAddrInfo.recipPhnno}"></span></li>
												</ul>
											</div>
										</td>
									</tr>
									<tr th:if="${oneData.giftPackYn == 'Y'}">
										<th>
											선물 메세지
										</th>
										<td th:text="${deliveryAddrInfo.giftMsg}" id="giftMsg"></td>
									</tr>
									<!-- 주문 -->
									<tr th:unless="${oneData.giftPackYn == 'Y'}">
										<th>
											배송지 정보
										</th>
										<td>
											<div class="block_line">
												<ul>
													<li>
														<span th:text="${deliveryAddrInfo.recipNm}" id="recipNm"></span>
													</li>
													<li>
														<span th:text="${deliveryAddrInfo.recipPhnno}" id="recipPhnno"></span>
													</li>
													<li>
														<span th:text="|${deliveryAddrInfo.recipBaseAddr} ${deliveryAddrInfo.recipDtlAddr}|" id="recipAddr"></span>
														<button type="button" class="btn btn_default btn_sm" th:if="${canChgAddr == 'Y'}" onclick="fnChangeDeliveryAddr()"><span>배송지 변경</span></button>
													</li>
													<li>
														배송요청 사항&nbsp;:&nbsp;<span id="delvMemo" th:text="${deliveryAddrInfo.delvMemo}"></span>
														<button type="button" class="btn_underline" th:if="${canChgAddr == 'Y'}" onclick="fnChangeDeliveryMemo(this)"><span>변경하기</span></button>
													</li>
												</ul>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<h4 class="subH3">결제정보</h4>
						<div class="tbl type6">
							<table>
								<colgroup>
									<col width="50%">
									<col width="50%">
								</colgroup>
								<tbody>
									<tr>
										<td>
											<dl>
												<div>
													<dt>총 주문금액 (상품금액+배송비+추가비용)</dt>
													<dd>
														<div class="price">
															<span class="order_total_price"><em th:text="${#numbers.formatInteger((orderAmtInfo.ordAmt + orderAmtInfo.cpn1DcAmt) - orderAmtInfo.cnclRtnAmt + orderAmtInfo.realDelvAmt, 1, 'COMMA')}"></em>원</span>
														</div>
													</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.cpn1DcAmt > 0}"> <!-- 할인항목 표기 class명 include_item -->
													<dt>즉시할인</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.cpn1DcAmt, 1, 'COMMA')}|"></em>원</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.tmtb1DcAmt + orderAmtInfo.tmtb2DcAmt > 0}">
													<dt>다다익선 할인</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.tmtb1DcAmt + orderAmtInfo.tmtb2DcAmt, 1, 'COMMA')}|"></em>원</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.cartCpnDcAmt + orderAmtInfo.goodsCpnDcAmt > 0}">
													<dt>쿠폰할인</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.cartCpnDcAmt + orderAmtInfo.goodsCpnDcAmt, 1, 'COMMA')}|"></em>원</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.prePntDcAmt > 0}">
													<dt>선포인트 할인</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.prePntDcAmt, 1, 'COMMA')}|"></em>P</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.pntDcAmt > 0}">
													<dt>포인트 사용</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.pntDcAmt, 1, 'COMMA')}|"></em>P</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.gfcdUseAmt > 0}">
													<dt>상품권 사용</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.gfcdUseAmt + orderAmtInfo.delvGfcdUseAmt, 1, 'COMMA')}|"></em>원</dd>
												</div>
												<div class="include_item" th:if="${paymentInfo.npayPntAmt > 0}">
													<dt>마일리지 사용</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.npayPntAmt, 1, 'COMMA')}|"></em>원</dd>
												</div>
												<div class="include_item" th:if="${orderAmtInfo.pgCpnAmt > 0}">
													<dt>제휴할인</dt>
													<dd><em th:text="|- ${#numbers.formatInteger(orderAmtInfo.pgCpnAmt, 1, 'COMMA')}|"></em>원</dd>
												</div>
											</dl>
										</td>
										<td>
											<dl>
												<div>
													<dt>결제 금액</dt>
													<dd>
														<div class="price">
															<span class="pay_total_price"><em th:text="${#numbers.formatInteger(orderAmtInfo.payAmt - orderAmtInfo.npayPntAmt - orderAmtInfo.pgCpnAmt, 1, 'COMMA')}"></em>원</span>
														</div>
													</dd>
												</div>
												<div>
													<dt class="sr-only">결제방법</dt>
													<!-- TODO -->
													<!-- Style24 간편결제 처리 (STYLE24 간편결제 : STYLE24 간편결제명 / 카드사명 / 할부개월(일시불)) -->
													<dd th:if="${paymentInfo.pgGb == 'NAVER'}">네이버 페이</dd>
													<dd th:if="${paymentInfo.pgGb == 'KAKAO'}">카카오 페이</dd>
													<dd th:if="${paymentInfo.pgGb == 'PAYCO'}">PAYCO</dd>
													<dd th:if="${paymentInfo.pgGb == 'KCP' and paymentInfo.payMeans == 'G014_10'}">실시간계좌이체</dd>
													<dd th:if="${paymentInfo.pgGb == 'KCP' and paymentInfo.payMeans == 'G014_20'}">무통장입금</dd>
													<dd th:if="${paymentInfo.pgGb == 'KCP' and paymentInfo.payMeans == 'G014_30'}" th:text="|${paymentInfo.cardNm}/${paymentInfo.cardMips}|"></dd>
													<dd th:if="${paymentInfo.pgGb == 'KCP' and paymentInfo.payMeans == 'G014_60'}">휴대폰결제</dd>
												</div>
												<div>
													<dt class="sr-only">영수증 확인</dt>
													<dd>
														<button type="button" class="btn btn_default btn_sm" th:if="${paymentInfo.pgGb == 'KCP' and paymentInfo.payMeans == 'G014_30'}" onclick="fnReceipt('card')"><span>신용카드 전표</span></button>
														<button type="button" class="btn btn_default btn_sm" th:if="${paymentInfo.pgGb == 'KCP' and not #strings.isEmpty(paymentInfo.cashAuthNo) and (paymentInfo.payMeans == 'G014_10' or paymentInfo.payMeans == 'G014_20')}" onclick="fnReceipt('cash')"><span>현금 영수증</span></button>
														<th:block th:if="${diffDays < 90}">
														<button type="button" class="btn btn_default btn_sm" th:if="${orderAmtInfo.gfcdUseAmt > 0 and (cashReceiptsInfo == null or #strings.isEmpty(cashReceiptsInfo.authNo))}" th:attr="ordNo=${ordNo}" onclick="fnRequestCashReceipt(this);"><span>상품권 현금 영수증 신청</span></button>
														</th:block>
													</dd>
												</div>
											</dl>
											<dl>
												<div>
													<dt>적립 예정 포인트</dt>
													<dd>
														<span class="save_point"><em th:text="|${#numbers.formatInteger(orderAmtInfo.savePntAmt, 1, 'COMMA')}P|"></em></span>
													</dd>
												</div>
											</dl>
										</td>
									</tr>
								</tbody>
							</table>
							<p class="t_help">※ NPAY등의 대체결제수단으로 결제 시 해당 결제 플랫폼에서 영수증 확인이 가능합니다.</p>
						</div>
						<div class="btn_footer_area">
							<button type="button" class="btn btn_dark btn_md" onclick="cfnGoToPage(_PAGE_MYPAGE_ORDER_LIST);"><span>확인</span></button>
						</div>
					</div>
				</form>
			</div>
			<!-- // CONT-BODY -->
		</div>

		<!-- 환불계좌 등록 팝업 -->
		<div class="modal fade refund_pop" id="refundPop" tabindex="-1" role="dialog" aria-labelledby="refundLabel" aria-hidden="true">
			<div class="modal-dialog" role="document">
				<div class="modal-content"></div>
			</div>
			<a href="#close-modal" rel="modal:close" id="refundPop_close" class="close-modal">Close</a>
			<a href="#close-modal" rel="modal:close" class="close-modal ">Close</a>
		</div>
		<!-- //환불계좌 등록 팝업 -->
	</div>
<script src="/ux/plugins/gaga/gaga.paging.js"></script>
<script th:inline="javascript">
	let ordNo = [[${ordNo}]];
	var isLogin = [[${isLogin}]];
	let orderList = [[${orderList}]];
	let oneData = [[${oneData}]];
	let paymentInfo = [[${paymentInfo}]];
	let orderAmtInfo = [[${orderAmtInfo}]];
	let deliveryAddrInfo = [[${deliveryAddrInfo}]];
	let kcpReceiptUrl = [[${@environment.getProperty('pg.kcp.receipt.url')}]];
	let giftMsg = [[${deliveryAddrInfo.giftMsg}]];
	let jsonObj = {};

	$(document).ready(function() {
		// 마이페이지 LNB 설정
		fnSetMypageLnbList(1);
		
		// 마이페이지 location 설정
		fnSetMypageLocation('주문확인/배송조회', '_PAGE_MYPAGE_ORDER_LIST', '주문상세');

		// 선물메시지
		if ($("#giftMsg").html() != null) {
			$("#giftMsg").html(giftMsg.replaceAll("\n", "</br>"));
		}
	});
	
	// 전체취소 버튼 클릭 이벤트
	var fnAllCancel = function() {
		// 환불계좌 체크
		let accountNo = $('#orderDetailForm input[name=accountNo]').val();
		let accountNm = $('#orderDetailForm input[name=accountNm]').val();
		let bankCd = $('#orderDetailForm input[name=bankCd]').val();

		if (paymentInfo.payMeans == 'G014_20' && paymentInfo.payStat == 'G016_30' && (gagajf.isNull(accountNo) || gagajf.isNull(accountNm) || gagajf.isNull(bankCd))) {
			let data = {};
			data.ordNo = oneData.ordNo;
			data.accountNm = oneData.accountNm;
			
			let jsonData = JSON.stringify(data);
			
			$.ajax( {
				type		: "POST",
				url 		: '/mypage/refund/account/register/popup/form',
				data		: jsonData,
				dataType 	: 'html',
				beforeSend : function(xhr, settings) {
					xhr.setRequestHeader("AJAX"			, "true");
					xhr.setRequestHeader('Accept'		, 'application/json');
					xhr.setRequestHeader('Content-Type'	, 'application/json');
				},
				success 	: function(result) {
					$("#refundPop .modal-dialog .modal-content").html(result);
					$("#refundPop").modal("show");
				}
			});
			
			return false;
		}

		mcxDialog.confirm('전체취소 처리하시겠습니까?', {
			cancelBtnText: "취소",
			sureBtnText: "확인",
			sureBtnClick: function(){
				// 취소요청 데이터 설정
				let url = '/mypage/cancel';
				
				// 주문상세번호 설정
				let ordDtlNoArr = [];
				$.each($('#orderDetailForm input[name=ordDtlNoArr]'), function(idx, item) {
					ordDtlNoArr.push($(item).val());
				});
				
				// 취소 수량 설정
				let cnclRtnReqQtyArr = [];
				$.each($('#orderDetailForm input[name=cnclRtnReqQtyArr]'), function(idx, item) {
					cnclRtnReqQtyArr.push($(item).val());
				});
				
				// 전체 취소 처리
				let data = {};
				data.ordNo = ordNo;
				data.chgReason = 'G686_10';
				data.chgReasonNm = '고객변심';
				data.accountNo = accountNo;
				data.accountNm = accountNm;
				data.bankCd = bankCd;
				data.isCustomer = true;
				data.reqGbn = 'cnclComplete';
				data.ordDtlNoArr = ordDtlNoArr;
				data.cnclRtnReqQtyArr = cnclRtnReqQtyArr;
				
				let jsonData = JSON.stringify(data);

				// 취소 처리 가능 여부 조회
				gagajf.ajaxJsonSubmit('/mypage/wms/cancel/available', jsonData, function(result) {
					let cancelYn = result.cancelYn;

					if (cancelYn == 'Y') {
						// 전체취소 처리
						gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
							cfnGoToPage(_PAGE_MYPAGE_CRE_LIST);
						}, true);
					} else {
						mcxDialog.alert('이미 배송처리 되어 전체취소 처리에 실패 하였습니다.');
					}
				});
				
				
			}
		});
	}

	// 배송지 정보 설정
	var delvAddrSet = function(delvObj) {
		let delvAddrSq = deliveryAddrInfo.delvAddrSq;
		let recipNm = delvObj.recipNm;
		let recipPhnno = delvObj.recipPhnno;
		let recipZipcode = delvObj.recipZipcode;
		let recipBaseAddr = delvObj.recipBaseAddr;
		let recipDtlAddr = delvObj.recipDtlAddr;
		let delvMemo = delvObj.delvMemo;
		
		$('#recipNm').text(recipNm);
		$('#recipPhnno').text(recipPhnno);
		$('#recipAddr').text(recipBaseAddr + ' ' + recipDtlAddr);
		$('#delvMemo').text(delvMemo);
		
		let url = '/mypage/change/delvery/addr';
		let data = {};
		data.ordNo			= ordNo;
		data.delvAddrSq = delvAddrSq;
		data.recipNm = recipNm;
		data.recipPhnno = recipPhnno;
		data.recipZipcode = recipZipcode;
		data.recipBaseAddr = recipBaseAddr;
		data.recipDtlAddr = recipDtlAddr;
		data.delvMemo = delvMemo;
		
		let jsonData = JSON.stringify(data);
		
		gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
		})
	}
	
	// 배송메모 설정
	var delvMemoSet = function(delvMemoObj) {
		let url = '/mypage/change/delvery/memo';
		let delvMemo = delvMemoObj.delvMemo;

		let data = {};
		data.delvMemo = delvMemo;
		data.ordNo = ordNo;
		data.delvAddrSq = oneData.delvAddrSq;

		let jsonData = JSON.stringify(data);

		gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
		})

		$("#delvMemo").text(delvMemo);
	}

	// 환불계좌 등록 콜백 처리
	var fnRegisterAccountCallback = function(result) {
		// 환불계좌 정보 설정
		$('#orderDetailForm input[name=accountNo]').val(result.accountNo);
		$('#orderDetailForm input[name=accountNm]').val(result.accountNm);
		$('#orderDetailForm input[name=bankCd]').val(result.bankCd);
		
		// 반품처리
		fnAllCancel();
	}

	// 상품권 현금영수증 신청 처리
	var fnRequestCashReceipt = function(param) {
		let url = '/mypage/cash/receipts/request';
		let ordNo = $(param).attr('ordNo');
		
		let data = {};
		data.ordNo = ordNo;
		
		let jsonData = JSON.stringify(data);
		
		gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
			cfnGoToPage(_PAGE_MYPAGE_ORDER_DETAIL + ordNo);
		}, true);
	}
	
	// 전체구매확정 버튼 클릭 이벤트
	var fnAllDecideOrder = function(param) {
		let orderDecisionArr = [];
		let ordNo = $(param).attr('ordNo');

		// 주문상세번호 설정
		$.each($('#orderDetailForm input[name=ordDtlNoArr]'), function(idx, item) {
			orderDecisionArr.push($(item).val());
		});
		
		if (orderDecisionArr.length == 0) {
			mcxDialog.alert('구매확정 가능한 상품이 없습니다.');
			return false;
		}
		
		mcxDialog.confirm('구매확정 후에는 반품/교환이 불가합니다. 구매확정하시겠습니까?', {
			cancelBtnText: "취소",
			sureBtnText: "확인",
			sureBtnClick: function(){
				let data = {};
				
				data.ordNo = ordNo;
				data.ordDtlNoArr = orderDecisionArr;
				
				var jsonData = JSON.stringify(data);
				gagajf.ajaxJsonSubmit('/mypage/order/decision'
					, jsonData
					, function() {
						if (typeof(fnReloadStatusCount) == 'function') {
							fnReloadStatusCount();
						} else {
							cfnGoToPage(_PAGE_MYPAGE_ORDER_DETAIL + ordNo);
						}
					});
			}
		});
	}
</script>

</th:block>

</body>
</html>
