examPointApplyList.vue
4.01 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<template>
<view class="exam-point-list">
<!-- 顶部申请按钮 -->
<view class="apply-btn-box">
<button class="apply-btn" :disabled="memberInfo.isPoints==0&&formInfo.auditStatus==2" @click="goApply">申请考点</button>
</view>
<!-- 列表 -->
<view class="list-content">
<view v-if="list.length === 0 && !loading" class="empty-tip">
<text>暂无申请记录</text>
</view>
<view
v-for="(item, index) in list"
:key="index"
class="list-item"
:class="{ 'success-row': item.shenAuditStatus == 2 }"
>
<view class="item-row">
<text class="item-label">审核协会</text>
<text class="item-value">{{ item.auditDeptName || '-' }}</text>
</view>
<view class="item-row">
<text class="item-label">审核日期</text>
<text class="item-value">{{ formatDate(item.auditTime) }}</text>
</view>
<view class="item-row">
<text class="item-label">审核状态</text>
<text class="item-status" :class="getStatusClass(item.auditResult)">
{{ item.auditResult == 0 ? '审核未通过' : '审核通过' }}
</text>
</view>
<view class="item-row">
<text class="item-label">理由</text>
<text class="item-value">{{ item.auditMsg ? item.auditMsg : '/' }}</text>
</view>
</view>
<view v-if="loading" class="loading-tip">
<text>加载中...</text>
</view>
<view v-if="noMore && list.length > 0" class="no-more-tip">
<text>没有更多了</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import { getMyRecent } from '@/common/api'
const app = getApp()
const list = ref([])
const loading = ref(false)
const noMore = ref(false)
const pageNum = ref(1)
const pageSize = ref(10)
const memberInfo = app.globalData.memberInfo
const formInfo = ref({})
onLoad(() => {
loadData()
})
function loadData() {
if (loading.value) return
loading.value = true
getMyRecent().then(res => {
formInfo.value = res.data
if (res.data && res.data.auditLogs) {
try {
list.value = JSON.parse(res.data.auditLogs)
} catch (e) {
list.value = []
}
} else {
list.value = []
}
}).finally(() => {
loading.value = false
})
}
onReachBottom(() => {
if (!noMore.value) {
pageNum.value++
loadData()
}
})
function goApply() {
uni.navigateTo({
url: '/pages/index/notice-examPointApply'
})
}
function getStatusClass(status) {
return {
'status-1': status == 0,
'status-2': status == 1,
'status-3': status == 3
}
}
function formatDate(dateStr) {
if (!dateStr) return '-'
const date = new Date(dateStr)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
</script>
<style lang="scss" scoped>
.exam-point-list {
min-height: 100vh;
background: #f5f5f5;
}
.apply-btn-box {
padding: 20rpx 30rpx;
}
.apply-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
background: #C4121B;
color: #fff;
font-size: 28rpx;
border-radius: 44rpx;
border: none;
&::after {
border: none;
}
&[disabled] {
background: #f3d4d5 !important;
color: #b7b5b5 !important;
border: 2rpx solid #e0e0e0 !important;
opacity: 1;
}
}
.list-content {
padding: 0 20rpx 20rpx;
}
.empty-tip,
.loading-tip,
.no-more-tip {
text-align: center;
padding: 60rpx 0;
color: #999;
font-size: 26rpx;
}
.list-item {
background: #fff;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 20rpx;
}
.list-item.success-row {
border-left: 6rpx solid #19be6b;
}
.item-row {
display: flex;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
}
.item-label {
width: 140rpx;
font-size: 26rpx;
color: #999;
}
.item-value {
flex: 1;
font-size: 26rpx;
color: #333;
}
.item-status {
font-size: 26rpx;
padding: 4rpx 16rpx;
border-radius: 20rpx;
}
.status-1 {
background: #fff7e6;
color: #fa8c16;
}
.status-2 {
background: #e6fff7;
color: #52c41a;
}
.status-3 {
background: #fff1f0;
color: #ff4d4f;
}
</style>