许静 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,7 +41,6 @@ export default class Profile extends Component {
41 41
     if (id) {
42 42
 
43 43
       getProfileDetail(id).then(res => {
44
-        console.log(res, "res")
45 44
         this.setState({
46 45
           detail: res,
47 46
           imgList: res.imgList,
@@ -56,7 +55,6 @@ export default class Profile extends Component {
56 55
   bindAlbumClick(e) {
57 56
     e.stopPropagation()
58 57
     Taro.chooseImage({
59
-      count: 6,
60 58
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
61 59
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
62 60
       success: res => {
@@ -88,17 +86,16 @@ export default class Profile extends Component {
88 86
 
89 87
   // 提交资料审核
90 88
   commitBtn() {
91
-    console.log(this.state.auditStatus, "this.state.auditStatus")
92 89
     if (this.state.imgList.length == 0) {
93 90
       Taro.showToast({ icon: 'none', title: '请先上传图片' });
94 91
     } else if (this.state.documentTitle == "") {
95 92
       Taro.showToast({ icon: 'none', title: '资料说明不能为空' });
96
-    }else {
93
+    } else {
97 94
 
98 95
       const payload = {
99 96
         documentTitle: this.state.documentTitle,
100 97
         imgList: this.state.imgList,
101
-        id:this.state.detail.documentVerifyId
98
+        id: this.state.detail.documentVerifyId
102 99
       }
103 100
 
104 101
       editDocumentVerify(payload).then(res => {
@@ -121,6 +118,19 @@ export default class Profile extends Component {
121 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 135
   renderUpImages() {
126 136
     return (
@@ -142,15 +152,15 @@ export default class Profile extends Component {
142 152
     return (
143 153
       <View className="profile-page" style="background:#f4f4f4">
144 154
         <ScrollView scrollY scrollWithAnimation style="height: 100vh">
145
-  
155
+
146 156
           {
147 157
             detail.verifyStatus == 2 &&
148 158
             <View>
149 159
               <View className="reject-reason" >驳回原因:{detail.rejectReason || ''}</View>
150
-              
160
+
151 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 164
               </View>
155 165
               <View style="padding:10px 20px">
156 166
                 {this.renderUpImages()}
@@ -161,7 +171,7 @@ export default class Profile extends Component {
161 171
                     return (
162 172
                       <View className="image-con" key={`img-${inx}`}>
163 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 175
                       </View>
166 176
                     )
167 177
                   })
@@ -187,7 +197,7 @@ export default class Profile extends Component {
187 197
                   imgList.map((item, inx) => {
188 198
                     return (
189 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 201
                       </View>
192 202
                     )
193 203
                   })

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

@@ -51,7 +51,6 @@ export default class Profile extends Component {
51 51
     })
52 52
     e.stopPropagation()
53 53
     Taro.chooseImage({
54
-      count: 6,
55 54
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
56 55
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
57 56
       success: res => {
@@ -85,7 +84,19 @@ export default class Profile extends Component {
85 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 101
   commitBtn() {
91 102
     console.log(this.state.auditStatus, "this.state.auditStatus")
@@ -142,7 +153,7 @@ export default class Profile extends Component {
142 153
         {
143 154
           verfyList.map((item, inx) => {
144 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 157
                 <View className="top">
147 158
 
148 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,7 +210,7 @@ export default class Profile extends Component {
199 210
                         return (
200 211
                           <View className="image-con" key={`img-${inx}`}>
201 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 214
                           </View>
204 215
                         )
205 216
                       })