<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org">
<!--
 *******************************************************************************
 * @source  : GoodsInstockAlarmFormWeb.html
 * @desc    : 재입고알림 팝업
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.03.02   eskim        최초 작성
 *******************************************************************************
 -->
<div class="modal-dialog" role="document">
	<div class="modal-content">
		<div class="modal-header">
			<h5 class="modal-title" id="pushRestockLabel">재입고 알림 신청</h5>
		</div>
		<div class="modal-body">
			<form name="goodsInstockAlarmForm" id="goodsInstockAlarmForm" method="post">
			<input type="hidden" name="goodsCd" th:value="${goodsInfo.goodsCd}"/>
			<input type="hidden" name="optCd1" th:value="${goodsInfo.colorCd}"/>
			<input type="hidden" name="optCd" />
			<input type="hidden" name="optCd2" />
			<div class="pop_cont">
				<div class="item_blk">
					<div class="item_prod" th:with="imgGoodsUrl=${@environment.getProperty('upload.goods.view')}, uxImgUrl=${@environment.getProperty('domain.uximage')}">
						<div class="item_state">
							<a href="javascript:void(0);" class="itemLink">
								<div class="itemPic">
									<img alt="" class="vLHTC pd_img" th:src="${imgGoodsUrl+'/'+goodsInfo.sysImgNm+'?RS=70'}">
								</div>
								<p class="itemBrand" th:text="${goodsInfo.brandGroupNm}">NBA 키즈</p>
								<div class="itemName" th:text="${goodsInfo.goodsFullNm}">유니 삼단블록 플리스 집업 유니 삼단블록 플리스 집업 유니 삼단블록 플리스 집업</div>
								<p class="itemPrice">
									<span class="itemPrice_original" th:if="${goodsInfo.listPrice > goodsInfo.currPrice}" th:text="${#numbers.formatInteger(goodsInfo.listPrice, 0,'COMMA')}">149,000</span>
									<th:block th:text="${#numbers.formatInteger(goodsInfo.currPrice, 0,'COMMA')}"> 134,100</th:block>
									<span class="itemPercent" th:if="${goodsInfo.dcRate > 0}" th:text="|${#numbers.formatDecimal(goodsInfo.dcRate,0,0)}%|">30%</span>
								</p>
							</a>
						</div>
					</div>
				</div>
				<th:block th:if="${goodsInfo.selfGoodsYn =='Y' }">
				<div class="select_blk" th:if="${goodsOption2List != null and !goodsOption2List.empty}" >
					<h6>사이즈 선택</h6>
					<div class="opt_size">
						<div class="form_field size_select">
							<th:block  th:each="goodsOption2, status : ${goodsOption2List}">
							<th:block th:if="${goodsOption2.soldoutYn == 'Y' or goodsOption2.stockQty <= 0}" >
							<div>
								<input type="radio" name="opt" th:id="${'alarmSize'+goodsOption2.optCd}" th:value="${goodsOption2.optCd2}" th:attr="optCd=${goodsOption2.optCd}" >
								<label th:for="${'alarmSize'+goodsOption2.optCd}"><span th:text="${goodsOption2.optCd2}" >90</span></label>
							</div>
							</th:block>
							</th:block>
						</div>
					</div>
				</div>
				</th:block>
				<th:block th:if="${goodsInfo.selfGoodsYn =='N' }">
				<div class="select_blk">
					<h6>옵션 선택</h6>
					<div class="opt_select">
						<div class="opt_header">
							<span class="title">옵션</span>
							<button type="button" id="btn_infoSize_pop" class="btn_popup"><span>사이즈정보</span></button>
						</div>
						<div class="form_field">
							<div class="select_custom item_opt3">
								<div class="combo">
									<div class="select">선택</div>
									<ul class="list">
										<!-- 선택처리 class="selected" / 선택불가 aria-disabled="true" / 품절표기 data-soldout="true" 추가  -->
										<li class="selected">선택</li> 
										<li>상품옵션01</li>
										<li>상품옵션02</li>
										<li>상품옵션03</li>
										<li aria-disabled="true">
											<div>상품옵션05</div>
											<div>120,000원</div>
										</li>
										<li>상품옵션06</li>
										<li aria-disabled="true" data-soldout="true">
											<div>상품옵션07</div>
											<div>120,000원</div>
										</li>
									</ul>
								</div>
							</div>
						</div>
						<div class="form_field">
							<div class="select_custom item_opt4" disabled>
								<div class="combo">
									<div class="select">선택</div>
									<ul class="list">
										<!-- 선택처리 class="selected" / 선택불가 aria-disabled="true" / 품절표기 data-soldout="true" 추가  -->
										<li class="selected">선택</li> 
										<li>상품옵션11</li>
										<li>상품옵션12</li>
										<li>상품옵션13</li>
										<li aria-disabled="true">
											<div>상품옵션15</div>
											<div>120,000원</div>
										</li>
										<li>상품옵션16</li>
										<li aria-disabled="true" data-soldout="true">
											<div>상품옵션17</div>
											<div>120,000원</div>
										</li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				</th:block>
			</div>
			</form>
		</div>
		<div class="modal-footer">
			<button type="button"  class="btn btn_dark" onclick="jfInstockAlarm();"><span>신청</span></button>
		</div>
	</div>
</div>
<a href="javascript:void(0);" rel="modal:close" onclick="cfCloseLayer('layer_instock_alarm')" class="close-modal">Close</a>
<script th:inline="javascript">
/*<![CDATA[*/
	
	
	var jfInstockAlarm = function(){
	
		let optCd2 = "";
		let optCd = "";
		$("#goodsInstockAlarmForm input:radio[name=opt]").each(function(){
			if ($(this).is(':checked')){
				optCd2 = $(this).val();
				optCd = $(this).attr('optCd');
			}
		});

		if (gagajf.isNull(optCd2)){
			mcxDialog.alert("사이즈를 선택해주세요.");
			return false;
		}
		$("#goodsInstockAlarmForm input[name=optCd]").val(optCd);
		$("#goodsInstockAlarmForm input[name=optCd2]").val(optCd2);
		
		
		gagajf.ajaxFormSubmit('/goods/instock/alarm/save'
				, $('#goodsInstockAlarmForm')
				, function() {
					jfInstockAlarmCallBack();		
				}
		);
	}
	
	var jfInstockAlarmCallBack = function(){
		$('#layer_instock_alarm').find('.close-modal').trigger("click");
	}
	
/*]]>*/
</script>

</html>