H5唤醒APP

支付宝

https://ds.alipay.com/?from=mobileweb





    
    支付宝
    
    
    
    
     
    
    


    
    

    

    
    

    

    

正在打开支付宝...

如果没有打开支付宝,请下载最新版

立即下载
最新版本: 9.6.6 (2016-05-10) 93.2MB


参考文档:http://www.tuicool.com/articles/uQr6Fff

一点万象

https://app.mixcapp.com/h5/share/templates/event.html?eventId=9bfef8ba73c3405d919251daee327ecc&appVersion=2.2.3&mallNo=0205A101×tamp=1516261044800

function appLink(eventId){
                var url = 'app/eventDetail?eventId=' + eventId;
                var ua = window.navigator.userAgent.toLowerCase();
                if(ua.match(/MicroMessenger/i) == 'micromessenger'){
                    //处理微信端打开
                    if (/iphone|ipad|ipod/.test(ua)) {
                        $(".goods-detail").css({
                            display: "none"
                        })
                        $(".ios-down").css({
                            display: "block",
                            background: "#f0eff5;"
                        })
                    } else if (/android/.test(ua)) {
                        $(".goods-detail").css({
                            display: "none"
                        })
                        $(".android-down").css({
                            display: "block",
                            background: "#f7f7f7;"
                        })
                    }

                }else{
                    if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
                        //ios设备
                        window.location = 'mixc://'+url;
                        setTimeout(function(){
                            window.location = 'https://itunes.apple.com/app/id1142151719';
                        }, 3000);
                    }else if(navigator.userAgent.match(/android/i)){
                        //安卓设备
                        window.location = 'mixc://'+url;
                        setTimeout(function(){
                            window.location = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.crland.mixc';
                        }, 3000);
                    }
                }
            }
H5唤醒APP_第1张图片



你可能感兴趣的:(HTML5)