编程知识 cdmana.com

Vue configures scheme to pull up three maps

Example Gould map
guide :https://lbs.amap.com/api/amap-mobile/summary

<a href="androidamap://navi?sourceApplication=appname&amp;poiname=fangheng&amp;lat=36.547901&amp;lon=104.258354&amp;dev=1&amp;style=2"> Navigation </a>

 Insert picture description here

First, judge whether it is wechat QQ The built-in browser opens If it is
Let it change the browser tencent built-in Are not compatible

function isWeiXin() {
   
   
       var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
   
   
            return true; // It's WeChat.    how  
        } else {
   
   
            return false;  //  other   browser   how  
        }
      }
  if (isWeiXin()) {
   
   
        alert(" This is the wechat built-in browser , Please change the browser to open ")
        return
      } else {
   
   
        if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
   
   // Judge ios
          const loadDateTime = new Date();// Define timestamps  
          window.location =""  // Definition scheme Address 
         window.setTimeout(function() {
   
   
              const timeOutDateTime = new Date(); // Define a new timestamp 
              if (timeOutDateTime - loadDateTime < 2200) {
   
   
                window.clearInterval(window.setTimeout)
                // Judge if the timeout occurs   Jump to download page  
                // No timeout clear timer 
                return true
              } else {
   
   
                 window.location = ""; 
                //android Download address   
                return
              }
            }, 2000); 
        } else if (navigator.userAgent.match(/android/i)) {
   
   
       
        try{
   
   
            const loadDateTime = new Date();
            t window.location = //schema Link or universal link
            window.setTimeout(function() {
   
   
              const timeOutDateTime = new Date();
              if (timeOutDateTime - loadDateTime > 2200) {
   
   
                window.clearInterval(setTimeout)
                return
              } else {
   
   
                this.URL = window.location = ""; //android Download address   
              }
            }, 2000); 
          } catch (e){
   
   
            window.close();
          }
        }
      }

版权声明
本文为[osc_ gzy9w31p]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224102147117o.html

Scroll to Top