123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <!DOCTYPE html>
- <html lang="en">
- <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" />
- <link rel="stylesheet" type="text/css" href="./public/public_css.css" />
- <script type="text/javascript" src="./public/jquery-2.1.0.js"></script>
- <title>猎豆优选小程序全新升级</title>
- <style>
- body {
- width: 100vw;
- min-height: 100vh;
- background: #ffa53e;
- }
- .container {
- position: relative;
- }
- .tg_bg {
- width: 100vw;
- }
- .tg_btn {
- width: 360px;
- position: absolute;
- top: 86%;
- left: 0;
- right: 0;
- margin: auto;
- }
- .applet_img {
- width: 260px;
- height: 260px;
- position: absolute;
- top: 46%;
- left: 0;
- right: 0;
- margin: auto;
- }
- .mask {
- width: 100%;
- height: 100vh;
- position: fixed;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.5);
- display: none;
- }
- .mask_con {
- color: #333;
- font-size: 16px;
- line-height: 30px;
- background: #fff;
- width: 80vw;
- height: 60px;
- padding: 20px;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- border-radius: 10px;
- }
- .close {
- position: absolute;
- bottom: -60px;
- width: 40px;
- left: 0;
- right: 0;
- margin: auto;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <img class="tg_bg" src="./applet_tg_img/tg_bg.jpg" alt="">
- <img class="applet_img" src="./applet_tg_img/applet_img_v2.jpg" alt="">
- <img class="tg_btn" onclick="goApplet()" src="./applet_tg_img/tg_btn.jpg" alt="">
- <div class="mask">
- <div class="mask_con">
- 小程序地址复制成功,请前往浏览器打开链接,进入小程序!
- <img class="close" onclick="closeMask()" src="./applet_tg_img/close.png" alt="">
- </div>
- </div>
- </div>
- </body>
- <script>
- let wxUrl = '' // 小程序url
- async function handleGetWxUrl() {
- $.ajax({
- type: "get",
- dataType: 'json',
- url: "/api/v2/wx/getUrlLink",
- success: function (res) {
- wxUrl = res.rst.url_link
- }
- })
- }
- function closeMask () {
- $(".mask").hide()
- }
- function goApplet () {
- let text = wxUrl
- let textarea = document.createElement("textarea")
- textarea.value = text
- textarea.readOnly = "readOnly"
- document.body.appendChild(textarea)
- textarea.select() // 选中文本内容
- textarea.setSelectionRange(0, text.length)
- $(".mask").show()
- document.execCommand("copy")
- textarea.remove()
- }
- $().ready(function () {
- handleGetWxUrl()
- })
- </script>
- </html>
|