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
<template>
<view class="cert-page">
<u-navbar
class="navbarHeigth"
back-icon-color="#000000"
:background="background"
title-color="#000"
:border-bottom="false"
title="我的证件"
title-bold="true"
></u-navbar>
<view class="content-cody">
<u-cell-group :border="false">
<u-cell-item v-for="(item, index) in list" :title="item.name" :value="item.isUploadName" :arrow="true" :key="index"
:value-style="{'color': item.color,'padding-left':'30rpx','padding-right':'30rpx'}" @click="toDetail(item.keyName)"
:title-style="{'padding-left':'20rpx'}">
<u-icon slot="icon" size="32" name="checkmark-circle" :color="item.iconColor"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: {
id_card: {
name: "身份证",
isUpload: false,
isUploadName: "未上传",
keyName: "id_card",
color: "#999999",
desc: ['身份证人像面', '身份证国徽面'],
data: {}
},
electrician_certificate: {
name: "电工证",
isUpload: false,
isUploadName: "未上传",
keyName: "electrician_certificate",
color: "#999999",
desc: ['电工证正面'],
data: {}
},
driver_license: {
name: "驾驶证",
isUpload: false,
isUploadName: "未上传",
keyName: "driver_license",
color: "#999999",
desc: ['驾驶证正面'],
data: {}
},
driving_license: {
name: "行驶证",
isUpload: false,
isUploadName: "未上传",
keyName: "driving_license",
color: "#999999",
desc: ['行驶证正面'],
data: {}
},
vehicle: {
name: "车辆照",
isUpload: false,
isUploadName: "未上传",
keyName: "vehicle",
color: "#999999",
desc: ['车辆正面/看到车牌', '车辆侧面/看到外观'],
data: {}
},
high_sky_license: {
name: "高空证",
isUpload: false,
isUploadName: "未上传",
keyName: "high_sky_license",
color: "#999999",
desc: ['高空证正面'],
data: {}
},
refrigeration_license: {
name: "制冷证",
isUpload: false,
isUploadName: "未上传",
keyName: "refrigeration_license",
color: "#999999",
desc: ['制冷证正面'],
data: {}
},
business_license: {
name: "营业执照",
isUpload: false,
isUploadName: "未上传",
keyName: "business_license",
color: "#999999",
desc: ['营业执照正面'],
data: {}
},
},
isRuZhu: false,
}
},
onLoad() {
getApp().trackPage('我的证件列表页')
let that = this;
this.$u.api
.getCertList()
.then((res) => {
if(res.code != 200){
return
}
this.isRuZhu = true
for(let key in this.list){
if(res.data.length <= 0){
this.list[key].data = {}
}else{
let getData = res.data[key];
this.list[key].isUpload = getData.status;
this.list[key].isUploadName = getData.status == 1 ? '已上传' : '未上传';
this.list[key].color = getData.status != 1 ? "#999999" : "#2272FF";
this.list[key].iconColor = getData.status != 1 ? "#999999" : "#2272FF";
this.list[key].data = getData;
}
}
}).catch((err) => {
this.isRuZhu = false;
});
},
methods: {
isUpload(typeBool) {
return typeBool ? '已上传' : '未上传'
},
toDetail(key) {
let data = null;
if(!this.isRuZhu){
uni.showToast({
icon: "none",
title: "您当前未入驻,暂无法上传证件",
});
return
// data = {
// type: key,
// url: "",
// desc: this.list[key].desc,
// status: 0,
// type_key: key
// }
}else{
data = this.list[key].data;
data.desc = this.list[key].desc;
}
if(data.status != 1){
wx.navigateTo({
url: '/pages/mine/cert/upload?type=' + data.type_key
});
}else{
wx.navigateTo({
url: '/pages/mine/cert/detail',
success: function(res) {
res.eventChannel.emit('acceptDataFromCert', data)
}
});
}
}
}
}
</script>
<style>
.cert-page {
font-size: 28rpx;
margin: 30rpx;
height: 100vh;
display: flex;
flex-direction: column;
}
.content-cody {
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
height: 82vh;
}
.rightBlue {
color: #007AFF;
}
.u-cell {
padding: 26rpx 0 !important;
}
</style>