No Description

customerService.html 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!DOCTYPE html>
  2. <html lang="charset">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  8. <title>客服微信</title>
  9. <link rel="stylesheet" type="text/css" href="./common/reset.css"/>
  10. <script type="text/javascript" src="./common/jquery-2.1.0.js"></script>
  11. <script type="text/javascript">
  12. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  13. window.onresize = function(){
  14. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  15. }
  16. </script>
  17. <style>
  18. #copy_1,#copy_2{
  19. position: absolute;
  20. left: -1000rem;
  21. }
  22. .alert-info {
  23. position: fixed;
  24. top: 3.8rem;
  25. right: 0;
  26. left: 0;
  27. bottom: 0;
  28. text-align: center;
  29. }
  30. .alert-info p {
  31. display: inline-block;
  32. height: 0.38rem;
  33. color: #fff;
  34. font-size: 0.14rem;
  35. line-height: 0.38rem;
  36. padding: 0 0.10rem;
  37. background-color: rgba(0, 0, 0, 0.7);
  38. border-radius: 5px;
  39. }
  40. body{
  41. width: 100%;min-height: 100vh;background: #FFC947;padding-top: 0.6rem;box-sizing: border-box;
  42. }
  43. .content{
  44. width:2.97rem;height:4.53rem;background:rgba(255,255,255,1);box-shadow:0px 0.02rem 0.09rem 0px rgba(253,174,12,1);
  45. border-radius:0.12rem;margin: 0 auto 0;position: relative; text-align: center;
  46. }
  47. .content .wechartImg{
  48. width: 0.75rem;height: 0.75rem;border-radius: 50%;position: absolute;top: -0.375rem;left: 0;right: 0;margin: auto;
  49. }
  50. .content h3{
  51. color: #212121;font-size: 0.2rem;line-height: 0.28rem;padding-top:0.58rem;
  52. }
  53. .content .serviceHint{
  54. color: #4D4D4D;font-size: 0.14rem;line-height: 0.2rem;margin-top: 0.1rem;
  55. }
  56. .content .evmImg{
  57. width: 1.7rem;height: 1.7rem;margin: 0.16rem auto;
  58. }
  59. #taokouling{
  60. color: #3A3939;font-size: 0.14rem;line-height: 0.2rem;
  61. }
  62. .content button{
  63. display:block;width: 1.04rem;height: 0.24rem;border-radius: 0.24rem;border:0.01rem solid #fff;background:linear-gradient(180deg,rgba(51,85,218,1) 0%,rgba(62,148,245,1) 100%);
  64. color: #FFFFFF;font-size: 0.14rem;line-height: 0.24rem;box-shadow:0 0.05rem 0.05rem #ccc;margin: 0.08rem auto 0;
  65. }
  66. .content .wxHint{
  67. color: #8A8A8A;font-size: 0.13rem;line-height: 0.18rem;margin-top: 0.23rem;
  68. }
  69. </style>
  70. </head>
  71. <body>
  72. <input id="copy_1" type="text" readOnly="true" value=""/>
  73. <div id="copy_2"></div>
  74. <div class="content">
  75. <img src="./other_img/serviceTopImg.png" class="wechartImg"/>
  76. <h3>借款小秘书</h3>
  77. <p class="serviceHint">客服mm,如有联系请添加客服微信<br/>欢迎与我交流</p>
  78. <img class="evmImg" src="./other_img/serviceEvm.png"/>
  79. <text id="taokouling">xiaoxiannvzuibang</text>
  80. <button onclick="copyPassword()">复制微信号</button>
  81. <p class="wxHint">微信扫码,来小花猪听我说借钱小技巧</p>
  82. </div>
  83. <div class="alert-info" style="display: none;">
  84. <!-- tip提示,3s后消失 -->
  85. <p></p>
  86. </div>
  87. </body>
  88. </html>
  89. <script>
  90. // 复制文字
  91. function copyPassword() {
  92. var data = document.getElementById("taokouling").innerHTML;
  93. copy_2.innerHTML = data;
  94. copy_1.value = data;
  95. if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
  96. //区分iPhone设备
  97. window.getSelection().removeAllRanges();//这段代码必须放在前面否则无效
  98. var Url2 = document.getElementById("copy_2");//要复制文字的节点
  99. var range = document.createRange();
  100. // 选中需要复制的节点
  101. range.selectNode(Url2);
  102. // 执行选中元素
  103. window.getSelection().addRange(range);
  104. // 执行 copy 操作
  105. var successful = document.execCommand('copy');
  106. // 移除选中的元素
  107. window.getSelection().removeAllRanges();
  108. } else {
  109. var Url2 = document.getElementById("copy_1");//要复制文字的节点
  110. Url2.select(); // 选择对象
  111. document.execCommand("Copy"); // 执行浏览器复制命令
  112. }
  113. showMsg('复制成功')
  114. sharePengyouquanVideo();
  115. }
  116. function showMsg(msg) {
  117. //弹框
  118. var msgBox = document.getElementsByClassName('alert-info')[0];
  119. msgBox.children[0].innerText = msg;
  120. msgBox.style.display="block";
  121. setTimeout(function() {
  122. msgBox.style.display="none";
  123. }, 1500);
  124. }
  125. //打开微信
  126. function sharePengyouquanVideo () {
  127. var param = {
  128. "open" :true
  129. }
  130. param = JSON.stringify(param)
  131. try {
  132. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  133. window.webkit.messageHandlers.xhz_h5_open_wechat.postMessage(param);
  134. }
  135. if(navigator.userAgent.match(/android/i)){
  136. obj4H5.xhz_h5_open_wechat(param);
  137. }
  138. } catch (error) {
  139. }
  140. }
  141. </script>