123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- <!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>
- html,body{margin:0;padding:0px;background: #FFFFFF;}
- </style>
- <script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
- <script type="text/javascript" src="../js/public/swiper.min.js"></script>
- <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
- <script type="text/javascript" src="../js/public/shareCom.js"></script>
- </head>
- <body>
- <div class="contentBody2">
-
- <div data-editor="topslider">
- <div id="index-container">
- <ul class="swiper-wrapper">
-
- </ul>
- <div class="swiper-pagination" id="index-pagination"></div>
- </div>
- </div>
- <div class="showDetail">
- <div class="h1Font hWeight" id="resourceName"></div>
- <div class="showFont" id="application"></div>
- <div class="madiaBlock">
- <ul class="mui-table-view noactiveTab infoBlock">
- <li class="mui-table-view-cell">
- <div class="flexCenter mui-clearfix">
- <a id="thisInfo">
- <div class="madiaHead" id="thisPic"></div>
- <div class="madiaInfo">
- <p><span class="h1Font ellipsisSty" id="thisName"></span><em class="authiconNew" title="" id="authFlag"></em></p>
- <p class="h3Font ellipsisSty" id="thisOther"></p>
- </div>
- </a>
- <div class="goSpan">
- <span class="attenSpan">关注</span>
- </div>
- </div>
-
- </li>
- </ul>
- </div>
-
- <div class="showMain showRes">
- <ul>
- <li>
- <div class="showTit">所属机构</div>
- <div class="showCon" id="resorceOrg"></div>
- </li>
- <li>
- <div class="showTit">厂商型号</div>
- <div class="showCon" id="modelNumber"></div>
- </li>
- <li>
- <div class="showTit">性能参数</div>
- <div class="showCon" id="performancePa"></div>
- </li>
- <li>
- <div class="showTit">合作备注</div>
- <div class="showCon" id="remarkContent"></div>
- </li>
- <li>
- <div class="showTit">详细介绍</div>
- <div class="showCon" id="detailDescp"></div>
- </li>
- </ul>
- </div>
-
- <ul class="tagList">
-
- <span class="h2Font"></span>
- </li>-->
- </ul>
- <div class="madiaBlock displayNone">
- <div class="madiaTit">相关文章</div>
- <ul class="mui-table-view" id="likeArtical">
- </ul>
- </div>
-
- <div class="madiaBlock displayNone">
- <div class="madiaTit">您可能感兴趣的资源</div>
- <ul class="mui-table-view" id="likeResource">
- </ul>
- </div>
-
- </div>
- <div class="shareEcode">
- <img class="Ecodecon" src="../images/ecordCard.jpg" />
- <div class="Ecodeinfo">
- <a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app"><button class="frmbtn frmactive">下载移动客户端</button></a>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- $(document).ready(function() {
- var imgUrl = "http://www.ekexiu.com/images/logo180.png";
- var lineLink = document.location.href;
- var descContent;
- var shareTitle;
- var appid = '';
-
- var resourceId = GetQueryString("id");
- var othisInfo=document.getElementById("thisInfo");
- var othisName = document.getElementById("thisName");
- var othisOther = document.getElementById("thisOther");
- var oauthFlag = document.getElementById("authFlag");
- var othisPic = document.getElementById("thisPic");
-
- var oresorcePic = document.getElementById("resorcePic");
- var oresourceName = document.getElementById("resourceName");
- var oapplication = document.getElementById("application");
- var oresorceOrg = document.getElementById("resorceOrg");
- var omodelNumber = document.getElementById("modelNumber");
- var operformancePa = document.getElementById("performancePa");
- var oremarkContent = document.getElementById("remarkContent");
- var odetailDescp = document.getElementById("detailDescp");
- getRecourceMe();
- relatedArticles();
- interestingResources();
- $.ajax({
- "url": "/ajax/resource/pageViews",
- "type": "POST",
- "dataType": "json",
- "data": {
- "resourceId": resourceId
- },
- "success": function(data) {
- console.log(data);
- if(data.success) {}
- },
- "error": function() {
-
- }
- });
-
- $("#thisInfo").on("click", function() {
- var reType = this.getAttribute("data-type");
- if(reType=="1"){
- var proId=this.getAttribute("data-id");
- location.href="http://" + window.location.host + "/e/p.html?id=" + proId;
- }else{
- var cmpId=this.getAttribute("data-id");
- location.href="http://" + window.location.host + "/e/c.html?id=" + cmpId;
- }
-
- })
- $("body").on("click",".goSpan",function(){
- location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app";
- $(this).addClass("activeThis");
- })
- function getRecourceMe() {
- $.ajax({
- url:'../ajax/resource/queryOne',
- data: {
- 'resourceId': resourceId,
- },
- dataType: 'json',
- type: 'get',
- timeout: 10000,
- success: function(data) {
- if(data.success) {
- var mydata = data.data;
- var resourceName = mydata.resourceName;
- document.title = resourceName;
- oresourceName.innerHTML = mydata.resourceName;
- oapplication.innerHTML = "用途:"+ mydata.supportedServices;
-
- shareTitle = oresourceName.innerHTML;
- descContent = oapplication.innerHTML;
- if(mydata.editProfessor) {
- othisInfo.setAttribute("data-id",mydata.editProfessor.id);
- othisInfo.setAttribute("data-type",mydata.resourceType);
- professorId = othisInfo.getAttribute("data-id");
- if(mydata.orgName) {
- oresorceOrg.innerText = mydata.orgName;
- oresorceOrg.parentNode.style.display="block";
- }
-
- othisName.innerHTML = mydata.editProfessor.name;
- var otitleInfo="";
- var oOrgInfo="";
- if(mydata.editProfessor.title) {
- otitleInfo = mydata.editProfessor.title + ",";
- } else {
- if(mydata.editProfessor.office) {
- otitleInfo = mydata.editProfessor.office + ",";
- }else{
- otitleInfo = "";
- }
- }
- if(mydata.editProfessor.orgName) {
- oOrgInfo = mydata.editProfessor.orgName;
- }
- othisOther.innerHTML = otitleInfo + oOrgInfo;
-
- var professorFlag = autho(mydata.editProfessor.authType, mydata.editProfessor.orgAuth, mydata.editProfessor.authStatus);
- oauthFlag.classList.add(professorFlag.sty);
- othisPic.classList.add("useHead");
- if(mydata.editProfessor.hasHeadImage == 1) {
- othisPic.style.backgroundImage = 'url(../images/head/' + mydata.editProfessor.id + '_l.jpg)';
- }
- }else{
- othisInfo.setAttribute("data-id",mydata.organization.id);
- othisInfo.setAttribute("data-status",mydata.organization.authStatus);
- othisInfo.setAttribute("data-type",mydata.resourceType);
- if(mydata.organization.forShort) {
- othisName.innerHTML = mydata.organization.forShort;
- }else{
- othisName.innerHTML = mydata.organization.name;
- }
-
- if(mydata.organization.subject){
- othisOther.innerHTML = (mydata.organization.subject).replace(/,/, " | ");
- }
- var mgimg="../images/default-icon.jpg";
- if(mydata.organization.hasOrgLogo) {
- mgimg="/images/org/" + mydata.organization.id + ".jpg";
- }
- othisPic.classList.add("cmpHead2");
- othisPic.innerHTML='<div class="boxBlock"><img class="boxBlockimg" id="companyImg" src="'+ mgimg+'"></div>'
- if(mydata.organization.authStatus==3){
- oauthFlag.classList.add("authicon-com-ok");
- }
- }
- if(mydata.spec) {
- omodelNumber.innerText = mydata.spec;
- omodelNumber.parentNode.style.display="block";
- }
- if(mydata.parameter) {
- operformancePa.innerHTML = mydata.parameter;
- operformancePa.parentNode.style.display="block";
- }
- if(mydata.cooperationNotes) {
- oremarkContent.innerHTML = mydata.cooperationNotes;
- oremarkContent.parentNode.style.display="block";
- }
- if(mydata.descp) {
- odetailDescp.innerHTML = mydata.descp;
- odetailDescp.parentNode.style.display="block";
- }
- if(mydata.subject) {
- var oSub = mydata.subject.split(",");
- var oSt = "";
- for(var i = 0; i < oSub.length; i++) {
- oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
- }
- $(".tagList").html(oSt);
- }else{
- $("#resourceList").parents(".otherShow").addClass("displayNone")
- }
- console.log(mydata.images.length)
- if(mydata.images.length!=0) {
- imgUrl="http://www.ekexiu.com/data/resource/" + mydata.images[0].imageSrc.replace(/.jpg/,"_s.jpg");
- var rPdiv ='';
- for(var i = 0; i < mydata.images.length; i++) {
- rPdiv +='<li class="swiper-slide"><a class="tab-re"><img src="../data/resource/' + mydata.images[i].imageSrc + '" /></a></li>'
- }
- $("#index-container ul").append(rPdiv);
-
- var swiper = new Swiper('#index-container', {
- pagination: '#index-pagination',
- slidesPerView: 1,
- paginationClickable: true,
- loop: true,
- autoplay: 5000,
- autoplayDisableOnInteraction: false
- });
- }else{
- $("#index-container").parent().hide();
- }
- }
- },
- error: function(e) {
- return;
- }
- });
- }
-
- function relatedArticles() {
- $.ajax({
- url:'/ajax/article/byAssResource',
- type: "GET",
- data: {
- "id": resourceId,
- },
- dataType: "json",
- success: function(data) {
- if(data.success) {
- if(data.data.length == 0) {
- return;
- }
- document.getElementById("likeArtical").parentNode.classList.remove("displayNone");
- var $html= data.data;
- var lengthT;
- if($html.length>5){
- lengthT=5;
- }else{
- lengthT=$html.length
- }
- for(var i = 0; i < $html.length; i++) {
- (function(n) {
- var oURL;
- if($html[i].articleType==1) {
- oURL="/ajax/professor/baseInfo/" + $html[i].professorId;
- }else{
- oURL="/ajax/org/" + $html[i].orgId;
- }
- $.ajax({
- url:oURL,
- type: "GET",
- dataType: "json",
- success: function(data) {
- if(data.success) {
- var likeRUl = document.getElementById("likeArtical");
- var likeRli = document.createElement("li");
- likeRli.className = 'mui-table-view-cell';
- likeRli.setAttribute("data-id", $html[n].articleId);
-
- var comName="";
- if($html[n].articleType==1) {
- var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
- comName=data.data.name;
- likeRli.setAttribute("data-type", 1);
- }else {
- var stl={};
- stl.sty="";
- stl.title="";
- if(data.data.authStatus==3) {
- stl.sty="authicon-com-ok";
- stl.title="认证企业";
- }
- if(data.data.forShort){
- comName=data.data.forShort;
- }else{
- comName=data.data.name;
- }
- likeRli.setAttribute("data-type", 2);
- }
-
- var str = ""
- str+='<div class="flexCenter OflexCenter mui-clearfix">'
- if($html[n].articleImg) {
- str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].articleImg + ')"></div>'
- } else {
- str += '<div class="madiaHead artHead"></div>'
- }
- str += '<div class="madiaInfo OmadiaInfo">'
- str += '<p class="ellipsisSty-2 h1Font">' + $html[n].articleTitle + '</p>'
- str += '<p><span class="h2Font" style="margin-right:10px;">' + comName + '</span><span class="time">'+commenTime($html[n].publishTime)+'</span></p>'
- str += '</div></div>'
- likeRli.innerHTML = str;
- likeRUl.appendChild(likeRli,likeRUl.lastChild);
- }
- },
- error: function() {
- }
- });
- })(i);
-
- }
- }
- },
- error: function() {
- }
- });
- }
-
- function interestingResources() {
- $.ajax({
- url:"/ajax/resource/ralateResources",
- data: {"resourceId": resourceId},
- dataType: "json",
- traditional: true,
- type: 'get',
- success: function(data) {
- if(data.success) {
- console.log(data)
- if(data.data.length == 0) {
- return;
- }
- document.getElementById("likeResource").parentNode.classList.remove("displayNone");
- var $respond=data.data;
- var lengthT;
- if($respond.length>5){
- lengthT=5;
- }else{
- lengthT=$respond.length
- }
- for(var i = 0; i < lengthT; i++) {
- (function(n) {
- var imgL="../images/default-resource.jpg";
- if($respond[i].images.length){
- imgL='/data/resource/' + $respond[i].images[0].imageSrc
- }
- var oURL;
- if($respond[i].resourceType==1) {
- oURL="/ajax/professor/baseInfo/"+$respond[i].professorId;
- }else{
- oURL="/ajax/org/" + $respond[i].orgId;
- }
- $.ajax({
- url:oURL,
- "type": "GET",
- 'dataType': "json",
- "success": function(data) {
- if(data.success){
- var thisName,userType,thisAuth,thisTitle
- if(data.data.forShort){
- thisName=data.data.forShort;
- }else{
- thisName=data.data.name;
- }
- if($respond.resourceType==1) {
- userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
- thisTitle = userType.title;
- thisAuth = userType.sty;
- }else {
- if(data.data.authStatus==3) {
- thisTitle = "科袖认证企业";
- thisAuth = "authicon-com-ok";
- }
- }
- var add = document.createElement("li");
- add.className = "mui-table-view-cell";
- add.setAttribute("data-id",$respond[n].resourceId);
- var itemlist = '<div class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url('+imgL+')"></div>';
- itemlist += '<div class="madiaInfo OmadiaInfo">';
- itemlist += '<p class="ellipsisSty-2 h1Font" id="usertitle">'+$respond[n].resourceName+'</p>';
- itemlist += '<p><span class="h2Font">'+thisName+'</span><em class="authiconNew '+thisAuth+'" title="'+thisTitle+'"></em></p>';
- itemlist += '</div></div>';
-
- add.innerHTML=itemlist;
- document.getElementById("likeResource").appendChild(add);
- }
- },
- 'error': function() {
- }
- });
- })(i);
- }
- }
- },
- error: function() {
- }
- });
- }
-
- $("#likeArtical").on("click", "li", function() {
- location.href="http://" + window.location.host + "/e/a.html?id=" + $(this).attr("data-id");
- })
-
- $("#likeResource").on("click", "li", function() {
- location.href="http://" + window.location.host + "/e/r.html?id=" + $(this).attr("data-id");
- })
-
- $.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: [
- "onMenuShareAppMessage",
- "onMenuShareTimeline",
- "onMenuShareQQ",
- "onMenuShareQZone",
- "scanQRCode",
- ]
- });
- wx.ready(function() {
-
- 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({
- title: shareTitle,
- desc: descContent,
- link: lineLink,
- imgUrl: imgUrl,
- success: share_success_callback,
- cancel: share_cancel_callback
- });
- wx.onMenuShareQZone({
- title: shareTitle,
- desc: descContent,
- link: lineLink,
- imgUrl: imgUrl,
- success: share_success_callback,
- cancel: share_cancel_callback
- });
- });
-
- function share_success_callback() {}
-
- function share_cancel_callback() {}
- }
- }
- });
- })
- </script>
- </body>
- </html>
|