Nav apraksta

serviceEvmTwo.html 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. <link rel="stylesheet" href="../common/reset.css">
  9. <script type="text/javascript" src="../common/jquery-2.1.0.js"></script>
  10. <script type="text/javascript">
  11. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  12. window.onresize = function () {
  13. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  14. }
  15. </script>
  16. <style type="text/css">
  17. body{background: #27238b;width:100%;min-height:100vh}
  18. .copyDiv{
  19. width: 2.6rem;
  20. height: 0.37rem;
  21. margin: auto;
  22. font-size: 0.16rem;
  23. display: flex;
  24. align-items: center;
  25. justify-content: space-between;
  26. position: absolute;
  27. left: 0;
  28. right: 0;
  29. top: 5.45rem;
  30. margin: auto;
  31. box-sizing: border-box;
  32. /* background: url(img/serviceEvmThreeButton03.png) no-repeat; */
  33. /* background-size:100%; */
  34. padding: 0 0.1rem;
  35. }
  36. .copyText{
  37. flex: 1;
  38. /* color: #930015; */
  39. color: #fff;
  40. padding: 0.03rem;
  41. font-size: 0.14rem;
  42. }
  43. .copyButton{
  44. width: 0.6rem;
  45. /* color: #930015; */
  46. color: #fff;
  47. text-align: center;
  48. }
  49. #copy_1,#copy_2{
  50. position: absolute;
  51. left: -1000rem;
  52. }
  53. .alert-info {
  54. position: fixed;
  55. top: 1.74rem;
  56. right: 0;
  57. left: 0;
  58. bottom: 0;
  59. text-align: center;
  60. }
  61. .alert-info p {
  62. display: inline-block;
  63. height: 0.38rem;
  64. color: #fff;
  65. font-size: 0.14rem;
  66. line-height: 0.38rem;
  67. padding: 0 0.10rem;
  68. background-color: rgba(0, 0, 0, 0.7);
  69. border-radius: 5px;
  70. }
  71. .content{
  72. width: 100%;
  73. }
  74. .content img{
  75. width: 100%;
  76. }
  77. </style>
  78. </head>
  79. <body>
  80. <div class="content">
  81. <img src="img/serviceEvmThree02.jpg" id="bgImg"/>
  82. <div class="copyDiv">
  83. <div class="copyText">微信号:<span id="wechatNumber">guopiao10041030</span></div>
  84. <div class="copyButton" onclick="copyEvent()">复制</div>
  85. </div>
  86. </div>
  87. <input id="copy_1" type="text" readOnly="true" value=""/>
  88. <div id="copy_2"></div>
  89. <div class="alert-info" style="display: none;">
  90. <!-- tip提示,3s后消失 -->
  91. <p></p>
  92. </div>
  93. </body>
  94. </html>
  95. <script type="text/javascript">
  96. var qs = parseQueryString(window.location.href);
  97. $().ready(function () {
  98. if(qs.wechat_number){
  99. if(qs.wechat_number == 'guopiao10041030'){
  100. $("#bgImg").attr('src','img/serviceEvmThree02.jpg');
  101. $("#wechatNumber").html('guopiao10041030');
  102. }
  103. }
  104. writeLogH5({action:'addServiceTwo',channel:'H5',url:window.location.href});//埋点
  105. })
  106. function copyEvent () {
  107. var data=$("#wechatNumber").html();
  108. copy_2.innerHTML = data;
  109. copy_1.value = data;
  110. if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
  111. //区分iPhone设备
  112. window.getSelection().removeAllRanges();//这段代码必须放在前面否则无效
  113. var Url2=document.getElementById("copy_2");//要复制文字的节点
  114. var range = document.createRange();
  115. // 选中需要复制的节点
  116. range.selectNode(Url2);
  117. // 执行选中元素
  118. window.getSelection().addRange(range);
  119. // 执行 copy 操作
  120. var successful = document.execCommand('copy');
  121. // 移除选中的元素
  122. window.getSelection().removeAllRanges();
  123. }else{
  124. var Url2=document.getElementById("copy_1");//要复制文字的节点
  125. Url2.select(); // 选择对象
  126. document.execCommand("Copy"); // 执行浏览器复制命令
  127. }
  128. showMsg('复制成功')
  129. }
  130. //提示弹框
  131. function showMsg(msg) {
  132. var msgBox = document.getElementsByClassName('alert-info')[0];
  133. msgBox.children[0].innerText = msg;
  134. msgBox.style.display="block";
  135. setTimeout(function() {
  136. msgBox.style.display="none";
  137. }, 1500);
  138. }
  139. //H5页面埋点
  140. function writeLogH5 (data) {
  141. $.ajax({
  142. type:'post',
  143. url:'/api/v2/channel/writeLogH5',
  144. dataType:'json',
  145. data:data,
  146. success:function (res) {
  147. }
  148. })
  149. }
  150. function parseQueryString(url) {
  151. var urlObj = {};
  152. var reg = /([^?=&]+)=([^?=&]+)/g;
  153. url.replace(reg, function($0, $1, $2) {
  154. urlObj[$1] = decodeURIComponent($2);
  155. })
  156. return urlObj;
  157. }
  158. </script>