{extend name="public/container"}
{block name="content"}
<style>
    
    label{
        margin-bottom: 0!important;
        margin-top: 4px;
    }
    .zongDai{
        margin-top: 4px;
        height: 34px;
        font-size: 12px;  
        display: block;
        padding-left: 10px;
        line-height: 1.3;
        border-width: 1px;
        border-style: solid;
        background-color: #fff;
        border-radius: 2px;
        outline: 0;
        -webkit-appearance: none;
        transition: all .3s;
        -webkit-transition: all .3s;
        box-sizing: border-box;
        border-color: #e6e6e6;
        width: 300px;
    }
</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15"  id="app">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">搜索条件</div>
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">总代名称</label>
                                <div class="layui-input-block" style="width: 400px;display: flex;">
                                        <input class="zongDai"   list="ice-cream-flavors" id="code" name="code"  />
                                        <datalist id="ice-cream-flavors">
                                            <option value=" ">全部</option>
                                            {volist name="code_list" id="v"}
                                            <option  value="{$v.code}">{empty name="v.real_name"}{$v.nickname}{else/}{$v.real_name}{/empty}</option>
                                            {/volist}                                          
                                        </datalist>
                                         <button class="layui-btn layui-btn-sm layui-btn-normal" style="height: 34px ;margin-top: 4px" lay-submit="search" lay-filter="search">
                                        <i class="layui-icon layui-icon-search"></i>搜索</button>      
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">团队销量排名</div>
                <div class="layui-card-body">
                    <table class="layui-hide" id="userList" lay-filter="userList"></table>
                    <script type="text/html" id="number">
                        <p><span>{{d.sum_price}}</span></p>
                    </script>
                    <script type="text/html" id="level">
                         {{# if(d.level==1){ }}
                         普通会员
                         {{#  }else if(d.level==2){ }}
                         金牌会员
                         {{#  }else if(d.level==3){ }}
                         钻石会员
                         {{#  }else if(d.level==4){ }}
                         合伙人
                         {{#  }else if(d.level==5){ }}
                         金牌合伙人
                         {{#  }else if(d.level==6){ }}
                         总代
                         {{#  }; }}                    
                    </script>
                    <script type="text/html" id="bar">
                        <button type="button" class="layui-btn layui-btn-xs" lay-event="see"><i class="layui-icon layui-icon-list"></i>详情</button>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
<script>
    layList.form.render();
    layList.date({elem:'#start_time',theme:'#393D49',type:'datetime'});
    layList.date({elem:'#end_time',theme:'#393D49',type:'datetime'});
    layList.tableList('userList',"{:Url('lst')}",function () {
        return [
            {field: 'uid', title: '用户编号'},
            {field: 'avatar', title: '头像',templet:'<p><img class="avatar " style="cursor: pointer" data-image="{{d.avatar}}" src="{{d.avatar}}" alt="{{d.nickname}}"></p>' },
            {field: 'nickname', title: '用户昵称' },
            {field: 'level', title: '用户等级',templet:'#level'},
            {field: 'team_cts', title: '团队业绩',},        
        ];
    });
    layList.search('search',function(where){        
        layList.reload(where);
    });
    layList.search('export',function(where){
        location.href=layList.U({a:'save_product_export',q:{start_time:where.start_time,end_time:where.end_time,title:where.title}});
    });
    layList.tool(function (event,data){
        switch (event){
            case 'see':
                layList.createModalFrame(data.store_name+'-详情',layList.Url({a:'product_info',p:{id:data.id}}),{w:768});
                break;
        }
    });
</script>
{/block}