portal html css js resource

a.html 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <!--<meta name="apple-itunes-app" content="app-id=H53C12FED, app-argument=ekexiu://">-->
  6. <title>文章分享-科袖网</title>
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <link rel="stylesheet" href="../css/reset.css" />
  9. <link rel="stylesheet" href="../css/common.css" />
  10. <link rel="stylesheet" href="../css/share.css" />
  11. <script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
  12. <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  13. <script type="text/javascript" src="../js/public/shareCom.js"></script>
  14. <script type="text/javascript" src="../js/public/openApp.js"></script>
  15. <style>
  16. html,body {background: #FFFFFF;}
  17. </style>
  18. </head>
  19. <body>
  20. <div class="contentBody2">
  21. <div class="topFu clearfix">
  22. <div class="topLogo floatL"></div>
  23. <div class="goSpan floatR">
  24. <span class="openSpan">打开</span>
  25. </div>
  26. </div>
  27. <div class="showDetail" style="padding-top:56px;">
  28. <div class="h1Font hWeight" id="articleName"></div>
  29. <div class="madiaBlock">
  30. <ul class="mui-table-view noactiveTab">
  31. <li>
  32. <div class="flexCenter clearfix">
  33. <a id="personAL">
  34. <div class="madiaHead useHead" id="messImg"></div>
  35. <div class="madiaInfo">
  36. <p><span class="h1Font ellipsisSty" id="name"></span><em class="authiconNew" title="" id="auth"></em></p>
  37. <p class="h3Font" id="oTime"></p>
  38. </div>
  39. </a>
  40. <div class="goSpan">
  41. <span class="attenSpan">关注</span>
  42. </div>
  43. </div>
  44. </li>
  45. </ul>
  46. </div>
  47. <!--文章内容区-->
  48. <div class="showMain" id="articleContent">
  49. </div>
  50. <!--标签模块-->
  51. <ul class="tagList displayNone">
  52. <!--<li>
  53. <span class="h2Font">金属材料工程与腐</span>
  54. </li>-->
  55. </ul>
  56. <div class="madiaBlock displayNone" id="correlationExpert">
  57. <div class="madiaTit">相关专家</div>
  58. <ul class="mui-table-view" id="expertList">
  59. </ul>
  60. </div>
  61. <div class="madiaBlock displayNone" id="resource">
  62. <div class="madiaTit">相关资源</div>
  63. <ul class="mui-table-view" id="resourceList">
  64. </ul>
  65. </div>
  66. <div class="madiaBlock displayNone" id="correlationCompany">
  67. <div class="madiaTit">相关企业</div>
  68. <ul class="mui-table-view" id="companyList">
  69. </ul>
  70. </div>
  71. <!--点赞模块-->
  72. <div class="thumbBlock">
  73. <span class="thumbBtn"><span id="snum"></span></span><!-- thumbedBtn 已赞 201-->
  74. </div>
  75. <!--您可能感兴趣的文章-->
  76. <div class="madiaBlock displayNone" id="article">
  77. <div class="madiaTit">您可能感兴趣的文章</div>
  78. <ul class="mui-table-view" id="articleList">
  79. </ul>
  80. </div>
  81. <!--您可能感兴趣的文章-->
  82. <div class="madiaBlock displayNone" id="newarticle">
  83. <div class="madiaTit">最新文章</div>
  84. <ul class="mui-table-view" id="newarticleList">
  85. </ul>
  86. </div>
  87. <!--留言-->
  88. <div class="madiaBlock displayNone">
  89. <div class="madiaTit" id="olisten">留言</div>
  90. <ul class="mui-table-view commentBlock commentsArea">
  91. </ul>
  92. </div>
  93. </div>
  94. <div class="shareEcode">
  95. <img class="Ecodecon" src="../images/ecordCard.jpg" />
  96. </div>
  97. </div>
  98. <script type="text/javascript">
  99. $(document).ready(function() {
  100. var imgUrl ="http://www.ekexiu.com/images/logo180.png";
  101. var lineLink = document.location.href;
  102. var descContent="";
  103. var shareTitle;
  104. var appid = '';
  105. var articleId = GetQueryString("id");
  106. leword(500, 1);//liuyan
  107. wlog("article", articleId, 3)
  108. //进入发布者详情页面
  109. $("#personAL").on("click", function() {
  110. var reType = this.getAttribute("data-type");
  111. if(reType=="1"){
  112. var proId=this.getAttribute("data-id");
  113. location.href="http://" + window.location.host + "/e/p.html?id=" + proId;
  114. }else{
  115. var cmpId=this.getAttribute("data-id");
  116. location.href="http://" + window.location.host + "/e/c.html?id=" + cmpId;
  117. }
  118. })
  119. var this_="../html/professorArticle.html?articleId="+articleId;
  120. wcFresh(this_);
  121. $("body").on("click",".goSpan,.thumbBtn",function(){
  122. isInstalled(this_,true);
  123. $(this).addClass("activeThis");
  124. })
  125. $("#articleList,#newarticleList").on("click","li", function() {
  126. var OdataId=this.getAttribute("data-id");
  127. location.href="http://" + window.location.host + "/e/a.html?id=" + OdataId;
  128. })
  129. $("#resourceList").on("click","li", function() {
  130. var OdataId=this.getAttribute("data-id");
  131. location.href="http://" + window.location.host + "/e/r.html?id=" + OdataId;
  132. })
  133. $("#expertList").on("click","li", function() {
  134. var OdataId=this.getAttribute("data-id");
  135. location.href="http://" + window.location.host + "/e/p.html?id=" + OdataId;
  136. })
  137. $(".commentBlock").on("click","li>.flexCenter",function(){
  138. var OdataId=this.getAttribute("data-id");
  139. location.href="http://" + window.location.host + "/e/p.html?id=" + OdataId;
  140. })
  141. $("#companyList").on("click","li", function() {
  142. var OdataId=this.getAttribute("data-id");
  143. location.href="http://" + window.location.host + "/e/c.html?id=" + OdataId;
  144. })
  145. $(".tagList").on("click", "li", function() {
  146. var keyCon=$(this).find(".h2Font").text();
  147. location.href="http://" + window.location.host + "/e/search.html?flag=3&key=" + keyCon;
  148. })
  149. var oArticleModule = {
  150. articleId: GetQueryString("id"),
  151. oAjaxGet: function(url, obj, oType, oFun) {
  152. $.ajax(url,{
  153. data: obj,
  154. dataType: 'json', //服务器返回json格式数据
  155. type: oType, //HTTP请求类型
  156. timeout: 10000, //超时时间设置为10秒;
  157. traditional: true,
  158. success: function(data) {
  159. if(data.success) {
  160. oFun(data.data);
  161. }
  162. },
  163. error: function(e) {
  164. return;
  165. }
  166. });
  167. },
  168. articleMess: function($data) {
  169. console.log($data);
  170. document.getElementById("articleName").innerHTML = $data.articleTitle;
  171. shareTitle=$data.articleTitle;
  172. document.title=$data.articleTitle;
  173. stt = $data.articleImg.substring(0, 9);
  174. imgUrl="http://www.ekexiu.com/data/article/" + stt + $data.articleId + "_s.jpg";
  175. console.log(stt)
  176. if($data.articleContent) {
  177. document.getElementById("articleContent").innerHTML = $data.articleContent;
  178. descContent=document.getElementById("articleContent").innerText.substr(0,40);
  179. }
  180. if($data.subject) {
  181. document.getElementsByClassName("tagList")[0].style.display = "block";
  182. var arr = $data.subject.split(",");
  183. for(var i in arr) {
  184. var oLi = document.createElement("li");
  185. oLi.innerHTML = '<span class="h2Font">' + arr[i] + '</span>'
  186. document.getElementsByClassName("tagList")[0].appendChild(oLi);
  187. }
  188. }
  189. document.getElementById("snum").innerHTML = $data.articleAgree;
  190. document.getElementById("oTime").innerHTML = commenTime($data.publishTime);
  191. document.getElementById("personAL").setAttribute("data-type",$data.articleType);
  192. if($data.articleType == 1) {
  193. oArticleModule.oAjaxGet("../ajax/article/ralateArticles", {
  194. "keys": arr,
  195. "professorId": oArticleModule.oWner,
  196. "articleId": oArticleModule.articleId,
  197. "rows": 5
  198. }, "get", oArticleModule.correlationArticle);
  199. document.getElementById("personAL").setAttribute("data-id",$data.professorId);
  200. oArticleModule.oAjaxGet("../ajax/professor/editBaseInfo/" + $data.professorId, "", "get", oArticleModule.professorMess);
  201. } else {
  202. oArticleModule.oAjaxGet("../ajax/article/ralateArticles", {
  203. "keys": arr,
  204. "orgId": oArticleModule.oWner,
  205. "articleId": oArticleModule.articleId,
  206. "rows": 5
  207. }, "get", oArticleModule.correlationArticle);
  208. document.getElementById("personAL").setAttribute("data-id",$data.orgId);
  209. oArticleModule.oAjaxGet("../ajax/org/" + $data.orgId, "", "get", oArticleModule.business);
  210. }
  211. },
  212. professorMess: function($data) {
  213. console.log($data);
  214. document.getElementById('name').innerHTML = $data.name;
  215. if($data.hasHeadImage == 1) {
  216. document.getElementById("messImg").style.backgroundImage = "url(../images/head/" + $data.id + "_l.jpg" + ")";
  217. }
  218. var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
  219. document.getElementById("auth").classList.add(userType.sty);
  220. },
  221. business: function($data) {
  222. if($data.forShort) {
  223. document.getElementById('name').innerHTML = $data.forShort;
  224. }else{
  225. document.getElementById('name').innerHTML = $data.name;
  226. }
  227. var mgimg="../images/default-icon.jpg";
  228. if($data.hasOrgLogo) {
  229. mgimg="/images/org/" + $data.id + ".jpg";
  230. }
  231. document.getElementById("messImg").classList.add("cmpHead2");
  232. document.getElementById("messImg").innerHTML='<div class="boxBlock"><img class="boxBlockimg" id="companyImg" src="'+ mgimg+'"></div>'
  233. if($data.authStatus == 3) {
  234. document.getElementById("auth").classList.add("authicon-com-ok");
  235. }
  236. },
  237. correlationExpert: function($data) {
  238. if($data.length == 0) {
  239. return;
  240. }
  241. document.getElementById("correlationExpert").classList.remove("displayNone");
  242. for(var i = 0; i < $data.length; i++) {
  243. (function(n) {
  244. oArticleModule.oAjaxGet("../ajax/professor/editBaseInfo/" + $data[n].professorId, "", "get", oArticleModule.expertList);
  245. })(i)
  246. }
  247. },
  248. expertList: function($data) {
  249. var os = "";
  250. if($data.title) {
  251. if($data.orgName) {
  252. os = $data.title + "," + $data.orgName;
  253. } else {
  254. os = $data.title;
  255. }
  256. } else {
  257. if($data.office) {
  258. if($data.orgName) {
  259. os = $data.office + "," + $data.orgName;
  260. } else {
  261. os = $data.office;
  262. }
  263. } else {
  264. if($data.orgName) {
  265. os = $data.orgName;
  266. }
  267. }
  268. }
  269. var baImg = "../images/default-photo.jpg";
  270. if($data.hasHeadImage == 1) {
  271. baImg = "/images/head/" + $data.id + "_l.jpg";
  272. }
  273. var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
  274. var li = document.createElement("li");
  275. li.setAttribute("data-id", $data.id);
  276. li.innerHTML = '<div class="flexCenter clearfix">' +
  277. '<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
  278. '<div class="madiaInfo">' +
  279. '<p><span class="h1Font">' + $data.name + '</span><em class="authiconNew ' + userType.sty + '"></em></p>' +
  280. '<p class="ellipsisSty h2Font">' + os + '</p>' +
  281. '</div>' +
  282. '</div>'
  283. document.getElementById("expertList").appendChild(li);
  284. },
  285. correlationResource: function($data) {
  286. console.log($data);
  287. if($data.length == 0) {
  288. return;
  289. }
  290. document.getElementById("resource").classList.remove("displayNone");
  291. for(var i = 0; i < $data.length; i++) {
  292. oArticleModule.oAjaxGet( "../ajax/resource/queryOne", {
  293. "resourceId": $data[i].resourceId
  294. }, "get", oArticleModule.rsourceList);
  295. }
  296. },
  297. rsourceList: function($data) {
  298. var namepo, userType;
  299. if($data.resourceType == 1) {
  300. namepo = $data.editProfessor.name;
  301. userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus);
  302. } else {
  303. userType = {};
  304. if($data.organization.forShort){
  305. namepo = $data.organization.forShort;
  306. }else{
  307. namepo = $data.organization.name;
  308. }
  309. if($data.organization.authStatus == 3) {
  310. userType.sty = "authicon-com-ok"
  311. }
  312. }
  313. var rImg = "../images/default-resource.jpg";
  314. if($data.images.length>0){
  315. rImg = "/data/resource/" + $data.images[0].imageSrc;
  316. }
  317. var li = document.createElement("li");
  318. li.setAttribute("data-id", $data.resourceId);
  319. li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' +
  320. ' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
  321. '<div class="madiaInfo OmadiaInfo">' +
  322. '<p class="ellipsisSty h1Font">' + $data.resourceName + '</p>' +
  323. '<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' +
  324. '<p class="ellipsisSty-2 h2Font">用途:' + $data.supportedServices + '</p>' +
  325. '</div>' +
  326. '</div>'
  327. document.getElementById("resourceList").appendChild(li);
  328. },
  329. correlationArticle: function($data) {
  330. if($data.total) {
  331. if($data.data.length == 0) {
  332. return;
  333. }
  334. }else{
  335. if($data.length == 0) {
  336. return;
  337. }
  338. }
  339. var oo=1;
  340. if($data.total) {
  341. var $data=$data.data;
  342. document.getElementById('newarticle').style.display = "block";
  343. oo=0;
  344. }else{
  345. document.getElementById('article').style.display = "block";
  346. }
  347. for(var i = 0; i < $data.length; i++) {
  348. var ourl, of ;
  349. if($data[i].articleType == 1) {
  350. ourl = "/ajax/professor/editBaseInfo/" + $data[i].professorId; of = 1;
  351. } else {
  352. ourl = "/ajax/org/" + $data[i].orgId; of = 2;
  353. }
  354. var arImg = "../images/default-artical.jpg";
  355. if($data[i].articleImg) {
  356. arImg = "/data/article/" + $data[i].articleImg
  357. }
  358. var title = $data[i].articleTitle;
  359. $.ajax({
  360. url:ourl,
  361. dataType: 'json', //服务器返回json格式数据
  362. type: "get", //HTTP请求类型
  363. timeout: 10000, //超时时间设置为10秒;
  364. async: false,
  365. traditional: true,
  366. success: function(data) {
  367. if(data.success) {
  368. var namepo=""
  369. var li = document.createElement("li");
  370. if( of == 1) {
  371. namepo = data.data.name;
  372. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  373. li.setAttribute("owner-id", data.data.id);
  374. li.setAttribute("data-type", 1);
  375. } else {
  376. if(data.data.forShort){
  377. namepo = data.data.forShort;
  378. }else{
  379. namepo = data.data.name;
  380. }
  381. var userType = {};
  382. if(data.data.authStatus == 3) {
  383. userType.sty = 'authicon-com-ok'
  384. } else {
  385. userType.sty = "e"
  386. }
  387. li.setAttribute("owner-id", data.data.id);
  388. li.setAttribute("data-type", 2);
  389. }
  390. li.setAttribute("data-id", $data[i].articleId);
  391. li.className = "mui-table-view-cell";
  392. li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' +
  393. '<div class="madiaHead artHead" style="background-image:url(' + arImg + ')"></div>' +
  394. '<div class="madiaInfo OmadiaInfo">' +
  395. '<p class="ellipsisSty-2 h1Font">' + title + '</p>' +
  396. '<p><span class="h2Font" style="margin-right:10px">'+namepo+'</span><span class="time">'+commenTime($data[i].publishTime)+'</span></p>'+
  397. '</div>' +
  398. '</div>'
  399. if(oo==0){
  400. document.getElementById("newarticleList").appendChild(li)
  401. }else{
  402. document.getElementById("articleList").appendChild(li);
  403. }
  404. }
  405. },
  406. error: function() {
  407. }
  408. });
  409. }
  410. },
  411. correlationCompany: function($data) {
  412. console.log($data);
  413. if($data.length == 0) {
  414. return;
  415. }
  416. document.getElementById("correlationCompany").classList.remove("displayNone");
  417. for(var i = 0; i < $data.length; i++) {
  418. oArticleModule.oAjaxGet( "../ajax/org/"+ $data[i].orgId, {
  419. }, "get", oArticleModule.companyList);
  420. }
  421. },
  422. companyList: function($data) {
  423. var baImg = "../images/default-icon.jpg";
  424. if($data.hasHeadImage == 1) {
  425. baImg = "/images/org/" + $data.id + "_l.jpg";
  426. }
  427. var namepo,userType=""
  428. if($data.authStatus == 3){
  429. userType= "authicon-com-ok"
  430. }
  431. if($data.forShort){
  432. namepo = $data.forShort;
  433. }else{
  434. namepo = $data.name;
  435. }
  436. /*应用行业*/
  437. var proOther = "";
  438. if($data.industry) {
  439. proOther = $data.industry.replace(/,/gi, " | ");
  440. }
  441. var li = document.createElement("li");
  442. li.setAttribute("data-id", $data.id);
  443. li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' +
  444. '<div class="madiaHead cmpHead">'+
  445. '<div class="boxBlock"><img class="boxBlockimg companyImg" id="oimg" src="'+ baImg +'"></div>'+
  446. '</div>' +
  447. '<div class="madiaInfo OmadiaInfo">' +
  448. '<p><span class="h1Font">' + namepo + '</span><em class="authiconNew ' + userType + '"></em></p>' +
  449. '<p class="ellipsisSty h2Font">' + proOther + '</p>' +
  450. '</div>' +
  451. '</div>'
  452. document.getElementById("companyList").appendChild(li);
  453. }
  454. }
  455. /*文章详细内容*/
  456. oArticleModule.oAjaxGet("../ajax/article/query", {
  457. articleId: oArticleModule.articleId
  458. }, "get", oArticleModule.articleMess);
  459. oArticleModule.oAjaxGet("../ajax/article/ralatePro", {
  460. "articleId": oArticleModule.articleId
  461. }, "get", oArticleModule.correlationExpert);
  462. oArticleModule.oAjaxGet("../ajax/article/ralateRes", {
  463. "articleId": oArticleModule.articleId
  464. }, "get", oArticleModule.correlationResource);
  465. oArticleModule.oAjaxGet("../ajax/article/ralateOrg", {
  466. "articleId": oArticleModule.articleId
  467. }, "get", oArticleModule.correlationCompany);
  468. oArticleModule.oAjaxGet("/ajax/article/find", {pageSize:5}, "get", oArticleModule.correlationArticle);
  469. //留言
  470. function leword(row, aa){
  471. $.ajax({
  472. url:"../ajax/leaveWord/ql",
  473. data: {
  474. "articleId":articleId,
  475. "rows":row },
  476. dataType: 'json', //服务器返回json格式数据
  477. type: 'get', //HTTP请求类型
  478. timeout: 10000, //超时时间设置为10秒;
  479. traditional: true,
  480. success: function(data) {
  481. if(data.success) {
  482. console.log(data)
  483. document.getElementsByClassName('commentBlock')[0].innerHTML = ""
  484. if(data.data.length == 0) {
  485. return;
  486. }
  487. document.getElementById("olisten").parentNode.classList.remove("displayNone");
  488. for(var i = 0; i < data.data.length; i++) {
  489. var oText = ""
  490. var userType = autho(data.data[i].professor.authType, data.data[i].professor.orgAuth, data.data[i].professor.authStatus);
  491. var baImg = "../images/default-photo.jpg";
  492. if(data.data[i].professor.hasHeadImage == 1) {
  493. baImg = "/images/head/" + data.data[i].professor.id + "_l.jpg";
  494. }
  495. var li = document.createElement("li");
  496. li.innerHTML = '<div class="flexCenter clearfix" data-id="' + data.data[i].professor.id + '">' +
  497. '<div class="madiaHead useHead useHeadMsg" style="background-image:url(' + baImg + ')"></div>' +
  498. '<div class="madiaInfo">' +
  499. '<p><span class="h1Font" data-id="' + data.data[i].professor.id + '">' + data.data[i].professor.name + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' +
  500. '<p class="h2Font">' + data.data[i].content + '</p>' +
  501. '<p class="operateSpan">' +
  502. '<span class="commenttime">' + commenTime(data.data[i].createTime) + '</span>' +
  503. // '<span data-id="' + data.data[i].id + '" class="dele">' + oText + '</span>' +
  504. '</p>' +
  505. '</div>'
  506. document.getElementsByClassName("commentBlock")[0].appendChild(li);
  507. }
  508. }
  509. },
  510. error: function() {
  511. }
  512. });
  513. }
  514. //浏览量
  515. $.ajax({
  516. "url" : "../ajax/article/pageViews",
  517. "type" : "POST" ,
  518. "dataType" : "json",
  519. "data" :{"articleId":articleId},
  520. "success" : function(data) {
  521. if (data.success){
  522. console.log(data);
  523. }
  524. },
  525. "error":function(){
  526. }
  527. });
  528. /*微信分享*/
  529. $.ajax({
  530. url: "../ajax/weixin/jsapiTicket",
  531. type: 'get',
  532. dataType: 'json',
  533. contentType: "application/x-www-form-urlencoded; charset=utf-8",
  534. data: {
  535. 'url': location.href.split('#')[0]
  536. },
  537. success: function(data) {
  538. if(data.data) {
  539. wx.config({
  540. debug: false, //调试模式好犀利
  541. appId: data.data.appId,
  542. timestamp: data.data.timestamp,
  543. nonceStr: data.data.nonceStr,
  544. signature: data.data.signature,
  545. jsApiList: [ // 所有要调用的 API 都要加到这个列表中
  546. "onMenuShareAppMessage",
  547. "onMenuShareTimeline",
  548. "onMenuShareQQ",
  549. "onMenuShareQZone",
  550. "scanQRCode",
  551. ]
  552. });
  553. wx.ready(function() {
  554. // 在这里调用 API
  555. wx.onMenuShareAppMessage({ //分享给朋友
  556. title: shareTitle, // 分享标题
  557. desc: descContent, // 分享描述
  558. link: lineLink, // 分享链接
  559. imgUrl: imgUrl, // 分享图标
  560. success: share_success_callback,
  561. cancel: share_cancel_callback
  562. });
  563. wx.onMenuShareTimeline({ //分享到朋友圈
  564. title: shareTitle, // 分享标题
  565. desc: descContent, // 分享描述
  566. link: lineLink, // 分享链接
  567. imgUrl: imgUrl, // 分享图标
  568. success: share_success_callback,
  569. cancel: share_cancel_callback
  570. });
  571. wx.onMenuShareQQ({ //分享到QQ
  572. title: shareTitle, // 分享标题
  573. desc: descContent, // 分享描述
  574. link: lineLink, // 分享链接
  575. imgUrl: imgUrl, // 分享图标
  576. success: share_success_callback,
  577. cancel: share_cancel_callback
  578. });
  579. wx.onMenuShareQZone({ //分享到QQ空间
  580. title: shareTitle, // 分享标题
  581. desc: descContent, // 分享描述
  582. link: lineLink, // 分享链接
  583. imgUrl: imgUrl, // 分享图标
  584. success: share_success_callback,
  585. cancel: share_cancel_callback
  586. });
  587. });
  588. //分享成功后的回调函数
  589. function share_success_callback() {}
  590. //用户取消分享后执行的回调函数
  591. function share_cancel_callback() {}
  592. }
  593. }
  594. });
  595. })
  596. </script>
  597. </body>
  598. </html>