vue安卓苹果下载链接合并

 1 <script type="text/javascript" charset="utf-8">
 2             androdd() {
 3                 var u = navigator.userAgent;
 4                 var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //Android
 5                 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //iOS
 6                 // alert('是否是Android:' + isAndroid);
 7                 // alert('是否是iOS:' + isiOS);
 8                 if (isAndroid)
 9                     window.location.href = "http://XXXX.com/apks/hotel.apk"
10                 else
11                     window.location.href = "https://apps.apple.com/cn/app/XXXXXXXX"
12             }
13         </script>

 

posted @ 2021-04-25 15:39  爱粉刷的小星星  阅读(339)  评论(0编辑  收藏  举报