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/api/votingElection.ts b/src/api/votingElection.ts index 12e455d..e8933b7 100644 --- a/src/api/votingElection.ts +++ b/src/api/votingElection.ts @@ -1,12 +1,10 @@ import { request } from '@/utils/http' - - // 获取投票选举(正在进行) export function getVoteprogress() { return request.http({ url: '/api/vote_progress', - method: "GET" + method: 'GET' }) } @@ -22,7 +20,6 @@ export function voteMember(data: any) { export function getMyvote() { return request.http({ url: '/api/my_vote', - method: "GET" - + method: 'GET' }) -} \ No newline at end of file +} 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 @@ - +