guoziyun 11 meses atrás
pai
commit
718ef635d2
2 arquivos alterados com 8 adições e 3 exclusões
  1. 1 1
      app.js
  2. 7 2
      views/v2/detail.ejs

+ 1 - 1
app.js

@@ -139,7 +139,7 @@ app.use('/api/subscribe', require('./routes/v2/subscribe'));  // 用户提交邮
 
 
 //v1
-app.use('/', require('./routes/index'));
+// app.use('/', require('./routes/index'));
 
 
 // catch 404 and forward to error handler

+ 7 - 2
views/v2/detail.ejs

@@ -390,8 +390,7 @@
         }
       };
 
-      /*
-      document.getElementById('appBtn').addEventListener('click', function () {
+      function jumpToAppDownload() {
         const userAgent = navigator.userAgent || navigator.vendor || window.opera;
 
         // Android 检测
@@ -408,6 +407,11 @@
           console.log('无法确定操作系统,或者为桌面操作系统');
           window.open('https://pcoloring.com/anc/', '_blank');
         }
+      }
+
+      /*
+      document.getElementById('appBtn').addEventListener('click', function () {
+        jumpToAppDownload()
       });
       */
 
@@ -430,6 +434,7 @@
                 // 此时可以判断是否需要跳转到App Store/Google Play
                 if (!document.hidden) { // 检查页面是否仍然可见,表示App未被拉起
                     console.log("App not opened, redirecting to store or showing smart banner.");
+                    jumpToAppDownload();
                     // 在这里可以实现 Deferred Deep Link 逻辑
                     // 1. 显示一个智能 App 横幅 (Smart App Banner) 引导用户下载
                     // 2. 直接重定向到App Store/Google Play