123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
- <title>【猎豆优选】优势和趋势</title>
- <link rel="stylesheet" type="text/css" href="public/public_css.css"/>
- <style type="text/css">
- body{
- width: 100%;
- min-height: 100vh;
- background: url(image/bgLiedou_college.jpg) #2f3141 no-repeat;
- background-size:100%;
- padding-top: 5.3rem;
- box-sizing: border-box;
- }
- img{
- width: 100%;
- }
- .buttonCopy{
- background: #FFC320;
- width: 2rem;
- height: 0.4rem;
- border-radius: 0.4rem;
- text-align: center;
- line-height: 0.4rem;
- color: #000;
- font-size: 0.2rem;
- margin: auto;
- }
- .ewm{
- margin-top: 0.17rem;
- }
- .ewm img{
- width: 1.36rem;
- height: 1.36rem;
- margin: auto;
- }
- .ewm .hint{
- color: #ffffff;
- font-size: 0.16rem;
- margin-top: 0.07rem;
- margin-bottom: 0.17rem;
- text-align: center;
- }
- #copy_1,#copy_2{
- position: absolute;
- left: -1000rem;
- }
- .alert-info {
- position: fixed;
- top: 3rem;
- right: 0;
- left: 0;
- bottom: 0;
- text-align: center;
- }
-
- .alert-info p {
- display: inline-block;
- height: 0.38rem;
- color: #fff;
- font-size: 0.14rem;
- line-height: 0.38rem;
- padding: 0 0.10rem;
- background-color: rgba(0, 0, 0, 0.7);
- border-radius: 5px;
- }
- </style>
- <script>
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- </script>
- </head>
- <body>
- <input id="copy_1" type="text" readOnly="true" value=""/>
- <div id="copy_2"></div>
- <div class="buttonCopy" onclick="copyEvent()">复制微信号</div>
- <div class="ewm">
- <img src="image/bgLiedoe_college_button.png" />
- <div class="hint">添加客服 进群听课</div>
- </div>
- <div class="alert-info" style="display: none;">
- <!-- tip提示,3s后消失 -->
- <p></p>
- </div>
- </body>
- </html>
- <script>
- function copyEvent () {
- var data='zhuaduoduo001';
- copy_2.innerHTML = data;
- copy_1.value = data;
- if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
- //区分iPhone设备
- window.getSelection().removeAllRanges();//这段代码必须放在前面否则无效
- var Url2=document.getElementById("copy_2");//要复制文字的节点
- var range = document.createRange();
- // 选中需要复制的节点
- range.selectNode(Url2);
- // 执行选中元素
- window.getSelection().addRange(range);
- // 执行 copy 操作
- var successful = document.execCommand('copy');
-
- // 移除选中的元素
- window.getSelection().removeAllRanges();
- }else{
- var Url2=document.getElementById("copy_1");//要复制文字的节点
- Url2.select(); // 选择对象
- document.execCommand("Copy"); // 执行浏览器复制命令
- }
- showMsg('微信号已复制')//toast
- }
- function showMsg(msg) {
- var msgBox = document.getElementsByClassName('alert-info')[0];
- msgBox.children[0].innerText = msg;
- msgBox.style.display="block";
- setTimeout(function() {
- msgBox.style.display="none";
- }, 1500);
- }
- </script>
|