portal html css js resource

da.html 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>回答分享-科袖网</title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link rel="stylesheet" href="../css/reset.css" />
  8. <link rel="stylesheet" href="../css/common.css" />
  9. <link rel="stylesheet" href="../css/share.css" />
  10. <style>
  11. html,body {background: #FFFFFF;}
  12. </style>
  13. <script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
  14. <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  15. <script type="text/javascript" src="../js/public/baseUtil.js"></script>
  16. <script type="text/javascript" src="../js/public/shareCom.js"></script>
  17. <script type="text/javascript" src="../js/public/shareLeaveWord.js"></script>
  18. <script type="text/javascript" src="../js/public/openApp.js"></script>
  19. </head>
  20. <body>
  21. <div class="contentBody2">
  22. <div class="showDetail">
  23. <div class="qa-top flexCenter">
  24. <div class="h1Font hWeight flex-pright" id="questTit"></div>
  25. <em></em>
  26. </div>
  27. <div class="madiaBlock">
  28. <ul class="mui-table-view noactiveTab">
  29. <li class="mui-table-view-cell">
  30. <div class="flexCenter flex-pright" id="ownerCon">
  31. <!--<div class="madiaHead useHead"></div>
  32. <div class="madiaInfo">
  33. <p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
  34. <p class="ellipsisSty h2Font">职称/职位,所在机构</p>
  35. </div>-->
  36. </div>
  37. <div class="goSpan">
  38. <span class="attenSpan">关注</span>
  39. </div>
  40. </li>
  41. </ul>
  42. </div>
  43. <!--文章内容区-->
  44. <div class="showMain" id="answerCnt"></div>
  45. <div class="h3Font" style="margin-top: 10px;" id="answerTime"></div>
  46. <!--点赞模块-->
  47. <div class="thumbBlock">
  48. <span class="thumbBtn"><span id="snum"></span></span>
  49. <span class="stepBtn"></span>
  50. </div>
  51. <!--留言-->
  52. <div class="madiaBlock">
  53. <div class="madiaTit" id="olisten">留言</div>
  54. <ul class="mui-table-view commentBlock noactiveTab">
  55. </ul>
  56. </div>
  57. </div>
  58. <div class="shareEcode">
  59. <img class="Ecodecon" src="../images/ecordCard.jpg" />
  60. <div class="Ecodeinfo">
  61. <a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app"><button class="frmbtn frmactive">下载移动客户端</button></a>
  62. </div>
  63. </div>
  64. </div>
  65. <script type="text/javascript">
  66. $(document).ready(function() {
  67. var imgUrl = "http://www.ekexiu.com/images/logo180.png",
  68. lineLink = document.location.href,
  69. descContent = "",
  70. shareTitle,
  71. appid = '';
  72. var answerId = GetQueryString("id");
  73. wlog("answer",answerId,'3');
  74. module.lWord(answerId,4);
  75. var oAjax = function(url, dataS, otype, oFun) {
  76. $.ajax({
  77. url: url,
  78. dataType: 'json',
  79. type: otype,
  80. data: dataS,
  81. success: function(res) {
  82. if(res.success) {
  83. oFun(res)
  84. }
  85. }
  86. });
  87. },
  88. getConmain = function() {
  89. oAjax('/ajax/question/answer', {
  90. "id": answerId
  91. }, "get", function(res) {
  92. var $da = res.data
  93. document.getElementById("answerTime").innerHTML = commenTime($da.createTime);
  94. document.getElementById("snum").innerHTML = $da.agree;
  95. if($da.cnt) {
  96. document.getElementById("answerCnt").innerHTML = ($da.cnt).replace(/\n/g,"<br />");
  97. descContent =document.getElementById("answerCnt").innerHTML.substr(0, 70);
  98. }
  99. proinfo($da.uid)
  100. questioninfo($da.qid)
  101. })
  102. },
  103. proinfo = function(uid) {
  104. oAjax("/ajax/professor/baseInfo/" + uid, {}, "get", function(res) {
  105. var dataStr = res.data
  106. var baImg = "../images/default-photo.jpg";
  107. if(dataStr.hasHeadImage == 1) {
  108. baImg = "/images/head/" + dataStr.id + "_l.jpg";
  109. }
  110. var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
  111. var os = "";
  112. if(dataStr.title) {
  113. if(dataStr.orgName) {
  114. os = dataStr.title + "," + dataStr.orgName;
  115. } else {
  116. os = dataStr.title;
  117. }
  118. } else {
  119. if(dataStr.office) {
  120. if(dataStr.orgName) {
  121. os = dataStr.office + "," + dataStr.orgName;
  122. } else {
  123. os = dataStr.office;
  124. }
  125. } else {
  126. if(dataStr.orgName) {
  127. os = dataStr.orgName;
  128. }
  129. }
  130. }
  131. var styStr='<em class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></em>'
  132. if(userType.sty=="e"){
  133. styStr=""
  134. }
  135. var str = '<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
  136. '<div class="madiaInfo">' +
  137. '<p><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + ' title="' + userType.title + '"></em></p>' +
  138. '<p class="ellipsisSty h2Font">' + os + '</p>' +
  139. '</div>'
  140. document.getElementById("ownerCon").innerHTML = str
  141. document.getElementById("ownerCon").setAttribute("data-id", uid);
  142. });
  143. },
  144. questioninfo = function(qid) {
  145. oAjax("/ajax/question/qo", {
  146. "id": qid,
  147. }, "get", function(res) {
  148. document.getElementById("questTit").innerHTML = res.data.title;
  149. document.getElementById("questTit").setAttribute("data-id", qid);
  150. if(res.data.img) {
  151. var subs=strToAry(res.data.img)
  152. imgUrl="/data/question"+subs[0].replace(/.jpg/,"_s.jpg");
  153. }
  154. shareTitle = res.data.title;
  155. document.title = res.data.title;
  156. });
  157. }
  158. getConmain()
  159. var this_ = "../html/qa-answer-show.html?anid=" + answerId;
  160. wcFresh(this_);
  161. $("body").on("click", ".goSpan,.collectBtn,.thumbBtn,.stepBtn,.plusbtn,.replyLew", function() {
  162. isInstalled(this_, true);
  163. $(this).addClass("activeThis");
  164. })
  165. $("#ownerCon").on("click", function() {
  166. var id = this.getAttribute("data-id");
  167. location.href = "http://" + window.location.host + "/e/p.html?id=" + id;
  168. })
  169. $("#questTit").on("click", function() {
  170. var id = this.getAttribute("data-id");
  171. location.href = "http://" + window.location.host + "/e/wen.html?id=" + id;
  172. })
  173. /*微信分享*/
  174. $.ajax({
  175. url: "../ajax/weixin/jsapiTicket",
  176. type: 'get',
  177. dataType: 'json',
  178. contentType: "application/x-www-form-urlencoded; charset=utf-8",
  179. data: {
  180. 'url': location.href.split('#')[0]
  181. },
  182. success: function(data) {
  183. if(data.data) {
  184. wx.config({
  185. debug: false, //调试模式好犀利
  186. appId: data.data.appId,
  187. timestamp: data.data.timestamp,
  188. nonceStr: data.data.nonceStr,
  189. signature: data.data.signature,
  190. jsApiList: [ // 所有要调用的 API 都要加到这个列表中
  191. "onMenuShareAppMessage",
  192. "onMenuShareTimeline",
  193. "onMenuShareQQ",
  194. "onMenuShareQZone",
  195. "scanQRCode",
  196. ]
  197. });
  198. wx.ready(function() {
  199. // 在这里调用 API
  200. wx.onMenuShareAppMessage({ //分享给朋友
  201. title: shareTitle, // 分享标题
  202. desc: descContent, // 分享描述
  203. link: lineLink, // 分享链接
  204. imgUrl: imgUrl, // 分享图标
  205. success: share_success_callback,
  206. cancel: share_cancel_callback
  207. });
  208. wx.onMenuShareTimeline({ //分享到朋友圈
  209. title: shareTitle, // 分享标题
  210. desc: descContent, // 分享描述
  211. link: lineLink, // 分享链接
  212. imgUrl: imgUrl, // 分享图标
  213. success: share_success_callback,
  214. cancel: share_cancel_callback
  215. });
  216. wx.onMenuShareQQ({ //分享到QQ
  217. title: shareTitle, // 分享标题
  218. desc: descContent, // 分享描述
  219. link: lineLink, // 分享链接
  220. imgUrl: imgUrl, // 分享图标
  221. success: share_success_callback,
  222. cancel: share_cancel_callback
  223. });
  224. wx.onMenuShareQZone({ //分享到QQ空间
  225. title: shareTitle, // 分享标题
  226. desc: descContent, // 分享描述
  227. link: lineLink, // 分享链接
  228. imgUrl: imgUrl, // 分享图标
  229. success: share_success_callback,
  230. cancel: share_cancel_callback
  231. });
  232. });
  233. //分享成功后的回调函数
  234. function share_success_callback() {}
  235. //用户取消分享后执行的回调函数
  236. function share_cancel_callback() {}
  237. }
  238. }
  239. });
  240. })
  241. </script>
  242. </body>
  243. </html>