苹果系统 微信浏览器无法跳转应用商店 怎么解决?
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; // 非微信浏览器直接跳转 } };