fbjs.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Share <%=anchorname%>'s public broadcast</title>
  6. <script>
  7. (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-N829M6R');
  8. </script>
  9. <style>
  10. div,p,a,body,html,button,span,table,tbody,thead,tr,td,th,mark,ul,li,header,footer,aside,section,input,em,b,strong,h1,h2,h3,h4,h5,h6{
  11. padding: 0;
  12. margin: 0;
  13. vertical-align:baseline;
  14. }
  15. header,footer,aside,nav,mark,section{
  16. display:block;
  17. }
  18. body{
  19. font-size:14px;
  20. color:#ccc;
  21. font-family:'microsoft yahei',Arial, Helvetica, sans-serif;
  22. background-color:#fff;
  23. }
  24. body,html{width: 100%;height:100%;overflow:visible;}
  25. a{text-decoration: none;}
  26. #app{
  27. /* min-width:1040px; */
  28. min-width:1000px;
  29. /*2017 10 27增加最短宽度是1260*/
  30. margin:0px auto;
  31. height:100%;
  32. }
  33. button,input,a{
  34. outline:none;
  35. }
  36. li{
  37. list-style: none;
  38. }
  39. /*2017 07 27修改盒子模型样式*/
  40. *{
  41. box-sizing:border-box;
  42. -webkit-tap-highlight-color: rgba(0,0,0,0)!important;
  43. -webkit-text-size-adjust:100%!important;
  44. }
  45. .text-ellipsis{
  46. display:block;
  47. overflow:hidden;
  48. -o-text-overflow:ellipsis;
  49. text-overflow:ellipsis;
  50. white-space:nowrap;
  51. word-break:break-all;
  52. }
  53. table{
  54. border-spacing:0px;
  55. border:0px;
  56. }
  57. /*table 样式初始化*/
  58. .editorImg{
  59. width: 22px;
  60. height: 22px;
  61. vertical-align: middle;
  62. }
  63. .msgText img,.detail img{
  64. width: 26px;
  65. height: 26px;
  66. vertical-align: middle;
  67. }
  68. /*动画时间 start*/
  69. /*数字代表零点多少秒*/
  70. .animate3{
  71. -webkit-transition:all 0.3s ease-in;
  72. -moz-transition:all 0.3s ease-in;
  73. -ms-transition:all 0.3s ease-in;
  74. -o-transition:all 0.3s ease-in;
  75. transition:all 0.3s ease-in;
  76. }
  77. /*动画时间 end*/
  78. .edui-scale{
  79. display: none!important;
  80. }
  81. .edui-toolbar{
  82. display: none;
  83. }
  84. .edui-container,.edui-editor-body,.editorBox{
  85. width: 100% !important;
  86. height: 100% !important;
  87. }
  88. /* .editorBox{
  89. border: .5px solid #000;
  90. } */
  91. .face{
  92. display:inline-block;
  93. width:20px;
  94. height:20px;
  95. vertical-align:middle;
  96. }
  97. /*2017 10 16 设置聊天表情的长宽为24 * 24 start*/
  98. .setFaceRect img{
  99. width:26px;
  100. height:26px;
  101. }
  102. /*2017 10 16 设置聊天表情的长宽为24 * 24 end*/
  103. .errorSty2 a{
  104. text-decoration:underline;
  105. color:inherit;
  106. }
  107. /*2017 10 26 充值遮罩样式*/
  108. .orderPopupMask{
  109. height: 100%;
  110. width: 100%;
  111. position: fixed;
  112. top: 0px;
  113. left: 0px;
  114. background: rgba(0,0,0,0.6);
  115. z-index: 999999;
  116. color: #FFFFFF;
  117. }
  118. /*2017 11 03 sander增加如果正在打开welcome to channel,那么隐藏新手引导 start*/
  119. .isWelcomeChannesTK .GuideMask{
  120. display:none!important;
  121. }
  122. /*2017 11 03 sander增加如果正在打开welcome to channel,那么隐藏新手引导 end*/
  123. ::-webkit-input-placeholder{
  124. color: #BFBFBF;
  125. }
  126. :-moz-placeholder{
  127. color: #BFBFBF;
  128. }
  129. ::-moz-placeholder{
  130. color: #BFBFBF;
  131. }
  132. :-ms-input-placeholder{
  133. color: #BFBFBF;
  134. }
  135. .title{
  136. height: 36px;
  137. line-height: 36px;
  138. color: #702b95;
  139. font-size: 16px;
  140. text-align: center;
  141. }
  142. .cover{
  143. height: 210px;
  144. width: 154px;
  145. margin: 0 auto;
  146. }
  147. .cover img{
  148. width: 100%;
  149. height: 100%;
  150. }
  151. .link{
  152. width: 100%;
  153. height: 32px;
  154. margin-top: 10px;
  155. position: relative;
  156. }
  157. .link input{
  158. width: 100%;
  159. height: 32px;
  160. line-height: 32px;
  161. border-radius: 2px;
  162. border: 1px solid #d2d2d2;
  163. color: #686868;
  164. font-size: 12px;
  165. padding-left: 8px;
  166. padding-right: 8px;
  167. }
  168. .msg{
  169. width: 166px;
  170. height: 28px;
  171. line-height: 26px;
  172. border:1px solid #f1f1f1;
  173. text-align: center;
  174. font-size: 14px;
  175. color: #6fd920;
  176. border-radius: 2px;
  177. position: absolute;
  178. right: 0px;
  179. background: #ffffff;
  180. top: -38px;
  181. box-shadow: 1px 1px 2px #b3b2b2;
  182. }
  183. .msg .msg-content{
  184. height: 100%;
  185. width: 100%;
  186. position: relative;
  187. }
  188. .msg .msg-content img{
  189. position: absolute;
  190. right: 10px;
  191. bottom: -11px;
  192. }
  193. .btn{
  194. height: 42px;
  195. margin-top: 12px;
  196. padding-left: 12px;
  197. padding-right: 12px;
  198. }
  199. .btn li{
  200. float: left;
  201. width: 33.333%;
  202. position: relative;
  203. }
  204. .btn li img{
  205. width: 42px;
  206. height: 42px;
  207. margin: 0 auto;
  208. display: block;
  209. }
  210. .btn li iframe{
  211. margin: 0 auto;
  212. display: block;
  213. margin-top: 12px;
  214. }
  215. .btn li .copy-msg{
  216. position: absolute;
  217. bottom: -26px;
  218. right: 0px;
  219. height: 26px;
  220. line-height: 26px;
  221. color: #f90;
  222. font-size: 12px;
  223. width: 300px;
  224. text-align: center;
  225. display: none;
  226. }
  227. </style>
  228. </head>
  229. <body>
  230. <div class="title">Share <%=anchorname%>'s public broadcast</div>
  231. <div class="cover">
  232. <!--<img src="http://192.168.88.17:84/uploadfiles/cover_photo/small/201710/ee6273bcce4ce16e44433e93e184dd46.png">-->
  233. <img src="<%=cover%>">
  234. </div>
  235. <div class="link">
  236. <input type="text" id="oldUrl" value="<%=ShareLink%>"/>
  237. <div class="msg" id="linkMsg" style="display:none;">
  238. <div class="msg-content">
  239. Broadcast link copied!
  240. <img src="<%=public_path%>/img/msg.png">
  241. </div>
  242. </div>
  243. </div>
  244. <div class="btn">
  245. <ul>
  246. <!--
  247. <li>
  248. <a href="javascript:void(0);" onclick="facebookShare()"><img src="<%=public_path%>/img/facebook_btn.png"></a>
  249. </li>
  250. <li>
  251. <a href="https://twitter.com/intent/tweet" onclick="twitterShare(this)"><img src="<%=public_path%>/img/twitter_btn.png"></a>
  252. </li>
  253. -->
  254. <li style="margin-left: 100px;">
  255. <a href="javascript:void(0);" id="copy-msg-btn" data-clipboard-text="<%=ShareLink%>"><img src="<%=public_path%>/img/copy_link_btn.png"></a>
  256. <div class="copy-msg" id="copy-msg">Copy success</div>
  257. </li>
  258. </ul>
  259. </div>
  260. <script src="<%=public_path%>/js/clipboard.min.js"></script>
  261. <script>
  262. /**
  263. * 大部分js逻辑做时再商量
  264. */
  265. var shareuserid = '<%=shareuserid%>';
  266. var anchorid = '<%=anchorid%>';
  267. var sharepagetype = '<%=sharepagetype%>';
  268. var source = '<%=source%>';
  269. function facebookShare(){
  270. Ajax.post('/nodeApi/getShareLink','shareuserid='+shareuserid+'&anchorid='+anchorid+'&sharetype=1&sharepagetype='+sharepagetype,function(data){
  271. var data = eval('(' + data + ')');
  272. data = data.data;
  273. FB.ui({
  274. method: 'share',
  275. href: data.sharelink //这里换成你的网址
  276. }, function(response) {
  277. //分享回调
  278. if(response && !response.error_message) {
  279. shareSuccessCallback(data.shareid,function(result){
  280. //提示分享成功
  281. var result = eval('(' + result + ')');
  282. copyMsg(result.data.msg);
  283. });
  284. } else {
  285. console.log('分享失败');
  286. }
  287. })
  288. });
  289. }
  290. function twitterShare(obj){
  291. Ajax.post('/nodeApi/getShareLink','shareuserid='+shareuserid+'&anchorid='+anchorid+'&sharetype=2&sharepagetype='+sharepagetype,function(data){
  292. var data = eval('(' + data + ')');
  293. data = data.data;
  294. obj.href = "https://twitter.com/intent/tweet?text="+encodeURIComponent(data.title)+"&url="+encodeURIComponent(data.sharelink);
  295. // shareSuccessCallback(data.shareid);
  296. });
  297. }
  298. /**
  299. * 分享成功回调
  300. */
  301. function shareSuccessCallback(shareid,callback){
  302. try{
  303. dataLayer.push({'event':'eventTracking','ga-data':'20341'})
  304. }catch(e){console.log(e)}
  305. Ajax.post('/nodeApi/setShareSuc','shareid='+shareid,function(data){
  306. if(callback){
  307. callback(data);
  308. }
  309. });
  310. }
  311. var Ajax={
  312. get: function(url, fn) {
  313. var obj = new XMLHttpRequest();
  314. obj.open('GET', url, true);
  315. obj.onreadystatechange = function() {
  316. if (obj.readyState == 4 && obj.status == 200 || obj.status == 304) {
  317. fn.call(this, obj.responseText);
  318. }
  319. };
  320. obj.send();
  321. },
  322. post: function (url, data, fn) {
  323. var obj = new XMLHttpRequest();
  324. obj.open("POST", url, false);
  325. obj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  326. obj.setRequestHeader("dev-type", "33");
  327. obj.onreadystatechange = function() {
  328. if (obj.readyState == 4 && (obj.status == 200 || obj.status == 304)) {
  329. fn.call(this, obj.responseText);
  330. }
  331. };
  332. obj.send(data);
  333. }
  334. }
  335. function copyToClipBoard(s) {
  336. var s = document.getElementById("oldUrl").value;
  337. if (window.clipboardData) {
  338. window.clipboardData.setData("Text", s);
  339. copyMsg("Copy success");
  340. } else if (navigator.userAgent.indexOf("Opera") != -1) {
  341. window.location = s;
  342. } else if (window.netscape) {
  343. try {
  344. netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  345. } catch (e) {
  346. copyMsg("Copy failed, please manually copy");
  347. }
  348. var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
  349. if (!clip)
  350. return;
  351. var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
  352. if (!trans)
  353. return;
  354. trans.addDataFlavor('text/unicode');
  355. var str = new Object();
  356. var len = new Object();
  357. var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
  358. var copytext = s;
  359. str.data = copytext;
  360. trans.setTransferData("text/unicode", str, copytext.length * 2);
  361. var clipid = Components.interfaces.nsIClipboard;
  362. if (!clip)
  363. return false;
  364. clip.setData(trans, null, clipid.kGlobalClipboard);
  365. copyMsg("Copy success");
  366. }else{
  367. if(typeof window.copy === "function"){
  368. window.copy(s);
  369. copyMsg("Copy success");
  370. }else{
  371. copyMsg("Copy failed, please manually copy");
  372. }
  373. }
  374. }
  375. try{
  376. var clipboard = new Clipboard(document.getElementById("copy-msg-btn"));
  377. clipboard.on('success', function(e) {
  378. try{
  379. dataLayer.push({'event':'eventTracking','ga-data':'20342'})
  380. }catch(e){console.log(e)}
  381. copyMsg("Copy success",true);
  382. });
  383. clipboard.on('error', function(e) {
  384. try{
  385. dataLayer.push({'event':'eventTracking','ga-data':'20342'})
  386. }catch(e){console.log(e)}
  387. copyMsg("Copy failed, please manually copy");
  388. });
  389. }catch(e){
  390. console.log(e);
  391. }
  392. var copyMsgTimer = null;
  393. function copyMsg(str,linkShow){
  394. window.clearTimeout(copyMsgTimer);
  395. var copyMsg = document.getElementById("copy-msg");
  396. var linkMsg = document.getElementById("linkMsg");
  397. copyMsg.style.display = "block";
  398. copyMsg.innerHTML = str;
  399. if(linkShow){
  400. linkMsg.style.display = "block";
  401. }
  402. copyMsgTimer = window.setTimeout(function(){
  403. copyMsg.style.display = "none";
  404. linkMsg.style.display = "none";
  405. },3000);
  406. }
  407. function getQueryString(name) {
  408. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  409. var r = window.location.search.substr(1).match(reg);
  410. if(r != null) return unescape(r[2]);
  411. return null;
  412. }
  413. /**
  414. */
  415. window.fbAsyncInit = function() {
  416. FB.init({
  417. appId: '2022708618006078',
  418. cookie: true,
  419. xfbml: true,
  420. version: 'v2.11'
  421. });
  422. FB.AppEvents.logPageView();
  423. };
  424. (function(d, s, id) {
  425. var js, fjs = d.getElementsByTagName(s)[0];
  426. if(d.getElementById(id)) {
  427. return;
  428. }
  429. js = d.createElement(s);
  430. js.id = id;
  431. js.src = "https://connect.facebook.net/en_US/sdk.js";
  432. fjs.parentNode.insertBefore(js, fjs);
  433. }(document, 'script', 'facebook-jssdk'));
  434. window.twttr = (function(d, s, id) {
  435. var js, fjs = d.getElementsByTagName(s)[0],
  436. t = window.twttr || {};
  437. if (d.getElementById(id)) return;
  438. js = d.createElement(s);
  439. js.id = id;
  440. js.src = "https://platform.twitter.com/widgets.js";
  441. fjs.parentNode.insertBefore(js, fjs);
  442. t._e = [];
  443. t.ready = function(f) {
  444. t._e.push(f);
  445. };
  446. return t;
  447. }(document, "script", "twitter-wjs"));
  448. </script>
  449. <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N829M6R" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  450. </body>
  451. </html>