coach.vue
3.6 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
<template>
<div>
<el-row>
<el-col v-for="(d,i) in listData" :key="i" :lg="24" :sm="24">
<div class="person-item">
<img v-if="d.photo" class="photo" :src="fillImgUrl(d.photo)">
<img v-else class="photo" style="object-fit: contain;background: #fff;" src="@/assets/v1/default.png">
<div class="info">
<div class="name">{{ d.name }}
<el-image v-if="d.sex=='0'||d.sex=='1'" :src="d.sex=='0'?male:female" />
</div>
<div class="flex">
<div>
<el-form-item label="教练证号:">{{ d.perCode }}</el-form-item>
<el-form-item label="所属省份:">{{ d.provinceName }}</el-form-item>
</div>
<div>
<!-- <el-form-item label="有效期开始:">{{ parseTime(d.createTime, '{y}-{m}-{d}') }}</el-form-item>-->
<el-form-item label="有效期结束:">{{ parseTime(d.validityDate, '{y}-{m}-{d}') }}</el-form-item>
</div>
<div>
<!-- <el-form-item label="教练类型:">{{ d.perTypeStr }}</el-form-item>-->
</div>
<div style="width: 170px">
<div v-if="d.canDownCert=='1'" class="vipDownLoad" @click="vipDownLoad(d.perId)">
<i />会员证
</div>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
<div v-if="!loading" class="text-center">
<span v-if="showMore" @click="handleQuery">加载更多</span>
<span v-else>没有更多了</span>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import * as authentic from '@/apiPc/authentic'
import _ from 'lodash'
import male from '@/assets/images/male.png'
import female from '@/assets/images/female.png'
import { getCurrentInstance } from '@vue/runtime-core'
const { proxy } = getCurrentInstance()
const props = defineProps({
query: {
required: true,
type: Object,
default: () => {
}
}
})
const listData = ref([])
const showMore = ref(false)
const loading = ref(false)
function handleQuery() {
loading.value = true
queryParams.pageNum++
authentic.query(queryParams).then((res) => {
_.each(res.data.personalList.rows, (r) => {
listData.value.push(r)
})
showMore.value = listData.value.length < res.data.personalList.total
loading.value = false
})
}
function vipDownLoad(perId) {
proxy.download(`/person/info/downStuCert/${perId}`, {}, '会员证.pdf')
}
let queryParams = {}
function init() {
queryParams = {
pageNum: 0,
pageSize: 10,
label: '4',
name: props.query.name
}
listData.value = []
handleQuery()
}
defineExpose({
init
})
</script>
<style scoped lang="scss">
.flex {
display: flex;
justify-content: space-between;
}
.person-item {
position: relative;
display: flex;
margin: 15px 0;
background: #F5F7F9;
border-radius: 2px;
padding: 10px 20px;
.photo {
width: 100px;
height: 130px
}
.info {
margin-left: 20px;
width: 90%;
.name {
font-size: 24px;
display: flex;
align-items: center;
margin: 10px 0;
}
.el-form-item--default {
margin-bottom: 0;
}
}
.el-form-item__content {
font-size: 18px;
color: #95A1A6;
}
}
@media (max-width: 500px) {
.person-item {
margin: 15px 0;
.photo {
width: 120px;
height: 140px;
}
.info {
margin-left: 15px;
.name {
font-size: 18px
}
}
}
:deep(.el-form-item--default .el-form-item__label) {
padding: 0;
}
}
</style>