var num=1; mui.init({ pullRefresh: { container: '#pullrefresh', up: { contentrefresh: '正在加载...', callback: pullupRefresh } } }); function pullupRefresh() { num++; setTimeout(function() { UnauthorizedUser(20,num); }, 1000); } mui.ready(function() { mui.plusReady(function() { var dd1=plus.webview.getWebviewById("cmpinfor-index.html"); var id = dd1.orgId; /*企业基本信息*/ function companyMessage() { mui.ajax(baseUrl + "/ajax/org/" + id, { dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 timeout: 10000, //超时设置 success: function(data) { if(data.success) { //console.log(JSON.stringify(data)); var $data = data.data; var orgType; document.getElementById("companyName").innerText = $data.name; if($data.hasOrgLogo) { document.getElementById("oimg").src = baseUrl + "/images/org/" + $data.id + ".jpg"; } else { document.getElementById("oimg").src = "../images/default-icon.jpg"; } /*企业标识*/ if($data.authStatus == 3) { document.getElementById("authFlag").classList.add("authicon-com-ok"); } /*企业类型*/ if($data.orgType) { switch($data.orgType) { case '2': orgType = "国有企业"; break; case '3': orgType = "上市企业"; break; case '4': orgType = "合资企业"; break; case '5': orgType = "私人企业"; break; case '6': orgType = "外资企业"; break; default: orgType = "初创企业"; break; } document.getElementById("orgType").innerText = orgType; } /*所在城市*/ if($data.city) { document.getElementById("ocity").innerText = $data.city; } else { document.getElementById("ocity").parentNode.removeChild(document.getElementById("ocity")); } } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); return; } }); } /*按钮点击切换*/ mui(".cmpClassNum").on("tap", "li", function() { var oStringText = this.innerText; var arr = new Array(); arr[0] = plus.webview.getWebviewById("cmpinfor-basic.html"); arr[1] = plus.webview.getWebviewById("cmpinfor-trend.html"); arr[2] = plus.webview.getWebviewById("cmpinfor-staff.html"); if(oStringText == "介绍") { arr[0].show(); } else if(oStringText == "动态") { arr[1].show(); } else if(oStringText == "员工") { return; } }) companyMessage(); UnauthorizedUser(20,1); }) }) /*获取企业认证的用户*/ function UnauthorizedUser(pageSize,pageNum) { mui.plusReady(function() { var dd1=plus.webview.getWebviewById("cmpinfor-index.html"); var id = dd1.orgId; mui.ajax(baseUrl + "/ajax/professor/pqOrgAuth", { type: "GET", timeout: 10000, dataType: "json", data: { "orgId": id, "orgAuth": 1, "pageSize": pageSize, "pageNo": pageNum }, success: function(data, textState) { if(data.success) { if(num*pageSize<=data.data.total){ mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); }else{ if(num==1){ mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); }else{ mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); return; } } var $data = data.data.data; dUserHtml($data); } }, error: function(XMLHttpRequest, textStats, errorThrown) { plus.nativeUI.toast("服务器链接超时", toastStyle); mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); return; } }) }) } function dUserHtml(obj) { for(var i = 0; i < obj.length; i++) { var img; var oSty = autho(obj[i].authType, obj[i].orgAuth, obj[i].authStatus); (obj[i].hasHeadImage == 1) ? img = baseUrl + "/images/head/" + obj[i].id + "_l.jpg": img = "../images/default-photo.jpg"; var li = document.createElement("li"); li.className = "mui-table-view-cell mui-media flexCenter" if(obj[i].authType==1){ li.setAttribute("professorId",obj[i].id); } var oString = '
' + obj[i].name + '
' oString += '' + personalInformation(obj[i]) + '
' if(obj[i].authType) { oString += '' + research(obj[i].researchAreas) + '
' } oString += '