From dbe70e3b4948b9ca2e6cb701ef90a6dd826a115b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Tue, 8 Sep 2026 13:21:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E6=8A=95=E7=A5=A8=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=A4=9A=E9=A1=B9=E9=A1=B5=E9=9D=A2=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增文章详情页投票组件,支持投票插件检查、展开收起 2. 新增下划线文本、投票卡片、投票列表页组件 3. 优化自定义tabbar样式与返回逻辑 4. 更新投票工具类与投票详情页逻辑 5. 优化公告详情页样式与功能 6. 修复部分样式与类型定义问题 --- .../uh-article-vote-item.vue | 421 +++++++++++++++++ .../uh-article-vote/uh-article-vote.vue | 54 +++ .../uh-data-loading/uh-data-loading.vue | 441 +++++++++--------- src/components/uh-navbar/uh-navbar.vue | 20 +- .../uh-text-underline/uh-text-underline.vue | 22 + src/components/uh-vote-card/uh-vote-card.vue | 234 ++++------ .../article-detail/article-detail.vue | 8 + src/pages-blog/notice/detail.vue | 249 +++++----- src/pages-blog/vote-detail/vote-detail.vue | 81 ++-- src/pages-blog/votes/votes.vue | 229 ++++++++- src/pages/maintenance/maintenance.vue | 6 +- src/tabbar/TabbarItem.vue | 18 +- src/tabbar/TabbarItem.vue.bak | 51 ++ src/tabbar/config.ts | 306 +++++++----- src/tabbar/index.vue | 267 +++++------ src/tabbar/index.vue.bak | 144 ++++++ src/tabbar/types.ts | 56 +-- src/utils/vote.ts | 62 +-- 18 files changed, 1802 insertions(+), 867 deletions(-) create mode 100644 src/components/uh-article-vote-item/uh-article-vote-item.vue create mode 100644 src/components/uh-article-vote/uh-article-vote.vue create mode 100644 src/components/uh-text-underline/uh-text-underline.vue create mode 100644 src/tabbar/TabbarItem.vue.bak create mode 100644 src/tabbar/index.vue.bak diff --git a/src/components/uh-article-vote-item/uh-article-vote-item.vue b/src/components/uh-article-vote-item/uh-article-vote-item.vue new file mode 100644 index 0000000..5034223 --- /dev/null +++ b/src/components/uh-article-vote-item/uh-article-vote-item.vue @@ -0,0 +1,421 @@ + + + + + diff --git a/src/components/uh-article-vote/uh-article-vote.vue b/src/components/uh-article-vote/uh-article-vote.vue new file mode 100644 index 0000000..a3309b9 --- /dev/null +++ b/src/components/uh-article-vote/uh-article-vote.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/uh-data-loading/uh-data-loading.vue b/src/components/uh-data-loading/uh-data-loading.vue index 85344f6..3440849 100644 --- a/src/components/uh-data-loading/uh-data-loading.vue +++ b/src/components/uh-data-loading/uh-data-loading.vue @@ -1,256 +1,265 @@ + 50% { + transform: rotate(4deg); + } + } + + /* 缓慢左右摇头(error) */ + @keyframes head-shake { + + 0%, + 100% { + transform: rotate(0); + } + + 25% { + transform: rotate(6deg); + } + + 75% { + transform: rotate(-6deg); + } + } + + /* 轻轻叹气缩肩(empty) */ + @keyframes sigh { + + 0%, + 100% { + transform: scaleY(1); + } + + 30%, + 70% { + transform: scaleY(0.92); + } + } + \ No newline at end of file diff --git a/src/components/uh-navbar/uh-navbar.vue b/src/components/uh-navbar/uh-navbar.vue index b917a3c..89cd43a 100644 --- a/src/components/uh-navbar/uh-navbar.vue +++ b/src/components/uh-navbar/uh-navbar.vue @@ -1,6 +1,7 @@ + + + \ No newline at end of file diff --git a/src/components/uh-vote-card/uh-vote-card.vue b/src/components/uh-vote-card/uh-vote-card.vue index 29c20f6..2a0ac3c 100644 --- a/src/components/uh-vote-card/uh-vote-card.vue +++ b/src/components/uh-vote-card/uh-vote-card.vue @@ -1,175 +1,99 @@ diff --git a/src/pages-blog/article-detail/article-detail.vue b/src/pages-blog/article-detail/article-detail.vue index d2c5322..c68f0fc 100644 --- a/src/pages-blog/article-detail/article-detail.vue +++ b/src/pages-blog/article-detail/article-detail.vue @@ -456,6 +456,11 @@ }) const globalAppSettings = computed(() => settingStore.settings) + + onMounted(() => { + console.log('获取当前所有的页面') + console.log(getCurrentPages()) + }) + + + diff --git a/src/pages-blog/notice/detail.vue b/src/pages-blog/notice/detail.vue index 41e68d9..20cfee1 100644 --- a/src/pages-blog/notice/detail.vue +++ b/src/pages-blog/notice/detail.vue @@ -1,154 +1,137 @@ - - + + + + 复制原文地址 + + + + + + \ No newline at end of file diff --git a/src/pages-blog/vote-detail/vote-detail.vue b/src/pages-blog/vote-detail/vote-detail.vue index 3d01e51..9991afe 100644 --- a/src/pages-blog/vote-detail/vote-detail.vue +++ b/src/pages-blog/vote-detail/vote-detail.vue @@ -7,7 +7,7 @@ import { computed, ref } from 'vue' import { onLoad, onPullDownRefresh, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app' import { getVoteDetail, submitVote } from '@/api/uni-halo' import { DataLoadingStatusEnum, useDataLoadingStatus } from '@/hooks/useDataLoadingStatus' -import { calcVotePercent, VOTE_TYPES, voteCacheUtil } from '@/utils/vote' +import { calcVotePercent, calcVoteState, VOTE_TYPES, voteCacheUtil } from '@/utils/vote' import { formatTime as formatTimeUtil } from '@/utils/formatTime' import type { IVote, IVoteDetail, IVoteOption } from '@/api/types/uni-halo' @@ -85,27 +85,17 @@ async function handleGetData() { const detailRes = res.data as IVoteDetail const tempVote = detailRes.vote as typeof vote.value if (tempVote) { - const typeKey = ((tempVote.spec?.type || 'SINGLE') as string).toUpperCase() - pageTitle.value = `投票详情(${VOTE_TYPES[typeKey as keyof typeof VOTE_TYPES] || tempVote.spec?.type})` + const typeKey = ((tempVote.spec?.type || 'single') as string).toLowerCase() + pageTitle.value = `投票详情(${VOTE_TYPES[typeKey] || tempVote.spec?.type})` tempVote.spec = tempVote.spec || {} tempVote.spec.isVoted = isVoted.value tempVote.spec.disabled = isVoted.value - tempVote.spec._uh_type = VOTE_TYPES[typeKey as keyof typeof VOTE_TYPES] || tempVote.spec.type + tempVote.spec._uh_type = VOTE_TYPES[typeKey] || tempVote.spec.type - // 计算状态 - const startTime = tempVote.spec.startDate ? new Date(tempVote.spec.startDate).getTime() : Date.now() - const endTime = tempVote.spec.endDate ? new Date(tempVote.spec.endDate).getTime() : Date.now() - const now = Date.now() - if (endTime < now) { - tempVote.spec._uh_state = { state: '已结束', color: 'red' } + // 计算状态(与旧项目 calcVoteState 一致,含 timeLimit 非 custom 时 hasEnded 兜底) + tempVote.spec._uh_state = calcVoteState(tempVote) + if (tempVote.spec._uh_state.state === '已结束') tempVote.spec.hasEnded = true - } - else if (startTime > now) { - tempVote.spec._uh_state = { state: '未开始', color: 'orange' } - } - else { - tempVote.spec._uh_state = { state: '进行中', color: 'green' } - } // 选项计算 // 插件选项为 {id,title},票数在 VoteDetail.voteDataList / Vote.stats.voteDataList @@ -272,7 +262,7 @@ onShareTimeline(() => ({