许静 5 years ago
parent
commit
0fb2377cdd
2 changed files with 35 additions and 14 deletions
  1. 20
    10
      src/pages/person/profile/detail/index.js
  2. 15
    4
      src/pages/person/profile/index.js

+ 20
- 10
src/pages/person/profile/detail/index.js View File

41
     if (id) {
41
     if (id) {
42
 
42
 
43
       getProfileDetail(id).then(res => {
43
       getProfileDetail(id).then(res => {
44
-        console.log(res, "res")
45
         this.setState({
44
         this.setState({
46
           detail: res,
45
           detail: res,
47
           imgList: res.imgList,
46
           imgList: res.imgList,
56
   bindAlbumClick(e) {
55
   bindAlbumClick(e) {
57
     e.stopPropagation()
56
     e.stopPropagation()
58
     Taro.chooseImage({
57
     Taro.chooseImage({
59
-      count: 6,
60
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
58
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
61
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
59
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
62
       success: res => {
60
       success: res => {
88
 
86
 
89
   // 提交资料审核
87
   // 提交资料审核
90
   commitBtn() {
88
   commitBtn() {
91
-    console.log(this.state.auditStatus, "this.state.auditStatus")
92
     if (this.state.imgList.length == 0) {
89
     if (this.state.imgList.length == 0) {
93
       Taro.showToast({ icon: 'none', title: '请先上传图片' });
90
       Taro.showToast({ icon: 'none', title: '请先上传图片' });
94
     } else if (this.state.documentTitle == "") {
91
     } else if (this.state.documentTitle == "") {
95
       Taro.showToast({ icon: 'none', title: '资料说明不能为空' });
92
       Taro.showToast({ icon: 'none', title: '资料说明不能为空' });
96
-    }else {
93
+    } else {
97
 
94
 
98
       const payload = {
95
       const payload = {
99
         documentTitle: this.state.documentTitle,
96
         documentTitle: this.state.documentTitle,
100
         imgList: this.state.imgList,
97
         imgList: this.state.imgList,
101
-        id:this.state.detail.documentVerifyId
98
+        id: this.state.detail.documentVerifyId
102
       }
99
       }
103
 
100
 
104
       editDocumentVerify(payload).then(res => {
101
       editDocumentVerify(payload).then(res => {
121
       documentTitle: e.detail.value
118
       documentTitle: e.detail.value
122
     })
119
     })
123
   }
120
   }
121
+  // 查看大图
122
+  onPreview = (item, e) => {
123
+    let urls = []
124
+    this.state.imgList.map((ele, index) => {
125
+      urls.push(ele.img)
126
+    })
127
+    e.stopPropagation()
128
+    e.preventDefault()
129
+    Taro.previewImage({
130
+      current: item.img,
131
+      urls: urls
132
+    })
133
+  }
124
   // 上传资料模块
134
   // 上传资料模块
125
   renderUpImages() {
135
   renderUpImages() {
126
     return (
136
     return (
142
     return (
152
     return (
143
       <View className="profile-page" style="background:#f4f4f4">
153
       <View className="profile-page" style="background:#f4f4f4">
144
         <ScrollView scrollY scrollWithAnimation style="height: 100vh">
154
         <ScrollView scrollY scrollWithAnimation style="height: 100vh">
145
-  
155
+
146
           {
156
           {
147
             detail.verifyStatus == 2 &&
157
             detail.verifyStatus == 2 &&
148
             <View>
158
             <View>
149
               <View className="reject-reason" >驳回原因:{detail.rejectReason || ''}</View>
159
               <View className="reject-reason" >驳回原因:{detail.rejectReason || ''}</View>
150
-              
160
+
151
               <View className="desc-box">
161
               <View className="desc-box">
152
                 资料说明:
162
                 资料说明:
153
-              <Input className='inputDesc'value={documentTitle||''} onInput={this.onInputText.bind(this)} type='text' placeholder='请填写资料说明' />
163
+              <Input className='inputDesc' value={documentTitle || ''} onInput={this.onInputText.bind(this)} type='text' placeholder='请填写资料说明' />
154
               </View>
164
               </View>
155
               <View style="padding:10px 20px">
165
               <View style="padding:10px 20px">
156
                 {this.renderUpImages()}
166
                 {this.renderUpImages()}
161
                     return (
171
                     return (
162
                       <View className="image-con" key={`img-${inx}`}>
172
                       <View className="image-con" key={`img-${inx}`}>
163
                         <Image className="close-btn" src={closeImg} onClick={this.deleteImg.bind(this, (inx))} />
173
                         <Image className="close-btn" src={closeImg} onClick={this.deleteImg.bind(this, (inx))} />
164
-                        <Image className="img" src={item.img} />
174
+                        <Image className="img" src={item.img} onClick={this.onPreview.bind(this, (item))} />
165
                       </View>
175
                       </View>
166
                     )
176
                     )
167
                   })
177
                   })
187
                   imgList.map((item, inx) => {
197
                   imgList.map((item, inx) => {
188
                     return (
198
                     return (
189
                       <View className="image-con" key={`img-${inx}`}>
199
                       <View className="image-con" key={`img-${inx}`}>
190
-                        <Image className="img" src={item.img} />
200
+                        <Image className="img" src={item.img} onClick={this.onPreview.bind(this, (item))} />
191
                       </View>
201
                       </View>
192
                     )
202
                     )
193
                   })
203
                   })

+ 15
- 4
src/pages/person/profile/index.js View File

51
     })
51
     })
52
     e.stopPropagation()
52
     e.stopPropagation()
53
     Taro.chooseImage({
53
     Taro.chooseImage({
54
-      count: 6,
55
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
54
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
56
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
55
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
57
       success: res => {
56
       success: res => {
85
       url: '/pages/person/profile/detail/index?id=' + item.documentVerifyId
84
       url: '/pages/person/profile/detail/index?id=' + item.documentVerifyId
86
     })
85
     })
87
   }
86
   }
88
-
87
+  // 查看大图
88
+  onPreview = (item, e) => {
89
+    let urls = []
90
+    this.state.imgList.map((ele, index) => {
91
+      urls.push(ele.img)
92
+    })
93
+    e.stopPropagation()
94
+    e.preventDefault()
95
+    Taro.previewImage({
96
+      current: item.img,
97
+      urls: urls
98
+    })
99
+  }
89
   // 提交资料审核
100
   // 提交资料审核
90
   commitBtn() {
101
   commitBtn() {
91
     console.log(this.state.auditStatus, "this.state.auditStatus")
102
     console.log(this.state.auditStatus, "this.state.auditStatus")
142
         {
153
         {
143
           verfyList.map((item, inx) => {
154
           verfyList.map((item, inx) => {
144
             return (
155
             return (
145
-              <View className="verfy-item" onClick={this.toProfileDetail.bind(this, (item))}>
156
+              <View className="verfy-item" key={`verfy-${inx}`} onClick={this.toProfileDetail.bind(this, (item))}>
146
                 <View className="top">
157
                 <View className="top">
147
 
158
 
148
                   <Text className="title">{item.documentTitle || ' '}</Text><Text className={item.verifyStatus == 0 ? 'status0' : item.verifyStatus == 1 ? 'status1' : 'status2'}>{item.verifyStatus == 0 ? '审核中' : item.verifyStatus == 1 ? '审核通过' : '未通过'}</Text>
159
                   <Text className="title">{item.documentTitle || ' '}</Text><Text className={item.verifyStatus == 0 ? 'status0' : item.verifyStatus == 1 ? 'status1' : 'status2'}>{item.verifyStatus == 0 ? '审核中' : item.verifyStatus == 1 ? '审核通过' : '未通过'}</Text>
199
                         return (
210
                         return (
200
                           <View className="image-con" key={`img-${inx}`}>
211
                           <View className="image-con" key={`img-${inx}`}>
201
                             <Image className="close-btn" src={closeImg} onClick={this.deleteImg.bind(this, (inx))} />
212
                             <Image className="close-btn" src={closeImg} onClick={this.deleteImg.bind(this, (inx))} />
202
-                            <Image className="img" src={item.img} />
213
+                            <Image className="img" onClick={this.onPreview.bind(this, (item))} src={item.img} />
203
                           </View>
214
                           </View>
204
                         )
215
                         )
205
                       })
216
                       })