user.html 11.6 KB
<include file="public@header"/>
<link rel="stylesheet" href="__STATIC__/install/css/mdialog.css">
<style>
    .popup{
        width: 250px;
        height: 100px;
        background-color: rgba(0,0,0,0.5);
        position: fixed;
        top: 50%;
        transform: translateY(-50px);
        left: 0;
        right: 0;
        margin: 0 auto;
        border-radius: 5px;
        color: #ffffff;
    }
    .popup p{
        text-align: center;
        margin-top: 20px;
    }
    .popup span{
        text-align: center;
        line-height: 30px;
        cursor: pointer;
    }
    .popup .queding{
        display: inline-block;
        width: 80px;
        height: 30px;
        background-color: #1E9FFF;
        border-radius: 3px;
    }
    .popup span:hover{
        opacity: 0.8;
    }
    .popup .quxiao{
        display: inline-block;
        width: 80px;
        height: 30px;
        ckground-color: #9cb945 ;
        color: #333333;
        border-radius: 3px;
        background-color:#fff;
        margin-left: 35px;
    }
    .btn_list{
        margin: 0 auto;
        width: 200px;
    }

    .paging {
        width: auto;
        margin: 0 auto;
        margin-top: 50px;
        overflow: hidden;
        clear: both;
        width: 780px;
        margin-bottom: 67px;
    }

    .paging ul li {
        float: left;
        display: block;
        width: 40px;
        height: 40px;
        background-color: #FFFFFF;
        margin-left: 10px;
        line-height: 40px;
        text-align: center;
    }

    .paging ul li:first-child {
        margin-left: 0;
    }

    .paging .paging_first {
        width: 78px;
    }

    .paging .active {
        background-color: #80B13B;
        color: #FFFFFF;
    }

    .page_btn,
    .pre,
    .next,
    .paging_first,
    .paging_last {
        cursor: pointer;
    }

    .paging .paging_last {
        width: 78px;
    }
    .content_list{
        min-height: 364px;
    }
</style>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>用户管理</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('AdminOauth/user')}">
        时间:
        <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="name" style="width: 200px;"
               value="{$name|default=''}" placeholder="请输入姓名">
        手机号:
        <input type="text" class="form-control" name="tel" style="width: 200px;"
               value="{$tel|default=''}" placeholder="请输入手机号">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('AdminOauth/user')}">清空</a>
    </form>


    <form method="post" class="js-ajax-form margin-top-20">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>手机号</th>
                <th>余额</th>
                <th>推荐人</th>
                <th>推荐人id</th>
                <th>注册时间</th>
                <th>状态</th>
                <th align="center" style="cursor: pointer; text-align: center;">查看</th>
                <th align="center" style="cursor: pointer;">操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="lists" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.name}</td>
                    <td>{$vo.tel}</td>
                    <th>{$vo.money}</th>
                    <td>
                        <empty name="vo.referee_name">
                            暂无
                        <else/>
                            {$vo.referee_name}
                        </empty>

                    </td>
                    <td>
                        <empty name="vo.referee_id">
                            暂无
                        <else/>
                            {$vo.referee_id}
                        </empty>

                    </td>

                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td>
                        <eq name="vo.status" value="1">
                            正常
                        </eq>
                        <eq name="vo.status" value="8">
                            已拉黑
                        </eq>
                        <eq name="vo.status" value="9">
                            已删除
                        </eq>
                    </td>
                    <td>
                            <span  class="detail" style="color: #0FD149; text-decoration:underline; cursor: pointer; "  index="{$vo.id}" >详细信息</span>
                            <span class="money" style="color: #9B399C; text-decoration:underline;  cursor: pointer; " index="{$vo.id}">收支明细</span>
                            <span class="getMoneyDetail" style="color: #18BC9C;text-decoration:underline;  cursor: pointer; " index="{$vo.id}">提现申请</span>
                            <span class="referee" style="color: #BFB61D; text-decoration:underline;  cursor: pointer; " index="{$vo.id}">邀请人</span>
                    </td>
                    <td>
                        <eq name="vo.status" value="1">
                            <span  class="black" style="color: #AC4555; text-decoration:underline; cursor: pointer; "  index="{$vo.id}">拉黑</span>
                        </eq>
                        <eq name="vo.status" value="8">
                            <span style="color:#aaaaaa; cursor: pointer; " index="{$vo.id}">已拉黑</span>
                        </eq>
                        <eq name="vo.status" value="9">
                            <span style="color:#aaaaaa; cursor: pointer; " index="{$vo.id}">已删除</span>
                        </eq>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <ul class="pagination">
            <!--<li class="page-item disabled"><span class="page-link">«</span></li>-->
            <!--<li class="page-item"><a class="page-link" href="/public/portal/code/index.html?page=3">3</a></li>-->
            <!--<li class="page-item"><a class="page-link" href="/public/portal/code/index.html?page=3">4</a></li>-->
            <!--<li class="page-item"><a class="page-link" href="/public/portal/code/index.html?page=2">»</a></li>-->
            {$page|default='1'}</ul>
        <!--<div class="paging">-->
            <!--<ul class="page_list">-->
                <!--<li class="paging_first">&lt;&lt;首页</li>-->
                <!--<li>&lt;</li>-->
                <!--<li class="page_btn active" data-id=1>1</li>-->
                <!--<li class="page_btn" data-id=2>2</li>-->
                <!--<li class="page_btn" data-id=3>3</li>-->
                <!--<li class="page_btn" data-id=4>4</li>-->
                <!--<li class="page_btn" data-id=5>5</li>-->
                <!--<li class="page_btn" data-id=6>6</li>-->
                <!--<li class="page_btn" data-id=7>7</li>-->
                <!--<li>&gt;</li>-->
                <!--<li class="paging_first">尾页&gt;&gt;</li>-->
            <!--</ul>-->
        <!--</div>-->


    </form>
    <div class="popup" style="display: none;">
        <p>确认拉黑该用户</p>
        <div class="btn_list">
            <span class="queding">确认</span>
            <span class="quxiao">取消</span>
        </div>
    </div>

</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/js/zepto.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/mdialog.js"></script>
<script type="">
    $('.black').click(function () {
        var id = $(this).attr('index');
        $('.popup').css('display','block');
        // 删除
        $('.queding').click(function () {
            $.ajax({
                type:"POST",
                url:"{:url('AdminOauth/del')}",
                data:{
                    "id":id,
                },
                success:function (data) {
                    new TipBox({type:'success',str:'操作成功',hasBtn:true});
                    $('.popup').css('display','none');
                },
                error:function () {
                    new TipBox({type:'error',str:'对不起,出错了!',hasBtn:true});
                    $('.popup').css('display','none');
                }
            })
        })
    })
    $('.quxiao').click(function () {
        $('.popup').css('display','none');
    })

//    查看用户详细信息
    $('.detail').click(function () {
        var url1 = "{:url('user/AdminOauth/userDetail')}";
        var url2 = $(this).attr('index');
        var url3 = url1.split('.');
        var url  = url3[0]+'/id/'+url2+'.html';
        window.location.href = url
    })
//    查看收支明细
    $('.money').click(function () {
        var url1 = "{:url('user/AdminOauth/money')}";
        var url2 = $(this).attr('index');
        var url3 = url1.split('.');
        var url  = url3[0]+'/id/'+url2+'.html';
        window.location.href = url
    })
//    查看提现申请
    $('.getMoneyDetail').click(function () {
        var url1 = "{:url('user/AdminOauth/getMoneyDetail')}";
        var url2 = $(this).attr('index');
        var url3 = url1.split('.');
        var url  = url3[0]+'/id/'+url2+'.html';
        window.location.href = url
    })
//    查看邀请人
    $('.referee').click(function () {
        var url1 = "{:url('user/AdminOauth/referee')}";
        var url2 = $(this).attr('index');
        var url3 = url1.split('.');
        var url  = url3[0]+'/id/'+url2+'.html';
        window.location.href = url
    })






    // 分页
    page_list = '';
    var tempPage = [];
    if(all_page - current_page > 9) {
        if(current_page > 0) {
            for(var i = 7; i > 0; i--) {
                tempPage[i] = parseInt(current_page - 1) + i;
            }
        } else {
            for(var i = 7; i > 0; i--) {
                tempPage[i] = parseInt(current_page) + i;
            }
        }
        tempPage.push('...');
        tempPage.push(all_page - 1);
        tempPage.push(all_page)
    } else {
        tempPage = [];
        if(all_page > 10) {
            for(var i = 10; i >= 0; i--) {
                tempPage[10 - i] = parseInt(all_page) - i;
                console.log(tempPage)
            }
        } else {
            for(var i = all_page; i >= 0; i--) {
                tempPage[all_page - i] = parseInt(all_page) - i;
            }
        }

    }

    var total = all_page > 10 ? 10 : all_page;
    var pagelist = '';
    for(var i = 1; i <= total; i++) {

        if(current_page == tempPage[i]) {
            if(tempPage[i] == '...') {
                pagelist += ' <li class="page_btn more" data-id = ' + i + ' >' + tempPage[i] + '</li>';
            } else {
                pagelist += ' <li class="pageli active" >' + tempPage[i] + '</li>';
            }

        } else {
            if(tempPage[i] == '...') {
                pagelist += ' <li class="page_btn more" data-id = ' + i + ' >' + tempPage[i] + '</li>';
            } else {
                pagelist += ' <li class="page_btn" data-id = ' + tempPage[i] + ' >' + tempPage[i] + '</li>';
            }
        }
    }
</script>
</body>
</html>