<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org">
<!--
 *******************************************************************************
 * @source  : GoodsShopBenefitFormWeb.html
 * @desc    : 쇼핑혜택 팝업
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.03.09   eskim        최초 작성
 *******************************************************************************
 -->
<div class="modal-dialog" role="document">
	<div class="modal-content">
		<div class="modal-header">
			<h5 class="modal-title" id="bnfShoppingLabel">쇼핑혜택</h5>
		</div>
		<div class="modal-body">
			<div class="pop_cont">
				<div class="benefit_blk" th:if="${(goodsCouponList != null and !goodsCouponList.empty) or (goodsCoupon1List != null and !goodsCoupon1List.empty)}">
					<h6>할인혜택</h6>
					<div class="tbl type1">
						<table>
							<colgroup>
								<col width="50%">
								<col width="*">
							</colgroup>
							<tbody>
								<tr th:if="${(goodsCoupon1List != null and !goodsCoupon1List.empty)}">
									<th>즉시할인</th>
									<td th:each="goodsCoupon, status : ${goodsCoupon1List}" th:if="${status.first}">
									<th:block th:if="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${#numbers.formatInteger(goodsCoupon.dcVal, 0,'COMMA')}원|"></th:block>
									<th:block th:unless="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${goodsCoupon.dcVal}%|"></th:block>
									 할인</td>
								</tr>
								<tr th:if="${(goodsCouponList != null and !goodsCouponList.empty)}">
									<th>쿠폰할인</th>
									<td th:each="goodsCoupon, status : ${goodsCouponList}" th:if="${status.first}">최대
									<th:block th:if="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${#numbers.formatInteger(goodsCoupon.dcVal, 0,'COMMA')}원|"></th:block>
									<th:block th:unless="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${goodsCoupon.dcVal}%|"></th:block>
									 할인</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="benefit_blk" th:if="${(tmtbList != null and !tmtbList.empty)}">
					<h6>다다익선</h6>
					<div class="tbl type1">
						<table>
							<colgroup>
								<col width="50%">
								<col width="*">
							</colgroup>
							<tbody>
								<tr th:each="tmtb, status : ${tmtbList}">
									<th><th:block th:text="${#numbers.formatInteger(tmtb.sectionVal, 0,'COMMA')}"></th:block><th:block th:text="${(tmtb.sectionGb == 'G810_10')? '개':'원'}"></th:block> 이상 구매 시</th>
									<td><th:block th:text="${#numbers.formatInteger(tmtb.dcVal, 0,'COMMA')}"></th:block><th:block th:text="${(tmtb.dcWay == 'G240_10')? '원':'%'}"></th:block> 할인</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="benefit_blk" th:if="${freeGoodsList != null and !freeGoodsList.empty}">
					<h6>사은품</h6>
					<div class="tbl type1">
						<table>
							<colgroup>
								<col width="50%">
								<col width="*">
							</colgroup>
							<tbody> 
								<tr th:each="freeGoods, status : ${freeGoodsList}">
									<td>
										<div class="th"><th:block th:text="${#numbers.formatInteger(freeGoods.sectionVal, 0,'COMMA')}"></th:block><th:block th:text="${(freeGoods.sectionGb == 'G810_10')? '개':'원'}"></th:block> 이상 구매 시</div>
										<th:block th:each="goodsNm : ${#strings.arraySplit(freeGoods.freeGoods,',')}" th:with="goodsArray=${#strings.arraySplit(goodsNm,'@:')}">
										<div class="td"><th:block th:text="${goodsArray[0]}"></th:block> <th:block th:text="${goodsArray[1]}"></th:block>개 증정 
										<th:block th:if="${freeGoods.allYn == 'N'}" th:text="${'외 택1'}"></th:block></div>
										</th:block>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>					 
			</div>
		</div>
	</div>
</div>
<a href="javascript:void(0);" rel="modal:close" onclick="cfCloseLayer('layer_shopping_benefit')" class="close-modal">Close</a> 	
 </html>