<!-- 주문목록이 있을때 -->
<th:block th:if="${#lists.size(orderList) > 0}">
	<th:block th:each="order , i : ${orderList}">
		<div class="inner">
			<div class="part_goods">
				<div class="goods_top">
					<div class="goods_date">주문일<span class="date" th:text="${order.ordDt}"></span></div>
					<a href="javascript:void(0);" class="detail_btn" th:ordno="${order.ordNo}" onclick="fnGoToOrderDetail(this, 'noMember')">주문상세보기</a>
				</div>
				
				<!-- 주문목록 -->
				<th:block th:each="ordDtl , j : ${order.ordDtlList}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
					<!-- 주문 접수 -->
					<div class="goods_section">
						<div class="goods_status">
							<!-- 일반배송일때 -->
							<th:block th:if="${ordDtl.giftPackYn} == 'N'">
								<p class="dlvr_staus" th:if="${ordDtl.ordDtlStat == 'G013_10'}">주문접수</p>
								<p class="dlvr_staus" th:if="${ordDtl.ordDtlStat == 'G013_35'}">상품준비중</p>
								<p class="dlvr_staus" th:unless="${ordDtl.ordDtlStat == 'G013_10' or ordDtl.ordDtlStat == 'G013_35'}" th:text="${ordDtl.ordDtlStatNm}"></p>
							</th:block>
							<!-- //일반배송일때 -->
						</div>
						<div class="goods_detail">
							<a href="javascript:void(0)" th:attr="goodsCd=${ordDtl.goodsCd}, optCd1=${ordDtl.goodsType == 'G056_N' ? ordDtl.optCd1 : ''}, ithrCd='IN20_01'" onclick="fnGoToGoodsDetail(this)">
								<div class="thumb_box">
									<img th:src="${imageUrl + '/' + ordDtl.sysImgNm + '?RS=90'}" width="100%" alt="">
								</div>
								<div class="info_box">
									<div class="od_name">
										<div class="brand">
											<span th:text="${ordDtl.brandNm}"></span>
											<div class="badge_wrap">
												<th:block th:if="${ordDtl.shotDelvYn} == 'Y'">
													<em class="order_badge order_bullet_badge">총알배송</em>
												</th:block>
												<th:block th:if="${ordDtl.shotDelvYn == 'N' and ordDtl.selfGoodsYn == 'Y'}">
													<em class="order_badge">STYLE24 일반배송</em>
												</th:block>
												<th:block th:if="${ordDtl.shotDelvYn} != 'Y' and ${ordDtl.selfGoodsYn} != 'Y'">
													<em class="order_badge">업체직배송</em>
												</th:block>
											</div>
										</div>
										<div class="name" th:text="${ordDtl.goodsNm}"></div>
									</div>
									<div class="od_opt">
										<div class="option" th:each="colorNm, index : ${ordDtl.colorNmArr}">
											<em th:text="${colorNm}"></em>
											<em th:text="${ordDtl.optCd2Arr[index.index]}"></em>
										</div>
									</div>
									<div class="od_calc">
										<!-- 판매금액과 할인금액이 같으면 표시 안함 -->
										<th:block th:if="(${ordDtl.ordAmt} - ${ordDtl.cnclRtnAmt}) > ${ordDtl.realOrdAmt} + ${ordDtl.pntDcAmt} + ${ordDtl.gfcdUseAmt}">
											<p class="sale_price">
												<del>
													<em th:text="${#numbers.formatInteger(ordDtl.ordAmt - ordDtl.cnclRtnAmt, 1, 'COMMA')}"></em>원
												</del>
											</p>
										</th:block>
										<p class="price">
											<span class="selling_price">
												<em th:text="${#numbers.formatInteger(ordDtl.realOrdAmt + ordDtl.pntDcAmt + ordDtl.gfcdUseAmt, 1, 'COMMA')}"></em>원
											</span>
											<span class="count">
												<em th:text="${ordDtl.ordQty} - ${ordDtl.cnclRtnQty}"></em>개
											</span>
										</p>
									</div>
								</div>
							</a>
						</div>
						
						<!-- 버튼기능정리 -->
						<!-- 일반배송 -->
						<th:block th:unless="${ordDtl.giftPackYn} == 'Y'">
							<!-- 입금대기 (1:1문의, 쇼핑백 담기) -->
							<th:block th:if="${ordDtl.ordDtlStat == 'G013_10'}">
								<div class="goods_btn_wrap btn_group_flex">
									<div>
										<button type="button" class="btn btn_default btn_cart_save" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);">
											<span>쇼핑백 담기</span>
										</button>
									</div>
								</div>
							</th:block>
							<!-- //입금대기 (1:1문의, 쇼핑백 담기) -->

							<!-- 결제완료, 상품준비중, 출고처지정 (주문취소) -->
							<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">-->
									<div class="goods_btn_wrap btn_group_flex">
										<div>
											<button type="button" class="btn btn_default btn_cncl_complete" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" th:ordCanChgQty="${ordDtl.ordCanChgQty}" th:delvFeeCd="${ordDtl.delvFeeCd}" onclick="fnCreateChange(this, 'cancel', 'noMember');">
												<span>주문 취소</span>
											</button>
										</div>
									</div>
<!--									</th:block>-->
								</th:block>
								<th:block th:unless="${ordDtl.ordExchGb == 'O'}">
									<div class="goods_btn_wrap btn_group_flex">
										<div>
											<button type="button" class="btn btn_default btn_cart_save" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);">
												<span>쇼핑백 담기</span>
											</button>
										</div>
									</div>
								</th:block>
							</th:block>
							<!-- //결제완료, 상품준비중, 출고처지정 (주문취소) -->
							
							<!-- 배송준비중-->
							<th:block th:if="${ordDtl.ordDtlStat} == 'G013_40'">
								<div class="goods_btn_wrap btn_group_flex">
									<div>
										<button type="button" class="btn btn_default btn_cart_save" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);">
											<span>쇼핑백 담기</span>
										</button>
									</div>
								</div>
							</th:block>
							<!-- //배송준비중-->
							
							<!-- 배송중 (교환가능, 반품가능) -->
							<th:block th:if="${ordDtl.ordDtlStat} == 'G013_50' or ${ordDtl.ordDtlStat} == 'G013_55'">
								<!-- 교환가능, 반품가능 -->
								<th:block th:if="${ordDtl.changeableYn} == 'Y' or ${ordDtl.returnableYn} == 'Y'">
									<div class="goods_btn_wrap btn_group_flex">
										<th:block th:if="${ordDtl.changeableYn} == 'Y'">
											<div>
												<button type="button" class="btn btn_default btn_exch_req" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" th:ordCanChgQty="${ordDtl.ordCanChgQty}" th:delvFeeCd="${ordDtl.delvFeeCd}" onclick="fnCreateChange(this, 'exchange', 'noMember');">
													<span>교환 신청</span>
												</button>
											</div>
										</th:block>
										<th:block th:if="${ordDtl.returnableYn} == 'Y'">
											<div>
												<button type="button" class="btn btn_default btn_rtn_req" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" th:ordCanChgQty="${ordDtl.ordCanChgQty}" th:delvFeeCd="${ordDtl.delvFeeCd}" onclick="fnCreateChange(this, 'return', 'noMember');">
													<span>반품 신청</span>
												</button>
											</div>
										</th:block>
										<div><button type="button" class="btn btn_default btn_delv_sch" th:attr="ordNo=${ordDtl.ordNo}, ordDtlNo=${ordDtl.ordDtlNo}, shipCompCd=${ordDtl.shipCompCd}, invoiceNo=${ordDtl.invoiceNo}" onclick="fnGoToDelivery(this, 'noMember');"><span>배송 조회</span></button></div>
									</div>
								</th:block>
								<!-- //교환가능, 반품가능 -->
							</th:block>
							<!-- //배송중 (교환가능, 반품가능) -->
								
							<!-- 배송완료 (교환가능, 반품가능) -->
							<th:block th:if="${ordDtl.ordDtlStat} == 'G013_60'">
								<div class="goods_btn_wrap btn_group_flex" th:if="${ordDtl.changeableYn == 'Y' or ordDtl.returnableYn == 'Y'}">
									<!-- 교환가능, 반품가능 -->
									<th:block th:if="${ordDtl.changeableYn} == 'Y'">
										<div>
											<button type="button" class="btn btn_default btn_exch_req" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" th:ordCanChgQty="${ordDtl.ordCanChgQty}" th:delvFeeCd="${ordDtl.delvFeeCd}" onclick="fnCreateChange(this, 'exchange', 'noMember');">
												<span>교환 신청</span>
											</button>
										</div>
									</th:block>
									<th:block th:if="${ordDtl.returnableYn} == 'Y'">
										<div>
											<button type="button" class="btn btn_default btn_rtn_req" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" th:ordCanChgQty="${ordDtl.ordCanChgQty}" th:delvFeeCd="${ordDtl.delvFeeCd}" onclick="fnCreateChange(this, 'return', 'noMember');">
												<span>반품 신청</span>
											</button>
										</div>
									</th:block>
									<!-- //교환가능, 반품가능 -->
								</div>
							</th:block>
							<!-- //배송완료 (교환가능, 반품가능) -->
							
							<!-- 구매확정 -->
							<th:block th:if="${ordDtl.ordDtlStat} == 'G013_70'">
								<div class="goods_btn_wrap btn_group_flex">
									<div>
										<button type="button" class="btn btn_default btn_cart_save" th:ordNo="${ordDtl.ordNo}" th:ordDtlNo="${ordDtl.ordDtlNo}" onclick="fnCreateCart(this);">
											<span>쇼핑백 담기</span>
										</button>
									</div>
								</div>
							</th:block>
							<!-- //구매확정 -->
						</th:block>
						<!-- //버튼기능정리 -->

						<!-- 상태문구정리 -->
						<!-- 배송중, 배송완료 상태 교환, 반품 가능 상태 체크 -->
						<th:block th:if="${ordDtl.ordDtlStat} == 'G013_50' or ${ordDtl.ordDtlStat} == 'G013_55' or ${ordDtl.ordDtlStat} == 'G013_60'">
							<div class="goods_alert">
							<!-- 교환불가능, 반품불가능 -->
							<th:block th:if="${ordDtl.changeableYn} == 'N' and ${ordDtl.returnableYn} == 'N'">
								<p class="cf_txt cf_desc">해당 상품은 교환/반품이 불가능한 상품입니다.<br>문의사항은 1:1 문의를 이용해 주세요.</p>
							</th:block>
							<!-- //교환불가능, 반품불가능 -->

							<!-- 교환불가능 -->
							<th:block th:if="${ordDtl.changeableYn} == 'N'">
								<p class="cf_txt cf_desc">해당 상품은 교환이 불가능한 상품입니다.<br>문의사항은 1:1 문의를 이용해 주세요.</p>
							</th:block>
							<!-- //교환불가능 -->

							<!-- 반품불가능 -->
							<th:block th:if="${ordDtl.returnableYn} == 'N'">
								<p class="cf_txt cf_desc">해당 상품은 반품이 불가능한 상품입니다.<br>문의사항은 1:1 문의를 이용해 주세요.</p>
							</th:block>
							<!-- //반품불가능 -->
							</div>
						</th:block>
						<!-- //배송중, 배송완료 상태 -->

						<!-- 주문접수 -->
						<th:block th:if="${ordDtl.ordDtlStat} == 'G013_10'">
							<div class="goods_txt">
								<p class="cf_txt cf_desc">주문 완료 / 결제를 기다리고 있습니다.</p>
								<th:block th:if="${ordDtl.delvResDt} != null">
									<p class="cf_txt cf_desc" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
								</th:block>
							</div>
						</th:block>
						<!-- //주문접수 -->

						<!-- 결제완료 -->
						<th:block th:if="${ordDtl.ordDtlStat == 'G013_20' and !#strings.isEmpty(ordDtl.delvResDt)}">
							<div class="goods_txt">
								<p class="cf_txt cf_desc" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
							</div>
						</th:block>
						<!-- //결제완료 -->

						<!-- 상품준비중 -->
						<th:block th:if="${ordDtl.ordDtlStat} == 'G013_30' or ${ordDtl.ordDtlStat} == 'G013_35'">
							<div class="goods_txt">
								<p class="cf_txt cf_desc">배송할 상품을 준비 중입니다.</p>
								<th:block th:if="${ordDtl.delvResDt} != null">
									<p class="cf_txt cf_desc" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
								</th:block>
							</div>
						</th:block>
						<!-- //상품준비중 -->

						<!-- 배송준비중 -->
						<th:block th:if="${ordDtl.ordDtlStat} == 'G013_40'">
							<div class="goods_txt">
								<p class="cf_txt cf_desc">상품 준비가 완료되어 곧 배송될 예정입니다.</p>
								<th:block th:if="${ordDtl.delvResDt} != null">
									<p class="cf_txt cf_desc" th:text="|예약판매 상품으로 ${ordDtl.delvResDt} 출고 예정입니다.|"></p>
								</th:block>
							</div>
						</th:block>
						<!-- //배송준비중 -->

						<!-- 배송완료 -->
						<th:block th:if="${ordDtl.ordDtlStat} == 'G013_60'">
							<div class="goods_txt">
								<p class="cf_txt cf_desc" th:if="${ordDtl.ordReqChgQty == 0}" th:text="|${ordDtl.autoDecideLeftDay}일 후 자동으로 구매확정됩니다.|"></p>
								<p class="cf_txt cf_desc" th:unless="${ordDtl.ordReqChgQty == 0}" th:text="||반품/교환이 진행 중입니다.||"></p>
							</div>
						</th:block>
						<!-- //배송완료 -->

						<!-- 구매확정 -->
						<th:block th:if="${ordDtl.ordDtlStat} == 'G013_70'">
						</th:block>
						<!-- //구매확정 -->
						<!-- //상태문구정리 -->
						
						<!-- 사은품 영역 -->
						<th:block th:if="${#lists.size(order.ordDtlList) == j.count}">
							<th:block th:if="${order.freeGiftList != null and #lists.size(order.freeGiftList) > 0}">
								<div class="goods_gift">
									<div class="gift_wrap">
										<div class="title">사은품</div>
										<div class="li_gift">
											<ul>
												<th:block th:each="freeGift , j : ${order.freeGiftList}">
													<li>
														<span class="gift_name" th:text="${freeGift.goodsNm}"></span> 
														<th:block th:if="${freeGift.usePoint} > 0">
															<span class="deduct_p" th:text="|(-${#numbers.formatInteger(freeGift.usePoint, 1, 'COMMA')}P)|"></span>
														</th:block>
													</li>
												</th:block>
											</ul>
										</div>
									</div>
								</div>
							</th:block>
						</th:block>
						<!-- //사은품 영역 -->
					</div>
					<!-- //주문 접수 -->
				</th:block>
				<!-- //주문목록 -->
			</div>
		</div>
	</th:block>
</th:block>
<!-- //주문목록이 있을때 -->
<!-- 주문목록이 없을때 -->
<th:block th:if="${#lists.size(orderList) < 1}">
	<div class="inner">
		<div class="part_goods">
			<div class="nodata">
				<div class="txt_box">
					<p>주문내역이 없습니다.<br/></p>
				</div>
			</div>
		</div>
	</div>
</th:block>
<!-- //주문목록이 없을때 -->

<script th:inline="javascript">
</script>

</th:block>

