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(() => ({