//创建js对象
//1、创建对象
function CompanyCommunity() {
this.companyCommunityPage = null;
this.communityContentPage = null;
this.communityNoticePage = null;
this.topicPresetPage = null;
this.list1 = [];
this.defaultMobileMainPage = null;
}
//2、这里继承公司的属性,并创建方法
$.extend(true, CompanyCommunity.prototype, {
//2.1、查询公司的信息的方法
findCompanyInfo: function (option) {
//一、这里是请求对应的参数
var options = {
url: _ctxPath + '/company/findCompanyInfo.json',
dataType: 'json',
async: false,
data: null,
success: function () {
}
};
//二、通过对象创建调用方法获取的参数信息,并继承
$.extend(true, options, option);
//三、掉用参数使用ajax请求获得值
$.ajax(options);
},
})
//创建对象并调用对象创建的方法
var cc = new CompanyCommunity();
var cdata = null;
function loadCompanyCommunityData(){
var data = {
companyID : _currentCompanyID
};
var option = {
data : data,
//回调创建对象成功
success : function(result){
var company = result._comInfo;
cdata = company;
$("#create_community_is_approve").find("input").each(function(){
if($(this).val()==company.createCompanyApprove){
$(this).prop("checked",true);
}
});
$("#move_community_is_approve").find("input").each(function(){
if($(this).val()==company.moveCompanyApprove){
$(this).prop("checked",true);
}
});
$("#delete_community_is_approve").find("input").each(function(){
if($(this).val()==company.deleteCompanyApprove){
$(this).prop("checked",true);
}
});
$("#close_community_is_approve").find("input").each(function(){
if($(this).val()==company.closeCompanyApprove){
$(this).prop("checked",true);
}
});
//$("#community_storage_size").html("");
}
};
//这里是调用方法实现逻辑
cc.findCompanyInfo(option);
}