新增ios跳转
This commit is contained in:
@@ -89,9 +89,28 @@ function get () {
|
||||
}
|
||||
$('.box .xz').click(function () {
|
||||
if (browser.ios) {
|
||||
window.location.href = `pikoApp://register?inviteCode=${inviteCode}&type=8`
|
||||
// window.location.href = `pikoApp://register?inviteCode=${inviteCode}&type=8`
|
||||
isAppInstalled(`pikoApp://register?inviteCode=${inviteCode}&type=8`);
|
||||
}
|
||||
})
|
||||
function isAppInstalled(scheme) {
|
||||
try {
|
||||
// 尝试打开应用
|
||||
window.location.href = scheme;
|
||||
// 如果应用打开,则在500毫秒后捕获超时错误
|
||||
setTimeout(() => {
|
||||
window.location.href = 'https://apps.apple.com/app/id6446155565';
|
||||
}, 500);
|
||||
|
||||
// 应用可能打开,也可能没有打开,所以这里不返回结果
|
||||
|
||||
} catch (err) {
|
||||
// 如果发生错误,说明应用没有安装
|
||||
console.log('App not installed');
|
||||
// 重定向到fallback URL
|
||||
window.location.href = 'https://apps.apple.com/app/id6446155565';
|
||||
}
|
||||
}
|
||||
$('.box .codeBg .copy').click(function () {
|
||||
$.copy({
|
||||
text: "复制成功", //分享提示文案
|
||||
|
Reference in New Issue
Block a user