certificateDetail.vue
3.9 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
<template>
<div class="body">
<nav-bar class="navbar">
<div slot="left" class="certificateback" @click="goBack">
<img src="../../assets/img/back.png" alt="">
</div>
<div slot="center" class="userinfotitle">
我的证书
</div>
<div slot="right" class="certificateresult"></div>
</nav-bar>
<div class="certificate">
<img v-if="detail.is_valid!=1" src="../../assets/img/over.png" alt="" class="overtime">
<div class="certificate_img">
<van-image
width="100%"
height="100%"
fit="cover"
:src="detail.image_text"
/>
</div>
<div class="certificate_detail">
<div class="certificate_title display-flex">
<img src="../../assets/img/quan.png" alt="" class="quan">
<div>{{name}}</div>
</div>
<div class="display-flex-between certificate_time">
<span>有效截止时间</span>
<span style="color:rgba(150,151,153,1);">{{detail.end_time}}</span>
</div>
<div class="display-flex-between certificate_time">
<span>更新时间</span>
<span style="color:rgba(150,151,153,1);">{{detail.update_time}}</span>
</div>
<div class="display-flex-between certificate_time">
<span>初始取证时间</span>
<span style="color:rgba(150,151,153,1);">{{detail.start_time}}</span>
</div>
</div>
<div class="footer" @click="again">
<div class="footer_button">重新上传</div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
id: '',
detail: '',
name: ''
}
},
created () {
},
mounted () {
this.id = this.$route.query.id
this.getcertificateDetail()
},
methods: {
goBack () {
this.$router.go(-1)
},
async getcertificateDetail () {
const params = {
id: this.id
}
const res = await this.api.certificateDetail(params)
if (res.code === 1) {
res.data.detail.end_time = res.data.detail.end_time.split(' ')[0]
res.data.detail.start_time = res.data.detail.start_time.split(' ')[0]
this.detail = res.data.detail
this.name = res.data.detail.cert.name
} else {
this.$toast(res.msg)
}
},
again () {
this.$router.push({
path: '/uploadcertificate',
query: {
id: this.detail.id
}
})
}
}
}
</script>
<style lang="scss" >
.body{
height: 100vh;
overflow: hidden;
background: #f7f8fa;
}
.navbar{
background: #fff;
}
.certificate{
text-align: center;
position: relative;
}
.certificate_img{
width: 6.22rem;
height: 4.16rem;
margin:0.48rem auto;
}
.certificate_detail{
width: 6.22rem;
height: auto;
border-radius: 0.16rem;
opacity: 1;
background: rgba(255,255,255,1);
padding:0 0.32rem 0.16rem;
box-sizing: border-box;
margin: 0 auto;
}
.certificate_title{
color: rgba(50,50,51,1);
font-size: 0.32rem;
font-weight: 600;
padding: 0.32rem 0 0.16rem 0;
box-sizing: border-box;
}
.certificate_time{
color: rgba(50,50,51,1);
font-size: 0.24rem;
font-weight: 400;
padding: 0.1rem 0;
box-sizing: border-box;
}
.quan{
width: 0.32rem;
height: 0.32rem;
margin-right: 0.16rem;
}
.overtime{
width:1rem;
height: 1rem;
position: absolute;
right: 0.6rem;
top: 0.6rem;
z-index: 8;
}
</style>