diff --git a/.agents/skills/uni-halo/SKILL.md b/.agents/skills/uni-halo/SKILL.md
index a34d734..6cf6b0b 100644
--- a/.agents/skills/uni-halo/SKILL.md
+++ b/.agents/skills/uni-halo/SKILL.md
@@ -534,7 +534,7 @@ function handleSubmit() {
投票状态、自己提交投票,页面只传 `vote-name`、监听 `on-vote-success` 提示
- **页面尽量薄**:页面只负责数据请求编排(hooks)、跳转、传参给组件
- **能抽 hooks 的就抽 hooks**:跨页面复用的业务逻辑放 `src/hooks/`(如
- `use-maintenance-intercept`、`useScroll`、`useUpload`),auto-import 免 import 直接调用
+ `useMaintenanceIntercept`、`useScroll`、`useUpload`),auto-import 免 import 直接调用
- 组件不直接依赖 store 的散装字段,通过 props 传入、events 传出,降低耦合
---
diff --git a/src/api/types/uni-halo.ts b/src/api/types/uni-halo.ts
index 96bb1be..a6a687a 100644
--- a/src/api/types/uni-halo.ts
+++ b/src/api/types/uni-halo.ts
@@ -141,7 +141,9 @@ export interface IPublicMaintenance {
status: 'scheduled' | 'active'
/** 维护页标题 */
title?: string
- /** 维护说明(富文本 HTML,mp-html 渲染) */
+ /** 维护说明(纯文本,维护页标题下方直接展示,留空展示默认文案) */
+ notice?: string
+ /** 维护详情(富文本 HTML,「维护详情」弹窗内 mp-html 渲染) */
description?: string
/** 维护开始时间(RFC3339 UTC 字符串) */
startTime?: string
diff --git a/src/components/uh-button/uh-button.vue b/src/components/uh-button/uh-button.vue
index d9384c2..e1e95e5 100644
--- a/src/components/uh-button/uh-button.vue
+++ b/src/components/uh-button/uh-button.vue
@@ -10,7 +10,7 @@
-
+
\ No newline at end of file
diff --git a/src/components/uh-maintenance-detail/uh-maintenance-detail.vue b/src/components/uh-maintenance-detail/uh-maintenance-detail.vue
new file mode 100644
index 0000000..ffcd485
--- /dev/null
+++ b/src/components/uh-maintenance-detail/uh-maintenance-detail.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ 维护详情
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/uh-notify-dialog/uh-notify-dialog.vue b/src/components/uh-notify-dialog/uh-notify-dialog.vue
index 8797385..4215130 100644
--- a/src/components/uh-notify-dialog/uh-notify-dialog.vue
+++ b/src/components/uh-notify-dialog/uh-notify-dialog.vue
@@ -1,12 +1,4 @@
-
diff --git a/src/hooks/useDataLoadingStatus.ts b/src/hooks/useDataLoadingStatus.ts
index bbf4f5e..5505a8f 100644
--- a/src/hooks/useDataLoadingStatus.ts
+++ b/src/hooks/useDataLoadingStatus.ts
@@ -1,15 +1,11 @@
import type { DataLoadingStatus } from './useDataLoading'
-/**
- * @deprecated 请改用 useDataLoading:状态由 hook 内部流转,
- * 无需再在 try/catch 里手工调用 updateLoadingStatus 搬运状态。
- * 本文件保留仅为兼容存量页面(category/article-detail 等),后续逐步迁移。
- */
export const DataLoadingStatusEnum = {
Loading: 'loading',
Error: 'error',
Empty: 'empty',
Success: 'success',
+ NoNetwork: 'noNetwork',
} as const
export function useDataLoadingStatus(status?: DataLoadingStatus) {
diff --git a/src/hooks/use-maintenance-intercept.ts b/src/hooks/useMaintenanceIntercept.ts
similarity index 100%
rename from src/hooks/use-maintenance-intercept.ts
rename to src/hooks/useMaintenanceIntercept.ts
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 1378c97..036fceb 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -1,106 +1,96 @@
-
-
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/maintenance/maintenance.vue b/src/pages/maintenance/maintenance.vue
index 914de14..a7e8ec2 100644
--- a/src/pages/maintenance/maintenance.vue
+++ b/src/pages/maintenance/maintenance.vue
@@ -3,7 +3,6 @@
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { useAppConfigStore } from '@/store/appConfig'
import { checkUrl } from '@/utils/url'
- import { markdownConfig } from '@/config/markdown'
import { usePluginAvailable } from '@/utils/plugin'
import type { IPublicMaintenance } from '@/api/types/uni-halo'
@@ -34,6 +33,8 @@
const spinning = ref(false)
/** Toast 文案(空 = 隐藏) */
const toast = ref('')
+ /** 「维护详情」弹窗显隐 */
+ const showDetail = ref(false)
let timer : ReturnType | null = null
let recoveryTimer : ReturnType | null = null
let toastTimer : ReturnType | null = null
@@ -42,8 +43,10 @@
const isIntercepted = computed(() => !!fromReason.value)
const isScheduled = computed(() => maintenance.value?.status === 'scheduled')
const title = computed(() => maintenance.value?.title || DEFAULT_MAINTENANCE_TITLE)
- /** 配置的富文本说明(未配置时展示设计稿默认文案) */
- const description = computed(() => maintenance.value?.description || '')
+ /** 维护详情(富文本 HTML;小程序端「维护详情」弹窗内 mp-html 渲染) */
+ const detailHtml = computed(() => maintenance.value?.description || '')
+ /** 维护说明(纯文本;标题下方按行直接展示,留空展示设计稿默认文案) */
+ const noticeLines = computed(() => (maintenance.value?.notice || '').split('\n'))
/** 应用信息 logo(相对插件内置资源路径 → BASE_API 补全) */
const appLogo = computed(() => {
@@ -137,7 +140,8 @@
* 拉取失败(服务器停机)保持维护页不打扰。
*/
async function silentCheck() {
- if (refreshing) { return }
+ if (refreshing)
+ return
refreshing = true
try {
await store.bootstrap({ force: true })
@@ -189,14 +193,12 @@
startRecoveryCheck()
}
else if (isIntercepted.value) {
- // 拦截场景无维护信息(插件未激活/未配置)→ 默认文案
maintenance.value = null
viewState.value = 'maintenance'
startRecoveryCheck()
}
else if (ok) {
- // 拉取成功但无 maintenance 键:未维护(或已到点自动结束)→ 服务正常
- viewState.value = 'normal'
+ goIndex()
}
else {
viewState.value = 'error'
@@ -251,7 +253,7 @@
onLoad((options) => {
const from = options?.from
fromReason.value = from === 'plugin' || from === 'maintenance' ? from : null
- void load()
+ load()
})
onUnload(() => {
@@ -264,142 +266,153 @@
-
-
-
-
- 加载中...
-
+
+
+
-
-
-
- ✅
-
-
- 当前服务正常,无需维护
-
-
- 如果仍然无法访问,请稍后重试或联系站长
-
-
-
- 返回首页
-
-
-
+
+
+ class="relative z-10 flex flex-col items-center justify-center px-10 py-48 text-center">
- ⚠️
+
-
+
服务暂时无法访问
-
+
站点可能正在维护中,请稍后重试
-
- 重新加载
-
+ 刷新试试
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
MAINTENANCE
-
+
{{ title }}
-
+
-
-
+
+
+ {{ line }}
+
为了给你带来更好的体验,站点正在维护升级中
- 别担心,你的数据都安然无恙 💚
+ 别担心,我们很快就回来!
-
-
-
+
+
+
-
+
-
-
+
+
GO!
-
-
+
-
-
- {{ countdownParts.days }}
- 天 DAY
+
+
+ {{ countdownParts.days }}
+
-
- {{ countdownParts.hours }}
- 时 HR
+
+ {{ countdownParts.hours }}
+
-
- {{ countdownParts.minutes }}
- 分 MIN
+
+ {{ countdownParts.minutes }}
+
-
- {{ countdownParts.seconds }}
- 秒 SEC
+
+ {{ countdownParts.seconds }}
+
-
+
{{ etaNote }}
-
-
-
- 刷新看看
+
+ 刷新看看
+
+ 维护详情
-
\ No newline at end of file
diff --git a/src/pages/tabbar/category/category.vue b/src/pages/tabbar/category/category.vue
index 8c85ccf..0fef65d 100644
--- a/src/pages/tabbar/category/category.vue
+++ b/src/pages/tabbar/category/category.vue
@@ -1,186 +1,181 @@
-
-
-
-
-
+
+
-
-
-
-
-
-
-
- {{ item.spec.displayName }}
-
-
- 共 {{ item.postCount }} 篇文章
-
-
-
-
-
- {{ loadMoreText }}
-
-
-
-
+
+
+
+
+
+
+
+ {{ item.spec.displayName }}
+
+
+ 共 {{ item.postCount }} 篇文章
+
+
+
+
+
+ {{ loadMoreText }}
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/tabbar/gallery/gallery.vue b/src/pages/tabbar/gallery/gallery.vue
index d53b73a..50d8576 100644
--- a/src/pages/tabbar/gallery/gallery.vue
+++ b/src/pages/tabbar/gallery/gallery.vue
@@ -1,250 +1,233 @@
-
-
-
-
-
-
- {{ cate.spec.displayName }}({{ cate.status?.photoCount ?? 0 }})
-
-
-
+
+
+
+
+
+
+ {{ cate.spec.displayName }} ({{ cate.status?.photoCount ?? 0 }})
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ loadMoreText }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ loadMoreText }}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/tabbar/home/home.vue b/src/pages/tabbar/home/home.vue
index 98ef5f6..e1f6b4b 100644
--- a/src/pages/tabbar/home/home.vue
+++ b/src/pages/tabbar/home/home.vue
@@ -6,6 +6,7 @@
import { useSettingStore } from '@/store/setting'
import { checkAvatarUrl, checkImageUrl } from '@/utils/url'
import { t } from '@/locale'
+ import { useMaintenanceIntercept } from '@/hooks/useMaintenanceIntercept'
import type { IPost } from '@/api/types/halo'
definePage({
@@ -146,12 +147,20 @@
},
})
}
-
+
+ function init(){
+ if (!intercepted.value) {
+ handleQuery()
+ }
+ }
+ init()
+
/* ---------------- 生命周期 ---------------- */
// 维护检查
onShow(async () => {
intercepted.value = await interceptOrContinue()
+ console.log('拦截状态', intercepted.value)
})
onPullDownRefresh(() => {
@@ -175,13 +184,6 @@
}
})
- // 首次加载
- onMounted(() => {
- if (intercepted.value) {
- return
- }
- handleQuery()
- })
diff --git a/src/pages/tabbar/moments/moments.vue b/src/pages/tabbar/moments/moments.vue
index 1e5e0a4..1d84ad3 100644
--- a/src/pages/tabbar/moments/moments.vue
+++ b/src/pages/tabbar/moments/moments.vue
@@ -274,7 +274,7 @@
-
+
@@ -282,7 +282,7 @@
-
+
@@ -290,7 +290,7 @@
-
@@ -313,22 +313,15 @@
-
-
-
-
- # {{ tag }}
-
+
+
+
-
-
@@ -360,19 +353,30 @@
@ended="onVideoEnded" />
+
+
+ # {{ tag }}
+
+
+
-
+ class="mt-2 mb-1 box-border w-full flex items-center justify-between gap-x-12 border-t border-black/5 py-3 px-4 text-xs text-gray-400">
+
点赞 {{ moment.stats.upvote || 0 }}
-
+
评论 {{ moment.stats.totalComment || 0 }}
+
+
+ 收藏
+
-