portal html css js resource

shareArticalinfor.html 9.6KB

    <!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/index.css" /> <link rel="stylesheet" href="../css/share.css" /> <style> html,body {background: #ffffff;} .proinfor .headblock {margin: 0 2% 4px 0;} .proinfor .headblock .headimg {max-width:64px;width: 64px;overflow: hidden;margin: auto;} .proinfor .media-body{width: 76%;} .listtit {font-size: 15px;line-height: 26px;color: #333333;} .listtit2 {font-size: 13px;line-height: 20px;color: #666666;} .listtit3 {font-size: 12px;line-height: 18px;color: #888888;} @media only screen and (min-width: 100px) and (max-width: 350px) { .proinfor .media-body{width:70%;} } </style> </head> <body> <div class="contentBody2"> <div class="art_topicBox"> <div class="art_img" id="articleImg"></div> <div class="art_tbox"> <h4 id="artical_topic"></h4> </div> </div> <div class="articalBox"> <ul id="proInfor"> <li style="padding:8px 20px 8px 10px;"> <a class="proinfor clearfix"> <div class="headblock floatL"><img id="proHead" class="headimg headRadius" src="../images/default-photo.jpg"></div> <div class="media-body floatL"> <span class="listtit"><span id="proName"></span><em class="authicon authicon-cu" style="position:absolute;margin:4px 0 0 2px ;"></em></span> <div class="listtit2"><span id="proTitle"></span><span id="proOffice"></span><span id="proOrg"></span><span id="proAddress"></span></div> <div class="mui-ellipsis listtit3" id="proRlist"></div> <div class="mui-ellipsis listtit3" id="proZlist"></div> </div> </a> </li> </ul> <div class="line01" style="margin:4px 0 10px 0;"></div> <div id="artical_real"> <!--body--> <div id="main_content"> </div> <!--body--> </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> </div> <script type="text/javascript" src="../js/jquery-1.11.1.js"></script> <script> $(document).ready(function() { var articleId = GetQueryString("articleId"); 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); } function proInfoMain() { $.ajax({ url: "/ajax/article/query", dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 data: { "articleId": articleId }, timeout: 10000, //超时设置 success: function(data) { var $info = data.data || {}; if(data.success && data.data) { var nameli = document.getElementById("nameli"); var proZlist = document.getElementById("proZlist"); //专家资源 var proRlist = document.getElementById("proRlist"); //专家资源 var proName = document.getElementById("proName"); var proTitle = document.getElementById("proTitle"); var proOffice = document.getElementById("proOffice"); var proOrg = document.getElementById("proOrg"); var proAddress = document.getElementById("proAddress"); var articleImg = document.getElementById("articleImg"); var artical_topic = document.getElementById("artical_topic"); var main_content = document.getElementById("main_content"); proName.innerText = $info.professor.name; if($info.professor.title && $info.professor.office && $info.professor.orgName && $info.professor.address) { proTitle.innerText = $info.professor.title + ","; proOffice.innerText = $info.professor.office + ","; proOrg.innerText = $info.professor.orgName + " | "; proAddress.innerText = $info.professor.address; } else if(!$info.professor.title && $info.professor.office && $info.professor.orgName && $info.professor.address) { proOffice.innerText = $info.professor.office + ","; proOrg.innerText = $info.professor.orgName + " | "; proAddress.innerText = $info.professor.address; } else if($info.professor.title && !$info.professor.office && $info.professor.orgName && $info.professor.address) { proTitle.innerText = $info.professor.title + ","; proOrg.innerText = $info.professor.orgName + " | "; proAddress.innerText = $info.professor.address; } else if($info.professor.title && $info.professor.office && !$info.professor.orgName && $info.professor.address) { proTitle.innerText = $info.professor.title + ","; proOffice.innerText = $info.professor.office + " | "; proAddress.innerText = $info.professor.address; } else if($info.professor.title && $info.professor.office && $info.professor.orgName && !$info.professor.address) { proTitle.innerText = $info.professor.title + ","; proOffice.innerText = $info.professor.office + ","; proOrg.innerText = $info.professor.orgName; } else if(!$info.professor.title && !$info.professor.office && $info.professor.orgName && $info.professor.address) { proOrg.innerText = $info.professor.orgName + " | "; proAddress.innerText = $info.professor.address; } else if(!$info.professor.title && $info.professor.office && !$info.professor.orgName && $info.professor.address) { proOffice.innerText = $info.professor.office + " | "; proAddress.innerText = $info.professor.address; } else if(!$info.professor.title && $info.professor.office && $info.professor.orgName && !$info.professor.address) { proOffice.innerText = $info.professor.office + ","; proOrg.innerText = $info.professor.orgName; } else if($info.professor.title && !$info.professor.office && !$info.professor.orgName && $info.professor.address) { proTitle.innerText = $info.professor.title + " | "; proAddress.innerText = $info.professor.address; } else if($info.professor.title && !$info.professor.office && $info.professor.orgName && !$info.professor.address) { proOffice.innerText = $info.professor.title + ","; proAddress.innerText = $info.professor.orgName; } else if($info.professor.title && $info.professor.office && !$info.professor.orgName && !$info.professor.address) { proTitle.innerText = $info.professor.title + ","; proOffice.innerText = $info.professor.office; } else if(!$info.professor.title && !$info.professor.office && !$info.professor.orgName && $info.professor.address) { proAddress.innerText = $info.professor.address; } else if(!$info.professor.title && !$info.professor.office && $info.professor.orgName && !$info.professor.address) { proOrg.innerText = $info.professor.orgName; } else if(!$info.professor.title && $info.professor.office && !$info.professor.orgName && !$info.professor.address) { proOffice.innerText = $info.professor.office; } else if($info.professor.title && !$info.professor.office && !$info.professor.orgName && !$info.professor.address) { proTitle.innerText = $info.professor.title; } var rlist = '' for(var n = 0; n < $info.professor.researchAreas.length; n++) { rlist += '<span>' + $info.professor.researchAreas[n].caption + '</span>'; if(n != $info.professor.researchAreas.length - 1) { rlist += ','; } } ($info.professor.researchAreas) ? proRlist.innerHTML = rlist: proRlist.innerText = ''; var zlist = ""; for(var n = 0; n < $info.professor.resources.length; n++) { zlist += '<span>' + $info.professor.resources[n].resourceName + '</span>'; if(n != $info.professor.resources.length - 1) { zlist += ','; } } ($info.professor.resources) ? proZlist.innerHTML = zlist: proZlist.innerText = ''; if($info.articleImg) { articleImg.style.backgroundImage = 'url(/data/article/' + $info.articleImg + ')'; } if($info.professor.hasHeadImage) { document.getElementById('proHead').src = "/images/head/" + $info.professorId + "_l.jpg"; } artical_topic.innerText = $info.articleTitle; if($info.articleContent) { main_content.innerHTML = $info.articleContent; var oImg = main_content.getElementsByTagName("img"); for(var i = 0; i < oImg.length; i++) { (function(n) { var att = oImg[n].src.substr(7); console.log(oImg[n].src) oImg[n].style.width = "100%"; oImg[n].parentNode.style.textIndent = "0em"; })(i); } } } }, error: function() { return; } }); } proInfoMain(); }) </script> </body> </html>