rzCarNumber.vue
2.16 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
<template>
<div style="background: #fff;width: 100%;height: 100%">
<h3 style="padding: 10px 10px;border-bottom: 5px solid #f5f5f5">
车牌号码:
<b style="color:#2282C5">{{$route.query.carNumber}}</b>
</h3>
<div style="padding: 10px 10px">
<van-uploader style="width: 100%" :after-read="afterRead" v-model="fileList" :max-count="1" preview-size="200">
<!--<!–<div class="uploadBg"></div>–>-->
<!--<van-image style="width: 100%;height: 200px;"-->
<!--:src="require('../../../assets/images/myCars/fornt.png')" />-->
</van-uploader>
<!--<div class="uploadBg">-->
<!---->
<!--</div>-->
<h4>
照片须符合如下条件:
</h4>
<h6>
1、行驶证正面
</h6>
<h6>
2、信息清晰显示真实有效
</h6>
<van-button type="info" round block style="margin-top: 40px;" @click="toMyCarsPage">立即验证</van-button>
</div>
</div>
</template>
<script>
import { uploadPic } from "@/api/myCars/myCars";
export default {
name: "rzCarNumber",
data() {
return {
fileList: [],
path:''
};
},
created() {
console.log(this.$route.query);
},
methods: {
afterRead(file) {
// 此时可以自行将文件上传至服务器
console.log(file.content);
this.path = file.content
this.uploadPic()
},
toMyCarsPage() {
console.log(this.fileList);
console.log(this.fileList.length);
// this.$router.push({
// name: "myCars"
// }
// );
if(this.fileList.length==0){
this.$toast('请先上传图片')
}else{
}
},
uploadPic() {
let jsondata = {
fileType: '11',
picFile: this.path
};
jsondata.sign = this.$utils.signObject(jsondata);
uploadPic(jsondata).then(response => {
console.log(jsondata)
if(response.code=='0'){
}
});
}
}
};
</script>
<style scoped>
.uploadBg {
width: 100%;
height: 200px;
background: #eee url("../../../assets/images/myCars/fornt.png") no-repeat;
background-size: 100% 100%;
}
</style>