猎豆优选小程序

applet_tg.html 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport"
  7. content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  8. <link rel="stylesheet" type="text/css" href="./public/public_css.css" />
  9. <script type="text/javascript" src="./public/jquery-2.1.0.js"></script>
  10. <title>猎豆优选小程序全新升级</title>
  11. <style>
  12. body {
  13. width: 100vw;
  14. min-height: 100vh;
  15. background: #ffa53e;
  16. }
  17. .container {
  18. position: relative;
  19. }
  20. .tg_bg {
  21. width: 100vw;
  22. }
  23. .tg_btn {
  24. width: 360px;
  25. position: absolute;
  26. top: 86%;
  27. left: 0;
  28. right: 0;
  29. margin: auto;
  30. }
  31. .applet_img {
  32. width: 260px;
  33. height: 260px;
  34. position: absolute;
  35. top: 46%;
  36. left: 0;
  37. right: 0;
  38. margin: auto;
  39. }
  40. .mask {
  41. width: 100%;
  42. height: 100vh;
  43. position: fixed;
  44. top: 0;
  45. left: 0;
  46. background: rgba(0, 0, 0, 0.5);
  47. display: none;
  48. }
  49. .mask_con {
  50. color: #333;
  51. font-size: 16px;
  52. line-height: 30px;
  53. background: #fff;
  54. width: 80vw;
  55. height: 60px;
  56. padding: 20px;
  57. position: absolute;
  58. top: 0;
  59. left: 0;
  60. right: 0;
  61. bottom: 0;
  62. margin: auto;
  63. border-radius: 10px;
  64. }
  65. .close {
  66. position: absolute;
  67. bottom: -60px;
  68. width: 40px;
  69. left: 0;
  70. right: 0;
  71. margin: auto;
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <div class="container">
  77. <img class="tg_bg" src="./applet_tg_img/tg_bg.jpg" alt="">
  78. <img class="applet_img" src="./applet_tg_img/applet_img_v2.jpg" alt="">
  79. <img class="tg_btn" onclick="goApplet()" src="./applet_tg_img/tg_btn.jpg" alt="">
  80. <div class="mask">
  81. <div class="mask_con">
  82. 小程序地址复制成功,请前往浏览器打开链接,进入小程序!
  83. <img class="close" onclick="closeMask()" src="./applet_tg_img/close.png" alt="">
  84. </div>
  85. </div>
  86. </div>
  87. </body>
  88. <script>
  89. let wxUrl = '' // 小程序url
  90. async function handleGetWxUrl() {
  91. $.ajax({
  92. type: "get",
  93. dataType: 'json',
  94. url: "/api/v2/wx/getUrlLink",
  95. success: function (res) {
  96. wxUrl = res.rst.url_link
  97. }
  98. })
  99. }
  100. function closeMask () {
  101. $(".mask").hide()
  102. }
  103. function goApplet () {
  104. let text = wxUrl
  105. let textarea = document.createElement("textarea")
  106. textarea.value = text
  107. textarea.readOnly = "readOnly"
  108. document.body.appendChild(textarea)
  109. textarea.select() // 选中文本内容
  110. textarea.setSelectionRange(0, text.length)
  111. $(".mask").show()
  112. document.execCommand("copy")
  113. textarea.remove()
  114. }
  115. $().ready(function () {
  116. handleGetWxUrl()
  117. })
  118. </script>
  119. </html>