Class(function(extend, using, self){
    extend("pages/page");
    using("lib/jquery.min.js");

    self.info_ref = null;

    self.initEvent = function(){
        var that = this;
        // 点击label，相邻兄弟节点checked改变状态
        $(document).delegate("span", "click", function () {
            var flag = $(this).prev().is(":checked");
            if(flag == false) {
                $(this).prev().prop('checked', true);
            }
        });

        // 点击关闭窗口按钮
        $(document).delegate(".tool .btn", "click", function () {
            that.info_ref.btn_ok_click();
        });
    }

    self.func(function(curData){
        var that = this;
        that.info_ref = curData;//report;

        /* loading-mask 控制*/
        that.addCall("on_show_loading", function(bshow) {
            if(bshow == true) {
                $(".loading-mask").show();
            } else {
                $(".loading-mask").hide();
            }
        });


        that.addCall("get_reportinfo", function() {
            var img = $(".evidence .image img:first").attr("src");
            var type = $("input[type='radio'][name='evidenceType']:checked").val();
            var desc = $("#report_info").val();
            img = img.replace(/file:\/\/\//,"").replace(/\.png.*/g,".png");
            var str = { img: img, desc: desc, type: type};
            var txt = JSON.stringify(str);
            return txt;
        });

        that.sup().constructor(curData);

        var img_str = that.info_ref.getimg();
        $(".evidence .image img:first").attr("src", img_str +  "?t=" + Math.random());

        that.initEvent();
    })
})

///* loading-mask 控制*/
//function on_show_loading(bshow) {
//    if(bshow == true) {
//        $(".loading-mask").show();
//    } else {
//        $(".loading-mask").hide();
//    }
//}
//
//
//function get_reportinfo() {
//    var img = $(".evidence .image img:first").attr("src");
//    var type = $("input[type='radio'][name='evidenceType']:checked").val();
//    var desc = $("#report_info").val();
//    img = img.replace(/file:\/\/\//,"").replace(/\.png.*/g,".png");
//    var str = { img: img, desc: desc, type: type};
//    var txt = JSON.stringify(str);
//    return txt;
//}


//var ReportAlert = ReportAlert || {info_ref: null};
//window.onload = function () {
//    ReportAlert.info_ref = report;
//    var img_str = ReportAlert.info_ref.getimg();
//    $(".evidence .image img:first").attr("src", img_str +  "?t=" + Math.random());
//}
//
///*
// * 点击label，相邻兄弟节点checked改变状态
// */
//$(document).delegate("span", "click", function () {
//    var flag = $(this).prev().is(":checked");
//    if(flag == false) {
//        $(this).prev().prop('checked', true);
//    }
//});
//
///*点击关闭窗口按钮*/
//$(document).delegate(".tool .btn", "click", function () {
//    ReportAlert.info_ref.btn_ok_click();
//});