收藏
回答

苹果系统 微信浏览器无法跳转应用商店 怎么解决?

const handleDownload = () => {


  const isWeChat = /micromessenger/i.test(navigator.userAgent); // 判断是否为微信浏览器

  mobilePlatform.value = detectMobileDevice()

  if (isWeChat) {

      const link = document.createElement('a');

      link.href =appStoreDeepLink;

      link.target = '_blank';

      document.body.appendChild(link);

      console.log(link.outerHTML);

      link.click();

      document.body.removeChild(link)

      setTimeout(() => {

        console.log('延时跳转');

        window.location.href = appStoreUrl; // 备用方案使用 https 链接跳转

      }, 1000); // 延时 1 秒后跳转

 


  } else {

    console.log("非微信浏览器,直接跳转到应用商");

    window.location.href = appStoreUrl;  // 非微信浏览器直接跳转

  }

};


回答关注问题邀请回答
收藏
登录 后发表内容