Class(function(extend, using, self){

    extend("pages/page");
    using("lib/jquery.min.js");

    self.room_children_info = null;
    self.filename = "";
    self.initPage = function () {
        this.room_children_info.log_trace("RoomChildrenInfo bindRoomChildrenInfo  start");
        this.bindRoomChildrenInfo();
        this.room_children_info.log_trace("RoomChildrenInfo bindRoomChildrenInfo  end");
    }
    // 绑定用户头像
    self.bindRoomChildrenInfo = function () {
        var group_info = this.room_children_info.get_child_room_info();
        $(".sub_room_name").text(group_info.groupname);
        $(".c-default-mictime").val(group_info.default_mictime);
        if(group_info.b_block_guest_chat) {
            $("input[name='open-auto']").prop('checked', true);
        } else {
            $("input[name='open-auto']").prop('checked', false);
        }
        if(group_info.b_guest_onlyuse_specialfont) {
            $(".c-use-specialfont").prop('checked', true);
        } else {
            $(".c-use-specialfont").prop('checked', false);
        }
        if(group_info.b_limit_textsend) {
            $(".c-limit-textsend").prop('checked', true);
        } else {
            $(".c-limit-textsend").prop('checked', false);
        }
        $(".c-limit-textsend-val").val(group_info.limit_textsend_time);
        if(group_info.b_limit_guestchat_len) {
            $(".c-limit-guestchat-len").prop('checked', true);
        } else {
            $(".c-limit-guestchat-len").prop('checked', false);
        }
        $(".c-limit-guestchat-val").val(group_info.limit_guestchat_len);
        if(group_info.open_to_member) {
            $(".c-open-to-member").prop('checked', true);
        } else {
            $(".c-open-to-member").prop('checked', false);
        }
        if(group_info.use_max_player) {
            $(".c-max-player").prop('checked', true);
        } else {
            $(".c-max-player").prop('checked', false);
        }
        $(".c-max-player-val").val(group_info.max_player);
        if(group_info.b_setguest_chattime_afterenter) {
            $(".c-setguest-chattime").prop('checked', true);
        } else {
            $(".c-setguest-chattime").prop('checked', false);
        }
        $(".c-setguest-chattime-val").val(group_info.time_guestchat_afterenter);
        if(group_info.b_block_guest_userlink) {
            $(".c-block-guest-userlink").prop('checked', true);
        } else {
            $(".c-block-guest-userlink").prop('checked', false);
        }
        /* 禁止游客是否发送链接*/
        if(group_info.b_block_userlink_identity) {
            $(".c-type-link").text("禁止游客与会员发链接");
        } else {
            $(".c-type-link").text("禁止游客发送链接");
        }

        /*禁止游客或者游客及会员发送链接*/
        if(group_info.b_block_chat_identify) {
            $(".c-disable-say-chat").text("禁止游客与会员文字聊天");
        } else {
            $(".c-disable-say-chat").text("禁止游客文字聊天");
        }
    }

    self.initEvent = function(){
        var that = this;
        /* 更新按钮*/
        $(document).delegate(".btn-box button:eq(0)", "click", function () {
            that.initPage();
        });

        /* 关闭按钮*/
        $(document).delegate(".btn-box button:eq(1)", "click", function () {
            that.room_children_info.btn_close_click();
        });
    }

    self.func(function(curData){
        var that = this;
        that.room_children_info = curData;//child_roominfo;


        that.sup().constructor(curData);
        that.initPage();
        that.initEvent();
    })

});

