From 0ad4dfee853c397cf58c109670e79bc93d3b7eba Mon Sep 17 00:00:00 2001 From: Hx <2294602187@qq.com> Date: Fri, 28 Mar 2025 18:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=B8=BE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common.ts | 17 ++++++++++++ src/pages/electionList/index.vue | 41 ++++++++++++++-------------- src/pages/electionList/info.vue | 46 ++++++++++++++++++++------------ src/utils/http.ts | 3 +-- 4 files changed, 68 insertions(+), 39 deletions(-) create mode 100644 src/api/common.ts diff --git a/src/api/common.ts b/src/api/common.ts new file mode 100644 index 0000000..692c02b --- /dev/null +++ b/src/api/common.ts @@ -0,0 +1,17 @@ +import { request } from '@/utils/http' + +export function getVoteList(data: pageType) { + return request.http({ + url: '/api/vote_list', + method: 'GET', + data + }) +} + +export function getVoteDetail(data: { id: number }) { + return request.http({ + url: '/api/vote_result_detail', + method: 'GET', + data + }) +} diff --git a/src/pages/electionList/index.vue b/src/pages/electionList/index.vue index d210237..abaa607 100644 --- a/src/pages/electionList/index.vue +++ b/src/pages/electionList/index.vue @@ -1,11 +1,10 @@ @@ -18,36 +17,38 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio - {{ '2024年度学生会主席选举' }} - 进行中 - - + {{ row.title }} + 进行中 + 未开始 + 已结束 - {{ '投票时间:2024-03-01 至 2024-03-07' }} + {{ `投票时间:${row.start_time} 至 ${row.end_time}` }} - - + + + + - 陈佳怡 - - 未当选 + {{ v.name }} + 当选 + 未当选 - 得票数:286 + 得票数:{{ v.agree_num }} - - 60% + + {{ v.ageree_percent }}% - 查看投票详情 + 查看投票详情 diff --git a/src/pages/electionList/info.vue b/src/pages/electionList/info.vue index adb0e66..b0bf738 100644 --- a/src/pages/electionList/info.vue +++ b/src/pages/electionList/info.vue @@ -1,56 +1,68 @@ - +