user_list.html 6.1 KB
<include file="public@header"/>
</head>
<body>
<style>
    .pagination{text-align:center;margin-top:20px;margin-bottom: 20px;}
    .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
    .pagination .active{background-color: #dd1a20;color: #fff;}
    .pagination .disabled{color:#aaa;}
</style>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#">用户列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('Users/user_list')}">
        <!--时间:-->
        <!--<input type="text" class="form-control js-bootstrap-datetime" name="start_time"-->
               <!--value="{$start_time|default=''}"-->
               <!--style="width: 140px;" autocomplete="off">- -->
        <!--<input type="text" class="form-control js-bootstrap-datetime" name="end_time"-->
               <!--value="{$end_time|default=''}"-->
               <!--style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;-->
        序号:
        <input type="text" class="form-control" name="id" style="width: 200px;"
               value="{$id|default=''}" placeholder="请输入序号">
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入微信昵称...">
        身份:
        <select name="identity"  class="form-control">
            <option value="">全部</option>
            <option value="2">一级业务员</option>
            <option value="3">二级业务员</option>
            <option value="4">学生</option>
            <option value="-1">自由人</option>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('Users/user_list')}">清空</a>
    </form>
    <table class="table table-bordered">
        <caption>边框表格布局</caption>
        <thead>
        <tr>
            <th>序号</th>
            <th>微信昵称</th>
            <th>身份</th>
            <th>手机号</th>
            <th>邀请人</th>
            <th>余额</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="data" id="val">
            <tr>
                <td>{$val.id}</td>
                <td>{$val.user_nickname}</td>
                <if condition="$val.status eq 2">
                    <td>一级业务员</td>
                    <elseif condition="$val.status eq 3"/>
                    <td>二级业务员</td>
                    <elseif condition="$val.status eq 4"/>
                    <td>学生</td>
                    <else/>
                    <td>自由人</td>
                </if>
                <td>{$val.phone}</td>
                <td>{$val.inviter_phone}</td>
                <td>{$val.balance}</td>
                <if condition="$val.status eq 2">
                        <td>{$val.audit_time|date="Y-m-d H:i:s",###}</td>
                    <else/>
                        <td>{$val.create_time|date="Y-m-d H:i:s",###}</td>
                </if>

                <td style="width:300px;">
                    <input type="hidden" name="" class="bianji{$val.id}">
                    <if condition="$val.status eq 0">
                        <button type="button" class="btn btn-default setup{$val.id}" onclick="set_up({$val.id})">设为业务员</button>
                        <elseif condition="$val.status eq 1"/>
                        <button type="button" class="btn btn-default">已设为业务员</button>
                        <elseif condition="$val.status eq 5"/>
                        <button type="button" class="btn btn-default">业务员审核中</button>
                        <elseif condition="$val.status eq 6" />
                        <button type="button" class="btn btn-default">审核驳回</button>
                        <else/>
                        <button type="button" class="btn btn-default" style="background-color: red;">不能设置</button>
                    </if>
                    <if condition="$val.status eq 2">
                        <a href="{:url('Users/teacher_list',array('id'=>$val.id))}"><button type="button" class="btn btn-default">下线名单</button></a>
                        <elseif condition="$val.status eq 3"/>
                        <a href="{:url('Users/student_list',array('teacher_id'=>$val.id))}"><button type="button" class="btn btn-default">下线名单</button></a>
                        <else/>
                        <button type="button" class="btn btn-default" style="background-color: red;">没有下线</button>
                    </if>
                    <if condition="$val.status eq 2">
                        <a href="{:url('Users/users_money',array('uid'=>$val.uid))}">
                            <button type="button" class="btn btn-default">余额明细</button>
                        </a>
                        <elseif condition="$val.status eq 3"/>
                        <a href="{:url('Users/users_money',array('uid'=>$val.uid))}">
                            <button type="button" class="btn btn-default">余额明细</button>
                        </a>
                        <else/>
                        <button type="button" class="btn btn-default" style="background-color: red;">没有余额</button>
                    </if>

                </td>
            </tr>
        </volist>
        </tbody>
    </table>
    <div class="pagination">
        {$data->render()}
    </div>
</div>
<script>
    /**
     *设置为业务员
     */
    function set_up(id){
        ccc = window.confirm('是否设置为业务员?');
        if(ccc){
            $.post("{:url('Users/set_salesman')}",{id:id},function(data){
                if(data){
                    $('.setup'+id).remove();
                    $('.bianji'+id).after("<button type='button' class='btn btn-default'>已设为业务员</button>");
                }else{
                    alert('设置失败');
                }
            });
        }
    }
</script>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>