
<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">
    <title>模型管理</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="/resources/layuiadmin/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/resources/layuiadmin/layuiadmin/style/admin.css" media="all">
    <!-- 编辑器配置文件 -->
    <script type="text/javascript" src="/resources/js/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/resources/js/ueditor/ueditor.all.js"></script>
</head>

<body layadmin-themealias="default">

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" id="showPic">
                <div class="layui-card-body">
                    <div class="layui-tab">
                        <ul class="layui-tab-title">

                            <li class="layui-this">基本信息</li>

                        </ul>
                        <div class="layui-tab-content">


                            <div class="layui-tab-item  layui-show   ">
                                <!--start-->
                                <div class="layui-row">
                                    <div class="layui-col-xs12 layui-col-md12">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label">排序</label>
                                            <div class="layui-input-inline">
                                                <input name="sort"  id="sort" value=""  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>*&nbsp;</span>靓号</label>
                                        <div class="layui-input-inline">
                                            <input name="number"  id="number" value=""  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>*&nbsp;</span>默认价格</label>
                                        <div class="layui-input-inline">
                                            <input name="price"  id="price" value=""  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>*&nbsp;</span>是否出售</label>
                                        <div class="layui-input-block">
                                            <input id="is_sell" type="radio" name="is_sell"  title="是"  value="1" ><input id="is_sell" type="radio" name="is_sell"  title="否"  value="2" >
                                        </div>
                                        <div class="layui-form-mid layui-word-aux"></div>
                                    </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><span>*&nbsp;</span>类型</label>
                                            <div class="layui-input-block">
                                                <input id="type" type="radio" name="type"  title="普通靓号"  value="1" ><input id="type" type="radio" name="type"  title="超级靓号"  value="2" >
                                            </div>
                                            <div class="layui-form-mid layui-word-aux"></div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">购买要求</label>
                                            <div class="layui-input-inline">
                                                <input name="rule"  id="rule" value=""  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">分段价格</label>
                                        <div class="layui-input-inline">
                                            <input name="piecewise"  id="piecewise" value=""  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">竞拍最低价</label>
                                            <div class="layui-input-inline">
                                                <input name="piecewise"  id="lowest_price" value=""  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">分段时间</label>
                                        <div class="layui-input-inline">
                                            <input name="piecewise_time"  id="piecewise_time" value=""  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">添加时间</label>-->
                                            <!--<div class="layui-input-inline">-->
                                                <!--<input type="text"   name="dtime" id="dtime" value=""     placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input ghy-date">-->
                                            <!--</div>-->
                                            <!--<div class="layui-form-mid layui-word-aux"></div>-->
                                        <!--</div>-->

                                        <div class="layui-form-item">
                                            <label class="layui-form-label">出售时间</label>
                                            <div class="layui-input-inline">
                                                <input type="text"   name="sell_time" id="sell_time" value=""     placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input ghy-date">
                                            </div>
                                            <div class="layui-form-mid layui-word-aux"></div>
                                        </div>

                                    </div>
                                </div>
                                <!--end-->
                            </div>

                        </div>
                    </div>
                </div>

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button  class="layui-btn" lay-submit="" lay-filter="save">提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </div>

            </form>

        </div>
    </div>
</div>

<script src="/resources/layuiadmin/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/resources/layuiadmin/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate'], function() {
        var $ = layui.$,
            admin = layui.admin,
            element = layui.element,
            layer = layui.layer,
            laydate = layui.laydate,
            form = layui.form,
            index = parent.layer.getFrameIndex(window.name); //获取窗口索引;

        form.render(null, 'component-form-group');

        laydate.render({
            elem:'.ghy-date',//制定元素
            type:'datetime',
            trigger:'click',//定义鼠标悬停时弹出控件
            show:false,//默认显示
            calendar:true,//是否显示公历节日
        });

        /* 自定义验证规则 */
        form.verify({
            pass: [/(.+){6,12}$/, '密码必须6到12位'],
            repass: function(value, item) {
                var password = $("#password").val();
                if(password != value) {
                    return '两次密码不一致';
                }
            },
        });

        /* 监听指定开关 */
        form.on('switch(component-form-switchTest)', function(data){

            if(this.checked==false)
            {
                $(".table-set").show();
            }else{
                $(".table-set").hide();
            }

        });

        //监听checkbox复选
        form.on('checkbox(checkboxchange)', function(data){
            var filedid = $("#"+data.elem.id).data('filedname');
            var classname = $("#"+data.elem.id).attr('class');

            var temp_val="";
            $("."+classname).each(function(){
                if ($(this).is(":checked")) {
                    if(temp_val=="")
                    {
                        temp_val=$(this).val();
                    }else
                    {
                        temp_val=temp_val+","+$(this).val();
                    }
                }
            });
            $("#"+filedid).val(temp_val);

        });


        /* 监听提交 */
        form.on('submit(save)', function(data) {
            //请求接口
            admin.req({
                url: '/manage/buyBeautiful/insert?table_id=41' //实际使用请改成服务端真实接口
                ,
                data: data.field,
                type: 'post',
                done: function(res) {

                    //登入成功的提示与跳转
                    layer.msg(res.msg, {
                        offset: '15px',
                        icon: 1,
                        time: 1000
                    }, function() {
                        parent.location.reload();
                        parent.layer.close(index);
                    });

                }
            });

            return false;
        });
    });


</script>

<style id="LAY_layadmin_theme">
    .layui-side-menu,
    .layadmin-pagetabs .layui-tab-title li:after,
    .layadmin-pagetabs .layui-tab-title li.layui-this:after,
    .layui-layer-admin .layui-layer-title,
    .layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child {
        background-color: #20222A !important;
    }

    .layui-nav-tree .layui-this,
    .layui-nav-tree .layui-this>a,
    .layui-nav-tree .layui-nav-child dd.layui-this,
    .layui-nav-tree .layui-nav-child dd.layui-this a {
        background-color: #FFB800 !important;
    }

    .layui-layout-admin .layui-logo {
        background-color: #20222A !important;
    }
</style>
</body>

</html>