<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css"rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/other/kingedit/themes/default/default.css" rel="stylesheet" type="text/css" />
<title>修改商品</title>
</head>
<body>
<div class="pd-20">
	<form action="${pageContext.request.contextPath }/admin/rewards/update" class="form form-horizontal" id="form-addGoods" method="POST" enctype="multipart/form-data">
		<input name="rankId" type="hidden" value="${rewardsRank.rankId }">
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>规则名称：</label>
			<div class="formControls col-5">
				<input id="rankName" name="rankName" type="text" class="input-text" value="${rewardsRank.rankName }" placeholder="" >
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>规则描述：</label>
			<div class="formControls col-5">
				<input id="rankDesc" name="rankDesc" type="text" class="input-text" value="${rewardsRank.rankDesc }" placeholder="">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>达标数量：</label>
			<div class="formControls col-2">
				<input id="rankNum" type="text" name="rankNum" id="" placeholder="" value="${rewardsRank.rankNum }" class="input-text" style="width:90%">台</div>
			<label class="form-label col-2"><span class="c-red">*</span>奖励金额/每台：</label>
			<div class="formControls col-2">
				<input id="rankMoney" type="text" name="rankMoney" id="" placeholder="" value="${rewardsRank.rankMoney / 100}" class="input-text" style="width:90%">元</div>
		</div>
		<div class="row cl">
			<label id="integralLabel" class="form-label col-2"><span class="c-red">*</span>产品类型：</label>
			<div id="integralDiv" class="formControls col-2">
				<select name="typeId">
					<c:forEach items="${typeList}" var="type" varStatus="status">
	                	<option value="${type.typeId}" <c:if test="${type.typeId == rewardsRank.productType.typeId }">selected</c:if>>${type.typeName }</option>
	                </c:forEach>
	            </select>
            </div>
		</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<!-- <button onClick="return admin_addGoods();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button> -->
				<button onClick="return checkProoduct();" class="btn btn-primary radius" type="submit">
					<i class="Hui-iconfont">&#xe632;</i>保存
				</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.all.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.config.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/tools.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/kindeditor.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/other/kingedit/lang/zh_CN.js"></script>
<script type="text/javascript">


$(document).ready(function(){

});

/*商品-数据验证*/
function checkProoduct(){
	 //商品名称数据验证
	if(!commonLengthJdg('rankName',1,60,null,true)){
		layer.msg("商品名称不能为空!且长度为1-30位",{icon: 2,time:2000});
		return false;
	}
	//商品简称数据验证
	if(!commonLengthJdg('rankDesc',1,20,null,true)){
		layer.msg("商品简称不能为空!且长度为1-10位",{icon: 2,time:2000});
		return false;
	}
	//原价乘100 取整
	var rankMoney = $("#rankMoney").val();
	$("#rankMoney").val(Math.round(rankMoney * 100));
}
</script>
</body>
</html>