shish 11 hónapja
szülő
commit
3d3cbe7463
1 módosított fájl, 41 hozzáadás és 0 törlés
  1. 41 0
      app-pt/views/main/app.php

+ 41 - 0
app-pt/views/main/app.php

@@ -193,7 +193,48 @@
     </div>
     
     <script>
+        // 检测是否在微信浏览器中
+        function isWeChatBrowser() {
+            const ua = navigator.userAgent.toLowerCase();
+            return ua.indexOf('micromessenger') !== -1;
+        }
+        
+        // 显示微信提示
+        function showWeChatTip() {
+            const tipHtml = `
+                <div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; display: flex; align-items: center; justify-content: center;">
+                    <div style="background: white; border-radius: 15px; padding: 30px; margin: 20px; max-width: 300px; text-align: center;">
+                        <div style="font-size: 24px; margin-bottom: 15px;">📱</div>
+                        <h3 style="color: #333; margin-bottom: 15px; font-size: 18px;">请在浏览器中打开</h3>
+                        <p style="color: #666; line-height: 1.5; margin-bottom: 20px; font-size: 14px;">
+                            由于微信限制,无法直接下载APP<br>
+                            请点击右上角 <span style="color: #3385FF;">⋯</span> 按钮<br>
+                            选择"在浏览器中打开"
+                        </p>
+                        <button onclick="closeWeChatTip()" style="background: #3385FF; color: white; border: none; padding: 10px 20px; border-radius: 20px; font-size: 14px; cursor: pointer;">
+                            我知道了
+                        </button>
+                    </div>
+                </div>
+            `;
+            document.body.insertAdjacentHTML('beforeend', tipHtml);
+        }
+        
+        // 关闭微信提示
+        function closeWeChatTip() {
+            const tip = document.querySelector('[style*="position: fixed"]');
+            if (tip) {
+                tip.remove();
+            }
+        }
+        
         function downloadApp(appType) {
+            // 检测是否在微信浏览器中
+            if (isWeChatBrowser()) {
+                showWeChatTip();
+                return;
+            }
+            
             // 这里可以根据appType跳转到对应的下载链接
             const downloadUrls = {
                 'xiaohuabao': 'http://api.shop.hzghd.com/1237.apk', // 销花宝APP下载链接