|
@@ -25,7 +25,6 @@ export default class Profile extends Component {
|
25
|
25
|
// 审核状态 0审核中 1审核通过 2审核不通过 3未审核
|
26
|
26
|
componentDidMount() {
|
27
|
27
|
this.getProfile()
|
28
|
|
-
|
29
|
28
|
}
|
30
|
29
|
|
31
|
30
|
getProfile() {
|
|
@@ -35,20 +34,9 @@ export default class Profile extends Component {
|
35
|
34
|
this.setState({
|
36
|
35
|
auditStatus: 3,
|
37
|
36
|
})
|
38
|
|
-
|
39
|
37
|
} else {
|
40
|
|
- console.log(res, "res")
|
41
|
|
- let imgList = []
|
42
|
|
- let fileList = res.imgList
|
43
|
|
- fileList.map((item, index) => {
|
44
|
|
- let newObj = {}
|
45
|
|
- newObj.url = item.img
|
46
|
|
-
|
47
|
|
- imgList.push(newObj)
|
48
|
|
- }
|
49
|
|
- )
|
50
|
38
|
this.setState({
|
51
|
|
- files: imgList,
|
|
39
|
+ files: res.imgList.map(x => ({ url: x.img })),
|
52
|
40
|
auditStatus: res.verifyStatus,
|
53
|
41
|
// resData:res,
|
54
|
42
|
documentVerifyId: res.documentVerifyId,
|
|
@@ -66,12 +54,11 @@ export default class Profile extends Component {
|
66
|
54
|
}
|
67
|
55
|
|
68
|
56
|
onChange(files) {
|
69
|
|
- uploadFiles(files).then((res) => {
|
70
|
|
- debugger
|
71
|
|
- })
|
72
|
|
-
|
73
|
|
- this.setState({
|
74
|
|
- files
|
|
57
|
+ const filePaths = files.map(x => x.file.path)
|
|
58
|
+ uploadFiles(filePaths).then((res) => {
|
|
59
|
+ this.setState({
|
|
60
|
+ files: res.map(x => ({ url: x}))
|
|
61
|
+ })
|
75
|
62
|
})
|
76
|
63
|
}
|
77
|
64
|
onFail(mes) {
|
|
@@ -80,6 +67,7 @@ export default class Profile extends Component {
|
80
|
67
|
onImageClick(index, file) {
|
81
|
68
|
console.log(index, file)
|
82
|
69
|
}
|
|
70
|
+
|
83
|
71
|
// 提交图片审核
|
84
|
72
|
commitBtn() {
|
85
|
73
|
console.log(this.state.auditStatus, "this.state.auditStatus")
|
|
@@ -89,34 +77,21 @@ export default class Profile extends Component {
|
89
|
77
|
let imgList = []
|
90
|
78
|
let fileList = this.state.files
|
91
|
79
|
fileList.map((item, index) => {
|
92
|
|
- let newObj = {}
|
93
|
|
- newObj.img = item.url
|
94
|
|
- newObj.sort = index
|
95
|
|
- imgList.push(newObj)
|
96
|
|
- }
|
|
80
|
+ let newObj = {}
|
|
81
|
+ newObj.img = item.url,
|
|
82
|
+ newObj.sort = index
|
|
83
|
+ imgList.push(newObj)
|
|
84
|
+ }
|
97
|
85
|
)
|
98
|
|
- // const resData = this.state.resData
|
99
|
86
|
|
100
|
87
|
const payload = {
|
101
|
|
- // ,
|
102
|
|
-
|
103
|
|
- // ...resData,
|
104
|
88
|
imgList,
|
105
|
89
|
documentVerifyId: this.state.documentVerifyId
|
106
|
|
-
|
107
|
90
|
}
|
108
|
|
- editDocumentVerify(payload).then(res => {
|
109
|
|
- let imgList = []
|
110
|
|
- let fileList = res.imgList
|
111
|
|
- fileList.map((item, index) => {
|
112
|
|
- let newObj = {}
|
113
|
|
- newObj.url = item.img
|
114
|
|
-
|
115
|
|
- imgList.push(newObj)
|
116
|
|
- })
|
117
|
91
|
|
|
92
|
+ editDocumentVerify(payload).then(res => {
|
118
|
93
|
this.setState({
|
119
|
|
- files: imgList,
|
|
94
|
+ files: res.imgList.map(x => ({url: x.img})),
|
120
|
95
|
auditStatus: res.verifyStatus
|
121
|
96
|
})
|
122
|
97
|
Taro.showToast({ icon: 'none', title: '提交成功' });
|
|
@@ -137,15 +112,8 @@ export default class Profile extends Component {
|
137
|
112
|
})
|
138
|
113
|
|
139
|
114
|
commitDocumentVerify(imgList).then(res => {
|
140
|
|
- let imgList = []
|
141
|
|
- let fileList = res.imgList
|
142
|
|
- fileList.map((item, index) => {
|
143
|
|
- let newObj = {}
|
144
|
|
- newObj.url = item.img
|
145
|
|
- imgList.push(newObj)
|
146
|
|
- })
|
147
|
115
|
this.setState({
|
148
|
|
- files: imgList,
|
|
116
|
+ files: res.imgList.map(x => ({url: x.img})),
|
149
|
117
|
auditStatus: res.verifyStatus
|
150
|
118
|
})
|
151
|
119
|
Taro.showToast({ icon: 'none', title: '提交成功' });
|