common.html 6.9 KB
<include file="public@header"/>
<link rel="stylesheet" href="__STATIC__/install/css/mdialog.css">
<style>
    .popup,.popdown{
        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,.popdown p{
        text-align: center;
        margin-top: 20px;
    }
    .popup span,.popdown span{
        text-align: center;
        line-height: 30px;
        cursor: pointer;
    }
    .popup .queding,.popdown .sure{
        display: inline-block;
        width: 80px;
        height: 30px;
        background-color: #1E9FFF;
        border-radius: 3px;
    }
    .popup span:hover,.popdown span:hover{
        opacity: 0.8;
    }
    .popup .quxiao,.popdown .re{
        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;
    }

    .page_div a {
        min-width: 30px;
        height: 28px;
        border: 1px solid #dce0e0!important;
        text-align: center;
        margin: 0 4px;
        cursor: pointer;
        line-height: 28px;
        color: #666666;
        font-size: 13px;
        display: inline-block;
        background: #fff;
    }
    #firstPage, #lastPage {
        width: 50px;
        color: #0073A9;
        border: 1px solid #0073A9!important;
    }
    #prePage, #nextPage {
        width: 70px;
        color: #0073A9;
        border: 1px solid #0073A9!important;
    }
    .page_div .current {
        background-color: #0073A9;
        border-color: #0073A9;
        color: #FFFFFF;
    }

    .totalPages {
        margin: 0 10px;
        color: #0073A9;
    }
    .totalSize {
        color: #0073A9;
    }
    .totalPages span, .totalSize span {
        margin: 0 5px;
    }
</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('Common/comment')}">
        时间:
        <input type="text" class="form-control js-bootstrap-datetime start_time" name="start_time"
               value="{$start_time|default=''}"
               style="width: 140px;" autocomplete="off"> -
        <input type="text" class="form-control js-bootstrap-datetime end_time" name="end_time"
               value="{$end_time|default=''}"
               style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
        用户名:
        <input type="text" class="form-control name" name="name" style="width: 200px;"
               value="{$name|default=''}" placeholder="请输入姓名">
        手机号:
        <input type="text" class="form-control tel" name="tel" style="width: 200px;"
               value="{$tel|default=''}" placeholder="请输入手机号">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('Common/comment')}">清空</a>
        <!--<span class="btn btn-default" onclick="window.history.back(-1)" >返回</span>-->
    </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 style="width: 25%;">评论内容</th>
                <th>是否已修改</th>
                <th>评论状态</th>
                <th>评论时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="lists" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.user_name}</td>
                    <td>{$vo.user_tel}</td>
                    <td>{$vo.agency_name}</td>
                    <td>{$vo.agency_tel}</td>
                    <td>{$vo.content}</td>
                    <td>
                        <eq name="vo.is_comment" value="0">未修改</eq>
                        <eq name="vo.is_comment" value="1">已修改</eq>
                    </td>
                    <td>
                        <eq name="vo.status" value="1">正常</eq>
                    </td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td><span  class="del" style="color: #ff0000; text-decoration:underline; cursor: pointer; "  index="{$vo.id}">删除</span></td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div id="page1" class="page_div"></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/paging.js"></script>
<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="">
    $('.del').click(function () {
        var id = $(this).attr('index');
        $('.popup').css('display','block');
        // 删除
        $('.queding').click(function () {
            $.ajax({
                type:"POST",
                url:"{:url('Common/agencyDel')}",
                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');
    })

    // 分页
    var page = "{$page}";
    var count = "{$count}";
    var page_int = parseInt(page);
    var pageNext = "{$Request.param.page}";
    var end_time = $('.end_time').val();
    var start_time = $('.start_time').val();
    var name = $('.name').val();
    var tel = $('.tel').val();

    $("#page1").paging({
        pageNo: pageNext,  // 当前页
        totalPage: page_int,  // 总页数(可以用Math.ceil()向上取整来计算)
        totalSize: count,  //总条数
        callback: function(num) {
            var url = "/User/Common/comment.html?page="+num+"&end_time="+end_time+"&start_time="+start_time+"&name="+name+"&tel="+tel;
            window.location.href = url;

        }
    })
</script>
</body>
</html>