portal html css js resource

s.html 22KB

    <!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/baseUtil.js"></script> <script type="text/javascript" src="../js/public/shareCom.js"></script> <script type="text/javascript" src="../js/public/openApp.js"></script> </head> <body> <div class="contentBody2"> <!--焦点图 start--> <div data-editor="topslider"> <div id="index-container"> <ul class="swiper-wrapper"> <!--<li class="swiper-slide"><a class="tab-re"><img src="../images/banner/banner01.jpg" /></a></li>--> </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" style="padding-right: 80px;"> <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="remarkContent"></div> </li> <li id="articleContent"> <div class="showTit">详细介绍</div> <div class="showCon" id="detailDescp"></div> </li> </ul> </div> <!--标签模块--> <ul class="tagList"> <!--<li> <span class="h2Font"></span> </li>--> </ul> <div class="madiaBlock displayNone" id="resource"> <div class="madiaTit">相关资源</div> <ul class="mui-table-view" id="resourceList"> </ul> </div> <!-- <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 serviceId = 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 oremarkContent = document.getElementById("remarkContent"); //合作备注 var odetailDescp = document.getElementById("detailDescp"); //详细描述 getRecourceMe(); /*获取信息*/ // relatedArticles(); /*相关文章信息*/ interestingResources(); pageViewLog(serviceId, 10); //进入发布者详情页面 $("#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 if(reType == "2"){ var cmpId = this.getAttribute("data-id"); location.href = "http://" + window.location.host + "/e/c.html?id=" + cmpId; } }) var this_ = "../html/serviceIdShow.html?serviceId=" + serviceId; wcFresh(this_); $("body").on("click", ".goSpan", function() { isInstalled(this_, true); $(this).addClass("activeThis"); }) function ajaxRequist(url, obj, type, fn) { $.ajax({ url: url, data: obj, dataType: 'json', //服务器返回json格式数据 type: type, //支持'GET'和'POST' traditional: true, success: function(data) { if(data.success) { fn(data) } }, error: function(xhr, type, errorThrown) {} }); } //相关资源 seresource() function seresource() { $.ajax({ "url": "/ajax/ware/res", "type": "GET", "data": { "id": serviceId }, "traditional": true, 'dataType': "json", "success": function(data) { if(data.success) { if(data.data.length == 0) { return; } document.getElementById("resource").classList.remove("displayNone"); for(var i = 0; i < data.data.length; i++) { (function(n) { ajaxRequist("/ajax/resource/queryOne", { "resourceId": data.data[n].resource }, "get", function(data) { sevrResource(data.data); }) })(i) } } }, 'error': function() { } }); } function sevrResource($data) { var namepo, userType; if($data.resourceType == 1) { namepo = $data.editProfessor.name; userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus); } else { userType = {}; if($data.organization.forShort) { namepo = $data.organization.forShort; } else { namepo = $data.organization.name; } if($data.organization.authStatus == 3) { userType.sty = "authicon-com-ok" } } var rImg = "../images/default-resource.jpg"; if($data.images.length > 0) { rImg = "/data/resource/" + $data.images[0].imageSrc; } var li = document.createElement("li"); li.setAttribute("data-id", $data.resourceId); li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' + ' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' + '<div class="madiaInfo OmadiaInfo">' + '<p class="ellipsisSty h1Font">' + $data.resourceName + '</p>' + '<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' + '<p class="ellipsisSty-2 h2Font">用途:' + $data.supportedServices + '</p>' + '</div>' + '</div>' document.getElementById("resourceList").appendChild(li); } function getRecourceMe() { $.ajax({ url: ' ', data: { 'id': serviceId, }, dataType: 'json', //服务器返回json格式数据 type: 'get', //HTTP请求类型 timeout: 10000, //超时时间设置为10秒; success: function(data) { if(data.success) { var $data = data.data; var resourceName = $data.name; document.title = resourceName; oresourceName.innerHTML = resourceName; if($data.cnt) oapplication.innerHTML = "内容:" + $data.cnt; //微信再次分享配置 // shareTitle = oresourceName.innerHTML; // descContent = oapplication.innerHTML; if($data.category == 1) { ajaxRequist("/ajax/professor/baseInfo/" + $data.owner, {}, "get", function(data) { var mydata = {}; mydata.editProfessor = data.data; othisInfo.setAttribute("data-id", mydata.editProfessor.id); othisInfo.setAttribute("data-type",mydata.category); professorId = othisInfo.getAttribute("data-id"); //用户个人信息 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 { ajaxRequist("/ajax/org/" + $data.owner, {}, "get", function(data) { var mydata = {}; mydata.organization = data.data; othisInfo.setAttribute("data-id", mydata.organization.id); othisInfo.setAttribute("data-status", mydata.organization.authStatus); othisInfo.setAttribute("data-type", mydata.category); 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($data.cooperation) { //合作备注 oremarkContent.innerHTML = $data.cooperation; oremarkContent.parentNode.style.display = "block"; } if($data.descp) { //详细描述 odetailDescp.innerHTML = $data.descp; odetailDescp.parentNode.style.display = "block"; } if($data.keywords) { var oSub = $data.keywords.split(","); var oSt = ""; for(var i = 0; i < oSub.length; i++) { oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>' } $(".tagList").html(oSt); } if($data.images) { console.log($data); if($data.images.split(",").length != 0) { imgUrl = "http://www.ekexiu.com/data/ware/" + $data.images.split(",")[0].replace(/\.(jpg|jpeg|png)$/, "_s.jpg"); var rPdiv = ''; for(var i = 0; i < $data.images.split(",").length; i++) { rPdiv += '<li class="swiper-slide"><a class="tab-re"><img src="../data/ware/' + $data.images.split(",")[i] + '" /></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/lq/byWare', type: "GET", data: { "ware": serviceId, "rows": 5 }, 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; for(var i = 0; i < $html.length; i++) { (function(n) { var oURL; if($html[i].articleType == 1) { oURL = "/ajax/professor/baseInfo/" + $html[i].ownerId; } else if($html[i].articleType == 2){ oURL = "/ajax/org/" + $html[i].ownerId; } else if($html[i].articleType == 3){ oURL = "/ajax/platform/info" + $html[i].ownerId; } $.ajax({ url: oURL, data:{id:$html[i].ownerId}, 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 if($html[n].articleType == 2) { 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); } else if($html[n].articleType == 3) { var stl = {}; stl.sty = ""; stl.title = ""; comName = data.data.name; likeRli.setAttribute("data-type", 3); } 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/ware/ralateWare", data: { "id": serviceId, "rows": 5 }, dataType: "json", traditional: true, type: 'get', //HTTP请求类型 success: function(data) { if(data.success) { if(data.data.length == 0) { return; } document.getElementById("likeResource").parentNode.classList.remove("displayNone"); var $data = data.data, arr = []; for(var i = 0; i < $data.length; i++) { arr.push($data[i].id) } if(i != 0) { ajaxRequist("/ajax/ware/qm", { "id": arr }, "get", function(data) { var $respond = data.data; for(var i = 0; i < $respond.length; i++) { (function(n) { var imgL = "../images/default-service.jpg"; if($respond[i].images) { imgL = '/data/ware/' + $respond[i].images.split(",")[0] } var oURL; if($respond[i].category == 1) { oURL = "/ajax/professor/baseInfo/" + $respond[i].owner; } else { oURL = "/ajax/org/" + $respond[i].owner; } $.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].id); 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].name + '</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/s.html?id=" + $(this).attr("data-id"); }) $("#resourceList").on("click", "li", function() { location.href = "http://" + window.location.host + "/e/r.html?id=" + $(this).attr("data-id"); }) $(".tagList").on("click", "li", function() { var keyCon = $(this).find(".h2Font").text(); location.href = "http://" + window.location.host + "/e/search.html?flag=7&key=" + keyCon; }) /*微信分享*/ $.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() {} } } }); }) </script> </body> </html>