微信扫码下载app的前端界面代码

编程知识 更新时间:2023-05-01 21:41:12

下载app二维码扫码下载,当用户微信扫码下载时 微信不能直接下载应用,所以做了一个过渡界面给用户来交互响应。效果图如下图:

  html的源代码如下。

<!DOCTYPE html>
<!-- saved from url=(0049)http://upgrade.haogonge/inspection/index.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>大加安全</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .item {
            width: 50%;
            background: #55a9ff;
            border-radius: 5px;
            display: flex;
            color: #fff;
            margin: 0 auto;
            padding: 15px;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
        }

        .item img {
            width: 30px;
            margin-left: 10px;
            margin-right: 10px;
        }

        .shadow {
            position: fixed;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            background: rgba(0, 0, 0, .8);
            display: none;
            /* display: flex; */
            /* align-items: center; */
            /* justify-content: center; */
        }
        .pimg{
     position: absolute;
     left: 0;
     right: 0;
     top: 0;
     bottom: 0;
     width: 95%;
}
    </style>
</head>

<body>
    <div class="wrpaper">
        <img src="https://img-blog.csdnimg/2022010622474671413.png" alt="" style="width: 100%;">

        <p style="text-align: center;margin-bottom: 20px;color:#B0B0B0">版本号 :2.0.1</p>
        <p style="text-align: center;margin-bottom: 20px;color:#B0B0B0">苹果下载请在Safari浏览器中打开</p>

        <div class="item" id="an">
            <img src="https://img-blog.csdnimg/2022010622474670438.png" alt="">
            <span>安卓下载</span>
        </div>
        <div class="item" id="ios">
            <img src="https://img-blog.csdnimg/2022010622474652497.png" alt="">
            <span>苹果下载</span>
        </div>


    </div>

    <div class="shadow" id="shadow">
        <img src="https://img-blog.csdnimg/2022010622474643717.png" alt="" class="pimg">

    </div>

    <script type="text/javascript">
        var an = document.getElementById('an');
        var ios = document.getElementById('ios');
        var shadow = document.getElementById('shadow');
        shadow.addEventListener('click', () => {
            shadow.style.display = 'none'
        })
        ios.addEventListener('click', () => {
            if (isWeiXin()) {
                shadow.style.display = 'block'
            } else {
                window.location.href =
                    "itms-services://?action=download-manifest&url=https://upgrade.znhl360/inspection/inspection.plist";
            }
        })
        an.addEventListener('click', () => {
            if (isWeiXin()) {
                shadow.style.display = 'block'
            } else {
                window.location.href = "http://dev-images.znhl360/9f0217a5-a14c-46f6-8233-2553695dd7ce.apk?Expires=4740380446&OSSAccessKeyId=uLNfGQv1BKmp6K1n&Signature=Vzqko9N4Lgsf8KJ8TS2fNt1BUz8%3D";           }
        })

        function isWeiXin() {
            var ua = window.navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == 'micromessenger') {
                return true;
            } else {
                window.location.href = "https://www.haogonge"
                return false;
            }
        }
    </script>

</body></html>

更多推荐

微信扫码下载app的前端界面代码

本文发布于:2023-04-24 03:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/5beb6d15785cb5d01cb0d89485709310.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:界面   代码   微信扫码   app

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 99596文章数
  • 25943阅读数
  • 0评论数