examPoints.vue
4.1 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
<template>
<div>
<div class="box">
<el-breadcrumb class="mt20 forPc" :separator-icon="ArrowRight">
<el-breadcrumb-item :to="{ path: '/' }">
<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">
<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" @keyup.enter="getList"
/>
</el-form-item>
</el-form>
</div>
<el-row :gutter="20">
<el-col v-for="n in examSiteList" :key="n.memId" :lg="8" :sm="24" :md="8">
<el-card class="item">
<div class="imgbox">
<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>
</el-card>
</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-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">
.searchbb{display: flex;align-items: center;justify-content: space-between}
.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>