<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> <title>推广页</title> <style type="text/css"> *{padding: 0;margin: 0;} body,html{background: #ff8838;} #container{width: 100%;height: 100%;display: none;} .container-bg{width: 100%;} .container-bottom{z-index: 10;position: fixed;top: 90vh;width: 80%;left: 50%;transform: translate(-50%);} .container-mask{position: absolute;width: 100%;height: 100%;top: 0;left: 0;background: rgba(0,0,0,0.5);z-index: 100;} .container-mask img{width: 240px;float: right;margin-top: 20px;margin-right: 20px;} </style> </head> <body> <div id="container"> <img class="container-bg" src='./img/xuan-bg.png'> <img class="container-bottom" onclick="showMask(1);" src="img/xuan-bottom.png" /> <div class="container-mask" hidden="hidden" onclick="showMask(0);"> <img src="img/xuan-ying.png" /> </div> </div> <script type="text/javascript"> function showMask(val){ document.getElementsByClassName('container-mask')[0].style.display= val?'block':'none'; } var downurl= 'https://img.haoleguagua.com/app-cao_qudao1.apk';//需要下载的app路径 function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return true; }else { return false; } } if(is_weixin()){ document.getElementById('container').style.display= 'block'; }else{ document.getElementById('container').style.display= 'none'; location.href=downurl;//如果不是微信就显示下载 } </script> </body> </html>