portal html css js resource

shareCom.js 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. function GetQueryString(name) {
  2. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  3. var r = window.location.search.substr(1).match(reg);
  4. var context = "";
  5. if(r != null)
  6. context = r[2];
  7. reg = null;
  8. r = null;
  9. return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
  10. }
  11. /*标志*/
  12. function autho() {
  13. if(arguments[0] == 1) {
  14. return {
  15. "sty": "authicon-pro",
  16. "title": "科袖认证专家"
  17. }
  18. } else {
  19. if(arguments[1] == 1) {
  20. return {
  21. "sty": "authicon-staff-ok",
  22. "title": "企业认证员工"
  23. }
  24. } else {
  25. if(arguments[2] == 3) {
  26. return {
  27. "sty": "authicon-real",
  28. "title": "实名认证用户"
  29. }
  30. } else {
  31. return {
  32. "sty": "e",
  33. "title": " "
  34. }
  35. }
  36. }
  37. }
  38. }
  39. //时间显示规则
  40. function commenTime(startTime) {
  41. //console.log(startTime)
  42. var nowTimg = new Date();
  43. var startdate = new Date();
  44. startdate.setFullYear(parseInt(startTime.substring(0, 4)));
  45. startdate.setMonth(parseInt(startTime.substring(4, 6)) - 1);
  46. startdate.setDate(parseInt(startTime.substring(6, 8)));
  47. startdate.setHours(parseInt(startTime.substring(8, 10)));
  48. startdate.setMinutes(parseInt(startTime.substring(10, 12)));
  49. startdate.setSeconds(parseInt(startTime.substring(12, 14)));
  50. var date3 = nowTimg.getTime() - startdate.getTime(); //时间差的毫秒数
  51. var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  52. var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
  53. if(date3 < 60000) {
  54. return "刚刚";
  55. } else if(date3 >= 60000 && date3 < 3600000) {
  56. return minutes + "分钟前";
  57. } else if(date3 >= 3600000 && date3 < 86400000) {
  58. return hours + "小时前";
  59. } else if(date3 >= 86400000) {
  60. if(nowTimg.getFullYear() == startTime.substring(0, 4)) {
  61. return startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
  62. } else {
  63. return startTime.substring(0, 4) + "年" + startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
  64. }
  65. }
  66. }
  67. function TimeTr(dealtime) {
  68. var myDate = new Date();
  69. var s = dealtime;
  70. var y = s.substr(0, 4);
  71. var m = s.substr(4, 2);
  72. var d = s.substr(6, 2);
  73. var h = s.substr(8, 2);
  74. var minute = s.substr(10, 2);
  75. var formatTime;
  76. if(s.length <= 6) {
  77. formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月";
  78. } else if(s.length > 6 && s.length <= 8) {
  79. formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 ";
  80. if(y != myDate.getFullYear()) {
  81. formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 ";
  82. }
  83. } else {
  84. formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
  85. if(y != myDate.getFullYear()) {
  86. formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
  87. }
  88. }
  89. return formatTime;
  90. }
  91. //企业类型
  92. var orgTypeShow = {
  93. "2": "上市企业",
  94. "3": "外资企业",
  95. "4": "合资企业",
  96. "5": "独资企业",
  97. "6": "个体经营",
  98. "7": "政府机构",
  99. "8": "公益组织",
  100. "9": "协会学会",
  101. "10": "新闻媒体",
  102. "11": "教育机构",
  103. "undefined":""
  104. }
  105. //需求的费用预算
  106. var demandCost = {
  107. '1': '1万元以内',
  108. '2': '1-5万元',
  109. '3': '5-10万元',
  110. '4': '10-20万元',
  111. '5': '20-50万元',
  112. '6': '50万元以上'
  113. }
  114. //需求的预期时长
  115. var demandDuration = {
  116. '1': '1个月内',
  117. '2': '1-3个月',
  118. '3': '3-6个月',
  119. '4': '6-12个月',
  120. '5': '1年以上'
  121. }
  122. function shareWays(shareTitle,descContent,lineLink,imgUrl){
  123. console.log(arguments);
  124. /*微信分享*/
  125. $.ajax({
  126. url: "../ajax/weixin/jsapiTicket",
  127. type: 'get',
  128. dataType: 'json',
  129. contentType: "application/x-www-form-urlencoded; charset=utf-8",
  130. data: {
  131. 'url': location.href.split('#')[0]
  132. },
  133. success: function(data) {
  134. if(data.data) {
  135. console.log()
  136. wx.config({
  137. debug: false, //调试模式好犀利
  138. appId: data.data.appId,
  139. timestamp: data.data.timestamp,
  140. nonceStr: data.data.nonceStr,
  141. signature: data.data.signature,
  142. jsApiList: [ // 所有要调用的 API 都要加到这个列表中
  143. "onMenuShareAppMessage",
  144. "onMenuShareTimeline",
  145. "onMenuShareQQ",
  146. "onMenuShareQZone",
  147. "scanQRCode",
  148. ]
  149. });
  150. wx.ready(function() {
  151. // 在这里调用 API
  152. wx.onMenuShareAppMessage({ //分享给朋友
  153. title: shareTitle, // 分享标题
  154. desc: descContent, // 分享描述
  155. link: lineLink, // 分享链接
  156. imgUrl: imgUrl, // 分享图标
  157. success: share_success_callback,
  158. cancel: share_cancel_callback
  159. });
  160. wx.onMenuShareTimeline({ //分享到朋友圈
  161. title: shareTitle, // 分享标题
  162. desc: descContent, // 分享描述
  163. link: lineLink, // 分享链接
  164. imgUrl: imgUrl, // 分享图标
  165. success: share_success_callback,
  166. cancel: share_cancel_callback
  167. });
  168. wx.onMenuShareQQ({ //分享到QQ
  169. title: shareTitle, // 分享标题
  170. desc: descContent, // 分享描述
  171. link: lineLink, // 分享链接
  172. imgUrl: imgUrl, // 分享图标
  173. success: share_success_callback,
  174. cancel: share_cancel_callback
  175. });
  176. wx.onMenuShareQZone({ //分享到QQ空间
  177. title: shareTitle, // 分享标题
  178. desc: descContent, // 分享描述
  179. link: lineLink, // 分享链接
  180. imgUrl: imgUrl, // 分享图标
  181. success: share_success_callback,
  182. cancel: share_cancel_callback
  183. });
  184. });
  185. //分享成功后的回调函数
  186. function share_success_callback() {}
  187. //用户取消分享后执行的回调函数
  188. function share_cancel_callback() {}
  189. }
  190. }
  191. });
  192. }
  193. function wlog(dt, id, src) {
  194. var src = src || "1";
  195. $.ajax({
  196. url: "http://www.ekexiu.com:8082/log/jsonp/log",
  197. data: {
  198. "id": id,
  199. "src": src,
  200. "__lt": dt,
  201. },
  202. success:function(data) {
  203. },
  204. dataType: "jsonp"
  205. });
  206. }