$(function () {
    $("#myPageAlert").hide();
    BindPageInfo();
    listcss();

});
//绑定
function BindPageInfo() {
    $(".loading").show();
    $(".loadingcover").show();
    var json = $.parseJSON(manageObj.getcompanyinfo());
    $("#spCompanyId").html(json.companyid);
    $("#txtCompanyName").val(json.companyname);
    $("#spRegTime").html(json.regtime.replace("T"," "));
    $("#spMaxTime").html(json.maxtime.replace("T"," "));
    $("#spContactName").html(json.contactname);
    $("#spMobile").html(json.mobile);
    $("#spWXCount").html(json.wxcount);
    $(".loadingcover").hide();
    $(".loading").hide();
}
//提交
function Save() {
    var objtxtCompanyName = $("#txtCompanyName");//企业名称

    objtxtCompanyName.val($.trim(Canceller(objtxtCompanyName.val())));

    if (objtxtCompanyName.val().length == 0) {
        ShowError("myPageAlert", "请输入企业名称！");
        objtxtCompanyName.focus();
        return;
    }

    $(".loading").show();
    $(".loadingcover").show();
    var strParaJson = $.toJSON({
        companyname: objtxtCompanyName.val()
    });
    manageObj.setcompanyinfo(strParaJson);
}
//回调
function AsyncSetCompanyInfoResult(jsonResult) {
    if (jsonResult.success) {
        ShowMsg("myPageAlert", "操作成功！");
    } else {
        ShowError("myPageAlert", "操作失败！");
    }
    $(".loadingcover").hide();
    $(".loading").hide();
}
//样式操作
function listcss() {
    $(".left-list-l").css({
        height: $(window).height()-40
    });
    $("#set - wrapper").css({
        width: $(window).width() - 130
    });
    $("#right").css({
        height: $(window).height() - 40
    });
    $("#left").css({
        height: $(window).height() - 40
    });
}
$(window).resize(function () {
    listcss();
});