examPoints.vue
5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<template>
<div>
<div class="box">
<el-breadcrumb class="mt20 forPc" :separator-icon="ArrowRight">
<el-breadcrumb-item>
<el-icon>
<HomeFilled />
</el-icon>
首页
</el-breadcrumb-item>
<!-- <el-breadcrumb-item :to="{ path: '/vip/index' }">会员服务</el-breadcrumb-item>-->
<el-breadcrumb-item>考点列表</el-breadcrumb-item>
</el-breadcrumb>
<div class="mb20 mt20">
<el-row class="topNews newsimgcover" :gutter="20">
<el-col :span="4">
<el-card :body-style="{padding:0}">
<ul class="meunUl">
<li v-for="r in regionsList" :key="r.id" :class="{'active':r.id==currRegion.id}" @click="changePv(r)">
{{ r.cityName }}
<el-tag round type="info">{{ r.count }}</el-tag>
</li>
</ul>
</el-card>
</el-col>
<el-col :span="20">
<el-card :body-style="{'background':'#fafafc'}">
<template #header>
<div class="searchbb">
<div class="text-muted">
<el-icon>
<LocationInformation />
</el-icon>
{{ currRegion?.cityName }}
</div>
<el-form style="width: 300px;display: inline-block">
<el-form-item>
<el-input
v-model="query.name"
placeholder="输入关键字"
:suffix-icon="Search" style="width: 225px;"
@keyup.enter="getList"
/>
<el-button style="margin-left: 10px" type="primary" round @click="getList">搜索</el-button>
</el-form-item>
</el-form>
</div>
</template>
<el-row :gutter="20">
<!-- 139贵州-->
<el-col v-for="n in examSiteList" :key="n.memId" :lg="8" :sm="24" :md="8">
<div class="item">
<div class="imgbox" :style="n.pictures?'background:#fff':''">
<img :src="fillImgUrl(n.pictures?.split(',')[0])">
</div>
<div class="info">
<h2 class="esp">{{ n.name }}</h2>
<p class="esp">
<el-icon>
<LocationFilled />
</el-icon>
{{ n.adress }}
</p>
<p class="esp">
<el-icon>
<PhoneFilled />
</el-icon>
{{ n.contact }} —— {{ n.phone }}
</p>
</div>
</div>
</el-col>
</el-row>
<el-empty v-if="total == 0" description="暂无数据" />
<div v-else class="pc-page-box">
<PaginationPc
v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="total"
@pagination="getList"
/>
</div>
</el-card>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script setup>
import { ArrowRight, Search } from '@element-plus/icons-vue'
import { onMounted, ref } from 'vue'
import { getExamRegionsList, getExamSiteList } from '@/apiPc/common'
import _ from 'lodash'
const regionsList = ref([])
const currRegion = ref(null)
const examSiteList = ref([])
const total = ref(0)
const query = ref({
pageSize: 15,
pageNum: 1,
provinceId: null,
name: null
})
onMounted(() => {
getRegionsList().then(getList)
})
const getRegionsList = () => {
return getExamRegionsList().then((res) => {
const sum = _.sumBy(res.data, (d) => d.count)
res.data.unshift({
id: null,
cityName: '全国',
count: sum
})
regionsList.value = res.data
currRegion.value = res.data[0]
})
}
const getList = () => {
query.value.provinceId = currRegion.value.id
getExamSiteList(query.value).then(res => {
examSiteList.value = res.rows
total.value = res.total
})
}
const changePv = (r) => {
currRegion.value = r
getList()
}
</script>
<style scoped lang="scss">
.item {
background: #fff;
box-shadow: 0 0 6px #eee;
.info {
padding: 0 15px 10px;
}
&:hover {
box-shadow: 0 0 6px #ddd;
}
}
.newsimgcover .item .imgbox {
height: 190px;
width: 100%;
}
.searchbb {
display: flex;
justify-content: space-between;
align-items: center;
:deep(.el-form-item--default) {
margin: 0 0 5px
}
}
.meunUl {
li {
display: flex;
justify-content: space-between;
cursor: pointer;
padding: 0 15px;
line-height: 50px;
align-items: center;
border-bottom: 1px solid #eee;
&:hover {
background: #eee;
}
&.active {
border-left: 2px solid var(--el-color-primary);
color: var(--el-color-primary)
}
}
}
</style>