code.vue
1.4 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
<template>
<view class="content">
<view class="title" v-if="imgURL==''">
暂未获得证书
</view>
<view class="" v-else>
<view class="title">
您的考试结果已经生成,请扫二维码查看
</view>
<view class="codeBox">
<image :src="imgURL" mode=""></image>
</view>
</view>
</view>
</template>
<script>
import request from'../../utils/request.js'
export default{
data(){
return{
id:'',
token:'',
imgURL:''
}
},
onLoad(options) {
this.id=options.id
this.token=uni.getStorageSync('Authorization')
},
onShow() {
this.getCode()
},
methods:{
getCode(){
request.post('/api/index/certificateCode',{
id:this.id,
// url:'/pages/index/result-login?id='+this.id+'&token='+this.token
// url:'/pages/index/index?id='+this.id+'&token='+this.token
url:'/pages/index/result-login'
}).then(res=>{
if(res.code==1){
this.imgURL=res.data.code
}
}).catch(err=>{
})
}
}
}
</script>
<style>
.content{
min-height: 100vh;
background-color: #F2F3F5;
width: 100%;
padding-top: 240rpx;
box-sizing: border-box;
}
.title{
font-size: 34rpx;
color: #323233;
font-weight: 500;
width: 100%;
text-align: center;
}
.codeBox{
margin-top: 80rpx;
display: flex;
justify-content: center;
}
.codeBox image{
width:424rpx;
height: 424rpx;
}
</style>