//阻尼系数 var deceleration = mui.os.ios ? 0.003 : 0.0009; mui('.mui-scroll-wrapper').scroll({ bounce: false, indicators: true, //是否显示滚动条 deceleration: deceleration }); mui.ready(function() { mui.plusReady(function() { var userId = plus.storage.getItem('userid'); var pullRefreshEl,index; //跳转专家浏览页面 mui("#likeUser").on("tap", "li", function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); //显示原生等待框 plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, { proid: id }); }) mui("#likeRes").on("tap", "li", function() { var resouId = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, { resourceId: resouId }); }) mui("#likeArt").on("tap", "li", function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, { articleId: id }); }) mui("#likePer").on("tap", "li", function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, { "paperId": id }); }) mui("#likePat").on("tap", "li", function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, { "patentId": id }); }) mui("#likeCmp").on("tap", "li", function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); plus.webview.create("../html/cmpInforShow.html", 'cmpInforShow.html', {}, { "cmpId": id }); }) mui("#likeDemand").on("tap", "li", function() { var id = this.getAttribute("data-id"); plus.nativeUI.showWaiting(); plus.webview.create("../html/needShow.html", 'needShow.html', {}, { "demanid": id }); }) getWatchCon(1,10,1) getWatchCon(1,10,2) getWatchCon(1,10,3) getWatchCon(1,10,4) getWatchCon(1,10,5) getWatchCon(1,10,6) getWatchCon(1,10,7) //左滑及右滑 document.querySelector('#slider').addEventListener('slide', function(event) { var $this = document.querySelector(".mui-scroll .mui-active"); if($this.innerHTML == "专家") { getWatchCon(1,10,1) } else if($this.innerHTML == "资源") { getWatchCon(1,10,2) } else if($this.innerHTML == "文章") { getWatchCon(1,10,3) } else if($this.innerHTML == "专利") { getWatchCon(1,10,4) } else if($this.innerHTML == "论文") { getWatchCon(1,10,5) }else if($this.innerHTML == "企业") { getWatchCon(1,10,6) }else if($this.innerHTML == "需求") { getWatchCon(1,10,7) } }); //点击 document.querySelector('#slider').addEventListener('tap', function(event) { var $this = document.querySelector(".mui-scroll .mui-active"); if($this.innerHTML == "专家") { getWatchCon(1,10,1) } else if($this.innerHTML == "资源") { getWatchCon(1,10,2) } else if($this.innerHTML == "文章") { getWatchCon(1,10,3) } else if($this.innerHTML == "专利") { getWatchCon(1,10,4) } else if($this.innerHTML == "论文") { getWatchCon(1,10,5) }else if($this.innerHTML == "企业") { getWatchCon(1,10,6) }else if($this.innerHTML == "需求") { getWatchCon(1,10,7) } }); function getWatchCon(pageNo,pageSize,num) { mui.ajax(baseUrl + '/ajax/watch/qaPro', { data: { "professorId": userId, "watchType": num, "pageNo": pageNo, "pageSize": pageSize }, dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 success: function(data) { plus.nativeUI.closeWaiting(); plus.webview.currentWebview().show("fade-in", 150); if(data.success && data.data.data != "") { var datalist = data.data.data; if(num==1){ detailPro(datalist); }else if(num==2){ detailRes(datalist); }else if(num==3){ detailArt(datalist); }else if(num==4){ detailPat(datalist); }else if(num==5){ detailPer(datalist); }else if(num==6){ detailCmp(datalist); }else if(num==7){ detailDemand(datalist); } }else{ if(num==1){ document.getElementById("likePro").nextSibling.classList.remove("displayNone"); }else if(num==2){ document.getElementById("likeRes").nextSibling.classList.remove("displayNone"); }else if(num==3){ document.getElementById("likeArt").nextSibling.classList.remove("displayNone"); }else if(num==4){ document.getElementById("likePat").nextSibling.classList.remove("displayNone"); }else if(num==5){ document.getElementById("likePer").nextSibling.classList.remove("displayNone"); }else if(num==6){ document.getElementById("likeCmp").nextSibling.classList.remove("displayNone"); }else if(num==7){ document.getElementById("likeDemand").nextSibling.classList.remove("displayNone"); } } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); } }); } function detailPro(datalist) { document.getElementById("likeUser").innerHTML=""; //console.log(JSON.stringify(datalist)) for(var i = 0; i < datalist.length; i++) { var li = document.createElement("li"); var userType = autho(datalist[i].professor.authType, datalist[i].professor.orgAuth, datalist[i].professor.authStatus); var os = ""; if(datalist[i].professor.title) { if(datalist[i].professor.orgName) { os = datalist[i].professor.title + "," + datalist[i].professor.orgName; } else { os = datalist[i].professor.title; } } else { if(datalist[i].professor.office) { if(datalist[i].professor.orgName) { os = datalist[i].professor.office + "," + datalist[i].professor.orgName; } else { os = datalist[i].professor.office; } } else { if(datalist[i].professor.orgName) { os = datalist[i].professor.orgName; } } } var baImg = "../images/default-photo.jpg"; if(datalist[i].professor.hasHeadImage == 1) { baImg = baseUrl + "/images/head/" + datalist[i].professor.id + "_l.jpg"; } var oSub = ""; if(datalist[i].professor.researchAreas.length) { var arr = []; for(var n = 0; n < datalist[i].professor.researchAreas.length; n++) { arr[n] = datalist[i].professor.researchAreas[n].caption; } oSub = "研究方向:" + arr.join(","); } li.setAttribute("data-id", datalist[i].professor.id); li.setAttribute("data-flag", 1); li.className = "mui-table-view-cell flexCenter"; li.innerHTML = '
' + '' + datalist[i].professor.name + '
' + '' + os + '
' + '' + oSub + '
' + '' + orgName + '
' + '' + orgType + ' ' + orgOther + '
' + '' + $data[i].name + '
' + '' + $data[i].authors.substring(0, $data[i].authors.length - 1) + '
' + '' + $data[i].name + '
' + '' + $data[i].authors.substring(0, $data[i].authors.length - 1) + '
' + '' + $data.resourceName + '
' + '' + namepo + '
' + '用途:' + $data.supportedServices + '
' + '' + title + '
' + ''+name+''+commenTime(dataItem.publishTime)+'
'+ ''+ $data[i].title +'
' strCon+='