member.vue
3.64 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>
<!-- 单位会员-->
<el-row>
<el-col v-for="(d,i) in listData" :key="i" :span="24">
<div class="item">
<div class="info">
<h3>{{ d.name }}</h3>
<p v-if="d.address">
<el-icon color="#D2D7D9" size="16">
<LocationFilled />
</el-icon>
{{ d.address }}
</p>
<div class="flexx">
<div>
<p>会员编码:{{ d.memCode }}</p>
<p>所属省份:{{ d.provinceStr }}</p>
</div>
<div>
<p>有效会员数:{{ d.personValiCount }}</p>
<p>是否为考点:<span v-if="d.isPoints=='1'">是</span><span v-else>否</span></p>
</div>
<div>
<p>有效期开始:{{ parseTime(d.createTime, '{y}-{m}-{d}') || '--' }}</p>
<p>有效期结束:{{ parseTime(d.validityDate, '{y}-{m}-{d}') || '--' }}
<!-- <span v-if="dayjs(d.validityDate).valueOf()>dayjs().valueOf()" class="green">(正常)</span>-->
<!-- <span v-else class="gray">(已过期)</span>-->
</p>
</div>
<div>
<!-- <div class="vipDownLoad" @click="vipDownLoad(d.perId)">-->
<!-- <i />单位会员证-->
<!-- </div>-->
</div>
</div>
</div>
</div>
</el-col>
</el-row>
<div class="text-center pd20">
<el-divider>
<span v-if="showMore" @click="handleQuery">加载更多</span>
<span v-else>没有更多了</span>
</el-divider>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import * as authentic from '@/apiPc/authentic'
import _ from 'lodash'
import { dayjs } from 'element-plus'
const props = defineProps({
query: {
required: true,
type: Object,
default: () => {
}
}
})
const listData = ref([])
const showMore = ref(false)
function handleQuery() {
queryParams.pageNum++
authentic.query(queryParams).then((res) => {
_.each(res.data.memberInfoVoList.rows, (r) => {
listData.value.push(r)
})
showMore.value = listData.value.length < res.data.memberInfoVoList.total
console.log(listData.value)
})
}
let queryParams = {}
function init() {
queryParams = {
pageNum: 0,
pageSize: 10,
label: '1',
name: props.query.name
}
listData.value = []
handleQuery()
}
defineExpose({
init
})
</script>
<style scoped lang="scss">
.item {
display: flex;
padding: 30px 0 0;
background: #f5f6f9;
margin-bottom: 20px;
.teamCarousel {
width: 200px;
.el-image {
width: 200px;
height: 120px;
}
}
.info {
margin-left: 20px;
flex: 1;
h3 {
font-size: 20px;
margin: 0 0 10px
}
p {
display: flex;
align-items: center;
font-size: 15px;
color: #99a4a9;
}
label {
color: #95A1A6
}
}
.flexx {
display: flex;
width: 100%;
justify-content: space-between;
p {
margin-right: 50px;
}
}
&:hover {
box-shadow: 0 0 10px #ddd;
}
}
.green {
color: #009E96
}
.gray {
color: #D2D7D9
}
@media (max-width: 500px) {
.item {
border: none;
.teamCarousel {
display: none
}
.info {
h3 {
font-size: 15px;
margin: 0 0 10px;
}
}
.flexx {
display: block;
p {
margin: 5px 0 0;
}
}
}
}
</style>