|
|
@ -1,11 +1,10 @@ |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
|
|
|
import { getVoteResult } from '@/api/common' |
|
|
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params }) |
|
|
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params }) |
|
|
const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => { |
|
|
const doSearch = (formData: { page: number; limit: number }, onSuccess: Function) => { |
|
|
onSuccess({ |
|
|
getVoteResult(formData).then((res) => { |
|
|
data: { |
|
|
const { data } = res as { data: { data: any; total: number } } |
|
|
data: [{ name: '测试一' }, { name: '测试二' }], |
|
|
onSuccess({ data }) |
|
|
total: 4 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -18,36 +17,38 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio |
|
|
<view class="flex"> |
|
|
<view class="flex"> |
|
|
<view class="flex1"> |
|
|
<view class="flex1"> |
|
|
<view class="flex-center-start"> |
|
|
<view class="flex-center-start"> |
|
|
<text class="text-ellipsis title">{{ '2024年度学生会主席选举' }}</text> |
|
|
<text class="text-ellipsis title">{{ row.title }}</text> |
|
|
<!-- <text class="status b">进行中</text> --> |
|
|
<text class="status b" v-if="row.status === 2">进行中</text> |
|
|
<!-- <text class="status f">未开始</text> --> |
|
|
<text class="status f" v-else-if="row.status === 1">未开始</text> |
|
|
<text class="status e">已结束</text> |
|
|
<text class="status e" v-else>已结束</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="time">{{ '投票时间:2024-03-01 至 2024-03-07' }}</view> |
|
|
<view class="time">{{ `投票时间:${row.start_time} 至 ${row.end_time}` }}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view :class="{ arrow: true, active: row.showInfo }" @click="row.showInfo = !row.showInfo"> |
|
|
<view :class="{ arrow: true, active: row.showInfo }" @click="row.showInfo = !row.showInfo"> |
|
|
<u-icon name="arrow-down" color="#9CA3AF" /> |
|
|
<u-icon name="arrow-down" color="#9CA3AF" /> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="info" v-if="row.showInfo"> |
|
|
<view class="info" v-if="row.showInfo"> |
|
|
<view class="flex info-items" v-for="(v, k) of 2" :key="k"> |
|
|
<view class="flex info-items" v-for="(v, k) of row.candidate" :key="k"> |
|
|
<view class="head"></view> |
|
|
<view class="head"> |
|
|
|
|
|
<image :src="v.photo" mode="aspectFill" /> |
|
|
|
|
|
</view> |
|
|
<view class="content flex1"> |
|
|
<view class="content flex1"> |
|
|
<view class="name flex-center-start"> |
|
|
<view class="name flex-center-start"> |
|
|
<text>陈佳怡</text> |
|
|
<text>{{ v.name }}</text> |
|
|
<!-- <text class="status">当选</text> --> |
|
|
<text class="status" v-if="v.vote_result == 1">当选</text> |
|
|
<text class="status un">未当选</text> |
|
|
<text class="status un" v-else>未当选</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="votes">得票数:286</view> |
|
|
<view class="votes">得票数:{{ v.agree_num }}</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="progress"> |
|
|
<view class="progress"> |
|
|
<u-line-progress :percentage="60" height="8rpx" active-color="#2563EB" :show-text="false" /> |
|
|
<u-line-progress :percentage="v.ageree_percent" height="8rpx" active-color="#2563EB" :show-text="false" /> |
|
|
<view class="progress-text">60%</view> |
|
|
<view class="progress-text">{{ v.ageree_percent }}%</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="info-bts" @click.stop="navto('pages/electionList/info')">查看投票详情</view> |
|
|
<view class="info-bts" @click.stop="navto('pages/electionList/info', { id: row.id })">查看投票详情</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|