(function () {



    var page = {
        isScroll: false,
        init: function ($page, param) {

            loadData(param);
        }
    };

    function loadData(param) {
        var result;
        learun.httpget(config.webapi + "learun/adms/timetable/StuList", param, (data) => {
            var studCheckList = $('.studCheckList');
            var html = '';

            console.log(data);
            var html2 = '<div class="tSec3Time"><span>' + data.date + '</span> 第' + data.time + '节</div>';
            $(".tSec3Box").html(html2);
            if (data.result.length == 0) {
                html = '<li>暂时没有信息</li>';
            } else {

                var html3 = '<div class="tSec4T"><div>' + data.lessonName + '</div> <div>' + data.classRoomName + '教室</div></div>' +
                    '<div class="tSec4Con">' +
                    '<div class="studSeeSec2Txt">' +
                    '<div><span>' + data.shouldArrive + '</span>人</div>' +
                    '<div>应到</div>' +
                    '</div>' +
                    '<div class="studSeeSec2Line"></div>' +
                    '<div class="studSeeSec2Txt">' +
                    '<div><span>' + data.turnTo + '</span>人</div>' +
                    '<div>实到</div>' +
                    '</div>' +
                    '</div>';
                $('.tSec4Box').html(html3);
                $.each(data.result, function (j, k) {
                    var statusName = k.Sort;
                    var sort;
                    switch (statusName) {
                        case "迟到":
                            sort = "2";
                            break;
                        case "早退":
                            sort = "2";
                            break;
                        case "病假":
                            sort = "4";
                            break;
                        case "事假":
                            sort = "2";
                            break;
                        case "准时":
                            sort = "1";
                            break;
                        case "旷课":
                            sort = "3";
                            break;
                        default:
                    }
                    html += '<li>' +
                        //'<div class="studCheckT"><img src="images/book.png" alt="" />'+k.title+'</div>'+
                        '<div style="float:right; margin-top: 7px;" class="studCheckStatue studCheckStatue' + sort + '">' +
                        '<span></span>' + statusName +
                        '</div>' +
                        '<div class="studCheckTxt">' +
                        //'<img src="images/time.png" alt="" />'+k.time+
                        '<span style="margin-left:0"><img src="images/person.png" alt="" />' + k.StuName + '</span>' +
                        '<img src="images/location.png" alt="" />' + k.ClassName +
                        '</div>' +
                        '</li>';
                })
            }

            studCheckList.html(html)
        }
        );

    }
    return page;
})();