<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body" pad15>
                            <div class="layui-form">
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>套餐名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="name" lay-verify="required|nLength" placeholder="" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">提示：最多只能输入20个字符</div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-form" lay-filter="type_item_filter">
                                        <label class="layui-form-label"><span class="must">*</span>收费类型</label>
                                        <div class="layui-input-inline">
                                            <select id="type_item" name="typeItem" lay-verify="required|haveDeposit"  lay-filter="type_item_even"></select>
                                        </div>
                                    </div>
                                    <div class="layui-form" id="discount_div" style="display: none">
                                        <label class="layui-form-label">折扣</label>
                                        <div class="layui-input-inline">
                                            <input value="100" type="number" name="discount" lay-verify="discount" placeholder="" autocomplete="off" class="layui-input" >
                                        </div>
                                        <div class="layui-form-mid layui-word-aux" style="margin-left: 38px">提示：折扣只能输入数字，例如输入【80】则为【80%】，代表8折。</div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>金额</label>
                                    <div class="layui-input-inline">
                                        <input value="0" type="number" name="amount" lay-verify="required|amount" placeholder="" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">提示：只能输入数字和后两位小数</div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>天数</label>
                                    <div class="layui-input-inline">
                                        <input type="number" name="days" lay-verify="required|dayNum" placeholder="" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">提示：只能输入数字</div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>套餐有效期</label>
                                    <div class="layui-input-inline">
                                        <input type="text"  class="layui-input date-icon" id="pro_date"  placeholder="请选择" autocomplete="off">
                                        <input type="hidden" name="beginDate" id="begin_date">
                                        <input type="hidden" name="endDate" id="end_date">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>上架状态</label>
                                    <div class="layui-input-inline">
                                        <input type="radio" name="putStatus" value="1" title="上架" checked="">
                                        <input type="radio" name="putStatus" value="2" title="下架">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>所属小区</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="residentialName" lay-verify="required" placeholder="" autocomplete="off"
                                               class="layui-input" th:value="${residential.name}" disabled="disabled">
                                        <input type="hidden" name="residentialId" id="residential_id" th:value="${residential.id}" />
                                        <input type="hidden" name="type" id="type" th:value="${type}" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-submit lay-filter="submit_button">提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary" id="cancel_btn">取消</button>
                                    </div>
                                </div>
                                <input type="hidden" id="canAddToll" th:value="${canAddToll}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- javascript -->
        <!--去掉input type="number"后面的箭头-->
        <style type="text/css">
            input::-webkit-outer-spin-button,
            input::-webkit-inner-spin-button {
                -webkit-appearance: none;
            }
            input[type="number"] {
                -moz-appearance: textfield;
            }
        </style>

        <script type="text/javascript" th:src="@{'/layui/layui.js'}"></script>
        <script type="text/javascript">
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script type="text/javascript" th:src="@{'/js/estate/faceChargeProject-add.js'}"></script>
    </body>
</html>