|
|
@@ -406,6 +406,60 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
+ // claim bonus 超过2秒自动跳转到下载页
|
|
|
+ document.addEventListener('DOMContentLoaded', function () {
|
|
|
+ // 检查 URL 中是否包含 check=1 参数
|
|
|
+ const urlParams = new URLSearchParams(window.location.search);
|
|
|
+ const hasCheckParam = urlParams.has('check');
|
|
|
+
|
|
|
+ console.log(window.location.search);
|
|
|
+
|
|
|
+ console.log('hasCheckParam:', hasCheckParam);
|
|
|
+
|
|
|
+ // 定义下载页面 URL(与 Download App 按钮保持一致)
|
|
|
+ const downloadUrl = document.querySelector('.btn-secondary').href;
|
|
|
+
|
|
|
+ // 如果是带 check 参数的页面,则执行拉起检测逻辑
|
|
|
+ if (hasCheckParam) {
|
|
|
+ let appLaunched = false;
|
|
|
+
|
|
|
+ // 监听页面可见性变化(判断 App 是否被拉起)
|
|
|
+ document.addEventListener('visibilitychange', function () {
|
|
|
+ if (document.hidden) {
|
|
|
+ // 页面被隐藏,说明 App 可能被成功拉起
|
|
|
+ appLaunched = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 监听页面焦点变化(辅助判断)
|
|
|
+ window.addEventListener('blur', function () {
|
|
|
+ appLaunched = true;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 2 秒后检查是否成功拉起 App
|
|
|
+ setTimeout(function () {
|
|
|
+ if (!appLaunched) {
|
|
|
+ // 未拉起 App,跳转到下载页
|
|
|
+ window.location.href = downloadUrl;
|
|
|
+ }
|
|
|
+ }, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 为 Claim Bonus 按钮添加防重复点击逻辑(可选)
|
|
|
+ const claimButton = document.querySelector('.btn-primary');
|
|
|
+ if (claimButton) {
|
|
|
+ claimButton.addEventListener('click', function (e) {
|
|
|
+ // 只有在没有 check 参数时才允许跳转(避免循环跳转)
|
|
|
+ if (!hasCheckParam) {
|
|
|
+ // 可添加加载状态
|
|
|
+ this.textContent = 'Launching...';
|
|
|
+ this.disabled = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
// 图片加载逻辑
|
|
|
const header = document.getElementById('header');
|
|
|
const posterImg = document.getElementById('poster-img');
|
|
|
@@ -449,6 +503,7 @@
|
|
|
} else {
|
|
|
wechatGuideOverlay.classList.remove('active'); // 确保隐藏
|
|
|
}
|
|
|
+
|
|
|
</script>
|
|
|
</body>
|
|
|
|