参考
    https://blog.csdn.net/zy1281539626/article/details/79203853
    https://blog.csdn.net/x550392236/article/details/77648985
    https://www.jianshu.com/p/45af72036e58
    还是不知道如何解析参数

    在AndroidManifest.xml 文件的 的添加下面6行

    1. <intent-filter>
    2. <action android:name="android.intent.action.MAIN" />
    3. <category android:name="android.intent.category.LAUNCHER" />
    4. </intent-filter>
    5. <intent-filter>
    6. <action android:name="android.intent.action.VIEW"/>
    7. <category android:name="android.intent.category.DEFAULT"/>
    8. <category android:name="android.intent.category.BROWSABLE"/>
    9. <data android:scheme="zyt" android:host="app" android:pathPrefix="/openwith"/>
    10. </intent-filter>
    1. <!DOCTYPE html>
    2. <html lang="zh">
    3. <head>
    4. <meta charset="UTF-8" />
    5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    6. <meta name="apple-itunes-app" content="app-id=477927812" />
    7. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    8. <title>Document</title>
    9. </head>
    10. <body>
    11. <a id="openApp">点击打开US100 </a>
    12. <p id="mod_pop" style="display:none;">请在其他浏览器中打开</p>
    13. <script type="text/javascript">
    14. window.onload = function() {
    15. function isWeixin() {
    16. var ua = navigator.userAgent.toLowerCase(); //获取判断用的对象
    17. if (ua.match(/MicroMessenger/i) == "micromessenger") {
    18. return true; //微信打开
    19. } else {
    20. return false; //不是微信打开
    21. }
    22. }
    23. document.getElementById("openApp").onclick = function(e) {
    24. if (isWeixin()) {
    25. var modPop = document.getElementById("mod_pop");
    26. modPop.style.display = "block";
    27. } else {
    28. if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
    29. //ios判断
    30. window.location.href = "com.ncuos.usapp100://"; //通过app打开协议来打开app
    31. window.setTimeout(function() {
    32. window.location.href =
    33. "https://itunes.apple.com/cn/app/id477927812"; //没有弹框打开app则打开app下载地址
    34. }, 20);
    35. } else if (/(Android)/i.test(navigator.userAgent)) {
    36. //Android判断
    37. var state = null;
    38. try {
    39. state = window.open("usapp://");
    40. } catch (e) {}
    41. if (state) {
    42. //window.close();
    43. } else {
    44. window.location.href =
    45. "https://www.baidu.com";
    46. }
    47. }
    48. }
    49. };
    50. };
    51. </script>
    52. </body>
    53. </html>