微信浏览器中支持直接下载apk,通过跳转到应用宝
www.edusoho.com/download/mobile?client=android&code=edusoho
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>应用正在下载...</title> | |
| <style> | |
| .message {font-style: 12px; color: #444;} | |
| </style> | |
| </head> | |
| <body> | |
| <div id="message">正在载入数据...</div> | |
| </body> | |
| <script> | |
| var urls = { | |
| iphone: 'https://itunes.apple.com/cn/app/kuo-zhi-xue-tang/id887301045', | |
| android: 'http://download.edusoho.com/edusoho-android-2.3.3.apk', | |
| weixin: 'http://a.app.qq.com/o/simple.jsp?pkgname=' + 'com.edusoho.kuozhi', | |
| }; | |
| var uagent = navigator.userAgent.toLowerCase(); | |
| var href = window.location.href.toLowerCase(); | |
| if (uagent.search("iphone") > -1 || uagent.search("ipad") > -1 || href.search("iphone") > -1 || href.search("ipad") > -1) { | |
| if (urls.iphone) { | |
| window.location = urls.iphone; | |
| } else { | |
| var messageNode = document.getElementById("message"); | |
| messageNode.parentNode.removeChild(messageNode); | |
| document.write("<div class='message'>暂无iphone版本...</div>"); | |
| } | |
| } else if(uagent.match(/MicroMessenger/i)=="micromessenger") { | |
| window.location = urls.weixin; | |
| } else { | |
| window.location = urls.android; | |
| } | |
| </script> | |
| </html> |
这个网页里面的源码可以进行参考
相关推荐
云中舞步 2020-11-12
杨德龙 2020-11-11
JohnYork 2020-10-16
wangzhaotongalex 2020-09-22
xiaoseyihe 2020-11-16
Crazyshark 2020-11-13
K先生 2020-11-10
思君夜未眠 2020-09-04
点滴技术生活 2020-08-21
MaggieRose 2020-08-19
kevinweijc 2020-08-18
wintershii 2020-08-17
vapaad 2020-08-17
wera00 2020-08-17
移动开发与培训 2020-08-16
ReunionIsland 2020-08-16
JimyFengqi 2020-08-16