123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <title>下载APP</title>
- <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
- <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
- <link rel="stylesheet" href="../static/css/maJiaBaoGoApp.css">
- <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
- <script src="../static/js/vender/toastr/toastr.min.js"></script>
- <script src="../static/js/vender/config.js"></script>
- <style>
- .middle{
- position: relative;
- width: 7.5rem;
- height: 33.33vh;
- }
- .btn-content {
- position: absolute;
- bottom: 8.6vh;
- left: 2.12rem;
- }
- .btn-active {
- position: absolute;
- bottom: 15vh;
- left: 2.12rem;
- }
- .download-app{
- width: 3.26rem;
- height: 0.88rem;
- }
- .imgs{
- width: 7.5rem;
- height: 33.38vh;
- margin-top: -0.05vh;
- display: block;
- }
- .img{
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="middle">
- <div class="btn-content" id="js_btn">
- <img class="download-app" src="../static/img/zhongqiuActivity/btn.png" />
- </div>
- </div>
- <div class="mask">
- <div class="point">
- <img class="point-img" src="../static/img/point.png" />
- </div>
- </div>
- </div>
- <script>
- toastr.options.positionClass = 'toast-center-center';
- toastr.options.timeOut = '1500';
- </script>
- <script type="text/javascript">
- let timer,flag = true;
- var url = window.location.href;
- url = url.split('/')
- // var baseUrl = 'https://test.androidscloud.com/'
- var loc = window.location.search,
- n1 = loc.length,//地址的总长度
- n2 = loc.indexOf("="),//取得=号的位置
- id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
- u = navigator.userAgent,
- ua = navigator.userAgent.toLowerCase(),
- isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
- isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
- imgs = ['../static/img/zhongqiuActivity/header.png','../static/img/zhongqiuActivity/middle.png','../static/img/zhongqiuActivity/footer.png'];
- //长屏判断
- if(document.documentElement.clientHeight > 736){
- imgs = ['../static/img/zhongqiuActivity/iphoneX01.png','../static/img/zhongqiuActivity/iphoneX02.png','../static/img/zhongqiuActivity/iphoneX03.png'];
- const btnContent = document.getElementsByClassName('btn-content')[0];
- btnContent.className = 'btn-active';
- }
- //异步加载图片
- async function loadAsync() {
- let promise = function(url) {
- return new Promise((resolve, reject) => {
- const image = new Image();
- image.src = url;
- image.className = 'imgs';
- image.onload = function() {
- if(image.src.includes('header.png') || image.src.includes('iphoneX01.png')){
- $('.container')[0].insertBefore(image, $('.middle')[0]);
- }else{
- $('.middle')[0].appendChild(image);
- }
- resolve('ok');
- }
- })
- }
- for(let url of imgs) {
- await promise(url);
- }
- }
- loadAsync();
- //埋点
- if(isAndroid){
- operate('中秋活动落地页');
- }
- if(isiOS){
- operate('中秋活动落地页');
- }
- function operate(pointName,type){
- $.ajax({
- url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
- type: 'post',
- data:JSON.stringify({
- pointName: pointName
- }),
- contentType:"application/json",
- dataType: 'json',
- cache: false,
- success: function (res) {
- if(isAndroid && type === 'click'){
- getAppDownload();
- }
- },
- })
- }
- //点击下载APP
- $('#js_btn')[0].addEventListener('click',()=>{
- if(ua.match(/MicroMessenger/i)=="micromessenger" || ua.match(/QQ\/[0-9]/i)){
- $('.point').animate({top: '0.1rem'},"fast");
- $('.mask').css('background','rgba(0,0,0,0.7)');
- $('.mask').show();
- document.documentElement.style.overflow='hidden';
- }else if(isAndroid){
- operate('中秋活动落地页-安卓','click');
- }else if(isiOS){
- operate('中秋活动落地页-iOS');
- window.location.href = 'https://www.pgyer.com/gemini6';
- }else{
- operate('中秋活动落地页-安卓','click');
- }
- },false);
- //调用下载接口
- function getAppDownload(){
- $.ajax({
- url: baseUrl + '/api/user/v1/ditchClient/addChannelAppDownload',
- type: 'post',
- data:JSON.stringify({
- code:"j2Di592n8374",
- type: "5",
- platform:"1",
- version:""
- }),
- contentType: "application/json",
- dataType: 'json',
- cache: false,
- success: function (res) {
- if(res.status === 0){
- window.location.href = 'https://wjzx.androidscloud.com:9091/file-center/fileOperate/downloadFile?id=610553281';
- }else{
- stopManyClick(() =>{
- toastr.error(res.msg)
- })
- }
- },
- })
- }
- //防止提示一秒内重复显示
- function stopManyClick(fn) {
- if (flag) {
- fn();
- }
- flag = false;
- if(timer){clearTimeout(timer);}
- timer = setTimeout(() => {flag = true}, 1500);
- }
- </script>
- </body>
- </html>
|