downApp.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <title>双子星云手机33</title>
  7. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  9. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  10. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  11. <script src="../static/js/vender/config.js"></script>
  12. <style>
  13. @media screen and (max-width: 750px) {
  14. html {
  15. font-size: calc(100vw / 7.5);
  16. }
  17. }
  18. @media screen and (min-width: 750px) {
  19. html {
  20. font-size: calc(450px / 7.5);
  21. }
  22. }
  23. html, body, div, ul, li, p {
  24. padding: 0;
  25. margin: 0;
  26. }
  27. ul, li {
  28. list-style: none;
  29. }
  30. body{
  31. background-color: #190D50;
  32. padding-bottom: 1rem;
  33. }
  34. .container{
  35. width: 7.5rem;
  36. height: 14.82rem;
  37. position: relative;
  38. }
  39. .down-bg{
  40. width: 100%;
  41. height: 100%;
  42. position: relative;
  43. }
  44. .down-row{
  45. width: 6.7rem;
  46. height: 1rem;
  47. position: fixed;
  48. bottom: 0.2rem;
  49. left: 50%;
  50. transform: translateX(-50%);
  51. display: flex;
  52. justify-content: space-between;
  53. align-items: center;
  54. font-size: 0.24rem;
  55. background: linear-gradient(180deg, #251282 0%, #140463 100%);
  56. color: #ffffff;
  57. border-radius: 0.18rem;
  58. border: 0.02rem solid #412DA4;
  59. padding: 0 0.2rem;
  60. }
  61. /* .left{
  62. } */
  63. .address{
  64. text-align: center;
  65. width: 4rem;
  66. height: 0.6rem;
  67. line-height: 0.6rem;
  68. background-color: #ffffff;
  69. color: #333333;
  70. border-radius: 0.1rem;
  71. z-index: 999;
  72. overflow: hidden;
  73. padding: 0 0.08rem;
  74. text-overflow:ellipsis;
  75. white-space: nowrap;
  76. }
  77. .right-btn{
  78. width: 1.1rem;
  79. height: 0.6rem;
  80. line-height: 0.6rem;
  81. text-align: center;
  82. background: #6048D8;
  83. box-shadow: 0 0.04rem 0.12rem 0 rgba(60, 31, 201, 0.4), 0 0.02rem 0.26rem 0 rgba(255, 255, 255, 0.29);
  84. border-radius: 0.1rem;
  85. background-color: #6048D8;
  86. }
  87. .down-pic{
  88. width: 4.74rem;
  89. height: 4.74rem;
  90. position: absolute;
  91. bottom: 2.2rem;
  92. left: 50%;
  93. transform: translateX(-50%);
  94. }
  95. #toast-container>.toast-error {
  96. background-image: none !important;
  97. }
  98. .toast-error {
  99. background-color: rgba(0, 0, 0, 0.8);
  100. }
  101. #toast-container>div {
  102. font-size: 14px;
  103. min-width: 80px !important;
  104. padding: 12px !important;
  105. box-shadow: none;
  106. }
  107. #toast-container {
  108. min-width: 100px;
  109. top: 50%;
  110. left: 50%;
  111. text-align: center;
  112. transform: translate(-50%,-50%);
  113. }
  114. @media (max-width: 480px) and (min-width: 241px) {
  115. #toast-container>div {
  116. min-width: 80px !important;
  117. width: auto;
  118. }
  119. }
  120. </style>
  121. </head>
  122. <body>
  123. <div class="container">
  124. <div class="ipt"></div>
  125. <img class="down-bg" src="../static/img/down-bg.png" />
  126. <img class="down-pic" src="../static/img/doubleElevenActivity/pic.jpg" />
  127. <div class="down-row">
  128. <div class="left">下载链接</div>
  129. <div class="address">http://www.androidscloud.com/suanchou</div>
  130. <div class="right-btn">复制</div>
  131. </div>
  132. </div>
  133. <script type="text/javascript">
  134. let timer,flag = true;
  135. //点击复制按钮
  136. $('.right-btn')[0].addEventListener('click',copyUrl);
  137. //复制
  138. function copyUrl(){
  139. stopManyClick(() => {
  140. var oInput = document.createElement('input'); //创建一个input
  141. oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  142. oInput.value = 'http://www.androidscloud.com/suanchou';
  143. $('.ipt')[0].appendChild(oInput);//将input插入到body
  144. // oInput.select(); // 选择对象 ios不支持
  145. selectText(oInput, 0, oInput.value.length);
  146. document.execCommand("Copy"); // 执行浏览器复制命令
  147. toastr.error('复制当前网址成功!');
  148. oInput.style.display='none'; // 将input隐藏
  149. oInput.blur();
  150. oInput.remove(); // 将input销毁
  151. })
  152. }
  153. // input自带的select()方法在苹果端无法进行选择,所以需要自己去写一个类似的方法
  154. // 选择文本。createTextRange(setSelectionRange)是input方法
  155. function selectText(textbox, startIndex, stopIndex) {
  156. if (textbox.createTextRange) {//ie
  157. const range = textbox.createTextRange();
  158. range.collapse(true);
  159. range.moveStart('character', startIndex);//起始光标
  160. range.moveEnd('character', stopIndex - startIndex);//结束光标
  161. range.select();//不兼容苹果
  162. } else {//firefox/chrome
  163. textbox.setSelectionRange(startIndex, stopIndex);
  164. textbox.focus();
  165. }
  166. }
  167. //防止提示一秒内重复显示
  168. function stopManyClick(fn) {
  169. if (flag) {
  170. fn();
  171. }
  172. flag = false;
  173. if(timer){clearTimeout(timer);}
  174. timer = setTimeout(() => {flag = true}, 1500);
  175. }
  176. </script>
  177. </body>
  178. </html>