portal html css js resource

shareProinfor.html 16KB

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <link rel="stylesheet" href="../css/reset.css" /> <link rel="stylesheet" href="../css/common.css" /> <link rel="stylesheet" href="../css/share.css" /> <style type="text/css"> .ResImgBox:before { margin-left: 0px;} </style> </head> <body> <div class="contentBody2"> <div class="blockGroup mainbox"> <div class="maincon personinfo"> <div class="headbox alignCenter"> <div class="headimg userRadius"><img src="../images/default-photo.jpg" width="100%" class="headimg1" /></div> <div class="listtit"><span class="personalMaterial" style="position: relative;"></span><em class="authiconNew" id="nameli"></em></div> <p class="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span></p> <p class="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"> </span> <span class="personalMaterial"></span></p> </div> </div> <ul> <li> <a class="mui-navigate-right clearfix peolevelbox " id="accessHistory"> <div class="pull-left peocountbox"> <div class="peocount clearfix"> <em class="dialogicon pull-left "></em> <span class="pull-left">已完成咨询<em class="consultCount"></em>次</span> </div> </div> <div class="rightword levelbox pull-right "> <span class="iconfont start"></span> <!--无色星星icon-favor 黄色星icon-favorfill--> <span class="iconfont start"></span> <span class="iconfont icon-favor start"></span> <span class="iconfont icon-favor start"></span> <span class="iconfont icon-favor start"></span> </div> </a> </li> </ul> </div> <div class="blockGroup mainbox" id="professorresourceList"> <div class="maincon"> <div class="infocontit">合作资源</div> <div class="infocon" style="padding:10px 0;"> <ul class="listitembox resinfo" id="resourceList"> </ul> </div> </div> </div> <div class="blockGroup mainbox" id="professorBreifinfo"> <div class="maincon"> <div class="infocontit">个人简介</div> <div class="infocon"> <span class="breifinfo"> </span> </div> </div> </div> <div class="blockGroup mainbox" id="professorInfosubject"> <div class="maincon"> <div class="infocontit">学术领域</div> <div class="infocon"> <ul class="infosubject"> </ul> </div> </div> </div> <div class="blockGroup mainbox" id="professorReserachMess"> <div class="maincon"> <div class="infocontit">研究方向</div> <div class="infocon reserachMess"> </div> </div> </div> <div class="blockGroup mainbox" id="professorinfoapply"> <div class="maincon"> <div class="infocontit">应用行业</div> <div class="infocon"> <ul class="infoapply"> </ul> </div> </div> </div> <div class="blockGroup mainbox" style="padding-bottom:40px;"> <div class="maincon alignCenter"> <div style="margin-top: 30px;"><span style="color:#ff9900; font-size: 16px;line-height: 32px;">「 科袖 」</span><br />搭建企业与专家的桥梁</div> <div class="frmbox" style="margin:20px auto;"> <a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app"><button class="frmbtn frmactive">下载移动客户端</button></a> </div> <div> <img style="width:120px;" src="../images/weixin_code.jpg" /> <div style="color:#CCCCCC;font-size:13px;">关注科袖公众号</div> </div> </div> </div> </div> <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> <script type="text/javascript" src="../js/jquery-1.11.1.js"></script> <script> //获取URL ID函数 $(document).ready(function() { var imgUrl = "http://www.ekexiu.com/images/logo180.png"; var lineLink = document.location.href; var descContent="研究方向:"; var shareTitle=""; var appid = ''; var personalMaterial = document.getElementsByClassName('personalMaterial'); var nameli = document.getElementById("nameli"); var personSummary = document.getElementsByClassName("breifinfo")[0]; var professorId = GetQueryString("professorId"); function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); var context = ""; if(r != null) context = r[2]; reg = null; r = null; return context == null || context == "" || context == "undefined" ? "" : decodeURI(context); } //查询学术领域 var subjectShow = function(data) { if(data != undefined && data.length != 0) { var subs = new Array(); if(data.indexOf(',')) { subs = data.split(','); } else { subs[0] = data; } if(subs.length > 0) { var html = []; for(var i = 0; i < subs.length; i++) { html.push("<li>" + subs[i] + "</li>"); }; document.getElementsByClassName("infosubject")[0].innerHTML = html.join(''); } } } //查询研究方向 var getRecords = function($researchAreaLogs, caption) { var ret = []; var t = 0; for(var i = 0; i < $researchAreaLogs.length; i++) { if(caption == $researchAreaLogs[i].caption) { ret[t] = { id: $researchAreaLogs[i].opreteProfessorId, img: $researchAreaLogs[i].hasHeadImage } t++; } } return ret; } var researchAreaShow = function($datas, $datarecords) { if($datas != undefined && $datas.length != 0) { var html = []; for(var i = 0; i < $datas.length; ++i) { var $data = $datas[i]; var $photos = []; //获取头像 if($datarecords.length > 0) { $photos = getRecords($datarecords, $data.caption); } descContent += " " + $data.caption; var showDiv = "<div class='listbox'><div class='listbrowse mui-ellipsis'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><div class='likenum'>"; if($photos.length < 4) { for(var j = 0; j < $photos.length; ++j) { if($photos[j].img) { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_m.jpg'></span>"; } else { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>"; } } } else { for(var j = $photos.length - 2; j < $photos.length; ++j) { if($photos[j].img) { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_m.jpg'></span>"; } else { showDiv += "<span class='likepeople userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>"; } } showDiv += "<span class='mui-icon iconfont icon-more likepeople likemore userRadius'></span>"; } showDiv += "</div></div></div>"; html.push(showDiv); } document.getElementsByClassName("reserachMess")[0].innerHTML = html.join('') } } //查询应用行业 var industryShow = function(data) { if(data != undefined && data.length != 0) { var subs = new Array(); if(data.indexOf(',')) { subs = data.split(','); } else { subs[0] = data; } if(subs.length > 0) { var html = []; for(var i = 0; i < subs.length; i++) { html.push("<li>" + subs[i] + "</li>"); }; document.getElementsByClassName("infoapply")[0].innerHTML = html.join(''); } } } var professorResource = function(odata) { var $data = odata; var html = []; for(var i = 0; i < odata.length; i++) { var string = '<li class="listitem">' string += '<div class="proinfor clearfix">' string += '<div class="media-object pull-left ResImgBox">' if($data[i].images.length) { string += '<img class="resImg headRadius" src="../images/resource/' + $data[i].resourceId + '.jpg">' } else { string += '<img class="resImg headRadius" src="../images/default-resource.jpg">' } string += '</div>' string += '<div class="pull-left media-body">' string += '<span class="listtit">' + $data[i].resourceName + '</span>' string += '<p class="listtit2">' + $data[i].supportedServices + '</p>' // string += '<p class="listtit3 resbrief">' // if($data[i].descp) { // string += $data[i].descp; // } // string += '</p>' string += '</div></div></li>' html.push(string); } document.getElementById("resourceList").innerHTML = html.join(''); } /*获取个人信息*/ function personalMessage() { $.ajax({ url: "../ajax/professor/info/" + professorId, dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 async:false, timeout: 10000, //超时设置 success: function(data) { var $data = data.data; personalMaterial[0].innerText = $data.name; //title标题栏 if(!$data.title){ $data.title=""; } shareTitle = "【科袖名片】" + $data.name + " " + $data.title + ""; window.setTimeout(function() { document.title = "【科袖名片】" + $data.name + " " + $data.title + ""; }, 500); //基本信息 if($data.consultCount) { document.getElementsByClassName("consultCount")[0].innerText = $data.consultCount; } else { document.getElementById("accessHistory").style.display = "none"; } var startLeval = parseInt($data.starLevel); var start = document.getElementsByClassName("start"); for(var i = 0; i < startLeval; i++) { start[i].classList.add("icon-favorfill"); start[i].classList.remove("icon-favor"); } if($data.hasHeadImage) { document.getElementsByClassName("headimg1")[0].src = "../images/head/" + $data.id + "_l.jpg"; } else { document.getElementsByClassName("headimg1")[0].src = "../images/default-photo.jpg"; } //认证 var oStyT=autho($data.authType,$data.orgAuth,$data.authStatus); nameli.classList.add(oStyT.sty); nameli.setAttribute("title",oStyT.title); if($data.office) { if($data.title) { personalMaterial[1].innerText = $data.office + ","; } else { personalMaterial[1].innerText = $data.office; } } if($data.title) { personalMaterial[2].innerText = $data.title; } if($data.orgName) { if($data.department) { personalMaterial[3].innerText = $data.orgName + " , "; } else { if($data.address) { personalMaterial[3].innerText = $data.orgName + " | "; } else { personalMaterial[3].innerText = $data.orgName; } } } if($data.department) { if($data.address) { personalMaterial[4].innerText = $data.department + " | "; } else { personalMaterial[4].innerText = $data.department; } } if($data.address) { personalMaterial[5].innerText = $data.address; } //个人简介 if($data.descp) { personSummary.innerHTML = $data.descp; } else { document.getElementById("professorBreifinfo").style.display = "none"; } //学术领域 if($data.subject) { subjectShow($data.subject); } else { document.getElementById("professorInfosubject").style.display = "none"; } //研究方向 if($data.researchAreas.length) { researchAreaShow($data.researchAreas, $data.editResearchAreaLogs); } else { document.getElementById("professorReserachMess").style.display = "none"; } //应用行业 if($data.industry) { industryShow($data.industry); } else { document.getElementById("professorinfoapply").style.display = "none"; } //专家资源 if($data.resources.length) { professorResource($data.resources); } else { document.getElementById("professorresourceList").style.display = "none"; } /*//如无详细内容数据,隐藏详细点击的按钮 if(!$data.edus.length && !$data.jobs.length && !$data.projects.length && !$data.papers.length && !$data.patents.length && !$data.honors.length) { document.getElementById("detailProfessor").style.display = "none"; } */ }, error: function(e) { return; } }); } personalMessage() /*微信分享*/ $.ajax({ url: "../ajax/weixin/jsapiTicket", type: 'get', dataType: 'json', contentType: "application/x-www-form-urlencoded; charset=utf-8", data: { 'url': location.href.split('#')[0] }, success: function(data) { if(data.data) { wx.config({ debug: false, //调试模式好犀利 appId: data.data.appId, timestamp: data.data.timestamp, nonceStr: data.data.nonceStr, signature: data.data.signature, jsApiList: [ // 所有要调用的 API 都要加到这个列表中 "onMenuShareAppMessage", "onMenuShareTimeline", "onMenuShareQQ", "onMenuShareQZone", "scanQRCode", ] }); wx.ready(function() { // 在这里调用 API wx.onMenuShareAppMessage({ //分享给朋友 title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); wx.onMenuShareTimeline({ //分享到朋友圈 title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); wx.onMenuShareQQ({ //分享到QQ title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); wx.onMenuShareQZone({ //分享到QQ空间 title: shareTitle, // 分享标题 desc: descContent, // 分享描述 link: lineLink, // 分享链接 imgUrl: imgUrl, // 分享图标 success: share_success_callback, cancel: share_cancel_callback }); }); //分享成功后的回调函数 function share_success_callback() {} //用户取消分享后执行的回调函数 function share_cancel_callback() {} } } }); /*标志*/ function autho() { if(arguments[0] == 1) { return { "sty": "authicon-pro", "title": "科袖认证专家" } } else { if(arguments[1] == 1) { return { "sty": "authicon-staff-ok", "title": "企业认证员工" } } else { if(arguments[2] == 3) { return { "sty": "authicon-real", "title": "实名认证用户" } } else { return { "sty": "e", "title": " " } } } } } }) </script> </body> </html>