<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<form class="layui-form whitebg pb10 pt10" action="" id="data_form">  
	<div class="tab-pane active">     
		<div class="panel-body">
			<div class="wrapper wrapper-content">
				<div class="panel-form animated fadeInRight wp60 fc">
					<div class="layui-form-item dn	has-error" >   
						<label class="layui-form-label">id</label>  
						<div class="layui-input-block">
							<input type="text" name="id" id="Id" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.id }" >
						</div>  
					</div>
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">userId</label>  
						<div class="layui-input-block">
							<input type="text" name="userId" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.userId }" >
						</div>  
					</div> --%>
					<!--管理员看到的  -->
					<c:if test="${admin eq 'admin' }">
					   <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">商户</label>
                                <div class="layui-input-block">
                                    <select name="merchantCode" lay-filter="selectMerchantCode" id="merchantCode">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantBaseInfoList }" var="mb">
                                            <option value="${mb.merchantCode }" <c:if test="${activityRecharge.merchantCode eq mb.merchantCode }">selected</c:if>>${mb.merchantName }</option>
                                        </c:forEach>
                                    </select>              
                                </div>
                            </div>
                       </div>
                        
                       <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">门店</label>
                                <div class="layui-input-block">
                                    <select name="storeId" id="storeId">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantStoreList }" var="ms">
                                            <option value="${ms.storeId }" <c:if test="${ms.storeId eq activityRecharge.storeId }">selected</c:if>>${ms.storeName }</option>
                                        </c:forEach>
                                    </select>              
                                </div>
                            </div>
                       </div>
					</c:if>
					
					<!--不是管理员看到的  -->
                    <c:if test="${admin ne 'admin' }">
                       <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">门店</label>
                                <div class="layui-input-block">
                                    <select name="storeId" id="storeId">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantStoreList }" var="ms">
                                            <option value="${ms.storeId }" <c:if test="${ms.storeId eq activityRecharge.storeId }">selected</c:if>>${ms.storeName }</option>
                                        </c:forEach>
                                    </select>              
                                </div>
                            </div>
                        </div>
                    </c:if>
					
					<div class="layui-form-item    has-error" >   
                        <label class="layui-form-label">活动名称</label>  
                        <div class="layui-input-block">
                            <input type="text" name="name" id="name" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.name }" >
                        </div>  
                    </div>
					
					<%-- <div class="layui-form-item   has-error" >   
                        <label class="layui-form-label">storeId</label>  
                        <div class="layui-input-block">
                            <input type="text" name="storeId" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.storeId }" >
                        </div>  
                    </div>
                    <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">storeName</label>  
                        <div class="layui-input-block">
                            <input type="text" name="storeName" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.storeName }" >
                        </div>  
                    </div> --%>
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">充值金额</label>  
						<div class="layui-input-block">
							<input type="text" name="rechargeMoney" id="rechargeMoney" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.rechargeMoney }" >
						</div>  
					</div>
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">赠送金额</label>  
						<div class="layui-input-block">
							<input type="text" name="giveMoney" id="giveMoney" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.giveMoney }" >
						</div>  
					</div>
					
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">startDt</label>  
						<div class="layui-input-block">
							<input type="text" name="startDt" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.startDt }" >
						</div>  
					</div>
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">noticeCode</label>  
						<div class="layui-input-block">
							<input type="text" name="noticeCode" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.noticeCode }" >
						</div>  
					</div> --%>
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">createDt</label>  
						<div class="layui-input-block">
							<input type="text" name="createDt" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.createDt }" >
						</div>  
					</div> --%>
					
						<div class="form-group">
			                <div class="layui-form-item">          
			                    <label class="layui-form-label">时间类型</label>
			                    <div class="layui-input-block">
			                        <select name="timeType" lay-filter="selectTimeType" id="timeType">  
			                           <!--  <option value="">请选择</option> -->
			                            <option value="0" <c:if test="${activityRecharge.timeType eq '0' }">selected</c:if> >永久</option>
			                            <option value="1" <c:if test="${activityRecharge.timeType eq '1' }">selected</c:if> >设置时间</option>
			                        </select>              
			                    </div>
			                </div>
			            </div>
			            
					         <div class="mt10 mb20" id="dateDetail">
		                        <span class="dlblock w100 textr">开始日期</span>
		                        <span class="bdc pt6 pb6 pl6 pr5 w180 dlblock">
		                             <input type="text" placeholder="" name="startDt" id="date1" class="w150"  value="<fmt:formatDate value='${activityRecharge.startDt }' pattern='yyyy-MM-dd' />" >
		                             <i class="fa fa-calendar"></i>
		                        </span> 
		                        <span class="dlblock w100 textr">结束日期</span>
		                        <span class="bdc pt6 pb6 pl6 pr5 w180 dlblock"> 
		                        <input type="text" placeholder="" name="endDt" id="date2" class="w150" value="<fmt:formatDate value='${activityRecharge.endDt }' pattern='yyyy-MM-dd' />" > 
		                            <i class="fa fa-calendar"></i>
		                        </span>
		                    </div>
					
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">时间类型</label>  
						<div class="layui-input-block">
							<input type="text" name="timeType"  lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityRecharge.timeType }" >
						</div>  
					</div> --%>
	               <c:if test="${admin eq 'admin' }">
                       <input type="hidden" id="isAdmin" value="1">
                    </c:if>
                    <c:if test="${admin ne 'admin' }">
                       <input type="hidden" id="isAdmin" value="0">
                    </c:if>
				</div>
			</div>
		</div>  
	</div>
</form>
<script type="text/javascript">
$(function(){
	//form表单样式
    layui.use(['layer', 'form'], function() {    
        var layer = layui.layer,
            form = layui.form;
        form.render();
    });
  //日历控件
    layui.use(['layer', 'laydate'], function() {
        var layer = layui.layer;
        laydate = layui.laydate;
        laydate.render({
        elem: '#date1' //指定元素
        });
        laydate.render({
            elem: '#date2' //指定元素
        });
    });
    $("#dateDetail").hide();
     if($("#timeType").val()=='1'){
    	$("#dateDetail").show();
    }
})
    
</script> 

