From c6ab431c8739ef4570b7e8dd465b52c38b09b852 Mon Sep 17 00:00:00 2001 From: tim Date: Sun, 31 Aug 2025 00:04:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A1=B5=E9=9D=A2=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/pages/posts/[id]/index.vue | 140 ++++++++++++++++++----- 1 file changed, 111 insertions(+), 29 deletions(-) diff --git a/frontend_nuxt/pages/posts/[id]/index.vue b/frontend_nuxt/pages/posts/[id]/index.vue index 63be402bd..94062262e 100644 --- a/frontend_nuxt/pages/posts/[id]/index.vue +++ b/frontend_nuxt/pages/posts/[id]/index.vue @@ -172,35 +172,36 @@
-
{{ poll.question }}
-
-
-
{{ opt }}
-
+
+
+
+
-
{{ pollVotes[idx] || 0 }} 票
-
-
- 投票 + v-for="(opt, idx) in poll.options" + :key="idx" + class="poll-option" + @click="voteOption(idx)" + > + + {{ opt }} +
+
+
100
+
投票人
+
-
- +
+
+ 投票 +
+
结果
+ +
+
离结束还有
+
12:00:00
+
@@ -358,6 +359,7 @@ const isAdmin = computed(() => authState.role === 'ADMIN') const isAuthor = computed(() => authState.username === author.value.username) const lottery = ref(null) const poll = ref(null) +const showPollResult = ref(false) const countdown = ref('00:00:00') let countdownTimer = null const lotteryParticipants = computed(() => lottery.value?.participants || []) @@ -1239,6 +1241,88 @@ onMounted(async () => { cursor: pointer; } +.poll-option-button { + color: var(--text-color); + padding: 5px 10px; + border-radius: 8px; + background-color: rgb(218, 218, 218); + cursor: pointer; + width: fit-content; +} + +.poll-top-container { + display: flex; + flex-direction: row; + align-items: center; + border-bottom: 1px solid var(--normal-border-color); +} + +.poll-options-container { + display: flex; + flex-direction: column; + overflow-y: auto; + flex: 4; +} + +.poll-info { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + min-height: 100px; + border-left: 1px solid var(--normal-border-color); +} + +.total-votes { + font-size: 40px; + font-weight: bold; + opacity: 0.8; +} + +.total-votes-title { + font-size: 18px; + opacity: 0.5; +} + +.poll-option { + margin-bottom: 10px; + margin-right: 10px; + cursor: pointer; + display: flex; + align-items: center; +} + +.poll-option-input { + margin-right: 10px; + width: 18px; + height: 18px; + accent-color: var(--primary-color); + border-radius: 50%; + border: 2px solid var(--primary-color); +} + +.poll-option-text { + font-size: 16px; +} + +.poll-bottom-container { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +.poll-left-time { + display: flex; + flex-direction: row; +} + +.poll-left-time-title { + font-size: 13px; + opacity: 0.7; +} + .action-menu-icon { cursor: pointer; font-size: 18px; @@ -1379,10 +1463,6 @@ onMounted(async () => { margin-bottom: 10px; } -.poll-option { - margin-bottom: 10px; -} - .poll-option-progress { position: relative; background-color: var(--border-color); @@ -1477,12 +1557,14 @@ onMounted(async () => { margin-left: 10px; } +.poll-left-time-title, .prize-end-time-title { font-size: 13px; opacity: 0.7; margin-right: 5px; } +.poll-left-time-value, .prize-end-time-value { font-size: 13px; font-weight: bold;