From 704706c6437ea913e9e252cfe25592330f7b09c7 Mon Sep 17 00:00:00 2001 From: Seven Date: Thu, 15 Jan 2026 06:38:10 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=B8=AD=E6=8F=90=E7=A4=BA=EF=BC=8C=E6=9B=B4=E6=96=B0=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/ar.json | 1 + src/locales/en-US.json | 1 + src/locales/zh-CN.json | 1 + src/locales/zh-HK.json | 1 + src/views/pwa/download.vue | 23 ++++++++++++++++++++--- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/locales/ar.json b/src/locales/ar.json index 974d57e..674e439 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -1015,6 +1015,7 @@ "nativeAppDesc": "بالفعل أحدث إصدار", "notSupportedTitle": "المتصفح غير مدعوم", "notSupportedDesc": "يرجى استخدام Chrome أو Safari أو Edge", + "loading": "جاري التحميل...", "iosInstallHeader": "دليل التثبيت على iOS", "iosInstallMessage": "اضغط على زر المشاركة في الأسفل واختر 'إضافة إلى الشاشة الرئيسية'", "iosInstallButton": "حسناً", diff --git a/src/locales/en-US.json b/src/locales/en-US.json index affd23a..a07c3ff 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -1015,6 +1015,7 @@ "nativeAppDesc": "Already latest version", "notSupportedTitle": "Browser not supported", "notSupportedDesc": "Please use Chrome, Safari, or Edge", + "loading": "Loading...", "iosInstallHeader": "iOS Installation Guide", "iosInstallMessage": "Tap the share button at the bottom and select 'Add to Home Screen'", "iosInstallButton": "Got it", diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 94ed5a2..a15a1b5 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -1015,6 +1015,7 @@ "nativeAppDesc": "已经是最新版本,无需下载", "notSupportedTitle": "当前浏览器暂不支持应用安装", "notSupportedDesc": "建议使用 Chrome、Safari 或 Edge 浏览器", + "loading": "加载中...", "iosInstallHeader": "iOS 安装指引", "iosInstallMessage": "请点击浏览器底部的分享按钮,然后选择\"添加到主屏幕\"", "iosInstallButton": "知道了", diff --git a/src/locales/zh-HK.json b/src/locales/zh-HK.json index f251380..c2b0339 100644 --- a/src/locales/zh-HK.json +++ b/src/locales/zh-HK.json @@ -1015,6 +1015,7 @@ "nativeAppDesc": "已經是最新版本,無需下載", "notSupportedTitle": "當前瀏覽器暫不支持應用安裝", "notSupportedDesc": "建議使用 Chrome、Safari 或 Edge 瀏覽器", + "loading": "加載中...", "iosInstallHeader": "iOS 安裝指引", "iosInstallMessage": "請點擊瀏覽器底部的分享按鈕,然後選擇\"添加到主屏幕\"", "iosInstallButton": "知道了", diff --git a/src/views/pwa/download.vue b/src/views/pwa/download.vue index c65d4b0..b4daa02 100644 --- a/src/views/pwa/download.vue +++ b/src/views/pwa/download.vue @@ -29,13 +29,20 @@ const wasUninstalled = computed(() => { return wasInstalled === "true" && !isInstalled.value; }); -// 显示下载按钮的条件 +// 显示下载按钮的条件:浏览器环境 + 未安装 + (能安装 或 非iOS) const shouldShowDownloadButton = computed(() => { - const result = platform === "browser" && !isInstalled.value; + const result = platform === "browser" && !isInstalled.value && (canInstall.value || !isIOS); console.log("[Download Page] shouldShowDownloadButton:", result); return result; }); +// 是否显示不支持提示:浏览器环境 + 不能安装 + 非iOS +const shouldShowNotSupported = computed(() => { + const result = platform === "browser" && !canInstall.value && !isIOS && !isInstalled.value; + console.log("[Download Page] shouldShowNotSupported:", result); + return result; +}); + // 处理安装 async function handleInstall() { if (isIOSSafari) { @@ -243,7 +250,7 @@ watch(isInstalled, (installed) => { -
+

{{ t("pwa.download.notSupportedTitle") }} @@ -253,6 +260,16 @@ watch(isInstalled, (installed) => {

+ + +
+
+ +

+ {{ t("pwa.download.loading") }} +

+
+