<!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.05.04   card007     최초 작성
 *******************************************************************************
 -->
<body>

<th:block layout:fragment="content">
	<div class="content myOrderView"> <!-- 페이지특정 클래스 = 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">
				<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}">
						<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>
<!--								<li><a href="javascript:void(0)" th:if="${allCanYn == 'Y' and order.ordReqChgQty == 0}" onclick="fnAllCancel();">주문전체취소</a></li>-->
<!--								<li><a href="javascript:void(0)" th:if="${allDecideYn == 'Y'}"  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_03'" 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'}">
														<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="|${ordDtl.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="|${ordDtl.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_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>
					</th:block>
					<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="${deliveryAddrInfo.recipNm}"></span></li>
												<li><span th:text="${deliveryAddrInfo.recipPhnno}"></span></li>
											</ul>
										</div>
									</td>
								</tr>
								<tr>
									<th>제품 정보</th>
									<td th:text="|${oneData.brandNm} ${oneData.goodsNm}|"></td>
								</tr>
								<tr>
									<th>송장 번호</th>
									<td th:text="${oneData.invoiceNo}"></td>
								</tr>
								<tr>
									<th>배송 주소</th>
									<td th:text="|${deliveryAddrInfo.recipBaseAddr} ${deliveryAddrInfo.recipDtlAddr}|"></td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="tbl type5 mt60">
						<table>
							<colgroup>
								<col width="25%">
								<col width="25%">
								<col width="25%">
								<col width="25%">
							</colgroup>
							<thead>
								<tr>
									<th scope="col">시간</th>
									<th scope="col">장소</th>
									<th scope="col">유형</th>
									<th scope="col">전화번호</th>
								</tr>
							</thead>
							<tbody>
								<tr th:if="${sweetTrackerInfoList}" th:each="sweetTrackerInfo, status : ${sweetTrackerInfoList}">
									<td th:text="${sweetTrackerInfo.timeTrans}"></td>
									<td th:text="${sweetTrackerInfo.delvWhere}"></td>
									<td th:text="${sweetTrackerInfo.details}"></td>
									<td th:text="${sweetTrackerInfo.telno}"></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!-- // CONT-BODY -->
		</div>
	</div>
<script src="/ux/plugins/gaga/gaga.paging.js"></script>
<script th:inline="javascript">
	let ordNo = [[${ordNo}]];
	var isLogin = [[${isLogin}]];

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

</th:block>

</body>
</html>
