{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>会员等级{:lang('list')}</legend>
            <blockquote class="layui-elem-quote">
                <div class="lemo-table">
                    <div class="layui-inline">
                        <input type="text" id='keys' name="keys" lay-verify="required" placeholder="{:lang('pleaseEnter')}" autocomplete="off" class="layui-input">
                    </div>
                    <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="search" id="search">{:lang('search')}</button>
                    <a data-href="{:url('levelAdd')}"  class="layui-btn layui-btn-sm layui-btn-warm add" >{:lang('add')}会员等级</a>
                </div>
              </blockquote>
        </fieldset>
        <table class="layui-table" id="list" lay-filter="list"></table>
    </div>
</div>


<script type="text/html" id="action">
    <a data-href="{:url('levelEdit')}?id={{d.id}}" class="layui-btn  layui-btn-xs" lay-event="edit">{:lang('edit')}</a>
    <a data-href="{:url('levelDel')}?id={{d.id}}" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
</script>
<script type="text/html" id="status">
    <input data-href="{:url('levelState')}" type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
</script>

<script type="text/html" id="image">
    {{d.ad_name}}<img src="/static/admin/images/image.gif" onmouseover="layer.tips('<img src={{d.ad_image}}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();">
</script>

<script type="text/html" id="create_time">
    {{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
</script>

{include file="common/footer"/}
<script>
    var tableIn = null;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
       Admin: 'Admin',
    }).use(['table','Admin'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;

         tableIn = table.render({
            elem: '#list',
            url: '{:url("levelIndex")}',
            method: 'post',
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 80, fixed: true, sort: true},
                {field: 'level_name', title: '名称', width: 120, },
                {field: 'amount', title: '等级金额', width: 150},
                {field: 'discount', title: '折扣', width: 80},
                {field: 'description', title: '头街 描述', width: 150},

                {field: 'status', title: '状态', width: 180, templet:'#status'},
                {field: 'create_time', title: '添加时间', width: 180,templet:'#create_time'},
                {field: 'update_time', title: '修改时间', width: 180,templet:'#update_time'},
                {title:'操作',width:150, align:'center', toolbar: '#action'}

            ]],

            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });


    });


</script>