123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <!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{min-height:100vh;width: 100%;height: 100vh;background:#f81131 url(images/bg.png) no-repeat;background-size: 100%;}
- .container{width: 100%;height: 5.25rem;background: url(images/bg02.png) no-repeat;background-size: 102%;position: relative; top: 1.44rem;}
- .container .step{display: block;height: 1.14rem;padding-top: 1.2rem;padding-bottom:0.35rem;font-size: 0.22rem;color: #FFFFFF;line-height: 0.38rem;text-align: left;padding-left: 0.55rem;}
- .container .copy{width:2.37rem;height:0.62rem;background:#FFD726;border-radius:0.31rem;margin: auto;font-size: 0.27rem;line-height: 0.62rem;text-align: center;color: #E70220; box-shadow: 0px 0px 0.08rem 0.02rem rgba(0,0,0,0.2);}
- .container .union{width: 100%;height: auto;padding-top: 0.4rem;}
- .container .union img{width: 1.42rem; margin: auto;}
- .container .union p{letter-spacing: 0.01rem;font-size: 0.2rem; color: #FFFFFF;text-align: center;padding-top: 0.09rem;}
- #copy_1,#copy_2,#taokouling{position: absolute;left: -1000rem;}
- .alert-info {position: absolute;top: 1.74rem; right: 0; left: 0;bottom: 0; text-align: center;z-index: 99;}
- .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 type="text/javascript">
- 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>
- <div class="container">
- <p class="step">Step1:点击复制淘口令 <br/>Step2:打开淘宝领取红包</p>
- <div class="copy" onclick="copyPassword(),showMsg()">复制淘口令</div>
- <!--<div class="union"><img src="images/001.png"/><p>联合送礼 </p></div>-->
- </div>
- <input id="copy_1" type="text" readOnly="true" value=""/>
- <div id="copy_2"></div>
- <text id="taokouling">€isRtbeg93wO€</text>
-
- <div class="alert-info" style="display: none;">
- <!-- tip提示,2s后消失 -->
- <p></p>
- </div>
- </body>
- </html>
- <script type="text/javascript" src="../public/jquery-2.1.0.js"></script>
- <script type="text/javascript">
-
- function showMsg() {
- var msg = "复制成功";
- var msgBox = $('.alert-info');
- msgBox.children('p').text(msg);
- msgBox.show();
-
- setTimeout(function() {
- msgBox.hide();
- }, 2000);
- }
-
- function copyPassword() {
- var data=document.getElementById("taokouling").innerHTML;
- 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"); // 执行浏览器复制命令
- }
- }
-
- </script>
|