<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="kaoheuser.aspx.cs" Inherits="xxjxkhbase.app.kaoheuser" %>

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>待评分人员-<%=xxsoft_check.check.getseting("systitle") %></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="../weui/css/weui.css"/>
    <link rel="stylesheet" href="../weui/css/weuix.css"/>

    <script src="../weui/js/zepto.min.js"></script>
    <script src="../weui/js/zepto.weui.js"></script>

    <script src="../weui/js/php.js"></script>

</head>

<body ontouchstart>
<div class="weui-header bg-blue"> 
  <div class="weui-header-left"> <a class="icon icon-109 f-white" href="javascript:history.go(-1);">返回</a>  </div>
   <h1 class="weui-header-title">待考核人员</h1>
    <div class="weui-header-right"><a class="icon icon-112 f-white" href="exit.aspx"></a></div> 
    </div>
    <div class="weui-panel weui-panel_access">
        <div class="weui-cells" id="rank-list"> 
       </div>
       <script id="tpl" type="text/html">
            <@  for(var i in data) {   @>
           <a class="weui-cell weui-cell_access" href="javascript:kaohedo(<@=data[i].id@>)">
            <div class="weui-cell__bd">
                <h4><@=data[i].userxm@>-<@=data[i].bumen@></h4>
            </div>
            <div class="weui-cell__ft"><@=data[i].kaohezt@></div>
        </a>
            <@ } @>
        </script>
        <div class="weui-panel__ft">
            <a href="javascript:void(0);" class="weui-cell weui-cell_access weui-cell_link">
                <div class="weui-cell__bd" id="getmore">查看更多<i id="loading" class="weui-loading"></i></div>

            </a>
        </div>
    </div>
    <br>
    <br>

    <script>
        $('#loading').hide();
     var fanganid = $_GET('fanganid');
    var fangshiid = $_GET('fangshiid');
        function kaohedo(userid) {
            window.location.href = 'kaohedo.aspx?userid=' + userid + '&fanganid=' + fanganid+'&fangshiid=' + fangshiid + '';
        }
        var pagesize = 20; //每页数据条数
        function ajaxpage(page) {
            $.ajax({
                type: "post",
                url: 'kaoheuser.aspx?action=list',
                data: { "page": page, "limit": pagesize, fanganid: fanganid, fangshiid: fangshiid},
                dataType: 'json',
                timeout: 10000,
                beforeSend: function (xhr) {
                    $('#loading').show();
                },
                success: function (data) {
                    $('#loading').hide();
                    var temp = "";
                    $("#rank-list").append(tpl(document.getElementById('tpl').innerHTML, data));
                    var maxpage = Math.ceil(data.count / pagesize);
                    sessionStorage['maxpage'] = maxpage;
                    if (page == maxpage) {
                        $("#getmore").html("没有更多数据了"); return false;
                    }
                },
                error: function (xhr) {
                    alert('ajax出错');
                }
            });
        }

        $(function () {
            var page = 2;
            var maxpage;
            $('#getmore').on('click', function () {
                maxpage = sessionStorage['maxpage'];
                if (page <= maxpage) {
                    ajaxpage(page);
                    page++;
                }
            });
            ajaxpage(1);
        })
</script>
</body>
</html>