From e97052b93c2b102bbc76951544a0cc21f146a780 Mon Sep 17 00:00:00 2001 From: zinface Date: Tue, 9 Jun 2026 09:54:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AD=A6=E9=86=92=E6=A8=AA=E5=B9=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在应用详情页顶部添加警醒横幅 - 当软件超过一年未更新时显示警告提示 --- src/components/AppDetailModal.vue | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/components/AppDetailModal.vue b/src/components/AppDetailModal.vue index 165a99ac..a7aed918 100644 --- a/src/components/AppDetailModal.vue +++ b/src/components/AppDetailModal.vue @@ -262,6 +262,23 @@
+ +
+
+ +
+

+ ⚠️ 注意:该软件已超过一年未更新 +

+

+ 最后更新于 {{ displayApp.update }},可能存在兼容性或安全问题,请谨慎安装。 +

+
+
+
{ if (target.closest(".overflow-y-auto, .overflow-auto")) return; e.preventDefault(); }; + +// 判断是否超过一年未更新 +const isOutdated = (updateDate: string) => { + if (!updateDate) return false; + try { + // 假设日期格式如 "2023-01-15" 或 "2024年12月20日" + const date = new Date(updateDate); + if (isNaN(date.getTime())) return false; + const oneYearAgo = new Date(); + oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1); + return date < oneYearAgo; + } catch { + return false; + } +};