//首页 var pageIndex = 1; // 页数 var allPages = 1; // 总页数 var table = document.body.querySelector('.list'); var search = document.getElementById("search"); mui.plusReady(function() { checkVersion(); document.addEventListener("resume", function(e) { if(mui.os.ios) { window.check_version = window.check_version || 1; //alert(window.check_version) window.check_version++; if(window.check_version % 2) { return; } } checkVersion(); }, false) }) function orName() { mui.ajax(baseUrl + "/ajax/professor/baseInfo/" + plus.storage.getItem('userid'), { dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 timeout: 10000, //超时设置 success: function(data) { if(data.success && data.data) { var $info = data.data || {}; dem($info.id, $info.orgId) } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); return; } }); } function dem(uid, oid) { mui.ajax(baseUrl + "/ajax/demand/qc", { dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 timeout: 10000, //超时设置 data: { "state": [0, 1], "uid": uid, "oid": oid }, traditional: true, success: function(data) { if(data.success) { var $data = data.data; if($data) { mui.openWindow({ url: '../html/demandPublish.html', id: 'demandPublish.html', show: { autoShow: true, aniShow: "slide-in-right" } }); } else { mui.openWindow({ url: '../html/sureOrg.html', id: 'sureOrg.html', show: { autoShow: true, aniShow: "slide-in-right", } }); } } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); return; } }); } document.getElementById("demandP").addEventListener("tap", function() { var userid = plus.storage.getItem('userid'); if(userid == null) { mui.openWindow({ url: '../html/login.html', id: 'login.html' }) return; } orName() }) document.getElementById("improfessor").addEventListener("tap", function() { mui.openWindow({ url: '../html/searchListNew2.html?content=1', id: '../html/searchListNew2.html', show: { autoShow: false, aniShow: "fade-in", }, extras: { key: "", qiFlag: 1 } }); }) proShow() resShare() ruZhuCmp() mui('#hotPro').on('tap', 'li', function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); //显示原生等待框 webviewShow = plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, { proid: id }); }) mui('#resShare').on('tap', 'li', function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); //显示原生等待框 webviewShow = plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, { resourceId: id }); }) mui('#ruZhuCmp').on('tap', 'li', function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); //显示原生等待框 webviewShow = plus.webview.create("../html/cmpInforShow.html", 'cmpInforShow.html', {}, { cmpId: id }); }) document.getElementById("moreRcmp").addEventListener("tap",function(){//查看更多企业 plus.nativeUI.showWaiting(); var web = plus.webview.create("../html/searchListNew2.html?content=2", "../html/searchListNew2.html", {}, { key:"", qiFlag:6 }); }) document.getElementById("moreShare").addEventListener("tap",function(){//查看更多资源 plus.nativeUI.showWaiting(); var web = plus.webview.create("../html/searchListNew2.html?content=3", "../html/searchListNew2.html", {}, { key:"", qiFlag:2 }); }) document.getElementById("moreHotp").addEventListener("tap",function(){//查看更多专家 plus.nativeUI.showWaiting(); var web = plus.webview.create("../html/searchListNew2.html?content=1", "../html/searchListNew2.html", {}, { key:"", qiFlag:1 }); }) ///*点击轮播图*/ //mui('.artical-scroll').on('tap', 'a', function() { // var articalNum = this.getAttribute("data-title"); // mui.openWindow({ // url: '../html/artical_' + articalNum + '.html', // id: '../html/artical_' + articalNum + '.html', // show: { // aniShow: "slide-in-right", // } // }); //}) /*点击热门领域*/ mui('.gridbg').on('tap', 'li', function() { var subject = this.getAttribute("data-title"); //plus.nativeUI.showWaiting();//显示原生等待框 //webviewShow = plus.webview.create("../html/search.html",'search.html',{},{subject:subject,bigClass:1});//后台创建webview并打开show.html mui.openWindow({ url: '../html/searchListNew2.html?content=1', id: '../html/searchListNew2.html', show: { //autoShow:false, aniShow: "slide-in-right", }, extras: { key: subject, qiFlag: 1 } }); }) function ruZhuCmp(){//入驻企业 mui.ajax(baseUrl+"/ajax/org/find/pq",{ type: "GET", timeout: 10000, dataType: "json", data:{ "pageSize": 5, "pageNo": 1 }, success: function(data) { if(data.success) { var $info = data.data.data; for(var i = 0; i < $info.length; i++) { var liStr=document.createElement("li"); liStr.className="mui-table-view-cell"; liStr.setAttribute("data-id", $info[i].id); document.getElementById("ruZhuCmp").appendChild(liStr); var cmpname,imgurl='../images/default-icon.jpg' if($info[i].hasOrgLogo) { imgurl=baseUrl+'/images/org/' + $info[i].id + '.jpg'; } if($info[i].forShort){ cmpname = $info[i].forShort; }else{ cmpname = $info[i].name; } var oSty={sty:"",tit:""}; if($info[i].authStatus == 3) { oSty.sty="authicon-com-ok" oSty.tit="科袖认证企业" } var orgOther = "",orgType=""; if($info[i].industry) { orgOther = $info[i].industry.replace(/,/gi, " | "); } if($info[i].orgType == "2") { orgType = orgTypeShow[$info[i].orgType] + ""; } var strCon=''; strCon += '