<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
    <meta name="decorator" content="base" />
    <meta charset="utf-8">
    <title>layuiAdmin 网站用户</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <title>添加品类</title>
    <style>
    </style>
</head>
<body>

<form class="layui-form" action="">
    <div class="layui-form-item" id="addChart">
        <div class="layui-inline">
            <label class="layui-form-label">购买渠道</label>
            <div class="layui-input-inline">
                <input type="tel" name="mallCame" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="text" name="sortNumber"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-hide ">
            <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
        </div>
    </div>
</form>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/ueditor/1.4.3/third-party/jquery-1.10.2.js"></script>
<script>
    layui.use(['form','table'], function(){
        var $ = layui.$;
        form = layui.form;
        form.verify({
            sortNumber:[/^[1-9]\d{0,2}$/,'排序只能是数字'],
        });
    });
    $(".addCategory").click(function () {
        var HTML='<div class="layui-form-item" id="addChart">'+
            '<div class="layui-inline">' +
            '<label class="layui-form-label">购买渠道</label>' +
            '<div class="layui-input-inline">' +
            '<input type="tel" name="mallCame" autocomplete="off" class="layui-input">' +
            '</div>' +
            '</div>' +
            '<div class="layui-inline">' +
            '<label class="layui-form-label">排序</label>' +
            '<div class="layui-input-inline">' +
            '<input type="text" name="sortNumber" autocomplete="off" class="layui-input">' +
            '</div>' +
            '</div>' +
            '<div class="layui-inline">' +
            '<button class="layui-btn addCategory" lay-filter="demo1">+</button>' +
            '</div>'+
            '</div>';
        $("#addChart").after(HTML);
    })
</script>
</body>
</html>