create vote card

This commit is contained in:
Alex committed 2025-01-14 08:55:11 +03:00
1 parent f0b099ad1c
commit cbda23c50c
4 files changed
+77 -20

No files matched your search

+6 -6
View File
@@ -1,30 +1,30 @@
<template> <template>
<v-row dense justify="center" class="mb-1"> <v-row dense class="ma-1 ">
<v-card variant="text" class="py-1"> <v-card variant="text" class="py-1">
<v-card-title style="white-space: normal;"> До окончания голосования осталось: </v-card-title> <v-card-title class="text-body-1"> До окончания голосования осталось: </v-card-title>
<v-row dense class="align-baseline justify-center"> <v-row dense class="align-baseline justify-center">
<v-col cols="2" class="text-center"> <v-col cols="auto" class="text-center">
<v-card class="bg-yellow-darken-4"> <v-card class="bg-yellow-darken-4">
<v-card-title>{{ displayDays }}</v-card-title> <v-card-title>{{ displayDays }}</v-card-title>
</v-card> </v-card>
<span class="text-caption">{{ declOfNum(displayDays, [' день', ' дня', ' дней']) }}</span> <span class="text-caption">{{ declOfNum(displayDays, [' день', ' дня', ' дней']) }}</span>
</v-col> </v-col>
<v-col cols="auto">:</v-col> <v-col cols="auto">:</v-col>
<v-col cols="2" class="text-center"> <v-col cols="auto" class="text-center">
<v-card class="bg-yellow-darken-4"> <v-card class="bg-yellow-darken-4">
<v-card-title>{{ displayHours }}</v-card-title> <v-card-title>{{ displayHours }}</v-card-title>
</v-card> </v-card>
<span class="text-caption">{{ declOfNum(displayHours, [' час', ' часа', ' часов']) }}</span> <span class="text-caption">{{ declOfNum(displayHours, [' час', ' часа', ' часов']) }}</span>
</v-col> </v-col>
<v-col cols="auto">:</v-col> <v-col cols="auto">:</v-col>
<v-col cols="2" class="text-center"> <v-col cols="auto" class="text-center">
<v-card class="bg-yellow-darken-4"> <v-card class="bg-yellow-darken-4">
<v-card-title>{{ displayMinutes }}</v-card-title> <v-card-title>{{ displayMinutes }}</v-card-title>
</v-card> </v-card>
<span class="text-caption">{{ declOfNum(displayMinutes, [' минута', ' минуты', ' минут']) }}</span> <span class="text-caption">{{ declOfNum(displayMinutes, [' минута', ' минуты', ' минут']) }}</span>
</v-col> </v-col>
<v-col cols="auto">:</v-col> <v-col cols="auto">:</v-col>
<v-col cols="2" class="text-center"> <v-col cols="auto" class="text-center">
<v-card class="bg-yellow-darken-4"> <v-card class="bg-yellow-darken-4">
<v-card-title>{{ displaySeconds }}</v-card-title> <v-card-title>{{ displaySeconds }}</v-card-title>
</v-card> </v-card>
@@ -0,0 +1,53 @@
<template>
<v-card>
<v-card-text class="d-flex justify-space-between ga-3 text-h6"> {{ voteCard.title }}
<v-btn flat size="medium">
<v-icon color="orange-lighten-1">mdi-pencil</v-icon>
</v-btn>
</v-card-text>
<v-img cover :src="voteCard.pictures" />
<v-card-text class="text-body-1">{{ voteCard.subtitle }}</v-card-text>
<TimerUI :endTime="voteCard.endDate" />
<v-card-actions class="justify-space-between">
<v-btn
v-if="!voteCard.voted"
color="teal-darken-4"
prepend-icon="mdi-vote-outline"
variant="outlined"
rounded="xl"
size="medium"
class="pa-2"
@click="openVoteModal(voting)">
Проголосовать
</v-btn>
<v-btn v-else color="teal-darken-4" disabled size="medium">Уже проголосовали</v-btn>
<v-btn color="error" @click="deleteVoting(voting.id)" size="medium">
<v-icon>mdi-delete</v-icon>
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import TimerUI from '../secret/TimerUI.vue';
export default {
components: { TimerUI },
props: {
voteCard: {
type: Object,
default: () => {
return {
id: 0,
title: "Допустим, здесь могла быть ваша реклама",
subtitle: "Но таких денег у вас нет, чтобы получить ее на нашем прекрасном голосовании",
pictures: "https://cdn.vuetifyjs.com/images/parallax/material.jpg",
endDate: new Date(new Date().getTime() + 600000),
voted: false,
}
}
}
}
}
</script>
+7 -6
View File
@@ -21,15 +21,16 @@
v-for="voting in sortedCurrentVotes" v-for="voting in sortedCurrentVotes"
:key="voting.id" :key="voting.id"
cols="12" lg="3" md="4" cols="12" lg="3" md="4"
> >
<v-card :class="{ 'voted-card': voting.voted }"> <VoteCard />
<!-- <v-card :class="{ 'voted-card': voting.voted }">
<v-card-title class="d-flex justify-space-between">{{ voting.title }} <v-card-title class="d-flex justify-space-between">{{ voting.title }}
<v-btn flat size="medium"> <v-btn flat size="medium">
<v-icon color="orange-lighten-1">mdi-pencil</v-icon> <v-icon color="orange-lighten-1">mdi-pencil</v-icon>
</v-btn> </v-btn>
</v-card-title> </v-card-title>
<v-card-subtitle> <v-card-subtitle>
Окончание: {{ formatDate(voting.endDate) }} Gbljhfcs! awdadawdadawdawdawd 2354awdqw 684721
</v-card-subtitle> </v-card-subtitle>
<TimerUI :endTime="endTimeOfVote"/> <TimerUI :endTime="endTimeOfVote"/>
<v-card-actions class="justify-space-between"> <v-card-actions class="justify-space-between">
@@ -46,7 +47,7 @@
<v-icon>mdi-delete</v-icon> <v-icon>mdi-delete</v-icon>
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card> -->
</v-col> </v-col>
</v-row> </v-row>
</v-container> </v-container>
@@ -118,11 +119,11 @@
<script> <script>
import {computed, ref} from "vue"; import {computed, ref} from "vue";
import VoteConstructor from "@/views/VoteConstructor.vue"; import VoteConstructor from "@/views/VoteConstructor.vue";
import SmallTimer from "@/components/secret/SmallTimer.vue";
import TimerUI from "@/components/secret/TimerUI.vue"; import TimerUI from "@/components/secret/TimerUI.vue";
import VoteCard from "@/components/vote/VoteCard.vue"
export default { export default {
components: { VoteConstructor, SmallTimer, TimerUI }, components: { VoteConstructor, TimerUI, VoteCard },
setup() { setup() {
const currentTab = ref("current"); const currentTab = ref("current");
const votes = ref([ const votes = ref([
+11 -8
View File
@@ -1,24 +1,27 @@
<template> <template>
<v-container> <!-- <v-container>
<TimerUI :endTime="end" /> <TimerUI :endTime="end" />
<SmallTimer :endTime="end"/> <SmallTimer :endTime="end"/>
</v-container> </v-container> -->
<VoteCard />
</template> </template>
<script> <script>
import TimerUI from "@/components/secret/TimerUI.vue" // import TimerUI from "@/components/secret/TimerUI.vue"
import SmallTimer from "@/components/secret/SmallTimer.vue" // import SmallTimer from "@/components/secret/SmallTimer.vue"
import VoteCard from "@/components/vote/VoteCard.vue"
export default { export default {
components: { components: {
TimerUI, // TimerUI,
SmallTimer, // SmallTimer,
VoteCard
}, },
setup() { setup() {
const end = new Date(2025, 0, 14, 15, 58, 5) // const end = new Date(2025, 0, 14, 15, 58, 5)
return { return {
end // end
} }
} }
} }