Geen omschrijving

serviceEvm.html 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  7. <title>添加客服</title>
  8. <script type="text/javascript" src="../common/jquery-2.1.0.js"></script>
  9. <script type="text/javascript">
  10. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  11. window.onresize = function () {
  12. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  13. }
  14. </script>
  15. <style type="text/css">
  16. body{width: 100%;min-height: 100vh;background: #FFFFFF;}
  17. body,p,div,text,img{margin: 0;padding: 0;-webkit-touch-callout:none;}
  18. .title{color: #000000;font-size: 0.16rem;line-height: 0.22rem;text-align: center;padding-top: 0.8rem;}
  19. .serviceEvmImg{width: 1.63rem;height: 1.64rem;display: block;margin: auto;margin-top: 0.15rem;}
  20. .copyDiv{width: 3rem;height: 0.37rem;margin: auto;margin-top: 0.15rem;background:
  21. #FA472E;border-radius: 0.19rem;font-size: 0.14rem;display: flex;align-items: center;justify-content: space-between; position: absolute;left: 0;right: 0;top: 5.1rem;margin: auto;border:0.02rem solid #FFFFFF;box-sizing: border-box;overflow: hidden;}
  22. .copyText{width: 2.2rem;height: 0.33rem;background: #FA472E;border-radius: 0.19rem 0 0 0.19rem;margin-left: 0.02rem;color: #ffffff;text-align: center;line-height: 0.33rem;}
  23. .copyButton{
  24. width: 0.6rem;
  25. height: 0.37rem;
  26. background: #ffffff;
  27. color: #FA472E;
  28. text-align: center;
  29. line-height: 0.37rem;
  30. border-radius: 0.37rem;
  31. }
  32. .hint{color: #333333;font-size: 0.12rem;line-height: 0.17rem;text-align: center;margin-top: 0.15rem;}
  33. #copy_1,#copy_2{
  34. position: absolute;
  35. left: -1000rem;
  36. }
  37. .alert-info {
  38. position: fixed;
  39. top: 1.74rem;
  40. right: 0;
  41. left: 0;
  42. bottom: 0;
  43. text-align: center;
  44. }
  45. .alert-info p {
  46. display: inline-block;
  47. height: 0.38rem;
  48. color: #fff;
  49. font-size: 0.14rem;
  50. line-height: 0.38rem;
  51. padding: 0 0.10rem;
  52. background-color: rgba(0, 0, 0, 0.7);
  53. border-radius: 5px;
  54. }
  55. .content{
  56. width: 100%;min-height: 100vh;background: #FFFFFF;position: relative;
  57. }
  58. .content img{
  59. width: 100%;
  60. }
  61. </style>
  62. </head>
  63. <body>
  64. <div class="content">
  65. <img src="bg.png?v=1" />
  66. <div class="copyDiv">
  67. <div class="copyText">微信号:guopiao10041030</div>
  68. <div class="copyButton" onclick="copyEvent()">复制</div>
  69. </div>
  70. </div>
  71. <input id="copy_1" type="text" readOnly="true" value=""/>
  72. <div id="copy_2"></div>
  73. <!--<p class="title">添加客服微信即可申请代理</p>
  74. <img src="serviceEvm.png" class="serviceEvmImg" />-->
  75. <!--<p class="hint">提示:您也可以截图保存到相册通过扫描二维码添加客服微信</p>-->
  76. <div class="alert-info" style="display: none;">
  77. <!-- tip提示,3s后消失 -->
  78. <p></p>
  79. </div>
  80. </body>
  81. </html>
  82. <script type="text/javascript">
  83. $().ready(function () {
  84. writeLogH5({action:'addService',channel:'H5',url:window.location.href});//埋点
  85. })
  86. function copyEvent () {
  87. var data='guopiao10041030';
  88. copy_2.innerHTML = data;
  89. copy_1.value = data;
  90. if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
  91. //区分iPhone设备
  92. window.getSelection().removeAllRanges();//这段代码必须放在前面否则无效
  93. var Url2=document.getElementById("copy_2");//要复制文字的节点
  94. var range = document.createRange();
  95. // 选中需要复制的节点
  96. range.selectNode(Url2);
  97. // 执行选中元素
  98. window.getSelection().addRange(range);
  99. // 执行 copy 操作
  100. var successful = document.execCommand('copy');
  101. // 移除选中的元素
  102. window.getSelection().removeAllRanges();
  103. }else{
  104. var Url2=document.getElementById("copy_1");//要复制文字的节点
  105. Url2.select(); // 选择对象
  106. document.execCommand("Copy"); // 执行浏览器复制命令
  107. }
  108. showMsg('复制成功')
  109. }
  110. //提示弹框
  111. function showMsg(msg) {
  112. var msgBox = document.getElementsByClassName('alert-info')[0];
  113. msgBox.children[0].innerText = msg;
  114. msgBox.style.display="block";
  115. setTimeout(function() {
  116. msgBox.style.display="none";
  117. }, 1500);
  118. }
  119. //H5页面埋点
  120. function writeLogH5 (data) {
  121. $.ajax({
  122. type:'post',
  123. url:'/api/v2/channel/writeLogH5',
  124. dataType:'json',
  125. data:data,
  126. success:function (res) {
  127. }
  128. })
  129. }
  130. </script>